waddah WROTE:mmh, I was talking about the transformerless and thinking about the 0 crossing
Anyway, I can replace that with batteries and v-regulators, right? I mean the the supply to the 5V components .
If you have a scope you can always check the input waveform before you put in the PIC. Or you may also put a 5.1V zener after the 5M resistor to prevent the voltage being too high.
Another way is to use a step down transformer (12V) and use the first half circuit as follows:

- picdccontrolleddimmer_1272130733(2).png (10 KiB) Viewed 5267 times
waddah WROTE:the datasheet explains that the system is plugged into a 110VAC/60Hz, the zero-crossing is necessary the limit the current(AC) before driving it to port RB0 for interrupt, I worry if the whole thing wont be compatible rather than dangerous for 240VAC/50Hz,?
For testing you can buy a 220V to 110V step down transformer and do everything on the secondary side of the transformer. This type of transformer is quite common for foreigners who migrated from countries using 100-120V AC. It can be bought from electrical or electronics shops. I got one which was used for my wire wrapping guns as they are all from Japan and US.
I also have a smaller one for my 100V color monitor.
When using 50Hz supply you have to amend the software to generate the burst at the correct interval as 50Hz is 20mS per cycle while 60Hz is 16.66mS per cycle.
Allen