Hi
Maybe not quite what you are after but you can reference pins directly, for example in a decision
Regards
16f18877 internal Zero Cross Detector
-
chipfryer27
- Valued Contributor
- Posts: 2146
- http://meble-kuchenne.info.pl
- Joined: Thu Dec 03, 2020 10:57 am
- Has thanked: 478 times
- Been thanked: 713 times
-
mnfisher
- Valued Contributor
- Posts: 2185
- Joined: Wed Dec 09, 2020 9:37 pm
- Has thanked: 177 times
- Been thanked: 1026 times
Re: 16f18877 internal Zero Cross Detector
Possibly!
I suspect you might be able to do $PORTA0 = 1 in a calculation too?
Though - this is new to me - and I've not tried it...
I suspect you might be able to do $PORTA0 = 1 in a calculation too?
Though - this is new to me - and I've not tried it...
-
chipfryer27
- Valued Contributor
- Posts: 2146
- Joined: Thu Dec 03, 2020 10:57 am
- Has thanked: 478 times
- Been thanked: 713 times
Re: 16f18877 internal Zero Cross Detector
Hi
You can indeed reference ports/pins in calculations.
This calculation immediately turns on the inbuilt LED on a lolin-lite (pin 22, active low)
Regards
You can indeed reference ports/pins in calculations.
This calculation immediately turns on the inbuilt LED on a lolin-lite (pin 22, active low)
Regards
Re: 16f18877 internal Zero Cross Detector
Maybe an easier method would be to simply connect a dual optical isolator via resistor directly to the micro controller transformer on the secondary ac side. Your open collector outputs will switch at every zero crossing.
That signal is connected to the hardware interrupt which services the routine.
If you need schematic help, I do have a working example.
Send me a note at aw@machineautomationproducts.net
That signal is connected to the hardware interrupt which services the routine.
If you need schematic help, I do have a working example.
Send me a note at aw@machineautomationproducts.net