Here's the code at comments as to what I think it should be doing....
Setup:
EasyPIC V7 board/ICD3/MCC
Using PIC18F45K22/8MHz
XC8/C90
- Code: Select all
volatile uint8_t rxData;
volatile uint8_t PinData;
void EUSART1_Initialize(void);
{
printf("\r EasyPIC V7 - Date 21/07/2019\r\n");
printf("UART Communications 8-bit Rx and Tx\r\n\n");
printf("Read PORT B Pins \r\n");
printf("using Port B Buttons, set to pull down. \r\n\n");
}
while (1)
{
PinData = PORTB; // save PortB To PinData
__delay_ms(500); // wait for TXREG to fill bit excessive but hey..
if(EUSART1_is_tx_ready()) //if transmit buffer is ready
{
EUSART1_Write(PinData); // send a byte to TX (Terminal from PortB)
}
}
}
The first bit of text comes onto terminal window fine but no input from the pins...
Any comments would be appreciated.
Regards
Les