![]() |
![]() |
![]() |
|
|
|||||||
| Micro Controllers Discuss all aspects of micro controllers - building them, coding them, etc. All controllers are welcome - PIC, BASIC, Z8 Encore!, etc. |
|
|
Thread Tools | Display Modes |
|
|
(permalink) |
|
I am trying to do phase control dimming using a 16f627 on 4mhz internal osc, using pic basic
This is the zero crossing detector I am using, dunno know why the page has a totally unrelated name , but I used two of the 22k resisters in series becuase of the higher voltage in the uk Code:
@ device INTRC_OSC_NOCLKOUT cmcon = 7 level var byte stage var byte level = 128 sync: if portb.1 = 0 then loop goto sync Loop: if portb.1 = 1 then zero goto loop zero: pauseus 100 for stage = 0 to 255 if stage = level then High PORTB.0 pauseus 35 low PORTB.0 else pauseus 35 endif next stage goto Loop end Now my problem is there is a fast flicker on the light, far too fast to count them, but its noticeable (sort of like when a computer monitor is not on fast enough refresh rate) I haven't got any kind of filtering, but someone says that when they did phase control dimming with a PIC, it didn't flicker when it had no filtering (its only dimming a 60w desklamp) The switching part is a moc3020 with 8 amp triac |
|
|
|
|