Yahoo Groups archive

Lpc2000

Index last updated: 2026-04-28 23:31 UTC

Message

Re: [lpc2000] Reading value of register

2004-12-07 by Robert Adsett

At 02:33 AM 12/7/04 -0800, you wrote:

<snip>
>int init_spi_read(void) /* Data is being read from SPI, MISO */
>{
>char read;
>read = S0SPDR;
>while (!(S0SPSR & 0x08)); /* check for the SPIF bit */
>return (S0SPSR); /* if Bit is High, read status register*/
>printf("The data read from ADC is %c", read);
>}
>
>when compile no error but when I want to read value from hyperterminal 
>com...it doesn't display.....where am I doing error ???

trying to print after the routine has already exited.  I would recommend 
using something like a good lint (PC-Lint is good) it will catch these 
types of errors. As will some compilers.

Robert

" 'Freedom' has no meaning of itself.  There are always restrictions,
be they legal, genetic, or physical.  If you don't believe me, try to
chew a radio signal. "

                         Kelvin Throop, III

Attachments

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.