can anyone help me...


Closed Thread
Results 1 to 16 of 16

Hybrid View

  1. #1
    Join Date
    Aug 2008
    Posts
    22


    Did you find this post helpful? Yes | No

    Default

    Hi Darrel,

    Thanks lot,
    Plz tell me, why u select FOSC32,whynot FOSC8.

    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.

    And also i m using LCD interface.wat should be the minimum delay b/w the commands to LCD.

    -thanks.
    Last edited by kvrajasekar; - 26th August 2008 at 07:35.

  2. #2
    Join Date
    Jul 2003
    Location
    Colorado Springs
    Posts
    4,959


    Did you find this post helpful? Yes | No

    Default

    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,
    DT

  3. #3
    Join Date
    Aug 2008
    Posts
    22


    Did you find this post helpful? Yes | No

    Default

    Thanks lot Darrel,I m very happy to see ur reply.

    can i use the same codings for zerocrossing?bcoz zero crossing will occur every rising or falling edge.plz correct me if i am wrong?

  4. #4
    Join Date
    Jul 2003
    Location
    Colorado Springs
    Posts
    4,959


    Did you find this post helpful? Yes | No

    Default

    No I'm sorry, but you said the last one was your "Final Question".

    Ok, 1 more.

    If you're waiting for a zero-cross, then you probably don't need to time the event with TMR0.
    Code:
    Wait4ZeroCross                    ; Wait for zero-cross, up or down
        btfss   PORTB,0
        goto    WaitForHigh
    WaitForLow
        btfsc   PORTB,0
        goto    WaitForLow
        goto    ZeroCrossDone
    WaitForHigh
        btfss   PORTB,0
        goto    WaitForHigh
    ZeroCrossDone
    DT

  5. #5
    Join Date
    Aug 2008
    Posts
    22


    Did you find this post helpful? Yes | No

    Default

    Thank you very much Mr.Darrel.

  6. #6
    Join Date
    Feb 2005
    Location
    Kolkata-India
    Posts
    563


    Did you find this post helpful? Yes | No

    Default Use DT's Instant Interrupt for detecting Zero Cross.

    In a UPS (Offline I suppose) control your primary task would be to monitor mains for abnormality which includes under/over voltage, blackout/brownout. I suggest sampling the mains voltage at 0.5ms intervals. Also a premature zero-cross is a definite indication of mains failure. While I use PORTB.0 INT for the zero cross in asm you may use Instant Interrupt to make your life easier.

    http://www.picbasic.co.uk/forum/showthread.php?t=3251
    Regards

    Sougata

  7. #7
    Join Date
    Aug 2008
    Posts
    22


    Did you find this post helpful? Yes | No

    Default

    Hi sougata,

    I m using power failure indication for UPS,wen it detects,i should start the inverter,also wen power resumption occur i should turn off the inverter and start with main.

    How can acheive this task,plz give ur ideas to implement,I m using PIC16f72.

    I am waiting for ur reply.

Members who have read this thread : 0

You do not have permission to view the list of names.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts