amit deulkar
Junior Member level 1
i am trying to send data to hyper terminal using following code but not working please help
Code C - [expand] 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 #include <stdio.h> #include <stdlib.h> #include<p18f452.h> #pragma config OSC=HS, OSCS=OFF #pragma config PWRT=OFF, BOR=ON, BORV=45 #pragma config WDT =OFF #pragma config DEBUG=OFF,LVP=OFF,STVR=OFF void uart_init(void); /* * */ void main(void) { uart_init(); while(1) { TXREG=0x06; while(PIR1bits.TXIF==0); } } void uart_init(void) { TRISCbits.TRISC6=0; // tx pin as o/p TRISCbits.TRISC7=1; // rx pin as i/p SPBRG=18; // (172800/9600) FOR 9600 BAUD RATE TXSTA=0X20; // TRANSMIT ENABLE RCSTAbits.SPEN=1; TXSTAbits.TXEN=1; //RCSTA=0X90; // RECEIVE ENABLE }