Menu

NT7108 not working

Help
mmotte
2020-12-01
2020-12-02
  • mmotte

    mmotte - 2020-12-01

    Electronic goldmine had a deal on CrystalFonz GLCD 12864 with a NT7108 controller. I checked in the GCB libraries and NT7108c was there. What luck. I wanted to make a graphing temperature device.

    I can not make the GLCD work by print not graphics.
    Yes I did set the V0 pin to -3vdc using a pot between +5vdc and -Vee. i can see the background is little squares on the blue backbackground.

    I have search the GCB forum and using Mikan's minimal code. i have tried the demos.
    I am using a 16F886. The Databus is on the 'A' port and the control lines on the 'B' bus because i need the hdwe I2C port for the sensor.

    GCBCompiler is 9807.

    ;Chip Settings
    #chip 16F886,8
    '#option explicit
    '#config OSC=INTOSCIO
    
      #include <glcd.h>
      #define GLCD_TYPE GLCD_TYPE_NT7108C               ' Specify the GLCD type
    
      #define GLCDDirection 0                           ' Flip the GLCD   0 do not flip, 1 flip
    
      '#define GLCD_CS1 PORTa.4    'D12 to actually since CS1, CS2 can be reversed on some devices
      '#define GLCD_CS2 PORTa.5
    
      #define GLCD_DB0 PORTa.0 'D0 to pin 7 on LCD
      #define GLCD_DB1 PORTa.1 'D1 to pin 8 on LCD
      #define GLCD_DB2 PORTa.2 'D2 to pin 9 on LCD
      #define GLCD_DB3 PORTa.3 'D3 to pin 10 on LCD
      #define GLCD_DB4 PORTa.4 'D4 to pin 11 on LCD
      #define GLCD_DB5 PORTa.5 'D5 to pin 12 on LCD
      #define GLCD_DB6 PORTa.6 'D6 to pin 13 on LCD
      #define GLCD_DB7 PORTa.7 'D7 to pin 14 on LCD
    
      '#define GLCD_RS PORTc.1
      '#define GLCD_Enable PORTa.6
      '#define GLCD_RW PORTc.0
      '#define GLCD_RESET PORTC.7
    
      #define GLCD_CS1 PORTB.0    'CS1 control line
        #define GLCD_CS2 PORTB.1    'CS2 control line
        #define GLCD_RS PORTB.4     'RS control line
        #define GLCD_ENABLE PORTB.5 'Enable control line
        #define GLCD_RW PORTB.3     'RW control line
        #define GLCD_RESET PORTB.2  'Reset control line
    
       ' Changed timing for 32 mhz device
       #define NT7108CReadDelay    9     ; = 5 normal usage, 5 or above is OK at 32 mhz!
       #define NT7108CWriteDelay   2    ; = 1 normal usage you may get away with 0, 2 or above is OK at 32 mhz!
       #define NT7108CClockDelay   2     ; = 1 normal usage you may get away with 0, 2 or above is OK at 32 mhz!
    
     'change to LED height, this,avoids set the 4 LED signals
      #define LED_GLCD_HEIGHT GLCD_HEIGHT
    
     dir portc.1 out
     'dir portc.2 in
    
     set portc.1 on
     wait 2 S
    
    '------------------------
    'GCB v0.98.03  2018-10-20
    '------------------------
    
      GLCDCLS
      Wait 1 S
      do Forever
    
        GLCDPrint (10,10,"Hello") 'Print Hello
        wait 500 ms
        GLCDPrint (100,100,"Hello")
        wait 500 ms
          line (0,63,64,31)
    
       wait 400 ms
    
       wait 1 s
          portC.1 = 0
          wait 500 ms
          portC.1 = 1
        'GLCDCLS
      loop
    

    note on portC.1 i hung an led for heartbeat / test to check execution of the code. It seems to execute but no display yet.

    Then I hooked up the Saleae Logic8 and only the Enable and D/I toggle. never see anything on any of the DB port.

    Is there any secrets with the NT7108c? Like do I need pullups? on anything?
    I have triple checked wiring and it is solder to proto board.

    Been working on this for a week, no luck.
    Mike

     

    Last edit: mmotte 2020-12-01
  • Anobium

    Anobium - 2020-12-01

    Have you tried increasing the delays?

    state these constants
      #define NT7108CReadDelay    7      ; = 7 normal usage
      #define NT7108CWriteDelay   7      ; = 7 normal usage 
      #define NT7108CClockDelay   7      ; = 7 normal usage 
    
     
  • mmotte

    mmotte - 2020-12-01

    I'm sorry I thought I answered but i sent it as email replay which don't get here.
    Yes I have tried the different delays and actually they are in the NT7108c driver.h

    So meanwhile I am starting to hack this by copying the 'InitGLCD_NT7108C' sub from the driver and making it run every big loop.
    I wanted to see the signals work and the DB port.

    I do see the /rst work and the CS1 and CS2 but still nothing on the dataport DB

     

    Last edit: mmotte 2020-12-01
  • mmotte

    mmotte - 2020-12-01

    I tried writing directly to Port A but in the nt7108c .
    And then the most direct.

    Set GLCD_RESET Off
        Wait 1 ms
        Set GLCD_RESET On
        Wait 1 ms
        'Set on
        Set GLCD_RS Off
        'GLCDWriteByte 63
        PortA = 0xff
        'Set Z to 0
        'GLCDWriteByte 192
        PortA = 0x00
        'Deselect chips
    

    the bits did not change.

    Finally I made a separate PortA program completely bare. and PortA toggles

    Proves the hardware and 16F886 are ok but ? which way now.

     
  • Anobium

    Anobium - 2020-12-01

    Let us start at the begining. :-)

    Got a photo of the back of the GLCD? Please post one.

    Is this the right GLCD....

     
  • mmotte

    mmotte - 2020-12-01

    Here is a picture of the back.

     
  • Anobium

    Anobium - 2020-12-01

    I will be online and able to look my Wednesday @1100 London time.

     

    Last edit: Anobium 2020-12-01
  • mmotte

    mmotte - 2020-12-01

    No emergency. I know I got too excited looking
    Thanks for help

     
  • Anobium

    Anobium - 2020-12-02

    I have spotted an error in the library. Introduced when I took the library from a contributor.

    Please download and use the new release here: https://sourceforge.net/projects/gcbasic/files/Release%20Candidates/

    Let me know if this resolves.

     
  • mmotte

    mmotte - 2020-12-02

    Had trouble downloading RC32 from Sourceforge but finally after 3 tries it downloaded and i installed.

    The change did not solve the issue. I started with a clean slate and made the Xconnections for control and data port . same results. Full pixel field on a blue background. But nothing printed nor drawn.

     
    • Anobium

      Anobium - 2020-12-02

      OK. Please upload the source and the ASM you are producing.

       
  • Anobium

    Anobium - 2020-12-02

    Full pixel field on a blue background What do this mean?

    Are you seeing a reset?

     
  • mmotte

    mmotte - 2020-12-02

    I was hooking up the Saleae logic analyzer and could get no signals.
    Then I put the PortC.1 Led to blink in the program I sent you. It would not blink anywhere

    Then I tried the old Mikam.gcb and it wrote stuff on the screen!! yah! and the led blinks.

     
  • Anobium

    Anobium - 2020-12-02

    Well, the library is not correct when writing to the port. This needs to be resolved. But, you are working now!

     
  • mmotte

    mmotte - 2020-12-02

    So it only works with that one program. I have tried two of the other older variations and they do not work.

    Getting closer!

    I can hammer on this for a while.
    Thanks for you help.

     
  • Anobium

    Anobium - 2020-12-02

    The full port will be a lot faster... when it works.

    Please increase NT7108CClockDelay tp 255. If that works then decrease till till stops....

    #define NT7108CClockDelay 255

     

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.