Author: robhamerling
Date: Tue Dec 30 06:17:30 2008
New Revision: 675
Added:
trunk/unvalidated/sample/by_device/18f6310/18f6310_lcd_hd44780_4.jal
Modified:
trunk/unvalidated/sample/by_device/18f6310/18f6310_lcd_hd44780_8.jal
Log:
Added 4-bits sample, corrected comments.
Added: trunk/unvalidated/sample/by_device/18f6310/18f6310_lcd_hd44780_4.jal
==============================================================================
--- (empty file)
+++ trunk/unvalidated/sample/by_device/18f6310/18f6310_lcd_hd44780_4.jal
Tue Dec 30 06:17:30 2008
@@ -0,0 +1,76 @@
+-- =======================================================================
+-- Title: Test program for LCD routines.
+--
+-- Author: Rob Hamerling, Copyright (c) 2008..2008, all rights reserved.
+--
+-- Adapted-by:
+--
+-- Compiler: >=2.4i
+--
+-- This file is part of jallib (http://jallib.googlecode.com)
+-- Released under the BSD license
(http://www.opensource.org/licenses/bsd-license.php)
+--
+-- Description: Program to test the lcd_hd44780_4 library
+--
+-- Sources:
+--
+-- Notes:
+--
+-- -----------------------------------------------------------------------
+
+include 18f6310 -- target
+
+pragma target clock 20_000_000 -- resonator frequency
+
+pragma bootloader long_start -- for TinyBootloader
+
+pragma target OSC hs
+pragma target WDT disabled
+pragma target MCLR external
+
+enable_digital_io() -- disable analog functions
+
+-- ------- LCD interface --------------------------------------------------
+
+const byte LCD_ROWS = 2
+const byte LCD_CHARS = 16
+
+var byte lcd_dataport is portF_high -- data
+var bit lcd_rs is pin_A3 -- command/data select.
+var bit lcd_en is pin_A2 -- data trigger
+
+include lcd_hd44780_4 -- fetch LCD library
+
+pin_A0_direction = output -- )
+portF_high_direction = all_output -- )
+pin_A2_direction = output -- } set port/pin
directions
+pin_A3_direction = output -- )
+
+lcd_init() -- init the lcd controller
+
+-- ------- ----------------------------------------------------------------
+
+include delay
+
+-- ------- ----------------------------------------------------------------
+
+forever loop
+
+ var byte c[LCD_CHARS] = "0123456789ABCDEF"
+
+ var byte i,j
+
+ for LCD_ROWS using i loop
+ lcd_setcursor(i,i)
+ for LCD_CHARS using j loop
+ pin_A0 = !pin_A0
+ lcd_writechar(c[j])
+ delay_100ms(3)
+ end loop
+ end loop
+ delay_100ms(10)
+ lcd_clearscreen()
+
+end loop
+
+
Modified:
trunk/unvalidated/sample/by_device/18f6310/18f6310_lcd_hd44780_8.jal
==============================================================================
--- trunk/unvalidated/sample/by_device/18f6310/18f6310_lcd_hd44780_8.jal
(original)
+++ trunk/unvalidated/sample/by_device/18f6310/18f6310_lcd_hd44780_8.jal
Tue Dec 30 06:17:30 2008
@@ -10,7 +10,7 @@
-- This file is part of jallib (http://jallib.googlecode.com)
-- Released under the BSD license
(http://www.opensource.org/licenses/bsd-license.php)
--
--- Description: Program to test the lcd_hd44780_4 library
+-- Description: Program to test the lcd_hd44780_8 library
--
-- Sources:
--
@@ -18,7 +18,7 @@
--
-- -----------------------------------------------------------------------
-include 18f6310 -- target: PIC16F88
+include 18f6310 -- target
pragma target clock 20_000_000 -- resonator frequency
@@ -27,7 +27,6 @@
pragma target OSC hs
pragma target WDT disabled
pragma target MCLR external
--- pragma target LVP disabled
enable_digital_io() -- disable analog functions
@@ -40,7 +39,7 @@
var bit lcd_rs is pin_A3 -- command/data select.
var bit lcd_en is pin_A2 -- data trigger
-include lcd_hd44780_8 -- fetch 4-bits LCD library
+include lcd_hd44780_8 -- fetch LCD library
pin_A0_direction = output -- )
portF_direction = all_output -- )
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---