View Full Version : PICDIM Lamp Dimmer for the PIC12C508 - PICREF-4
charudatt
- 20th December 2004, 19:02
Hello All,
I am planning to build a Lamp Dimmer as mentioned in the PICREF-4 design. I would like some help in code for this project using PICBASIC PRO.
Thank you in advance.
mister_e
- 20th December 2004, 19:17
hi,
For the benefit of all here's the link for Microchip APP NOTE PICREF-4
http://ww1.microchip.com/downloads/en/AppNotes/40171a.pdf
which part of the code you need to know??? On which frequency your AC line work... not too important but...
IMO, i prefer using other circuit design for that... no transformer AAAAARRRRGH! Safer to use cheap transformer+opto isolator between PIC and TRIAC. But i always use the safer method... not the cheaper one. I may be wrong here but... i'm still on the market and alive :)
charudatt
- 20th December 2004, 19:29
Hello Steve,
I am looking for a code using PICBASIC Pro, It would be much easier to understand and modify.
AC - 230V @ 50 Hz.
I would then be interested in coupling this circuit with some IR chip set and making it totally remote operated. The IR would be ready made solution and not integrated withing the PIC itself.
regards
mister_e
- 20th December 2004, 22:06
O.k
all you need to know @50Hz
Period : 20 ms
1/2 period :10 ms
i'll prefer to detect begining of each cycle using the appended circuit...
You must detect begining of cycle, then activate output to TRIAC for a maximum delay of 10ms including when your PIC is detecting the begining of the cycle. Let's say your PIC is detecting the cycle after 1ms of the begining, you must wait a maximum of 9 ms. Can be intelligent to use a PIC who have internal voltage comparator here.
try the following code as a begining.
'Using PIC16F628
@ __config _INTRC_OSC_NOCLKOUT & _WDT_ON & _PWRTE_ON & _MCLRE_ON & _LVP_OFF
TRISB=%00000001
BeginingCycle var PORTB.0
OutputToTriac var PORTB.1
delay var byte
Hold var word
while BeginingCycle
wend
start:
For delay=0 to 8
for Hold=1 to 100
while BeginingCycle=0
wend
OutputToTriac=1
Pause delay
OutPutToTriac=0
While BeginingCycle
Wend
Next
next
goto start
mister_e
- 23rd December 2004, 07:42
Hi,
I do one code based on a PIC12F675. Wiring is the same as in the PICREF. But i choose a full wave rectify AC for input to PIC.
Hope this help you.
have fun!!!
regards
charudatt
- 24th December 2004, 04:35
Thanks a lot steve. I shall try and get back to you in a couple of days.
Just enjoying the HAMFEST hosted by some local HAM club here in India.
I shall post my developments soon.
VU2UPX
AnupPravin
- 1st September 2015, 14:44
Hi,
I am trying to control an AC lamp with 230V 50Hz using PIC12F1572. Is it possible with this MCU??. Please help me in understanding the working of the circuit and program flow. I am using MPLAB X with xC8 compiler.
The Data sheet of PIC12F1572 is attached in the link.
http://ww1.microchip.com/downloads/en/DeviceDoc/40001723D.pdf
Thanks in Advance
mackrackit
- 1st September 2015, 19:52
Hi,
I am trying to control an AC lamp with 230V 50Hz using PIC12F1572. Is it possible with this MCU??. Please help me in understanding the working of the circuit and program flow. I am using MPLAB X with xC8 compiler.
The Data sheet of PIC12F1572 is attached in the link.
http://ww1.microchip.com/downloads/en/DeviceDoc/40001723D.pdf
Thanks in Advance
You will be better off asking on a forum for XC8, this forum is for PicBasic.
AnupPravin
- 2nd September 2015, 07:14
If i use the same PIC12F1572 with PicBasic is it possible?
Powered by vBulletin® Version 4.1.7 Copyright © 2025 vBulletin Solutions, Inc. All rights reserved.