Thanks Awais, yes there is a power LED. It was only on when data was being transmitted. I have now connected 5V to VCC and it is permanently on. So, with the VCC connected I tried Anobium's modified code. TX sort of worked but RX produced nonsense.
Loop back testing (put jumper wire b/w pin 2 and 3) of your USB-to-Serial converter. Usually I use "Realterm" or Arduino can also be used for simplicity. "Hercules SETUP utility" is also a good software. https://www.hw-group.com/software/hercules-setup-utility
Check USB-to-Serial converter voltages on pin 2 and 3 with reference to pin 5 (0V). If you can use Oscilloscope then it will be much better. Usually cheap converters do not provide proper voltage levels as per RS-232.
Can you share the photo and driver info of USB-to-Serial converter from Windows Device Manager?
Did you try sample codes in \GreatCowBasic\Demos\serial_communications_solutions\hardware+sofware_serial_loopback_solutions
Regards,
Awais
Last edit: Awais 2023-12-15
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Hi Awais, thanks for your help. I put the jumper wire between pins 2 & 3 and downloaded the Hercules software. Unfortunately I don't have access to an oscilloscope but the loopback test seems fine. I tried one of the sample codes but I get the odd correct character with lots of rubbish between.
OK, so I found a PIC16F1937 in my parts. I gave it a try with Anobium's TX code; perfect. So I tried the RX code. Perfect as well. Has anybody tried this on a 16F1825? Is mine broken?
I'm baffled. I've found another PIC16f1825 and it behaves exactly like the previous one yet the PIC16F1937 works perfectly using the same breadboard, jumper leads and TTL/RS232 converter.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Hi,
Just tested now with PIC16F1825 and results are ok.
I am attaching the photos and screenshot. I used USB-to-TTL converter from Aliexpress with Silicon Labs CP2102 IC and there is no inversion.
Just used voltage divider on PIC TX pin 6, 1k-1.5k to interface with 3.3V level of USB converter. The chip on RHS is PIC16F1825 and on LHS is PIC16F1827.
Regards,
Awais
Hi, I started to suspect that there was a problem with my breadboard / leads. I decided to try software serial on different pins and that seems to work fine, so I'm happy with that for now.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Thanks Awais, yes there is a power LED. It was only on when data was being transmitted. I have now connected 5V to VCC and it is permanently on. So, with the VCC connected I tried Anobium's modified code. TX sort of worked but RX produced nonsense.
Rick, have you checked the following?
Loop back testing (put jumper wire b/w pin 2 and 3) of your USB-to-Serial converter. Usually I use "Realterm" or Arduino can also be used for simplicity. "Hercules SETUP utility" is also a good software.
https://www.hw-group.com/software/hercules-setup-utility
Check USB-to-Serial converter voltages on pin 2 and 3 with reference to pin 5 (0V). If you can use Oscilloscope then it will be much better. Usually cheap converters do not provide proper voltage levels as per RS-232.
Can you share the photo and driver info of USB-to-Serial converter from Windows Device Manager?
Did you try sample codes in \GreatCowBasic\Demos\serial_communications_solutions\hardware+sofware_serial_loopback_solutions
Regards,
Awais
Last edit: Awais 2023-12-15
Hi Awais, thanks for your help. I put the jumper wire between pins 2 & 3 and downloaded the Hercules software. Unfortunately I don't have access to an oscilloscope but the loopback test seems fine. I tried one of the sample codes but I get the odd correct character with lots of rubbish between.
Hi Rich,
Any success?
Second, I would like to share a really good Android Oscilloscope. If you can DIY (HS-40X) or buy a ready made (HS502/512).
https://www.martinloren.com/
https://play.google.com/store/apps/details?id=com.martinloren.hscope&hl=en&gl=US
Regards,
Awais
If you have a PICKit 2 you can use the Logic analyser mode to see your waveform, no need for an Oscilloscope for digital stuff.
OK, so I found a PIC16F1937 in my parts. I gave it a try with Anobium's TX code; perfect. So I tried the RX code. Perfect as well. Has anybody tried this on a 16F1825? Is mine broken?
Regards,
Rich
I did try on a real chip. It worked fine. I posted this a few days ago.
I'm baffled. I've found another PIC16f1825 and it behaves exactly like the previous one yet the PIC16F1937 works perfectly using the same breadboard, jumper leads and TTL/RS232 converter.
Most odd.
I have looked at the Datasheet, the Errata and the ASM. All looks ok.
Would you send me one of these chips? Then, I look at it depth.
Evan
Hi,
Just tested now with PIC16F1825 and results are ok.
I am attaching the photos and screenshot. I used USB-to-TTL converter from Aliexpress with Silicon Labs CP2102 IC and there is no inversion.
Just used voltage divider on PIC TX pin 6, 1k-1.5k to interface with 3.3V level of USB converter. The chip on RHS is PIC16F1825 and on LHS is PIC16F1827.
Regards,
Awais
Very good. Thank for the post.
I have never had to use a voltage divider on the CP2102, it may be worth while checking that you need to add the voltage divider.
Hi, I started to suspect that there was a problem with my breadboard / leads. I decided to try software serial on different pins and that seems to work fine, so I'm happy with that for now.
Glad to know that you found a way to solve the problem.
Regards,
Awais
Did you ever get it working hardware serial?
Last edit: Brent 2024-01-01
@Brent
No. As I said above it works using software serial so I'm sticking with that for now.