ailatech
Joined: 24 Jul 2007 Posts: 7 Location: Jordan
|
sending int16 using RS232 |
Posted: Mon Sep 24, 2007 11:43 pm |
|
|
Hello
I have written to the program eeprom sucessfully, and then i need to read those data and send them via the RS232 terminal. The program writes to program eeprom successfully, but it does not send via the rs232.
The code is:
Code: | #include<16f877.h>
#fuses NOWDT, HS
#use delay (clock = 20000000)
#use rs232(baud=9600, xmit=PIN_C6,rcv=PIN_C7)
void flash (void);
int16 address;
void main()
{
for (address = 7168; address<7178; address++)
{
write_program_eeprom(address,address%16);
flash();
}
delay_ms(100);
for (address = 7168; address<7178; address++)
{
printf("address:%Lu data:%Lu \n\r",address,read_program_eeprom(address));
delay_ms(1000);
}
}
void flash (void)
{
output_high(PIN_B6);
delay_ms(1);
output_low(PIN_B6);
delay_ms(1);
} |
what is the wrong with this program? _________________ Eng. Haytham Shyouk
B.A. Electronics Engineering |
|