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

PCD: Possible SPI bug???

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



Joined: 29 Nov 2009
Posts: 25

View user's profile Send private message

PCD: Possible SPI bug???
PostPosted: Wed Dec 09, 2009 11:28 pm     Reply with quote

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

Confused
FvM



Joined: 27 Aug 2008
Posts: 2337
Location: Germany

View user's profile Send private message

PostPosted: Thu Dec 10, 2009 12:35 am     Reply with quote

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

View user's profile Send private message

PostPosted: Thu Dec 10, 2009 12:41 am     Reply with quote

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 Crying or Very sad
bkamen



Joined: 07 Jan 2004
Posts: 1615
Location: Central Illinois, USA

View user's profile Send private message

PostPosted: Thu Dec 10, 2009 12:52 am     Reply with quote

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
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