Author: robhamerling
Date: Thu Dec 25 03:20:03 2008
New Revision: 652

Added:
    trunk/unvalidated/sample/by_device/18f6310/sample_lcd_hd44780_8.jal

Log:

Sample for 8-bits hd44780 LCD interface



Added: trunk/unvalidated/sample/by_device/18f6310/sample_lcd_hd44780_8.jal
==============================================================================
--- (empty file)
+++ trunk/unvalidated/sample/by_device/18f6310/sample_lcd_hd44780_8.jal Thu  
Dec 25 03:20:03 2008
@@ -0,0 +1,77 @@
+-- =======================================================================
+-- 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: PIC16F88
+
+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
+-- pragma target LVP        disabled
+
+enable_digital_io()                           -- disable analog functions
+
+-- ------- LCD interface --------------------------------------------------
+
+const byte LCD_ROWS  = 2
+const byte LCD_CHARS = 16
+
+var  byte lcd_dataport    is portF              -- data
+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
+
+pin_A0_direction     = output                   -- )
+portF_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
+
+

--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---

Reply via email to