I am using a PIC18f4520 and i am trying to use the uart tool on the pickit2 to receive from PIC and print 'Hey' to screen. I am using 9600baud and need to know what delay i need to use in my code and how to use it. This is the code i am using and i am getting nothing on the screen.
#pragma config OSC = INTIO67 // Sets the oscillator mode to HS
#pragma config WDT = OFF // Turns the watchdog timer off
#pragma config MCLRE = OFF // Turns low voltage programming off
void main()
{
long i;
// clock frequency = 8MHz
OSCCONbits.IRCF2 = 1;
OSCCONbits.IRCF1 = 1;
OSCCONbits.IRCF0 = 1;
TRISD=0x00;
LATDbits.LATD1=1;
for (i=0;i<10000;i++);
//Delay1KTCYx(250);
putrsUSART( "Hey" );
LATDbits.LATD1=0;
for (i=0;i<10000;i++);
//Delay1KTCYx(250);
LATDbits.LATD1=1;
//Delay10KTCYx(2000);
}
Any help would be much appreciated.
For software USART goto Software Peripheral Library then Software UART Functions then click the top arrow pointing to the right 1 time. And you will have delay info...