Yahoo Groups archive

AVR-Chat

Index last updated: 2026-04-28 22:41 UTC

Thread

Some help required with SPI on Mega16

Some help required with SPI on Mega16

2006-02-12 by kernels_nz

Hi guys, I must admit I have not tried this, but any suggestions would
be appreciated. 

Using the Mega16 SPI module to send data seems very easy (I have done
this) . . . Put your byte in the SPDR register and the processor takes
care of clocking this byte out to the selected slave. 

My question is, what do I do when I want to clock data out of a slave
device (non AVR IC) ? Can I clock 0x00 into the slave device and once
I have clocked the byte out with the Mega as master, read the SPDR
register and this should contain a byte clocked out by the slave ?

Thanks guys
Hein B
Auckland
New Zealand.

Re: [AVR-Chat] Some help required with SPI on Mega16

2006-02-13 by David Kelly

On Feb 12, 2006, at 2:02 PM, kernels_nz wrote:

> My question is, what do I do when I want to clock data out of a slave
> device (non AVR IC) ? Can I clock 0x00 into the slave device and once
> I have clocked the byte out with the Mega as master, read the SPDR
> register and this should contain a byte clocked out by the slave ?

Yes, but make sure whatever you shift into the slave device is not a  
command or data that the slave is going to act upon and do something  
undesired. 0x00 is usually safe.

--
David Kelly N4HHE, dkelly@HiWAAY.net
========================================================================
Whom computers would destroy, they must first drive mad.

Move to quarantaine

This moves the raw source file on disk only. The archive index is not changed automatically, so you still need to run a manual refresh afterward.