Author: jsuijs
Date: Wed Feb 25 13:06:02 2009
New Revision: 812
Modified:
trunk/include/external/lcd/glcd_common.jal
trunk/include/external/lcd/lcd_hd44780_common.jal
trunk/include/external/lcd/ng_hd44780_4.jal
trunk/include/external/lcd/ng_hd44780_8.jal
Log:
udated ng_hd44780_?.jal comment. Should be okay now.
Modified: trunk/include/external/lcd/glcd_common.jal
==============================================================================
--- trunk/include/external/lcd/glcd_common.jal (original)
+++ trunk/include/external/lcd/glcd_common.jal Wed Feb 25 13:06:02 2009
@@ -92,4 +92,13 @@
procedure lcd_setcursor(byte in row, byte in col) is
glcd_char_y_pos = row * 7 -- up to 9 rows
glcd_char_x_pos = col * 5 -- up to 25 cols
-end procedure
\ No newline at end of file
+end procedure
+
+--
----------------------------------------------------------------------------
+-- cursor returns home(line 1, position 1)
+--
----------------------------------------------------------------------------
+procedure lcd_home() is
+ glcd_char_y_pos = 0
+ glcd_char_x_pos = 0
+end procedure
+--
----------------------------------------------------------------------------
Modified: trunk/include/external/lcd/lcd_hd44780_common.jal
==============================================================================
--- trunk/include/external/lcd/lcd_hd44780_common.jal (original)
+++ trunk/include/external/lcd/lcd_hd44780_common.jal Wed Feb 25 13:06:02
2009
@@ -138,10 +138,16 @@
var volatile byte lcd_pos = 0
-
+-- to be depricated
procedure lcd_writechar(byte in data) is
; pragma inline
_lcd_write_data(data)
+end procedure
+
+
+procedure lcd_write_char(byte in data) is
+; pragma inline
+ _lcd_write_data(data)
end procedure
procedure lcd'put(byte in data) is
@@ -154,7 +160,7 @@
-- sets the cursor of the LCD to the position in the shadow register
-- (this routine is only used inside this file)
--
----------------------------------------------------------------------------
-procedure lcd_restore_cursor() is
+procedure _lcd_restore_cursor() is
-- set LCD back to normal operation
_lcd_write_command( lcd_set_ddram_address | lcd_pos )
end procedure
@@ -184,7 +190,7 @@
end if
end if
- lcd_restore_cursor
+ _lcd_restore_cursor()
end procedure
@@ -241,11 +247,19 @@
--
----------------------------------------------------------------------------
--
----------------------------------------------------------------------------
--- clears the LCD
+-- clears the LCD (depricated)
--
----------------------------------------------------------------------------
procedure lcd_clearscreen() is
- _lcd_write_command( lcd_clear_display )
- delay_10us( 180 )
+ _lcd_write_command( lcd_clear_display )
+ delay_10us( 180 )
+end procedure
+
+--
----------------------------------------------------------------------------
+-- clears the LCD
+--
----------------------------------------------------------------------------
+procedure lcd_clear_screen() is
+ _lcd_write_command( lcd_clear_display )
+ delay_10us( 180 )
end procedure
--
----------------------------------------------------------------------------
@@ -283,7 +297,7 @@
if line == 1 then lcd_pos = 0 end if
if line == 2 then lcd_pos = 40 end if
- lcd_restore_cursor
+ _lcd_restore_cursor()
-- now fill line with spaces
for 39 loop
@@ -291,7 +305,7 @@
end loop
-- set LCD back to normal operation
- lcd_restore_cursor
+ _lcd_restore_cursor()
end procedure
--
----------------------------------------------------------------------------
@@ -320,7 +334,7 @@
end if
end if
- lcd_restore_cursor
+ _lcd_restore_cursor()
for amount loop
lcd = pattern
Modified: trunk/include/external/lcd/ng_hd44780_4.jal
==============================================================================
--- trunk/include/external/lcd/ng_hd44780_4.jal (original)
+++ trunk/include/external/lcd/ng_hd44780_4.jal Wed Feb 25 13:06:02 2009
@@ -10,12 +10,16 @@
-- Sources:
--
-- Description:
--- Simple interface for HD44780 compatible alphanumeric LCD screens.
--- Screens can range from 2x8 (2 lines, 8 chars) to 4x20.
--- Uses 4 bit wide datapath + 2 handshake lines (total 6 PIC pins).
+-- Nibble interface for HD44780 compatible alphanumeric LCD screens.
+--
-- Expects: - 2 pins for handshake: 'lcd_rs' and 'lcd_en'
-- - 1 port nibble for data: 'lcd_dataport'
--- *
+-- or
+-- - 2 pins for handshake: 'lcd_rs' and 'lcd_en'
+-- - 4 lines for data: 'lcd_d4' .. 'lcd_d7'
+-- note: a 'port nibble' - the lower or higher 4 bits of a port -
give
+-- faster and more compact code then random selected data
lines.
+-- --
-- Directions for use of this library in application programs
-- (in this sequence):
-- 1. Declare the following constants:
@@ -25,59 +29,33 @@
-- var byte lcd_dataport is portA_low -- 4 data pins
-- var bit lcd_en is pin_A4 -- trigger
-- var bit lcd_rs is pin_A5 -- cmd/data select
---
---
--- ------------- place this below, in your MAIN file and add to
---------
--- ------------- the pins which are not used the variable:
---------
--- ------------- "not_connected" and change the other pins
---------
--- ------------- according to your hardware.
---------
--- ------------- also remove the "--"
---------
---
--- var volatile bit lcd_rs is pin_e0 -- data/command select
--- var volatile bit lcd_rw is pin_e1 -- read/write select
--- var volatile bit lcd_en is pin_e2 -- clock the data
---
--- var volatile bit lcd_d4 is pin_d4
--- var volatile bit lcd_d5 is pin_d5
--- var volatile bit lcd_d6 is pin_d6
--- var volatile bit lcd_d7 is pin_d7
---
---
--- include lcd_hd44780_rz
---
---
--------------------------------------------------------------------------
---
--------------------------------------------------------------------------
---
---
+-- or
+-- var bit lcd_d4 is is pin_A3 -- databit d4 pin
+-- var bit lcd_d5 is is pin_A1 -- databit d5 pin
+-- var bit lcd_d6 is is pin_C0 -- databit d6 pin
+-- var bit lcd_d7 is is pin_C2 -- databit d7 pin
+-- var bit lcd_en is pin_A4 -- trigger
+-- var bit lcd_rs is pin_A5 -- cmd/data select
+-- --
-- 2. Include this library.
+-- --
-- and somewhere before actually using the lcd:
-- 3. Set the chosen LCD dataport and handshake pins to output:
-- portA_low_direction = all_output
-- pin_A4_direction = output
-- pin_A5_direction = output
+-- or
+-- pin_A3_direction = output -- set data pin as output
+-- pin_A1_direction = output -- set data pin as output
+-- pin_C0_direction = output -- set data pin as output
+-- pin_C2_direction = output -- set data pin as output
+-- pin_A4_direction = output -- set control pin as output
+-- pin_A5_direction = output -- set control pin as output
+-- --
-- 4. Call lcd_init() to initialize the lcd controller.
-- Above is an example for a 2x16 LCD:
--- Bits 0..3 of portA are used for data, pins 4 and 5 of portA are
--- used for handshake. Any other available nibble and handshake pins
--- could be used (provided these are configurable for output).
--- *
---
--- ;; ;; JS: check where we put this info - actually, this file is only the
--- ;; ;; driver and
--- ;; Available functions for application programs:
--- ;; lcd_init() initialize the LCD
controller
--- ;; lcd_clearscreen() clear screen, cursor home
--- ;; lcd_setcursor(<row>,<column>) where to write next
character
--- ;; lcd_writechar(<byte>) write single character
--- ;; at cursor position and
--- ;; shift cursor position 1
right
--- ;; *
--- ;; A pseudo byte variable 'lcd' is declared as alternative for
lcd_writechar(<byte>)
--- ;; So in stead of: lcd_writechar(<byte>)
--- ;; you may use: lcd = <byte>
--- ;; And you may also use 'lcd' as destination in functions of other
--- ;; libraries, like print().
---
+-- --
+-- See hd_44780_common for the LCD API.
--
-- Dependencies: delay.jal
--
@@ -173,11 +151,11 @@
__lcd_write_nibble(0b0000_0011) -- function set
delay_1ms(5) -- > 4.1 milliseconds
__lcd_write_nibble(0b0000_0011) -- function set
- delay_10us(10) -- > 100 �s
+ delay_10us(10) -- > 100 us
__lcd_write_nibble(0b0000_0011) -- function set
- delay_10us(4) -- > 37 �s
+ delay_10us(4) -- > 37 us
__lcd_write_nibble(0b0000_0010) -- to 4-bit mode
- delay_10us(4) -- > 37 �s
+ delay_10us(4) -- > 37 us
-- init the API
_hd44780_init()
Modified: trunk/include/external/lcd/ng_hd44780_8.jal
==============================================================================
--- trunk/include/external/lcd/ng_hd44780_8.jal (original)
+++ trunk/include/external/lcd/ng_hd44780_8.jal Wed Feb 25 13:06:02 2009
@@ -10,12 +10,16 @@
-- Sources:
--
-- Description:
--- Simple interface for HD44780 compatible alphanumeric LCD screens.
--- Screens can range from 2x8 (2 lines, 8 chars) to 4x20.
+-- Port interface for HD44780 compatible alphanumeric LCD screens.
-- Uses 8 bit wide datapath + 2 handshake lines (total 10 PIC pins).
-- Expects: - 2 pins for handshake: 'lcd_rs' and 'lcd_en'
-- - 1 complete port for data: 'lcd_dataport'
--- *
+-- or
+-- - 2 pins for handshake: 'lcd_rs' and 'lcd_en'
+-- - 8 lines for data: 'lcd_d0' .. 'lcd_d7'
+-- note: a 'port nibble' - the lower or higher 4 bits of a port -
give
+-- faster and more compact code then random selected data
lines.
+-- --
-- Directions for use of this library in application programs
-- (in this sequence):
-- 1. Declare the following constants:
@@ -25,65 +29,41 @@
-- var byte lcd_dataport is portF -- 8 data pins
-- var bit lcd_en is pin_A2 -- trigger
-- var bit lcd_rs is pin_A3 -- cmd/data select
---
---
--- ------------- place this below, in your MAIN file and add to
---------
--- ------------- the pins which are not used the variable:
---------
--- ------------- "not_connected" and change the other pins
---------
--- ------------- according to your hardware.
---------
--- ------------- (now selected as 4 line)
---------
--- ------------- also remove the "--"
---------
---
--- var volatile bit lcd_rs is pin_e0 -- data/command select
--- var volatile bit lcd_rw is pin_e1 -- read/write select
--- var volatile bit lcd_en is pin_e2 -- clock the data
---
--- var volatile bit lcd_d0 is pin_d0
--- var volatile bit lcd_d1 is pin_d1
--- var volatile bit lcd_d2 is pin_d2
--- var volatile bit lcd_d3 is pin_d3
--- var volatile bit lcd_d4 is pin_d4
--- var volatile bit lcd_d5 is pin_d5
--- var volatile bit lcd_d6 is pin_d6
--- var volatile bit lcd_d7 is pin_d7
---
---
---
--- include lcd_hd44780_rz
---
---
--------------------------------------------------------------------------
---
--------------------------------------------------------------------------
---
---
+-- or
+-- var bit lcd_d0 is is pin_D0 -- databit d0 pin
+-- var bit lcd_d1 is is pin_D1 -- databit d1 pin
+-- var bit lcd_d2 is is pin_C6 -- databit d2 pin
+-- var bit lcd_d3 is is pin_C7 -- databit d3 pin
+-- var bit lcd_d4 is is pin_B0 -- databit d4 pin
+-- var bit lcd_d5 is is pin_B1 -- databit d5 pin
+-- var bit lcd_d6 is is pin_C0 -- databit d6 pin
+-- var bit lcd_d7 is is pin_C2 -- databit d7 pin
+-- var bit lcd_en is pin_A2 -- trigger
+-- var bit lcd_rs is pin_A3 -- cmd/data select
+-- --
-- 2. Include this library.
+-- --
-- and somewhere before actually using the lcd:
-- 3. Set the chosen LCD dataport and handshake pins to output:
-- portF_direction = all_output
-- pin_A2_direction = output
-- pin_A3_direction = output
+-- or
+-- pin_D0_direction = output -- set data pin as output
+-- pin_D1_direction = output -- set data pin as output
+-- pin_C6_direction = output -- set data pin as output
+-- pin_C&_direction = output -- set data pin as output
+-- pin_B0_direction = output -- set data pin as output
+-- pin_B1_direction = output -- set data pin as output
+-- pin_C0_direction = output -- set data pin as output
+-- pin_C2_direction = output -- set data pin as output
+-- pin_A2_direction = output -- set control pin as output
+-- pin_A3_direction = output -- set control pin as output
+-- --
-- 4. Call lcd_init() to initialize the lcd controller.
-- Above is an example for a 2x16 LCD:
--- Bits 0..3 of portA are used for data, pins 4 and 5 of portA are
--- used for handshake. Any other available nibble and handshake pins
--- could be used (provided these are configurable for output).
--- *
---
--- ;; ;; JS: check where we put this info - actually, this file is only the
--- ;; ;; driver and
--- ;; Available functions for application programs:
--- ;; lcd_init() initialize the LCD
controller
--- ;; lcd_clearscreen() clear screen, cursor home
--- ;; lcd_setcursor(<row>,<column>) where to write next
character
--- ;; lcd_writechar(<byte>) write single character
--- ;; at cursor position and
--- ;; shift cursor position 1
right
--- ;; *
--- ;; A pseudo byte variable 'lcd' is declared as alternative for
lcd_writechar(<byte>)
--- ;; So in stead of: lcd_writechar(<byte>)
--- ;; you may use: lcd = <byte>
--- ;; And you may also use 'lcd' as destination in functions of other
--- ;; libraries, like print().
---
+-- --
+-- See hd_44780_common for the LCD API.
--
-- Dependencies: delay.jal
--
@@ -168,11 +148,11 @@
_lcd_write_command(0b0011_0000) -- function set
delay_1ms(5) -- > 4.1 milliseconds
_lcd_write_command(0b0011_0000) -- function set
- delay_10us(10) -- > 100 �s
+ delay_10us(10) -- > 100 us
_lcd_write_command(0b0011_0000) -- function set
- delay_10us(4) -- > 37 �s
+ delay_10us(4) -- > 37 us
_lcd_write_command(0b0011_1000) -- to 8-bit mode
- delay_10us(4) -- > 37 �s
+ delay_10us(4) -- > 37 us
-- init the API
_hd44780_init()
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"jallib" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/jallib?hl=en
-~----------~----~----~----~------~----~------~--~---