View previous topic :: View next topic |
Author |
Message |
andreluizeng
Joined: 04 Apr 2006 Posts: 117 Location: Brasil
|
PIC16F876 to PIC18F2620 |
Posted: Thu Jan 24, 2008 6:08 am |
|
|
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
|
|
Posted: Thu Jan 24, 2008 11:39 am |
|
|
Always post your compiler version. |
|
|
andreluizeng
Joined: 04 Apr 2006 Posts: 117 Location: Brasil
|
|
Posted: Thu Jan 24, 2008 12:48 pm |
|
|
Sorry..
IDE 4.013
PCB 4.013
PCM 4.013
PCH 4.013 _________________ Andre |
|
|
PCM programmer
Joined: 06 Sep 2003 Posts: 21708
|
|
Posted: Thu Jan 24, 2008 3:09 pm |
|
|
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
|
|
Posted: Thu Jan 24, 2008 3:22 pm |
|
|
Hello,
Do you have the same quartz frequency on your 2 boards?
Franck. |
|
|
andreluizeng
Joined: 04 Apr 2006 Posts: 117 Location: Brasil
|
|
Posted: Thu Jan 24, 2008 5:16 pm |
|
|
PCM, Im going to do this...
Franck, Im using the same board.. just changing the pics on it... _________________ Andre |
|
|
Guest
|
|
Posted: Fri Jan 25, 2008 8:07 am |
|
|
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
|
|
Posted: Fri Jan 25, 2008 8:28 am |
|
|
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 |
|
|
|