CCS C Software and Maintenance Offers
FAQFAQ   FAQForum Help   FAQOfficial CCS Support   SearchSearch  RegisterRegister 

ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

CCS does not monitor this forum on a regular basis.

Please do not post bug reports on this forum. Send them to CCS Technical Support

Search found 12 matches
CCS Forum Index
Author Message
  Topic: 18f4520 SPI AD7376
ouch_

Replies: 19
Views: 29952

PostForum: General CCS C Discussion   Posted: Wed Apr 03, 2013 4:57 pm   Subject: 18f4520 SPI AD7376
Which is why I suggested using 7bit.

Best Wishes

hello Ttelmah, thanks!

you're right! with 7 bits, in mode3 seems alright.

http://s2.postimg.org/u2ywnlfjt/image.jpg

all values works ok ...
  Topic: 18f4520 SPI AD7376
ouch_

Replies: 19
Views: 29952

PostForum: General CCS C Discussion   Posted: Tue Apr 02, 2013 10:36 pm   Subject: 18f4520 SPI AD7376
looking at the scope, the SDO pin (compared with SDI) of ad7376, the word is shifted 1bit to the right

http://s16.postimg.org/z01tjqgz9/123.jpg

I believe that this value, wrong, is the used.
t ...
  Topic: 18f4520 SPI AD7376
ouch_

Replies: 19
Views: 29952

PostForum: General CCS C Discussion   Posted: Tue Apr 02, 2013 8:10 am   Subject: 18f4520 SPI AD7376

Now, do you really expect to send bytes continuously without any pause at all and be able to make a meaningful measurement on the output?. The Vw settling time is 4uSec, so a minimum of this is need ...
  Topic: 18f4520 SPI AD7376
ouch_

Replies: 19
Views: 29952

PostForum: General CCS C Discussion   Posted: Mon Apr 01, 2013 8:48 pm   Subject: 18f4520 SPI AD7376
Working:

#USE SPI (MASTER, CLK=PIN_C3, DI=PIN_C2, DO=PIN_C5, MODE=3, BITS=8, STREAM=SPI_1, MSB_FIRST)

VOID main (VOID)
{
WHILE (TRUE)
{
output_ ...
  Topic: 18f4520 SPI AD7376
ouch_

Replies: 19
Views: 29952

PostForum: General CCS C Discussion   Posted: Mon Apr 01, 2013 4:55 pm   Subject: 18f4520 SPI AD7376
thanks Ttelmah,

but in your code, I did not understand where the value is to be sent.
sorry, I'm beginner.

trying manually, I wrote a code that is looped off and on PIN_C3 with delays of 3us be ...
  Topic: 18f4520 SPI AD7376
ouch_

Replies: 19
Views: 29952

PostForum: General CCS C Discussion   Posted: Sun Mar 31, 2013 6:12 pm   Subject: 18f4520 SPI AD7376
hello PCM programmer,

first, very thanks!

I'm testing with a resistance meter, between W and A, between W and B.

when I say working, I have a resistence value equivalent to the decimal value ...
  Topic: 18f4520 SPI AD7376
ouch_

Replies: 19
Views: 29952

PostForum: General CCS C Discussion   Posted: Sun Mar 31, 2013 5:09 pm   Subject: 18f4520 SPI AD7376
tested in another pic I have here,
18f4431 with internal osc,

same result. Sad
  Topic: 18f4520 SPI AD7376
ouch_

Replies: 19
Views: 29952

PostForum: General CCS C Discussion   Posted: Fri Mar 29, 2013 10:28 pm   Subject: 18f4520 SPI AD7376
trying with software spi:

#include <18F4520.h>
#use delay(clock=10000000)
#FUSES NOWDT, HS, NOPROTECT, NOBROWNOUT, NOPUT, NOCPD, STVREN, NODEBUG, NOLVP,
NOWRT, NOWRTD, NOIESO, NOFC ...
  Topic: 18f4520 SPI AD7376
ouch_

Replies: 19
Views: 29952

PostForum: General CCS C Discussion   Posted: Fri Mar 29, 2013 5:45 pm   Subject: 18f4520 SPI AD7376
If you look at it the data sheet picture again, it shows an eighth data bit after the seven bits are sent.
To send '3' to the chip, you need to rotate this by one, and send '6'.


also try adding ...
  Topic: 18f4520 SPI AD7376
ouch_

Replies: 19
Views: 29952

PostForum: General CCS C Discussion   Posted: Fri Mar 29, 2013 1:00 pm   Subject: 18f4520 SPI AD7376
the same Sad

results:
setup_spi ( SPI_MASTER | SPI_MODE_0 | SPI_CLK_DIV_64 );
spi_write (3); = none
spi_write (4); = none

setup_spi ( SPI_MASTER | SPI_MODE_1 | SPI_CLK_DIV_64 );
spi ...
  Topic: 18f4520 SPI AD7376
ouch_

Replies: 19
Views: 29952

PostForum: General CCS C Discussion   Posted: Fri Mar 29, 2013 11:56 am   Subject: 18f4520 SPI AD7376
Hello Ttelmah,
first, very thanks!

I was using the same #defines you showed, but with SPI_MODE_3 in setup_spi. only modified to be more objective here.

testing here now, in SPI_MODE_0 nothing w ...
  Topic: 18f4520 SPI AD7376
ouch_

Replies: 19
Views: 29952

PostForum: General CCS C Discussion   Posted: Fri Mar 29, 2013 9:11 am   Subject: 18f4520 SPI AD7376
Hello! I'm new here and beginner in PIC uC

I need help with a problem I have no idea how to solve.

I'm trying to control a digipot AD7376 via SPI from PIC 18F4520.

the signals seem correct in ...
 
Page 1 of 1
All times are GMT - 6 Hours
Jump to:  


Powered by phpBB © 2001, 2005 phpBB Group