Hi
I have a PIC 18F45K22 running at 8MHz and am trying to receive command strings in the form L_nnn~ where nnn is an unsigned integer and L is an identifier. The received string is garbled as if the baud rate were set wrongly, but it looks OK. I have tried two RS232 sources, one a terminal, with the same results and the RS232 signal on PortC.B7 decodes correctly using a Saleae analyser.Can anyone help please?
Thanks
Jim
RS232 outputs garbled strings.
Moderator: Benj
- QMESAR
- Valued Contributor
- Posts: 1287
- Joined: Sun Oct 05, 2014 3:20 pm
- Location: Russia
- Has thanked: 384 times
- Been thanked: 614 times
Re: RS232 outputs garbled strings.
Hi Jim
As you are using the Internal Hi frequency Oscillator you need to use a C component and configure your Internal Oscillator Register OSCCON to use 8 MHZ
your device seems to me not running at 8Mhz more likely on the 16MHZ standard setting

As you are using the Internal Hi frequency Oscillator you need to use a C component and configure your Internal Oscillator Register OSCCON to use 8 MHZ
your device seems to me not running at 8Mhz more likely on the 16MHZ standard setting

- Attachments
-
- 31.03.jpg (119.19 KiB) Viewed 4198 times
https://www.flowcodexchange.com/
Regards QMESAR
Regards QMESAR
- Benj
- Matrix Staff
- Posts: 15312
- Joined: Mon Oct 16, 2006 10:48 am
- Location: Matrix TS Ltd
- Has thanked: 4803 times
- Been thanked: 4314 times
- Contact:
Re: RS232 outputs garbled strings.
Hi Jim,
The 1 second flash test is always a good sanity check: http://www.matrixtsl.com/wiki/index.php ... ED_flasher
The Project options clock speed calculates things like delays and baud rates for you but assumes the value entered matches what the hardware is actually being clocked at.I had thought that Project options/clock speed set that.
The 1 second flash test is always a good sanity check: http://www.matrixtsl.com/wiki/index.php ... ED_flasher
Regards Ben Rowland - MatrixTSL
Flowcode Product Page - Flowcode Help Wiki - Flowcode Examples - Flowcode Blog - Flowcode Course - My YouTube Channel
Flowcode Product Page - Flowcode Help Wiki - Flowcode Examples - Flowcode Blog - Flowcode Course - My YouTube Channel
- QMESAR
- Valued Contributor
- Posts: 1287
- Joined: Sun Oct 05, 2014 3:20 pm
- Location: Russia
- Has thanked: 384 times
- Been thanked: 614 times
Re: RS232 outputs garbled strings.
I am happy that it is working now Jim
good luck
good luck

https://www.flowcodexchange.com/
Regards QMESAR
Regards QMESAR