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 support@ccsinfo.com

PIC16F876 to PIC18F2620

 
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion
View previous topic :: View next topic  
Author Message
andreluizeng



Joined: 04 Apr 2006
Posts: 117
Location: Brasil

View user's profile Send private message Send e-mail MSN Messenger

PIC16F876 to PIC18F2620
PostPosted: Thu Jan 24, 2008 6:08 am     Reply with quote

Hi,


Im having some problem to run a code on PIC18F2620 that works fine on PIC16F876.

The main problem is in spi communication, when i try to initialize a mmc card connected at bus, with 16F876 it works fine, but when i use 18F2620 i cant initialize the card.

the only things that are diferente between softwares are the address of registers like SSPBUF, SSTAT and IO PORTS.

has somebody the same problem ?


thanks.
_________________
Andre
PCM programmer



Joined: 06 Sep 2003
Posts: 21708

View user's profile Send private message

PostPosted: Thu Jan 24, 2008 11:39 am     Reply with quote

Always post your compiler version.
andreluizeng



Joined: 04 Apr 2006
Posts: 117
Location: Brasil

View user's profile Send private message Send e-mail MSN Messenger

PostPosted: Thu Jan 24, 2008 12:48 pm     Reply with quote

Sorry..

IDE 4.013
PCB 4.013
PCM 4.013
PCH 4.013
_________________
Andre
PCM programmer



Joined: 06 Sep 2003
Posts: 21708

View user's profile Send private message

PostPosted: Thu Jan 24, 2008 3:09 pm     Reply with quote

Post a small test program. Show the #include, #fuses, #use delay(),
and any other #use statements (such as fast_io). Put in a small main()
that shows the setup_spi() statement, and TRIS statements, if you use
any. This program should be for the 18F2620.

I can then compile it for your version (or one that's close to it)
and for the latest version. I can compare the .LST files to see
if your version has a problem with the setup_spi() function.
Franck26



Joined: 29 Dec 2007
Posts: 122
Location: Ireland

View user's profile Send private message

PostPosted: Thu Jan 24, 2008 3:22 pm     Reply with quote

Hello,
Do you have the same quartz frequency on your 2 boards?

Franck.
andreluizeng



Joined: 04 Apr 2006
Posts: 117
Location: Brasil

View user's profile Send private message Send e-mail MSN Messenger

PostPosted: Thu Jan 24, 2008 5:16 pm     Reply with quote

PCM, Im going to do this...

Franck, Im using the same board.. just changing the pics on it...
_________________
Andre
Guest








PostPosted: Fri Jan 25, 2008 8:07 am     Reply with quote

Hi,

i solved the problem...

PCM, I checked the list file of 16f and 18f and i found something diferent between softwares..

then i made my own spi initialization.. and it works fine...

but it is really getting hard to trust on CCS built-in functions....


thanks for the help.
Ttelmah
Guest







PostPosted: Fri Jan 25, 2008 8:28 am     Reply with quote

If you go and look at the 'Version 4' sticky thread at the top of this group, you will find that 4.013, predates the point were V4, really began to be pretty reliable... :-(
I'd suggest, since you have a demonstable 'fault' with the inbuilt SPI, you moan at CCS, who will normally give a latter version free in this case.
I'd suspect that your code would work fine, using the inbuilt functions, in perhaps 4.040.

Best Wishes
Display posts from previous:   
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion All times are GMT - 6 Hours
Page 1 of 1

 
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