A couple days ago, I suddenly got a good idea to utilize the Region Detection pin6. Once the program detects the region from the level of pin 6 (float (internal pull-up): US, pull-down: EU), it is not used until all the code pulsing is finished. So, in US mode for example, after it started pulsing and when you want to stop it, forcing the pin6 to ground will exit the do loop in software and the device will go sleep. I tested both US and EU mode with modified code and worked fine. This way, you can save battery.
I added these two lines (first three lines below) into the code.
Code: Select all
// exit do loop if REGIONSWITCH is pressed
if ((region == US && !(PINB & _BV(REGIONSWITCH)))
|| (region == EU && (PINB & _BV(REGIONSWITCH)))) break;
// delay 250 milliseconds before transmitting next POWER code
delay_ten_us(25000);
And EU version:
If you want to have both in hand like me, you can use following design with a DPDT slide switch to change region.
Cheers!
http://jeonlab.BANNED.com/2011/11/23 ... selection/