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

PIC18F8722 SPI
Goto page Previous  1, 2
 
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion
View previous topic :: View next topic  
Author Message
PCM programmer



Joined: 06 Sep 2003
Posts: 21708

View user's profile Send private message

PostPosted: Fri Sep 05, 2008 12:30 pm     Reply with quote

Quote:
#fuses EC_IO

#define FOSC 32000000
#use delay (clock=FOSC)

In your latest code, you show the EC_IO fuse. Your schematic shows
a crystal. I don't believe that a crystal will work in EC_IO mode.
I did a test with an 18F452 and a 20 MHz crystal, and it didn't work.
I had to change it to HS to make it work. Also, the 18F722 data sheet
shows that the maximum crystal frequency for HS mode is 25 MHz.
I question whether your board is working. Is this project being done
on an actual board, or is this a Proteus (or other simulator) project ?

If you do get the PIC oscillator working, I suggest that you make a
test program that does a reset operation to the CS5526, and then
read the config, offset, and gain registers. The data sheet says that
after a reset operation, they will have this value:
Quote:
configuration register: 000040(H)
offset register: 000000(H)
gain register: 800000(H)

This test will confirm that you can read the chip OK.
bela



Joined: 31 Aug 2008
Posts: 27
Location: Bedford, BEDS UK

View user's profile Send private message Visit poster's website

PostPosted: Sun Sep 07, 2008 2:12 am     Reply with quote

Hello PCM Programmer,

I shoud have mentioned previously that the crystal on the schematic has been replaced with a 32mhz oscillator which runs off the 5v_live net. It runs very well, timing wise, on external clock mode, as you pointed out earler.

This is an actual PCB not a simulation. Lots of features appear to be working well, eg, the USB and all of the I2C devices.

I have previously tried the experiment that you suggest. Perform a reset sequence and read back the registers. They're all 00s. Can you confirm that I have the reset sequence correct? I performed the reads after the 15 0xFFs and 1 of 0xFE.

Thanks for your help.

Daz.
bela



Joined: 31 Aug 2008
Posts: 27
Location: Bedford, BEDS UK

View user's profile Send private message Visit poster's website

PostPosted: Mon Sep 08, 2008 2:28 pm     Reply with quote

Can anyone help with this?
PCM programmer



Joined: 06 Sep 2003
Posts: 21708

View user's profile Send private message

PostPosted: Mon Sep 08, 2008 2:39 pm     Reply with quote

Post a test program that does these tests, where you send a Reset
command to the chip, and then read specific registers.
Make sure the code that you post is compilable with no errors.
Display posts from previous:   
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion All times are GMT - 6 Hours
Goto page Previous  1, 2
Page 2 of 2

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group