I am re-programming a digital radio transmitter that I built about a year and a half ago to include a working "terminal" interface. The board is based around a PIC18F4550 running at 48Mhz using the PLL off of a 16Mhz crystal and at the time I did not know how easy it was to do USB with these, so there is no USB interface on the board (that would have saved me so much time now).
Anyway, I am having trouble with the USART on the chip receiving characters properly. The computer can read characters the chip sends just fine, but the chip cannot read characters the computer sends to it. Right now the chip's program just echoes back whatever it receives. The only problem is that it throws a frame error every time it receives a character and the character it sends back is definately not what I sent it, but what it sends back stays consistent (i.e. when I type 'a' into the terminal I always get back an 'O' no matter the baud rate). I recently figured out the pattern in these errors (as in figured out just a few minutes ago), but it is really complex and I am not even sure it is actually a pattern and I definately don't know how to correct it other than using a lookup table which could take a while to generate.
On the chip end, the serial hardware on the PCB consists of a MAX232 hooked up to an old serial port I grabbed off an ancient motherboard with the other end hooked up to TX and RX on the chip. The computer hardware consists of a USB->Serial cable (one of those cheap ones with the translucent blue ends and the silver cable between, called "Huge Pine USB to Serial ports" in the device manager) and Realterm running on the computer.
Has anyone here ever seen this before or have any ideas on how to fix this without resorting to a hack like a lookup table?
Anyway, I am having trouble with the USART on the chip receiving characters properly. The computer can read characters the chip sends just fine, but the chip cannot read characters the computer sends to it. Right now the chip's program just echoes back whatever it receives. The only problem is that it throws a frame error every time it receives a character and the character it sends back is definately not what I sent it, but what it sends back stays consistent (i.e. when I type 'a' into the terminal I always get back an 'O' no matter the baud rate). I recently figured out the pattern in these errors (as in figured out just a few minutes ago), but it is really complex and I am not even sure it is actually a pattern and I definately don't know how to correct it other than using a lookup table which could take a while to generate.
On the chip end, the serial hardware on the PCB consists of a MAX232 hooked up to an old serial port I grabbed off an ancient motherboard with the other end hooked up to TX and RX on the chip. The computer hardware consists of a USB->Serial cable (one of those cheap ones with the translucent blue ends and the silver cable between, called "Huge Pine USB to Serial ports" in the device manager) and Realterm running on the computer.
Has anyone here ever seen this before or have any ideas on how to fix this without resorting to a hack like a lookup table?