'PIC based Scaler for compact board
'18F2455 16x2 1602LCD
'V4.0 with configuration for CPS CPM uR and long sample option
'V5 with count display during scaling
'v6 skipped
'V7 moved to PBP3 and bug fixes
'(c)G8RPI 2011
DEFINE OSC 20 'set for 10MHz xtal
Not sure what I set the speed to I am wanting to set the speed to 48Mhz. but this is the internal clock. 4Mhz is external. Do I DEFINE OSC 20 'set for 4MHz xtal' ? What about the internal clock? How does one use that?
DEFINE LCD_DREG PORTA ' LCD on port a
DEFINE LCD_DBIT 0 ' Data bits A0..A3
DEFINE LCD_RSREG PORTA ' RS on PORTA
DEFINE LCD_RSBIT 1 ' RS on A1
DEFINE LCD_EREG PORTA ' E on PORTA
DEFINE LCD_EBIT 2 ' E on A2
DEFINE LCD_BITS 4 ' LCD 4 bit mode
DEFINE LCD_LINES 2 ' 2 line LCD display
Define LCD_COMMANDUS 2000 ' Command Delay (uS)
Define LCD_DATAUS 50 ' Data Delay (uS)
LCDOUT $FE,1:PAUSE 3000:LCDOUT $FE,1 ' Initialize LCD WITH HUGE PAUSE !!!
Pause 3000 ' AND AGAIN ...
LcdOut $FE, $80," DUAL TERMOMETER "
LcdOut $FE, $C0," AND THERMOSTAT "
PAUSE 5000 ' AND AGAIN ...
LCDOUT $FE, 1, $FE, $0C ' Clear display, cursor off
Pause 1000
input portB.3 'set to input as the board connects this pin (9) to the LM358 output pin 7
input portB.0
input portB.6
input portA.4 'Switch input
OPTION_REG.7 = 0 'Set portB weak pull-up on
'Pins 10,11,12,13,14 are not connected
'Pin 20 RB.0 is used to enter configuration
'Pin 26 RB.6/T1CKI connected to Pin 9 and LM358 pin 7
Bookmarks