Menu

More Serial RX problems

Rich
2023-12-10
2024-01-02
<< < 1 2 (Page 2 of 2)
  • Rich

    Rich - 2023-12-13

    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.

     
    • Awais

      Awais - 2023-12-15

      Rick, have you checked the following?

      1. 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

      2. 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.

      3. Can you share the photo and driver info of USB-to-Serial converter from Windows Device Manager?

      4. Did you try sample codes in \GreatCowBasic\Demos\serial_communications_solutions\hardware+sofware_serial_loopback_solutions

      Regards,
      Awais

       

      Last edit: Awais 2023-12-15
  • Rich

    Rich - 2023-12-16

    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.

     
  • Chris Roper

    Chris Roper - 2023-12-16

    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.

     
  • Rich

    Rich - 2023-12-16

    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

     
    • Anobium

      Anobium - 2023-12-16

      I did try on a real chip. It worked fine. I posted this a few days ago.

       
  • Rich

    Rich - 2023-12-16

    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.

     
    • Anobium

      Anobium - 2023-12-17

      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

       
  • Awais

    Awais - 2023-12-28

    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

     
    • Anobium

      Anobium - 2023-12-28

      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.

       
  • Rich

    Rich - 2023-12-28

    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.

     
    • Awais

      Awais - 2023-12-28

      Glad to know that you found a way to solve the problem.
      Regards,
      Awais

       
  • Brent

    Brent - 2024-01-01

    Did you ever get it working hardware serial?

     

    Last edit: Brent 2024-01-01
  • Rich

    Rich - 2024-01-02

    @Brent
    No. As I said above it works using software serial so I'm sticking with that for now.

     
<< < 1 2 (Page 2 of 2)

Log in to post a comment.