Menu

Some help please with GCB RTC demo (Evan's) using MCP9740N and Serial Display

Help
Keith
2016-09-08
2016-10-01
<< < 1 2 (Page 2 of 2)
  • Peter

    Peter - 2016-09-24

    I've just started putting together a troubleshooting guide (in the demos and guides). I'm going to do I2C next.

     
  • Keith

    Keith - 2016-09-24

    Still nothing on the display but I have a feeling that the Serial Display adapter may be at the cause om my problems.

    On the rear of the adapter are three option links 'A0' 'A1' and 'A2' All three are open circuit.

     
    • Anobium

      Anobium - 2016-09-24

      Let us try to determine the address.

      Please use the I2C discovery code to show the address. Again, look in the demo folder for the i2c discovery. Hook up a serial TTL converter between the 1937 and your Pic (If you dont have one, they are very very cheap and will provide huge amount of value when debugging).

      Let me know the address displayed from the discovery program.

       
  • Keith

    Keith - 2016-09-24

    I have ordered one of these :
    http://www.ebay.co.uk/itm/262448073893

    The discription is very similar to yours with the difference being that it is here in the UK and it should be here on Tuesday.

    'Between... the 16f1937 and your PC' - Mud just thickened a bit.....

     
    • Anobium

      Anobium - 2016-09-26

      In preparation of the TTL converter arriving, you should take 16f1937 I2C discovery program and compile, then connect up the TX from the chip to your PC and connect the 0v! You will get nothing displayed on the terminal but if you add SCKP =1 to the GCB then you will!

      SCKP sets Transmit Data Polarity and therefore for chips that support setting Transmit Data Polarity you do not need a TTL converter for transmitting. You still need a TTL converter for other chips and reasons.

      The polarity of the transmit data can be controlled with the SCKP bit of the BAUDCON register. The default state of this bit is ‘0’ which selects high true transmit Idle and data bits. Setting the SCKP bit to ‘1’ will invert the transmit data resulting in low true Idle and data bits. The SCKP bit controls transmit data polarity in Asynchronous mode only. In Synchronous mode, the SCKP bit has a different function. See Section 25.4.1.2 of the datasheet.

      So, you may be able to run the i2c discovery before your TTL converter arrives.

      I did try the i2c discovery this morning. It works a treat.

       
      • Anobium

        Anobium - 2016-09-27

        Results from my I2C discovery are:

        Hardware I2C 
        
             00 01 02 03 04 05 06 07 08 09 0A 0B 0C 0D 0E 0F 
        00:  -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
        10:  -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
        20:  -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
        30:  -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
        40:  -- -- -- -- -- -- -- -- -- -- -- -- -- -- 4E 4F
        50:  -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
        60:  -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
        70:  -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
        80:  -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
        90:  -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
        A0:  -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
        B0:  -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
        C0:  -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
        D0:  -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
        E0:  -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
        F0:  -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
        
        End of Search
        
         
  • Peter

    Peter - 2016-09-27

    My USB toTTL converter arrived today, Keith's must've got lost in the post :)

    Im getting garbage on the terminal screen on the PC though. Am I doing it right?

    InitSer 1, r1200, 1+WaitForStart, 8, 1, none, normal

    In PuTTY I've set the following:
    Baud rate 1200
    Data bits 8
    Stop bits 1
    (no option for start bits)
    Parity None
    Flow control None

    Edit: The 16F676 doesn't have a USART - but I didn't think one was needed for the software serial routines?

    Edit2: Each time data comes through to the PC, only 10 (garbled) characters come up not the 11 + CR + LF that are being sent. I've tried a baud rate of 300 at both ends but no change.

     

    Last edit: Peter 2016-09-27
  • Anobium

    Anobium - 2016-09-27

    Can you use the demo code ? The i2c discovery uses hardare serial and you will find this code is fully operational.

     
    • Anobium

      Anobium - 2016-09-28

      Sorry, being dim. Software. Ohh.

      I just tested your code. Works ok here. I get lots of 'Hello World'.
      My terminal is set to 1200.

      I am not sure what the issue is.

       
      • Peter

        Peter - 2016-09-28

        I will keep investigating, but it seems to suggest I'm doing something fundamentally wrong with serial connections.
        The PIC I'm using is an old one, and the calibration data has been lost so I'm wondering if that's the cause of the garbage (bad timing = incorrect baud). I will try again with a newer PIC or an external crystal.

         
        • Peter

          Peter - 2016-09-28

          That solved it:

           
  • Anobium

    Anobium - 2016-09-29

    What solved it?

     
    • Peter

      Peter - 2016-10-01

      I swapped the 16F676 for a 16F1825 which made it work. I'm assuming the internal oscilator in the 676 is out of calibration due to the missing calibration setting.

       
<< < 1 2 (Page 2 of 2)

Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.