Asteroid
Newbie level 4
PIC and Usart
Hi to all friends.
I am new to the world of programming microcontrollers and trying to set up communication between my Pic 16F877 and Virtual Terminal in Proteus.
I have written the following code. But it is not working. Please tell me what's wrong with it.
//Pic 16F877
// Clock 20 Mhz
unsigned char txt[8];
unsigned int i;
void main() {
Usart_Init(9600);
Lcd_Init(&PORTD);
txt[0]="12";
txt[1]="20";
txt[2]="50";
txt[3]="10";
txt[4]="40";
txt[5]="80";
txt[6]="76";
txt[7]="48";
for (i=0;i<8;i++)
Usart_Write(txt);
}
Hi to all friends.
I am new to the world of programming microcontrollers and trying to set up communication between my Pic 16F877 and Virtual Terminal in Proteus.
I have written the following code. But it is not working. Please tell me what's wrong with it.
//Pic 16F877
// Clock 20 Mhz
unsigned char txt[8];
unsigned int i;
void main() {
Usart_Init(9600);
Lcd_Init(&PORTD);
txt[0]="12";
txt[1]="20";
txt[2]="50";
txt[3]="10";
txt[4]="40";
txt[5]="80";
txt[6]="76";
txt[7]="48";
for (i=0;i<8;i++)
Usart_Write(txt);
}