View previous topic :: View next topic |
Author |
Message |
applecon2000
Joined: 29 Jul 2007 Posts: 31 Location: UK
|
Ask for help |
Posted: Fri Aug 17, 2007 5:29 pm |
|
|
Dear all,
after building RS232 interface in my LCD module, I wanna build I2C and SPI interfaces into it as well, is there any friend who can give me the suggestion about the code for those two interfaces.
As the codes I writing for I2C and SPI:
Code: | #USE RS232(BAUD=9600,XMIT=PIN_C6,RCV=PIN_C7)
#USE I2C(slave, sda=PIN_C4, scl=PIN_C3, address=0xA0)
...
while(1)
{
while(!i2c_poll());
lcd_putc("\f I2C data: \n");
value3=i2c_read();
lcd_putc(value3);
} //end while of I2C
while(1)
{
output_low(PIN_A5);
while(!spi_data_is_in() && input(PIN_A5));
if (spi_data_is_in())
value3=spi_read();
lcd_putc(value3);
} //end while of SPI |
But it seems not work well. My LCD module would be treated as a slave mode, just being used to receive data from other hardware.
Thanks for your help indeed. _________________ Enjoy our EEE |
|
|
ckielstra
Joined: 18 Mar 2004 Posts: 3680 Location: The Netherlands
|
|
Posted: Fri Aug 17, 2007 5:52 pm |
|
|
In your other post you were told not to post twice. You said you were sorry, and now you are again double posting...
Please post all follow-ups in the other thread. |
|
|
applecon2000
Joined: 29 Jul 2007 Posts: 31 Location: UK
|
Guide me please |
Posted: Fri Aug 17, 2007 5:54 pm |
|
|
please tell me the right place I can post about my question.
and that's the last question, if you know the answer please give me your suggestion, I will stop post it.
thanks. _________________ Enjoy our EEE |
|
|
|