EmbeddedRelated.com
Forums

Analog Devices ADuC831 - SPI Question

Started by Ron Blancarte September 14, 2006
Does anyone know if on the ADuC831, if it is possible to write to the
SPIDAT (SPI I/O Register) when the chip is in slave mode?

I am only asking this because I am trying to debug some software and
the Keil compiler is not taking my slave writes to SPIDAT, but it
would when I had specified the chip as a Master.  This could just be a
limitation/flaw in the software though.  I wanted to check to make
sure though.

RonB


--------------------------------------------------
"It is human nature to take shortcuts in thinking"
--------------------------------------------------
On Thu, 14 Sep 2006 13:38:44 -0500 (while OU was sucking), Ron
Blancarte wrote:
>Does anyone know if on the ADuC831, if it is possible to write to the >SPIDAT (SPI I/O Register) when the chip is in slave mode? > >I am only asking this because I am trying to debug some software and >the Keil compiler is not taking my slave writes to SPIDAT, but it >would when I had specified the chip as a Master. This could just be a >limitation/flaw in the software though. I wanted to check to make >sure though.
I figured out the answer to my own question. With some creative debugger use, it can be done. BTW - I figured that this was possible, but the debugger is a bit clunky to get to work (basically fooling the simulated chip to think it is connected to something). RonB -------------------------------------------------- "It is human nature to take shortcuts in thinking" --------------------------------------------------
"Ron Blancarte" <ron@---TAKETHISOUT---.blancarte.com> wrote in message 
news:s78jg2dmqvbthg1kpoek3tkv54f9931ll3@4ax.com...
> Does anyone know if on the ADuC831, if it is possible to write to the > SPIDAT (SPI I/O Register) when the chip is in slave mode? > > I am only asking this because I am trying to debug some software and > the Keil compiler is not taking my slave writes to SPIDAT, but it > would when I had specified the chip as a Master. This could just be a > limitation/flaw in the software though. I wanted to check to make > sure though. > > RonB > > > -------------------------------------------------- > "It is human nature to take shortcuts in thinking" > --------------------------------------------------
Yes, of course. That is how you provide data to be returned to the master. I think the problem you see with the simulator is that it had no control over the SPI communications. I know we have done similar with the 834 and 845 while testing code for the Master side, but I don't think we did for the slave. I never tried, but it might be possible to redirect one of the com ports to the SPI port. You can certainly redirect the PC com ports to the 8xx Uart ports. We did some communication testing between a PC running the simulator and a real unit one day. Never looked to see if the SPI would do the same. Scott
Ron Blancarte wrote:
> Does anyone know if on the ADuC831, if it is possible to write to the > SPIDAT (SPI I/O Register) when the chip is in slave mode? > > I am only asking this because I am trying to debug some software and > the Keil compiler is not taking my slave writes to SPIDAT, but it > would when I had specified the chip as a Master. This could just be a > limitation/flaw in the software though. I wanted to check to make > sure though.
Once you realize that SPI is a pair or a chain of shiftregisters with input, output, clock and latch, their handling becomes rather simple. The master is the one that provides the clock and the latch signal. Rene -- Ing.Buero R.Tschaggelar - http://www.ibrtses.com & commercial newsgroups - http://www.talkto.net