Wednesday, 11 April 2018

avr - chip select on one to one spi connection


I connect an imx233 (master) and atmega168a (slave) through SPI. I am trying to debug the communication. I have problem with imx233's chip select, therefore I connect CS of the AVR onto the ground. Could anyone tell me if I really need to use chip select as I have only one slave? I asked that question on different forums and some says I have to have the CS, some says it is not necessary if I have only one slave and connect the CS onto the ground.


I would be grateful if someone can clear my mind if I really need to have the CS on one to one SPI connection or not? and why?



Answer



In general, it depends on the part. Some parts use the CS going high to process the data in the receive buffer.


Specifically for the Atmega168a in slave mode, yes, you can just ground the CS. However, you'll have no way to reset the SPI logic, so if you are off by one bit on one transaction that error will continue to propagate.


So, it's possible, but not recommended. Especially if you're still attempting to debug the connection.


No comments:

Post a Comment

arduino - Can I use TI's cc2541 BLE as micro controller to perform operations/ processing instead of ATmega328P AU to save cost?

I am using arduino pro mini (which contains Atmega328p AU ) along with cc2541(HM-10) to process and transfer data over BLE to smartphone. I...