I am currently working on a project to select different outputs based on a text input from a laptop via USB.
What I am currently trying to do is send a character out from my PIC18F1320 to HyperTerminal, I have tried using variables but was recieveing rnadom characters such as smiley faces etc. I simplified my code to simply print a 1 however I am still recieving smily face symbols. I have checked that I am using the correct baud rate and there is definite communication between my laptop and the PIC, however at this point I am completely stuck as I have no idea why random characters are being output.
I have extremely little knowledge of C and any help would be appreciated
#include <p18f1320.h>
#include <usart.h>
#include <stdio.h>
#include <stdlib.h>
void main()
{
OSCCON = 0x70; // 8MHz internal clock
// Configure USART
OpenUSART( USART_TX_INT_OFF &
USART_RX_INT_OFF &
USART_ASYNCH_MODE &
USART_EIGHT_BIT &
USART_CONT_RX &
USART_BRGH_LOW,
12);
while (1)
{
putrsUSART("1");
}
CloseUSART();
}