while(1)
{
while( ! PORTAbits.RA0 ); //wait for RA0 high
putrsUSART( PORTD ); //write value of PORTD
if(PORTD == 0x80) // check for termination
break; // value
}
Not knowing anything about microcontrollers at this point, I can only guess, but should the while loop not look something like this:
(note the added brackets and removed ";")
while(1)
{
while( ! PORTAbits.RA0 ) //wait for RA0 high
{
putrsUSART( PORTD ); //write value of PORTD
if(PORTD == 0x80) // check for termination { break; }// value
}
}
Actually, I think my above example may be an endless loop and I would shorten it to this:
while( ! PORTAbits.RA0 ) //wait for RA0 high
{}
// if we get to here, it is high
while(1)
{
putrsUSART( PORTD ); //write value of PORTD
if(PORTD == 0x80) // check for termination
{ break; }// value
}
Please note that the second while loop will run forever if portD never equals hex 80 due to a transmission error. A for loop may be better.
(I wish the forum would show code with the indentations.)