Electronic Projects, forums and more.

Go Back   Electronic Circuits Projects Diagrams Free > Electronics Categories > Micro Controllers


Micro Controllers Discuss all aspects of micro controllers - building them, coding them, etc. All controllers are welcome - PIC, BASIC, Z8 Encore!, etc.

Reply
 
Thread Tools Display Modes
Old 20th April 2004, 07:18 PM   (permalink)
Default Phase control dimming

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
I know that by the time it finishes the loops that the full half cycle hasn't ended, but it needs time to detect the next zero crossing (pulse 100u before crossing), also triggering in last 10% wont result in any light output.

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
Adam is offline   Reply With Quote
Reply

Bookmarks

Thread Tools
Display Modes




All times are GMT. The time now is 09:35 AM.


Electronic Circuits  |  Electronics Wiki
Powered by vBulletin® Version 3.7.0
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.