Dimmer


Closed Thread
Page 1 of 2 12 LastLast
Results 1 to 40 of 68

Thread: Dimmer

  1. #1

    Default Dimmer

    What would be the solution for following problem. I want to controll 2 opto SCR connected to RB1 RB2. I want one to increase light at the same time as the other Decrease light. The zero detection works perfect and also the delay for the ignition puls for scr1 but what about no 2.How do I solve it with Picbasic pro

    Thanks





    DELAY_1 = 8500 : us

    POS_FLNK:IF ZERODETECT = 0 Then POS_FLNK
    NEG_FLNK:IF ZERODETECT = 1 Then NEG_FLNK
    DELAY_1 = DELAY_1 - 1

    IF DELAY_1 < 7000 Then DELAY_1 = 7000

    PauseUs DELAY_1
    High out_1
    "High out_2"
    PauseUs 100
    "Low out_1"
    Low out_2

    GoTo POS_FLNK

  2. #2
    Join Date
    Oct 2004
    Posts
    448


    Did you find this post helpful? Yes | No

    Default

    Hi,

    Since you want to basically complement the 2 outputs, the timing part is easy; assuming you are on 50 Hz, your circuit should see a zero crossing every 10 ms. Therefore, if the delay for one output is X, the other would be (10000-X) us.

    Now, the difficult part is that at times X will be less than (10000-X), and more than (10000-X) the other times.

    You'll need to therefore determine the sequence of servicing the 2 outputs.

    E.g., IF X < (10000-X) THEN PAUSEUS X, SWITCH ON TRIAC1, PAUSEUS (10000-X), SWITCH ON TRIAC2.

    IF X > (10000-X) THEN PAUSEUS (10000-X), SWITCH ON TRIAC1, PAUSEUS X, SWITCH ON TRIAC2.

    Take care of the situation when X = (10000-X) !

    Also allow for the time taken for the actual execution, or else you'll miss the subsequent zero crossing. This you could do by taling the half cycle width to be, say, 9000 us seconds instead of 10000.

    Hope this helps!

    Regards,

    Anand Dhuru

  3. #3


    Did you find this post helpful? Yes | No

    Default

    What about the timing of the trigger pulse when they meet in the center "50%dutycyle". At one point the pic will be busy with 100us pulse for SCR1 and at the same time SCR2 should be triggerd. this might give some flicker. maybe the solution would be to make the dimfunction in lets say 10 or 20 steps and then take care of the overlap instead of a linear dimfuntion


    Thanks

  4. #4
    Join Date
    Oct 2004
    Posts
    448


    Did you find this post helpful? Yes | No

    Default

    I've found that the trigger pulse can be as narrow as 5uS; therefore the flicker you refer to is imperceptible.

    Also, you could put in a line that caters specifically to this situation; e.g., if X = (1000-X) then High Out1 - Pauseus 5 - Low OUt1 - High Out2 - Pauseus 5 - Low Out2.

    BTW, I am using traics, not SCRs. Any particular reason you are using SCRs?

    Regards,

    Anand

  5. #5


    Did you find this post helpful? Yes | No

    Default

    I am using a opto triac Sharp S216S01 so its not a SCR. have to check what the shortest triggpulse can be

    Thanks for you input

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


    Did you find this post helpful? Yes | No

    Default Which PIC are you using ?

    Hi there,

    Which PIC are you using ayway and how are you detecting the zero cross.

    It is also important if you are detecting every or alternate zero crosses.

    If you are using an interrupt based routine then do the following

    1. Play with Timer0 and reset it every zero cross. All turn off the outputs. Its best to do it in assembly.
    2. Thus your timer functions as a digital ramp generator now use to loop to detect if the timer has reached the desired value. In this way you do not have to care about the glitches.
    3. A 5us time might be not enough. It is best to keep the outputs latched till the next zero cross. This will also let you use low loads under the latching current of the SCR.

    Regards

    Sougata

  7. #7


    Did you find this post helpful? Yes | No

    Default

    I use a 16F84 8Mhz.Zero detection with an opto coupler after rectifyer 100Hz and then a schmittrigger to get the levels right. Have a <1ms puls around zero.
    It might be a good idea to make the pulse as long as it can be ,and bring it low just before zero. Sharp "s216s01" recomends 1mS min ,
    Assembly might be the best way of solving this ,since my goal is to control 5 outputs , I start with one then work my way up

    thanks

  8. #8
    Join Date
    Oct 2005
    Location
    New Zealand
    Posts
    171


    Did you find this post helpful? Yes | No

    Default

    I use a resistor as zero detect, 1 meg from phase straight into the port, I then have a 470K resistor on the pin next door to it and swing the bias in an opposite direction to the mains ie:

    GPIO.5 is the output pin with the 470K on it - trigger is GPIO.4 which is connected upto the 1M which goes straight to phase. The triac is triggered by a BC327 and i trigger by turning pic from high impedance to low by changing from input to output.

    LowSide: 'look for trigger points and trigger triac

    IF trigger = 1 Then lowside 'wait for phase to go low
    GPIO.5 = 0 'weight input to sense zero crossing
    PauseUs dim 'wait for dim period
    Output triac 'fire triac
    triac = 0
    PauseUs 400
    Input triac


    HighSide:

    IF trigger = 0 Then HighSide
    GPIO.5 = 1
    PauseUs dim
    Output triac
    triac = 0
    PauseUs 400
    Input triac

    GoTo start
    Last edited by George; - 31st October 2005 at 21:38.

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


    Did you find this post helpful? Yes | No

    Default How would you like your outputs to be controlled

    Hi there,

    Having the opto-triac driven till the zero cross would take care of inductive loads also.
    Provide me with the following :

    1. How the outputs would be controlled? (Internal timer /push button etc)
    2. Your line frequency

    I would try to play with the interrupt part simulate it.

    Regards

    Sougata

  10. #10


    Did you find this post helpful? Yes | No

    Default

    What i wanted to do is a controller for some decorative lights. I want to make a pattern where light fade in / out.
    Powersupply = 50 hz 220V

    My first plan was to fade in/out between 2 limits on 1 channel "this works ok".
    then i wanted to try 2 channels to push the limit "a bit"
    Now I can see this extend to like 5 output creating a wave like motion.
    may be it will end up with a lot of assembly code and also lower the demands
    on "linear control" and go over to fixed steps and a data table


    could even parallell 5 pics to achive my goal this would be the last solution

    Thanks

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


    Did you find this post helpful? Yes | No

    Default I will be posting the code tomorrow.

    Hi,

    Understood. The only problem is that I don't have 16F84 ready. However it should work. Do you have a PIC18F452 ready? This is where I am most comfortable. I also have 16F676, 16F73, 16F619 handy. BTW you don't need five PICs.

    Regards

    Sougata
    Last edited by sougata; - 1st November 2005 at 10:08.

  12. #12
    Join Date
    Nov 2003
    Location
    Greece
    Posts
    3,806


    Did you find this post helpful? Yes | No

    Default

    I have not done this but may be my idea could help.

    Using Interrupts, when there is pulse from zero-crossing detector, you could succeed in your house keeping, timing that is.

    Entering the ISR, the relevant registers would increment or decrement according the flags you have set in your main program. So there is accurate timing to fire every SCR even 5 or more since the ISR would be triggered every 10ms.

    Ioannis

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


    Did you find this post helpful? Yes | No

    Talking I am working on a simplified version

    Hi Everybody,

    It is possible to trigger n numbers of SCRs within the 10ms(50Hz) time frame. My DMX Dimmer handles 48 of them. There I use a bubble sort algo and actually different interrupt sources. One for syncing the timer with ac, one for firing, listening to USART, fader read and so on. All this handled by two PICs 18F452 @ 40MHZ. The second one is mainly for the download and running of pattern or randomizing them.

    I am working on a simplified version using a PIC16F84A (Yes I found one) and trying to acheive a 100% PBP code using the On-Interrupt function. I have no idea about the latency till I get my code running tomorrow and checking on scope. Even the asm interrupt would be quite easy.

    You see with a clock frequency of 8MHz--> 2MHz(Fosc/4) / 128 (prescale) / 100 (reset every 10miliseconds), the timer0 would count 156 (50Hz) or 130(60Hz max). Compare this constantly in a loop with preset or increasing / decreasing values and fire the appropriate port.On interrupt

    1. Clear all outputs
    2. Reset Timer0
    3. Return

    Thats it. It will be done before the new cycle begins!!!!!!!!!2MIPS

    I am working on a two channel version and let you all guys out there juice it up.

    BTW most of the PICs have an inbuilt Schmidt Trigger on input ports so the interfacing is pretty easy. I use a couple of resistors a diode bridge and an optocoupler to derive the zero cross sync. It is accurate without any phase latency (as in the case of transformer based).Direct AC feed through high value resistor is also possible and practical but the circuit becomes live and is not recommended for experimenters.(I use it in my remote controlled fan/light dimmer to keep costs under control. It retails for about 18USD!!!!)

    The toughest part is possibly randomizing the paterns or using pschychedelic effect with beat detection within the scope of the chosen processor (clock code space, instruction set).

    We are having Diwali (the festival of lights) and a holiday to work with a fun project. The entire town is having myriads of lighting displays so why not doing one for the forum. Happy Diwaly to guys out there.

    It is midnight now and I can get my hands on the PIC only tomorrow when I get the lunch break. So till then....

    Bye!!

    Regards

    Sougata

  14. #14


    Did you find this post helpful? Yes | No

    Default

    Hello everybody
    What happend here , did the the project stall

    RGDS
    BG
    BMI

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


    Did you find this post helpful? Yes | No

    Default Sorry.

    Sorry guys,

    I could not keep up to my commitments. I lost a very near and dear friend. Give me a couple of days, I will get back with something working.

    Regards

  16. #16
    Join Date
    Sep 2004
    Location
    montreal, canada
    Posts
    6,898


    Did you find this post helpful? Yes | No

    Default

    A previous thread ==> http://www.picbasic.co.uk/forum/showthread.php?t=1026

    Schematic + code (Dimmer.zip) ==> http://www.melabs.com/resources/samples.htm#submitted

    Maybe not exactly what you need but should be enough to start
    Steve

    It's not a bug, it's a random feature.
    There's no problem, only learning opportunities.

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


    Did you find this post helpful? Yes | No

    Unhappy Can somebody please test this thing?

    Sorry guys although I did a testing for a single channel version, I couldn't test the five channel one. I am posting the circuit and the code. I request the PIC gurus to have a look at the code and point the flaws. Please do read the notes.doc file for important information.

    Regards

    Sougata
    Attached Files Attached Files

  18. #18


    Did you find this post helpful? Yes | No

    Default

    Thank´s for the code Sougata. I will test it later. However I wrote some code myself and it works.I did not use Interupt´s.. There are some similaritys to what you wrote.

    But As i say I will try out your code later

    thanks
    BG
    Attached Files Attached Files
    BMI

  19. #19
    Reven's Avatar
    Reven Guest


    Did you find this post helpful? Yes | No

    Default

    Can someone help me?
    I build the circuit from (Dimmer.zip) ==> http://www.melabs.com/resources/samples.htm#submitted,
    and I have this problem:
    If I press the increase button (<500ms) ,the lamp go on,full and if I press the decrease button, the lamp go off (normal).
    If I try to decrease the intensity from full on, or increase the intensity from off state, the lamp it fllash fast without decreasing/increasing brightness, until the lamp go on or off.
    On GP4 I have 50hz, and value at the pin GP2 while press the buttons, increment/decrement pulses by 500 uSec,until the maximum/minimum value, everything look ok.

    Any Help?

    Thanks!

  20. #20
    Join Date
    Nov 2003
    Location
    Greece
    Posts
    3,806


    Did you find this post helpful? Yes | No

    Default

    Have you adapted the program for the 50Hz line freq?

    Ioannis

  21. #21
    Reven's Avatar
    Reven Guest


    Did you find this post helpful? Yes | No

    Unhappy

    If you mean the maxdelay value, yes.

    But if you conect osciloscope and take a look at the pulses from the pic output and the 50Hz at the same time, you will see that the maxdelay value is only for the maximum brightness.

  22. #22
    Join Date
    Sep 2004
    Location
    montreal, canada
    Posts
    6,898


    Did you find this post helpful? Yes | No

    Default

    Looks like a bad signal level to me...

    What is the voltage of your transformer?
    What are your R3 and R4 value?

    Try decrease R3 and post your results.
    Steve

    It's not a bug, it's a random feature.
    There's no problem, only learning opportunities.

  23. #23
    Reven's Avatar
    Reven Guest


    Did you find this post helpful? Yes | No

    Unhappy

    This is the osciloscope measures from the GP4 (AcLine input), and from GP2 (Output to TRIAC).
    I use tranformer 8Vac, R3=4k7 and R4=10k.

    Look the pictures from 0 to 4. Is from value off to on through 3 steps.


    But the lamp still flashing...
    Attached Images Attached Images      

  24. #24
    Join Date
    Oct 2005
    Location
    Sweden
    Posts
    3,521


    Did you find this post helpful? Yes | No

    Default This doesn't look right.....

    Reven,
    I've not used that circuit or code you are reffering to but by just looking at your waveforms it seems that the triac is triggered at the same phase angle in case 1, 2, 3 & 4.

    The triac only needs a short pulse on the gate and will then hold itself 'on' untill the AC-line crosses zero, at which point it will turn 'off'. That short pulse should be delayed a certain amount of time from the zero crossing.

    On your scope pics the triac seems to be triggered exactly 1div from the zero crossing in all cases except full on and full off.

    /Henrik Olsson.

  25. #25
    Join Date
    May 2004
    Location
    NW France
    Posts
    3,614


    Did you find this post helpful? Yes | No

    Wink Pulse position, not pulse length !!!

    Hi, reven

    Henrik is right ...

    Here, the pulse length is not the thing to be variable.

    but you must vary the time between zero voltage detection and triac gate firing ...

    Long time = weak light
    short time = full light

    remember once the triac is turned on it stays turned ON until current becomes null.


    Alain

    Here, you had programmed a ... DC Dimmer !!!
    ************************************************** ***********************
    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 " !!!
    *****************************************

  26. #26
    Reven's Avatar
    Reven Guest


    Did you find this post helpful? Yes | No

    Thumbs up Pulse position, not pulse length...

    I think you have right...
    As Henrik says ,now the triac is triggered at the same phase angle in all cases.
    I must change my code to put the pulse position in a variable.
    Thanks all of you!
    I will inform you about my progress!




    BTW, take a look at the code,bacause I checked it many times and I could not find where the problem is.

    http://www.picbasic.co.uk/forum/atta...0&d=1103787743

    Thanks again,
    Reven

  27. #27
    Join Date
    May 2004
    Location
    NW France
    Posts
    3,614


    Did you find this post helpful? Yes | No

    Wink Got it !!!

    Hi, Reven

    Just understand what the interrupt routine does instead of should have done ...

    ""
    ' ACDetect
    ' --------
    '
    ' Interrupt routine called by ACLine (GP4) pin state change
    '
    disable
    ACDetect:
    if ACline==1 then ' Check for rising edge of AC signal
    if triacdelay > 0 then
    Triac=1 ' Activate TRIAC

    Alain's : ;;; No,No,No ... here we have to wait for ( Maxdelay - Triacdelay ) !!! THEN fire the Triac for, say, 20µs ... then let things quiet.

    if FullBright==0 then ' In case Brightness flag is not set
    pauseus triacdelay ' do the selected delay
    triac=0 ' Disable TRIAC
    endif
    else
    triac=0
    endif
    endif
    INTCON.0=0 ' Clear GPIF (interrupt on GP4 change)
    resume
    enable

    ""


    *** This part of program smells to have been taken from a heather using burst mode dimming ...

    Sorry, Steve ... je t'aimais bien ( avec la musique de circonstance ... )

    Alain
    Last edited by Acetronics2; - 13th December 2005 at 12:15.
    ************************************************** ***********************
    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 " !!!
    *****************************************

  28. #28
    Join Date
    Sep 2004
    Location
    montreal, canada
    Posts
    6,898


    Did you find this post helpful? Yes | No

    Default

    mmm, sorry all. something should be wrong in what i posted. I used that program in various app and it worked... let me the time to return at home(Next week) and i'll compare the posted version and what i use...

    Many thousands of appologies.
    Steve

    It's not a bug, it's a random feature.
    There's no problem, only learning opportunities.

  29. #29
    Join Date
    Sep 2004
    Location
    montreal, canada
    Posts
    6,898


    Did you find this post helpful? Yes | No

    Default

    Can't wait to return home... use the following ACDetect routine instead.
    this should work.
    Code:
    disable
    ACDetect:
    if ACline==1 then 
        '
        '    Rising edge of AC signal
        '    ========================
    	if triacdelay then              ' A delay is set by user
                                            '  
    	    if FullBright==0 then       ' Full Brightness flag is not set
                pauseus maxdelay-triacdelay '    do the selected delay
                triac=1                     '    enable TRIAC	    	
                else                        '
        	        triac=1                 ' Full Brightness flag is set
                                            '    enable triac
                endif                       '
                                            '
            else                            '
        	    triac=0                     ' No Delay set by user... disable Triac
            endif                           '
        
        else                                
        '
        '    Falling edge of AC signal
        '    =========================
            if fullbright==0 then triac=0   ' Disable the Triac on falling edge of 
                                            ' Ac signal
        endif
    INTCON.0=0 ' Clear GPIF (interrupt on GP4 change)
    resume
    enable
    Yeah i know you can also use Pulsout and forget the Falling edge detection... as you wish. Both will work.
    Last edited by mister_e; - 18th December 2005 at 11:39.
    Steve

    It's not a bug, it's a random feature.
    There's no problem, only learning opportunities.

  30. #30
    Reven's Avatar
    Reven Guest


    Did you find this post helpful? Yes | No

    Thumbs up Ok!

    First, I write something like this:

    ' Interrupt routine called by ACLine (GP4) pin state change
    disable
    ACDetect:

    if ACline=1 then ' Check for rising edge of AC signal

    pauseus triacdelay ' do the selected delay
    Triac=1 ' Activate TRIAC
    pauseus 20
    Triac=0 ' Disable TRIAC

    endif


    INTCON.0=0 ' Clear GPIF (interrupt on GP4 change)
    resume
    enable



    and because I use half wave signal from the AC line on GP4, finaly something like this:


    ' Interrupt routine called by ACLine (GP4) pin state change
    disable
    ACDetect:

    if ACline=1 then ' Check for rising edge of AC signal

    pauseus triacdelay ' do the selected delay
    Triac=1 ' Activate TRIAC
    pauseus 20
    Triac=0 ' Disable TRIAC


    'send a second pulse to triac,after 10ms, like the full wave
    pause 10
    Triac=1 ' Activate TRIAC
    pauseus 20
    Triac=0 ' Disable TRIAC


    endif


    INTCON.0=0 ' Clear GPIF (interrupt on GP4 change)
    resume
    enable





    Again, thanks all of you!
    Reven

  31. #31
    Join Date
    Sep 2006
    Location
    Florida, USA
    Posts
    88


    Did you find this post helpful? Yes | No

    Default Problem with config fuse

    Hello - I am trying to compile the dimmer program and I am getting an error at the CONFIG fuse:

    @ __CONFIG _INTRC_OSC_CLKOUT & _WDT_OFF & _MCLRE_OFF & _CP_OFF

    It's giving me:

    Error ACLAMP~1.ASM 60: [235] opcode expected instead of '__config'

    Can anyone tell me what I am doing wrong?

    PBP 2.43 - PIC12F675

    Atom058

  32. #32
    Join Date
    Sep 2004
    Location
    montreal, canada
    Posts
    6,898


    Did you find this post helpful? Yes | No

    Default

    Can anyone tell me what I am doing wrong?
    You're using PM instead of MPASM to compile your code

    if you want to use PM, you must use the @ DEVICE directive instead.

    See the Faq about that. There's a whole thread about how to set config fuses in your code.
    http://www.picbasic.co.uk/forum/showthread.php?t=543
    Steve

    It's not a bug, it's a random feature.
    There's no problem, only learning opportunities.

  33. #33
    Join Date
    Sep 2006
    Location
    Florida, USA
    Posts
    88


    Did you find this post helpful? Yes | No

    Talking

    You're the MAN! Totally missed that one. Thanks!

  34. #34
    Join Date
    Sep 2006
    Location
    Florida, USA
    Posts
    88


    Did you find this post helpful? Yes | No

    Default Schematic Critique

    Hello - I am trying to build the Dimmer Circuit as described and was wondering if someone could critique the attached circuit diagram. I have built this and do not seem to be able to get it to work and if it is not my design then it must be my code (both of which I obtained here). Any comments will be appreciated. I am using part numbers, schematic and code that are described here: http://www.melabs.com/resources/samples.htm#submitted
    Thanks! Atom058

  35. #35
    Join Date
    Sep 2006
    Location
    Florida, USA
    Posts
    88


    Did you find this post helpful? Yes | No

    Default Oops!

    Here's the schematic....
    Attached Images Attached Images

  36. #36
    Join Date
    Sep 2004
    Location
    montreal, canada
    Posts
    6,898


    Did you find this post helpful? Yes | No

    Default

    %%^%^&*&!#@$! it's my silly mistake. I will have to update the whole thing soon. Use...
    <img src="http://www.picbasic.co.uk/forum/attachment.php?attachmentid=1116&stc=1&d=116053407 7">

    You only have to move 1 wire...

    PCB mod... really easy
    <img src="http://www.picbasic.co.uk/forum/attachment.php?attachmentid=1117&stc=1&d=116053452 8">
    SORRY SORRY SORRY SORRY SORRY SORRY SORRY SORRY SORRY SORRY
    Attached Images Attached Images  
    Last edited by mister_e; - 11th October 2006 at 05:08.
    Steve

    It's not a bug, it's a random feature.
    There's no problem, only learning opportunities.

  37. #37
    Join Date
    Sep 2006
    Location
    Florida, USA
    Posts
    88


    Did you find this post helpful? Yes | No

    Default

    Mister-E - No harm done! Thanks for the quick response! I will give it a try tonight and we'll see what happens.

    Atom058

  38. #38
    Join Date
    Sep 2006
    Location
    Florida, USA
    Posts
    88


    Did you find this post helpful? Yes | No

    Default PIC Issue

    I was trying to program a PIC12F675 to work with this dimmer design and I am obviously missing something. I copied the code from the Dimmer example and it was not working so I moved to a breadboard to do some testing. I can not even make an output on these PIC's go high! I know I am missing something but I can't imagine what it is! Here is the code - as simple as it is:

    @ DEVICE INTRC_OSC_NOCLKOUT & WDT_ON & MCLR_OFF & PWRT_ON & BOD_ON

    PAUSE 500
    CMCON=7 ' Disable analog comparator
    ANSEL=0 ' Disable analog converter

    TRISIO = %11111111
    TRISIO.0 = 0
    TRISIO.1 = 0
    TRISIO.2 = 0
    TRISIO.3 = 0
    TRISIO.4 = 0

    HIGH GPIO.0
    HIGH GPIO.1
    HIGH GPIO.2
    HIGH GPIO.3
    HIGH GPIO.4

    Start:
    GOTO Start

    END

    Now, correct me if I am wrong, but I should be able to measure 5V at each of the 5 outputs above. I get nothing. I have tried several PICs and get the same results. I've written hundreds of programs for different PICs and this one has beaten me. I know the solution is unbelieveabley simple, but GEEZ!

  39. #39
    Join Date
    Jan 2006
    Location
    Istanbul
    Posts
    1,185


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by Atom058
    ...
    @ DEVICE INTRC_OSC_NOCLKOUT & WDT_ON & MCLR_OFF & PWRT_ON & BOD_ON...

    Hi Atom,

    First thing, try these instead of the line above.

    Code:
    @ DEVICE pic12F675, INTRC_OSC_NOCLKOUT 
    @ DEVICE pic12F675, WDT_ON
    @ DEVICE pic12F675, PWRT_ON
    @ DEVICE pic12F675, MCLR_OFF
    @ DEVICE pic12F675, BOD_ON
    @ DEVICE pic12F675, CPD_OFF
    @ DEVICE pic12F675, PROTECT_OFF
    These should fix your problem.


    Second thing, GP3 is an input-only pin. Never goes high.



    ----------------------
    Last edited by sayzer; - 12th October 2006 at 03:38.
    "If the Earth were a single state, Istanbul would be its capital." Napoleon Bonaparte

  40. #40
    Join Date
    Sep 2004
    Location
    montreal, canada
    Posts
    6,898


    Did you find this post helpful? Yes | No

    Default

    Your @ device line is faulty...
    If you'e using PM to compile your code you must use something like
    Code:
    @ device  pic12F675, intrc_osc_noclkout, wdt_on, mclr_off, protect_off
    With MPASM
    Code:
    @ __config _INTRC_OSC_NOCLKOUT & _WDT_ON & _MCLRE_OFF & _CP_OFF
    OUPS! SAYZER WHY YOU REPLYED AT THE SAME TIME

    i know this one is familiar to you
    Steve

    It's not a bug, it's a random feature.
    There's no problem, only learning opportunities.

Similar Threads

  1. PICDIM Lamp Dimmer for the PIC12C508 - PICREF-4
    By charudatt in forum General
    Replies: 8
    Last Post: - 2nd September 2015, 07:14
  2. Dimmer switch
    By iugmoh in forum Off Topic
    Replies: 4
    Last Post: - 20th March 2009, 16:02
  3. Ideas on ir-code for dimmer
    By tirithen in forum mel PIC BASIC Pro
    Replies: 0
    Last Post: - 13th February 2009, 23:22
  4. 50hz sync for light dimmer
    By tirithen in forum General
    Replies: 2
    Last Post: - 6th September 2008, 19:29
  5. Dimmer Circuit
    By Pesticida in forum mel PIC BASIC Pro
    Replies: 9
    Last Post: - 25th January 2007, 14:37

Members who have read this thread : 1

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