Question on LampDim.BAS


Closed Thread
Results 1 to 14 of 14

Hybrid View

  1. #1
    Join Date
    Nov 2003
    Location
    Wellton, U.S.A.
    Posts
    5,924


    Did you find this post helpful? Yes | No

    Default

    Looks like Steve was going for a 10 second period in the MAXDELAY . Triggering with the AC line at 60 Hz 6000 cycles = 10 second.

    DIMMERS? Catching the positive side of the AC signal?
    Dave
    Always wear safety glasses while programming.

  2. #2
    Join Date
    May 2004
    Location
    NW France
    Posts
    3,653


    Did you find this post helpful? Yes | No

    Lightbulb

    Quote Originally Posted by mackrackit View Post
    Looks like Steve was going for a 10 second period in the MAXDELAY . Triggering with the AC line at 60 Hz 6000 cycles = 10 second.
    Hi, Dave

    Maxdelay value is used for a PAUSEUS command ( bottom of program ) ... soooooo ...

    looks Steve has left 2 ms time for the triac to de-activate @ zero approaching and get a good zero detection for next cycle, maiy be executing some code lines in between ( )

    these 2 ms also set the minimum time the lamp glows ( may be THE reason ) to effectively produce some light ...

    Alain
    ************************************************** ***********************
    Why insist on using 32 Bits when you're not even able to deal with the first 8 ones ??? ehhhhhh ...
    ************************************************** ***********************
    IF there is the word "Problem" in your question ...
    certainly the answer is " RTFM " or " RTFDataSheet " !!!
    *****************************************

  3. #3
    Join Date
    Nov 2003
    Location
    Wellton, U.S.A.
    Posts
    5,924


    Did you find this post helpful? Yes | No

    Default

    So that is what the US after PAUSE is for
    Dave
    Always wear safety glasses while programming.

  4. #4


    Did you find this post helpful? Yes | No

    Default

    I am trying to experiment and adjust this code for 16F676 BUT with an external oscillator (_XT_OSC).
    Can I still use "T1CON=%00110100"?

  5. #5
    Join Date
    May 2008
    Location
    Italy
    Posts
    825


    Did you find this post helpful? Yes | No

    Default

    Can I still use "T1CON=%00110100"?
    You have to set bit 2 to 0 T1CON = %00110000 for external oscillator.


    Code:
    gosub Debounce_AutoRepeat
    		if (triacdelayMaxDelay,
    			fullbright=1        ' set the full brightness Flag
    		endif
    The above has been copied from the code you have posted. This code, without correction, will not compile

    Al.
    Last edited by aratti; - 7th August 2010 at 09:18.
    All progress began with an idea

  6. #6


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by aratti View Post
    You have to set bit 2 to 0 T1CON = %00110000 for external oscillator.
    I checked the datasheet for Bit2, will timer1 be running at 4MHz & TMR1 interrupts be happening at 16.383mS?

    Also can bit2=0 run timer1 or it won't work at all?

  7. #7


    Did you find this post helpful? Yes | No

    Question Progress........

    OK, I have now changed the code to work on 16F676. Code is attached.
    I have tried different values for triacdelay from 8000 & downwards as in lampdim.bas to as high as 15000 & downwards, but I am not getting satisfactory results for my fan speed.
    It woks fine at full speed but when values start reducing, the fan speed reduces quiet a lot at the first step only. Any ideas as to what values I should try with?
    Attached Files Attached Files
    ___________________
    WHY things get boring when they work just fine?

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