Terminal Character Issue
Posted: Sun Nov 24, 2019 11:03 am
HW: Explorer 16/32, 8MHz, PIC24FJ256GB110 PIM
SW: MPLABX v5.2, MCC, terminal via UART1/USB
Aims: Output data to terminal via UART.
PIN Config:
Debug (PGEC2- pin 26, PGED2 - Pin 27) Previously Tested.
UART (Tx - 50, Rx out - Pin 49 in ) Previously Tested.
Hi Guys,
During messing around with an orientation sensor programming exercise yesterday, the character output to terminal has gone wrong.
So as part of the diagnostic process I loaded a known simple working program, which now had the same issue, then created a completely new simple 'hello world' example which also has the same issue.
Its consistent but wrong.
My initial exploration leads to the possibility that the baud rate is wrong?
from the uart1.c file I see
With BRGH=1
and using the Eq 17-2 from the 'family' data sheet... I get Baud Rate = 4000000/(4*(25+1)) = 38461.53 which seems wrong to me?
Am I on the right track? What's more strange is that it's only just started to happen, could it be and update error? I have got my IDE set to check at every start.
Regards
Les
EDIT...
When I tested my echo back to terminal prog which worked in in the past, it echos back all the standard chars normally, but any numbers are resolved as foreign language fonts. The text sent from the prog has the wrong formatting and chars as well, in fact complete garbage.
SW: MPLABX v5.2, MCC, terminal via UART1/USB
Aims: Output data to terminal via UART.
PIN Config:
Debug (PGEC2- pin 26, PGED2 - Pin 27) Previously Tested.
UART (Tx - 50, Rx out - Pin 49 in ) Previously Tested.
Hi Guys,
During messing around with an orientation sensor programming exercise yesterday, the character output to terminal has gone wrong.
So as part of the diagnostic process I loaded a known simple working program, which now had the same issue, then created a completely new simple 'hello world' example which also has the same issue.
becomesHello World
d-E_Pëev
Its consistent but wrong.
My initial exploration leads to the possibility that the baud rate is wrong?
from the uart1.c file I see
- Code: Select all
// BaudRate = 19200; Frequency = 2000000 Hz; BRG 25;
U1BRG = 0x0019;
With BRGH=1
and using the Eq 17-2 from the 'family' data sheet... I get Baud Rate = 4000000/(4*(25+1)) = 38461.53 which seems wrong to me?
Am I on the right track? What's more strange is that it's only just started to happen, could it be and update error? I have got my IDE set to check at every start.
Regards
Les
EDIT...
When I tested my echo back to terminal prog which worked in in the past, it echos back all the standard chars normally, but any numbers are resolved as foreign language fonts. The text sent from the prog has the wrong formatting and chars as well, in fact complete garbage.