View previous topic :: View next topic |
Author |
Message |
Langton
Joined: 29 Nov 2009 Posts: 25
|
PCD: Possible SPI bug??? |
Posted: Wed Dec 09, 2009 11:28 pm |
|
|
Using:
dsPIC33FJ64GP206
CCS vers: 4.085
It appears to be from the below assembly that CCS is storing the info to send in 0x0000 and then over writting it with 0x8. Upon branching to 494 it goes to put the now corrupted data into the SPI buffer at 0x0248. HELP!!!
Code: |
857: spi_xfer(16);
0BAC mov.b #0x10,0x0000
0BAE mov.b #0x8,0x0000
0BB0 mov.b 0x0000,0x0a6c
0BB2 call 0x000494
|
Code: |
18: #use spi FORCE_HW,SPI1,MASTER,BITS=8,BAUD=250000, SAMPLE_FALL, stream = spi_stream)
0494 mov.w 0x0000,0x0248 |
|
|
|
FvM
Joined: 27 Aug 2008 Posts: 2337 Location: Germany
|
|
Posted: Thu Dec 10, 2009 12:35 am |
|
|
Yes, the code has been changed somewhere between V4.093 and V4.098.
You may want to try setup_spi() and spi_read() instead.(it's better to use spi_read for both read and write action). |
|
|
Langton
Joined: 29 Nov 2009 Posts: 25
|
|
Posted: Thu Dec 10, 2009 12:41 am |
|
|
Thanks for the reply
I'd like to do that except speed is quite crucial as I am loading RGB data from an external memory to an LCD |
|
|
bkamen
Joined: 07 Jan 2004 Posts: 1615 Location: Central Illinois, USA
|
|
Posted: Thu Dec 10, 2009 12:52 am |
|
|
yea, I had some SPI issues a while back. I haven't checked the code and how it compiles now with an updated compiler, but I did end up writing my own setup/x-fer routines.
Hey, just like C30. ;)
-Ben _________________ Dazed and confused? I don't think so. Just "plain lost" will do. :D |
|
|
|