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

18F46J50 SPI2 Hardware Interface

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



Joined: 10 Oct 2007
Posts: 681

View user's profile Send private message

18F46J50 SPI2 Hardware Interface
PostPosted: Mon May 24, 2010 6:51 am     Reply with quote

Hi All,
I have just submitted a bug report to CCS and thought I would post it here to A, see if anyone else has encountered the problem (verify it Smile) and B, to let you know there is potentially a problem. I am still waiting for a response from CCS.

PCWH Compiler
Version 4.107

When using SPI2 of the 18F46J50 I have found that no matter what I configure in setup_spi2 it will always set CKE of SSP2STAT. setup_spi works fine for SPI1.

I have also issued a ticket to Microchip with regards to this device and the functionality of SPI2. Certain settings do not seem to be working properly.
There is quite a lot to explain but basically it appears that in certain modes the device (an SD card) responds with correct data (0x01) but I read the value I sent 0xFF, it is as though the SR is not being transfered to the buffer!
If I bit bang it I get the correct value back all though I ran in to another problem when switching between SSP hardware to send and IO to receive, There is a glitch on the CLK which causes the device to start transmission which means the response is 1 bit out.

In other modes I get 1 in 5 correct response.
I am monitoring the spi2 lines on a Logic Analyser

Also the SMP bit appears to be affecting transmission of data and not just reception, changing it alters what the card sends back (physically as seen on the scope) indicating it did not get the correct command.

As I said, this is more for info but if anyone has encountered similar problems then please post.

Lastly but not least, I have also discovered that you need a License to be able to produce hardware which uses the SD specification, this also includes using the SPI bus of an SD card. It will cost at least $1000 which gets you the Full SD specification and a further $3000 a year to keep the Licenses current.
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