Menu

Picaxe LCD - help needed

Help
2018-01-23
2018-01-30
<< < 1 2 3 > >> (Page 2 of 3)
  • JohanDenRidder

    JohanDenRidder - 2018-01-25

    It works. A bit slow but that's ok.
    I am not sure what is standard though, high pulses or low pulses?

    The other reason for not communicating was timing. I wouldn't bet on Picaxe for that...

     
  • stan cartwright

    stan cartwright - 2018-01-25

    It's a good result.. Now you mention the display, I have a "looks familiar" display, not used for 15 years cos too many wires and thought to convert to serial with a mcp expander which is a nice chip to use. I know these displays are slow and think why bother...I use glcd displays with gcb..they are nice, with graphics. It was a thought.
    I got the picaxe serial mp3 player working with gcb no prob but no picaxe chip interface was involved just send bytes.
    Happy trails
    I have a more modern version lcd, but can't find it. you know
    PS I think there's other ways to use these lcds using shift register chips but for cost?

     

    Last edit: stan cartwright 2018-01-26
  • JohanDenRidder

    JohanDenRidder - 2018-01-26

    I just found that by using SerPrint in stead of HSerPrint it is possible to invert the serial signal, thus eliminating the need for a transistor:

    InitSer 1, r2400, 1 + WaitForStart, 8, 1, none, invert
    

    I tried it and this works.
    Thanks for the help.

    Regards,
    Johan

     
  • Chris Roper

    Chris Roper - 2018-01-26

    just found that by using SerPrint in stead of HSerPrint it is possible to invert the serial signal, thus eliminating the need for a transistor

    Did you see my earlyer post about how to do the same with HSerPrint?
    ~~~
    SCKP = 1 ' Invert Tx Bit
    ~~~

    SCKP is an abreviation of Synchronus Clock Polarity but it works becouse in Asynchronus mode the Tx Pin is the same as the Clock pin.

    So you are not forced to use soft serial to invert, you can alocate serial to the hardware and use the CPU for other things.

    Chrees
    Chris

     
  • JohanDenRidder

    JohanDenRidder - 2018-01-26

    Hi Chris, I see now I missed your earlier post, because of switching to the second page of this thread.
    I'll try tomorrow, thanks.

     

    Last edit: JohanDenRidder 2018-01-26
    • Chris Roper

      Chris Roper - 2018-01-27

      No Library needed it is part of the built in functions.
      It may sacrifice portability, however, as it is directly setting a register
      bit in the EUSART.

       
  • stan cartwright

    stan cartwright - 2018-01-27

    This info should be in the help with emphasis on polarity as rs232 is "something everyone understands", not so...I never used rs232 until I used it to program picaxe and it worked with 2 resistors...scientific explanation. It's supposed to just work but this lcd query says otherwise.
    Good explanation of serial issues/useage Chris Roper.

     
  • JohanDenRidder

    JohanDenRidder - 2018-01-27
    SCKP = 1 ' Invert Tx Bit
    

    Chris, thanks. It works now on hardware UART and without the extra transistor.
    I can send text to the LCD by introducing a delay between bytes.

    However, the bigger problem remains that for debugging I want to show the content of variables. If the value is more than 9 (more than 1 digit) the HSerPrint sends too short pauses between digits. Is there a command to increase that pause?

    Johan

     
    • Chris Roper

      Chris Roper - 2018-01-28

      Try #define USART_DELAY
      That will introduce a 1ms pause between chracters.
      So the test code will now be:

      'Set chip model:
      #chip 12LF1840
      
      'Config Hardware-UART:
      #define USART_BLOCKING
      #define USART_BAUD_RATE 2400
      #define USART_DELAY 1
      
      Do
        HSerPrint "AAAAAAAAAA"
        HSerPrintCRLF
        Wait 1 s
      Loop
      

      Cheers
      Chris

       

      Last edit: Anobium 2018-01-28
  • stan cartwright

    stan cartwright - 2018-01-27

    I have this to come,ha. Is it serprint str(var)? I dunno. rs232 It worked for me with picaxe mp3 player
    don't say you got to break down a var to chr$ and send each..no way

     

    Last edit: stan cartwright 2018-01-27
    • JohanDenRidder

      JohanDenRidder - 2018-01-28

      Stan, yes sending a variable to the LCD after breaking it down does work.
      I did it like this:

        sub PrintLCD (Value)
          HSerPrint Value/100
          Wait 5 mS
          Value = Value - ((Value/100)*100)
          HSerPrint Value/10
          Wait 5 mS
          Value = Value - ((Value/10)*10)
          HSerPrint Value
          Wait 5 mS
        end sub
      

      The value wil be printed on the LCD with 5 mS pause between digits.
      The Picaxe LCD accepts it.

      Johann

       
  • mmotte

    mmotte - 2018-01-28
    'To slow down print, set this delay:
    '(Setting to 0 ms will remove all delays)
    #define USART_DELAY 1 ms
    

    actually you can define longer delays using this statement.
    The default is 1 ms.

    try #define USART_DELAY 5 ms

    BR
    M

     
    • JohanDenRidder

      JohanDenRidder - 2018-01-28

      I will try that. Will be much easier than my work around.

       
  • stan cartwright

    stan cartwright - 2018-01-28

    Interesting topic this. Is this in latest gcb 98.01 help/demos...somewhere not obvious to me?
    http://www.circuitvalley.com/2011/12/two-wire-serial-lcd-16x2-graphics.html
    or anything similar
    edit I mean if the circuit works, what/how do I address the display? it's a 2 lots of 4 bits send I think...hence my asking out of not knowing stuff. and to think I programmed this display once in asm, sad

     

    Last edit: stan cartwright 2018-01-28
    • Anobium

      Anobium - 2018-01-28

      See https://m.youtube.com/watch?v=0VAklkWtPiM

      A much improved solution.

       
      • JohanDenRidder

        JohanDenRidder - 2018-01-28

        Very interesting display. Do we have details (source, hardware)?

        Johan

         
        • Anobium

          Anobium - 2018-01-29

          The hardware is a standard LCD. Can be up 8x1, 16x1,16x, 40x2 or 40x4.
          The microcontroller is any PIC with sufficient memory.
          The connectivity between the microcontroller and the PIC is an 8 bit bus.

           
  • JohanDenRidder

    JohanDenRidder - 2018-01-29
    'To slow down print, set this delay:
    '(Setting to 0 ms will remove all delays)
    #define USART_DELAY 1 ms
    

    mmotte you made my day, thanks.
    5 mS did the trick, the Picaxe display is now fully compatible with HSerPrint.

     
    • Anobium

      Anobium - 2018-01-29

      Good job! Interfacing to legacy equipment can be time consuming but Great Cow BASIC is flexible enough to make that Picaxe display work. :-)

       
  • JohanDenRidder

    JohanDenRidder - 2018-01-29

    Yes, thanks.
    To sum it up:
    connect the Picaxe LCD module to the serial hardware port of the PIC (Pin 7 in case of the 12F1840, which is PortA.0)
    Enter these settings:

    'USART settings
      #define USART_BAUD_RATE 2400
      #define USART_TX_BLOCKING
      #define USART_DELAY 5 ms
      SCKP = 1 ' Invert Tx Bit
    
    Now HSerPrint and HSerSend work as usual.
    
     
  • JohanDenRidder

    JohanDenRidder - 2018-01-29

    These two subs will also be useful:

      sub CLS
        ; clear display
        HSerSend (254)
        Wait 5 mS
        HSerSend (1)
        Wait 5 mS
      End Sub
    
      sub Cursor (Line, Position)
        ; position cursor
        HSerSend (254)
        Wait 5 mS
    
        Select Case Line
          Case 1
            Position +=127
            HSerSend (Position)
          Case 2
            Position +=191
            HSerSend (Position)
          Case 3
            Position +=147
            HSerSend (Position)
          Case 4
            Position +=211
            HSerSend (Position)
          case else
        end Select
    
        Wait 5 mS
      end sub
    
     

    Last edit: JohanDenRidder 2018-01-29
    • Chris Roper

      Chris Roper - 2018-01-29

      With the line:

      define USART_DELAY 5 ms

      you probably no longer need all the 5ms delays you have scattered in the
      code.

      On 29 January 2018 at 21:36, JohanDenRidder <hendriksx@users.sourceforge.net

      wrote:

      These two subs will also be useful:

      sub CLS
      ; clear display
      HSerSend (254)
      Wait 5 mS
      HSerSend (1)
      Wait 5 mS
      End Sub

      sub Cursor (Line, Position)
      HSerSend (254)
      Wait 5 mS
      Select Case Line
      Case 1
      Position +=127
      HSerSend (Position)
      Case 2
      Position +=191
      HSerSend (Position)
      Case 3
      Position +=147
      HSerSend (Position)
      Case 4
      Position +=211
      HSerSend (Position)
      case else
      end Select

      Wait 5 mS
      

      end sub

       
  • stan cartwright

    stan cartwright - 2018-01-29

    The picaxe display is in gcb lcd solutions. Would the gcb one wire lcd work with this..as the delays seem different. What does the rc network do,add another delay? https://www.romanblack.com/shift1/shift1c.gif
    edit meaning a bog standard display in photos I posted earlier in this topic.

     

    Last edit: stan cartwright 2018-01-30
  • JohanDenRidder

    JohanDenRidder - 2018-01-30

    Chris,
    Yes, in the previous post you can see I did use that line. It solved the LCD timing issue.
    Only for these two subs that I showed, where special functions of the module are called, I needed an extra delay to get it to work.

     
    • Anobium

      Anobium - 2018-01-30

      Question. Was this an AXE033 LCD? If so, I have developed an alternative firmware for the device many years ago. The firmware is written in Great Cow BASIC and can therefore be a plug in replacement for the existing microcontroller.

       
<< < 1 2 3 > >> (Page 2 of 3)

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.