Re: [jallib] double LCD

16 views
Skip to first unread message

Rob CJ

unread,
Feb 16, 2023, 2:56:21 PM2/16/23
to jal...@googlegroups.com
Hi Hans,

Not sure if I understand you correctly but you have 2 enable pins, 1 for each display. Why do you want to change the alias of a pin? Why not just use the 2 pins and use 2 aliases? I do not understand the difference between changing aliases and changing pins.

Can you explain it in more detail?

Thanks

Kind regards,

Rob


Van: jal...@googlegroups.com <jal...@googlegroups.com> namens hans <hanz...@zeelandnet.nl>
Verzonden: woensdag 15 februari 2023 21:00
Aan: jallib <jal...@googlegroups.com>
Onderwerp: [jallib] double LCD
 
Hi all,
I have a few LCDs which have 2 x 2 character lines. All connections are common, but each part has its own enable. So if I change the enable I can control both. Is there a way to change the alias of the enable in the program to change to another pin?
regards
Hans

--
You received this message because you are subscribed to the Google Groups "jallib" group.
To unsubscribe from this group and stop receiving emails from it, send an email to jallib+un...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/jallib/37f2b309-6b73-465a-be49-dda946113510n%40googlegroups.com.
Message has been deleted

hans

unread,
Feb 16, 2023, 3:18:32 PM2/16/23
to jallib
Hello Rob,
I solved it like this:
Modified the lib and saved it separately: as lcd_hd44780_4_double
  -------------------------------------------------- -------------------------------------------------- --------
  if LCD_ON == low then
                                                 -- clock pulse
    lcd_en = HIGH -- trigger on
    _usec_delay(1) -- delay (> 400ns)
    lcd_en = LOW

   else
         lcd_en2 = HIGH -- trigger on
    _usec_delay(1) -- delay (> 400ns)
    lcd_en2 = LOW
   end if -- triggeroff

end procedure
-------------------------------------------------- -------------------------------------------------- ---
and the program adapted accordingly:
-------------------------------------------------- ----------------
alias lcd_en2 is pin_A1 -- data trigger second lcd
  pin_A1_direction = output

var bit LCD_ON = low

alias lcd_d4 is pin_B0
alias lcd_d5 is pin_B1
alias lcd_d6 is pin_B2
alias lcd_d7 is pin_B4
--
pin_B0_direction = output
pin_B1_direction = output
pin_B2_direction = output
pin_B4_direction = output
--
include lcd_hd44780_4_double
--
lcd_init()
LCD_ON = high
lcd_init() -- init the lcd controller
-------------------------------------------------- -----------------------------------
Now if I toggle the bit LCD_ON I switch from one to the other.
regards
Hans


Op donderdag 16 februari 2023 om 20:56:21 UTC+1 schreef Rob CJ:
Reply all
Reply to author
Forward
0 new messages