Hello all,
I'm working on coding a couple pic chips within a transmitter/reciever system.
I've posted previously about this subject here
https://www.electro-tech-online.com/threads/12f675f-coding-help.29192/
I do still have a couple questions that hopefully someone can bring some clarity to.
As said in the previous post the system will control 2 independent devices in which a remote control will be able to turn on/off and dim. In order to dim I have chosen to use a variable resistor (pot) connected to the A/D GPIO. The code will be setup to store that 8bit code in a register and sent as the command byte of the data packet. The data packet being the id code (device 1 or 2) and command code (level of brightness).
Now for the questions lol -
I've built a zero crossing detector on the reciever side hooked up to a optoisolator/triac connect to the wall 110V outlet.
What is the best way to time when the microcontroller will send a pulse out with respect to where the zero crossings are? What would the code look like? on a side note: what exactly is happening when a zero crossing takes place? Is the microcontroller reciever a short pulse? If so, How do i take those reference points, start the counter, compare the counter values to that of the command code, and fire a pulse to the triac?
I realize i am going to need a counter probably counting up to 255. 0 being the light off and 255 being the light on.
Sorry for the long post, I just didnt want to sound like an idiot that doesnt do research.
I'm working on coding a couple pic chips within a transmitter/reciever system.
I've posted previously about this subject here
https://www.electro-tech-online.com/threads/12f675f-coding-help.29192/
I do still have a couple questions that hopefully someone can bring some clarity to.
As said in the previous post the system will control 2 independent devices in which a remote control will be able to turn on/off and dim. In order to dim I have chosen to use a variable resistor (pot) connected to the A/D GPIO. The code will be setup to store that 8bit code in a register and sent as the command byte of the data packet. The data packet being the id code (device 1 or 2) and command code (level of brightness).
Now for the questions lol -
I've built a zero crossing detector on the reciever side hooked up to a optoisolator/triac connect to the wall 110V outlet.
What is the best way to time when the microcontroller will send a pulse out with respect to where the zero crossings are? What would the code look like? on a side note: what exactly is happening when a zero crossing takes place? Is the microcontroller reciever a short pulse? If so, How do i take those reference points, start the counter, compare the counter values to that of the command code, and fire a pulse to the triac?
I realize i am going to need a counter probably counting up to 255. 0 being the light off and 255 being the light on.
Sorry for the long post, I just didnt want to sound like an idiot that doesnt do research.