Author: jsuijs
Date: Tue Mar 31 01:19:47 2009
New Revision: 901
Modified:
trunk/project/lcd_interface/lcd_interface.jal
trunk/test/external/lcd/test_lcd_hd44780_serial.jal
Log:
removed reference to board file
Modified: trunk/project/lcd_interface/lcd_interface.jal
==============================================================================
--- trunk/project/lcd_interface/lcd_interface.jal (original)
+++ trunk/project/lcd_interface/lcd_interface.jal Tue Mar 31 01:19:47 2009
@@ -21,36 +21,72 @@
-- todo:
-- - i2c slave interface
--
-----------------------------------------------------------------------------
--- lcd_app.jal
-
-include board_16f88_sl
+;include board_16f88_sl
;@jallib use chipdef
;@jallib use lcd_hd44780_4
-;@jallib use serial
+;@jallib use serial
+;@jallib use ccp
+
+--
-----------------------------------------------------------------------------
+-- copy of relevant part of board file for designed PCB
+--
-----------------------------------------------------------------------------
+
+-- chip setup
+include 16f88
+
+-- We'll use internal oscillator. It work @ 8MHz
+pragma target clock 8_000_000
+pragma target OSC INTOSC_NOCLKOUT
+OSCCON_IRCF = 0b_111 -- Specify no postscaler, ie.
really runs @8MHz
+
+pragma target WDT disabled -- no watchdog
+pragma target LVP disabled -- no low-voltage programming
+pragma target CCP1MUX RB0 -- ccp1 pin on B0
+pragma bootloader long_start -- for TinyBootloader
+
+const serial_hw_baudrate = 57_600
+
+-- LCD IO definition
+var bit lcd_rs is pin_a6 -- LCD command/data select.
+var bit lcd_rs_direction is pin_a6_direction
+var bit lcd_en is pin_a7 -- LCD data trigger
+var bit lcd_en_direction is pin_a7_direction
+var byte lcd_dataport is porta_low -- LCD data port
+var byte lcd_dataport_direction is porta_low_direction
+const byte LCD_ROWS = 4 -- 4 lines
+const byte LCD_CHARS = 20 -- 20 chars per line
+
+-- ccp setup
+var volatile bit pin_ccp1_direction is pin_b0_direction
+
+--
-----------------------------------------------------------------------------
+-- Board file end
+--
-----------------------------------------------------------------------------
enable_digital_io()
+; lcd setup
lcd_rs_direction = output
lcd_en_direction = output
lcd_dataport_direction = output
+include lcd_hd44780_4
+; serial port setup
include serial_hardware
serial_hw_init()
-
-include lcd_hd44780_4
-
--- define input byte & bitfiels
-var volatile byte inchar
-var volatile bit cmdfield at inchar : 5
-var volatile bit*5 datafield at inchar : 0
-
-; setup pwm for backlight
+
+; pwm setup (for backlight)
include pwm_hardware
pin_ccp1_direction = output
pwm_max_resolution(1)
pwm1_on()
pwm1_set_dutycycle(0) -- backlight off
+
+-- define input byte & bitfiels for serial comms
+var volatile byte inchar
+var volatile bit cmdfield at inchar : 5
+var volatile bit*5 datafield at inchar : 0
forever loop
Modified: trunk/test/external/lcd/test_lcd_hd44780_serial.jal
==============================================================================
--- trunk/test/external/lcd/test_lcd_hd44780_serial.jal (original)
+++ trunk/test/external/lcd/test_lcd_hd44780_serial.jal Tue Mar 31 01:19:47
2009
@@ -51,16 +51,16 @@
end loop
const byte str1[] = "Hello world!" -- define strings
-const byte str2[] = "third line"
-const byte str3[] = "fourth line"
+;const byte str2[] = "third line"
+;const byte str3[] = "fourth line"
lcd_init() -- initialize LCD
print_string(lcd, str1) -- show hello world!
-lcd_cursor_position(2,0) -- to 3rd line
-print_string(lcd, str2)
-lcd_cursor_position(3,0) -- to 4th line
-print_string(lcd, str3)
+;lcd_cursor_position(2,0) -- to 3rd line
+;print_string(lcd, str2)
+;lcd_cursor_position(3,0) -- to 4th line
+;print_string(lcd, str3)
var byte counter = 0
@@ -70,19 +70,18 @@
-- slope increase
for 255 using i loop
lcd_backlight_variable(i)
- delay_1ms(5)
+ delay_1ms(2)
end loop
-- slope decrease
for 255 using i loop
lcd_backlight_variable(255-i)
- delay_1ms(5)
+ delay_1ms(2)
end loop
- -- off for 2 secs
- lcd_backlight_variable(0)
- delay_100ms(20)
-
+; -- off for 2 secs
+; lcd_backlight_variable(0)
+; delay_100ms(20)
end procedure
@@ -94,9 +93,9 @@
print_byte_hex(lcd, counter) -- output in hex format
delay_100ms(3) -- wait a little
--- lcd_backlight_variable(counter) -- test backlight
+-- lcd_backlight_variable(counter) -- basic test backlight
- backlight_slope();
+ backlight_slope(); -- enhanced backlight test
if counter == 255 then -- counter wrap
lcd_cursor_position(1,1) -- 2nd line, 2nd char
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---