??? 11/04/09 19:58 Modified: 11/04/09 20:23 Read: times |
#170446 - Here ya go... Responding to: ???'s previous message |
code=filename.txt]include <Philips8xC31-51-80C51Fx-80C51Rx+.h>
#include <standard.h> #define PORT1 P1 // P1 recieves the ADC data and transfers it to serial port // unsigned char mybyte ; //intermediate variable// void serial_send(unsigned char mybyte ) ; void main (void) { TMOD = 0x20; SCON = 0x50; TH1 = 0xFD; TR1 = 1 ; TI = 0 ; while(1) { mybyte = PORT1 ; // from port 1 to mybyte variable // serial_send(mybyte) ; } } void serial_send(unsigned char mybyte) { SBUF = mybyte ; while(TI) <------- Shouldn't there be a semi-colon? TI = 0 ; } Also, how come you dont have a specific interrupt that the compiler understands.... like in KEIL here is an example: void it_UART(void) interrupt IRQ_UART // shows the interrupt and IRQ_UART is the number given in the .h fileOn top of that do you have your baud set properly? Which is highly dependent on what processor youre using and this isnt copiable. void UART_Init(void) |
Topic | Author | Date |
URGENT !!! 8051 SERIAL COMMUNICATION CODE HELP | 01/01/70 00:00 | |
Duplicate Thread! | 01/01/70 00:00 | |
Not exactly ... | 01/01/70 00:00 | |
TI | 01/01/70 00:00 | |
Here ya go...![]() | 01/01/70 00:00 |