;============================={INFORMATION}==================================
;	File:		lcd.asm
;	Project:	PIC/lcd
;	Author:		Tamás Nagy
;	Version:	1.00
;	Used PIC:	PIC16F88A
;****************************************************************************
;============================={DESCRIPTION}==================================
;****************************************************************************
;==========================={SPECIFICATIONS}=================================
;****************************************************************************
;==================={PROCESSOR + INCLUDE + CONFIG}===========================
	list		P=PIC16F88
	#include	<p16f88.inc>
;****************************************************************************
;=============================={DEFINITIONS}=================================
;-------------------------------{I/O PORTS}----------------------------------
#define		LCD_E	PORTB,1
#define		LCD_RS	PORTB,0
#define		LCD_D4	PORTB,2
#define		LCD_D5	PORTB,3
#define		LCD_D6	PORTB,4
#define		LCD_D7	PORTB,5
;-------------------------------{CONSTANTS}----------------------------------
;-------------------------------{VARIABLES}----------------------------------
;--------------------------------{MACROES}-----------------------------------
;****************************************************************************
;=============================(PROGRAM START)================================
	org	0x00
	goto	main
;****************************************************************************
;//////////////////////////////////{MAIN}\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\
;--------------------------{MAIN INITIALIZATIONS}----------------------------
main:	
	banksel	TRISB
	movlw	0xF4
	movwf	OSCCON
	clrf	TRISB
	banksel	PORTB
	clrf	PORTB
	call	LCD_Init
	movlw	d'0'
	call	LCD_Goto
	clrf	count
;****************************************************************************
;==========================={MAIN PROGRAM START}=============================
loop:	
	movf	count,w		;counter
	call	msg1		;call text table
	iorlw	0x00		;when return zero then sleep
	btfsc	STATUS,Z	;checking zero bit 
	goto	next
	call	LCD_Data	;write character
	incf	count,f		;increment counter
	goto	loop
next:
	movlw	0x40
	call	LCD_Goto
	clrf	count
msgwrite2:
	movf	count,w		;counter
	call	msg2		;call text table
	iorlw	0x00		;when return zero then sleep
	btfsc	STATUS,Z	;checking zero bit 
	goto	next1
	call	LCD_Data	;write character
	incf	count,f		;increment counter
	goto	msgwrite2
next1:
	sleep
	
msg1:	addwf	PCL,f		;character table
	dt	"U1=00.0 I1=0.00",0
msg2:	addwf	PCL,f
	dt	"U2=00.0 I1=0.00",0
	end