Quote Originally Posted by kvrajasekar View Post
Hi Darrel,

Thanks lot,
Plz tell me, why u select FOSC32,whynot FOSC8.
I chose FOSC32 because I didn't know what crystal you were using.
If you had a 20mhz crystal FOSC8 would probably not work.
But even with a 4mhz crystal, FOSC32 will still work fine.

and my final ques is how to find the rising edge(tON) and Falling Edge(tOFF).I used the following code to find this,
This is a digital i/p,
go_vol1
btfss PORTB,0 ;checking whether porta pin is set or not
goto go_vol1 ;waiting
clrf TMR0
Duty_vol1
btfsc PORTB,0 ;keep monitoring rising edge
goto Duty_vol1
movf TMR0,0
movwf volt_val

Plz give me ur suggestion to use this code,If it is correct my work will get finish.
The code shown will wait for a rising edge, then measure the duration of the high pulse. if you add the same thing again for the low pulse, you'll have both values.
Code:
go_vol1
		btfss 	PORTB,0   ; Wait for rising edge 
		goto 	go_vol1
		clrf	TMR0      ; clear TMR0 for high pulse
Duty_vol1
		btfsc	PORTB,0	  ; keep monitoring high pulse
		goto	Duty_vol1
		movf	TMR0,0    ; put TMR0 value in W reg
		clrf    TMR0      ; clear TMR0 for low pulse
		movwf	tON       ; save timer value to variable

Duty_vol2
		btfss	PORTB,0	  ; keep monitoring low pulse
		goto	Duty_vol2
		movf	TMR0,0    ; put TMR0 value in W reg
		movwf	tOFF      ; save timer value to variable
> And also i m using LCD interface.wat should be the minimum delay b/w the commands to LCD.

It varies from display to display. I think the average is around 1.6ms, but some are as high as 2.5ms for commands. 2.0ms is standard with 50us DATA delay.

hth,