Originally Posted by
PA3EXV
@edeca: I work on my own code now and found almost all ASM instructions only use 1 cycle for the 12F683. What do I overlook? If each of my ASM instructions that I need to generate the ID indeed only use a single cycle, do I understand correct for 5MHz clock I may use 4 instructions? The instructions outise the period were the ID is generated towards the GPIO may use more instructions as this is just for generating the random interval in between the sending of the ID's. Can you respond to me?
@edeca: Already solved, each ASM instruction is executed by an Internal instruction cycle clock which is FOSC/4.
This indeed puts some pressure in being creative to set the GPIO in as less as possible ASM instructions...
No need to reply anymore!
PA3EXV, I used the 12F1840 because it has an internal PLL that multiplies the instruction clock by 4x. A quick glance at the 12F683 datasheet suggests it does not have this.
Using a 5Mhz crystal without the PLL you can quite happily use a run of pure ASM to generate the modulated carrier. You get a whole one instruction cycle (four crystal cycles) per modulation period. This means you can really only toggle the bits using xor or set the whole port. These instructions only take one clock cycle. You can't use any branching.
This does mean that you are limited by program memory if you want more than one identifier. You also can't easily include other data in the transponder code, such as battery status or temperature.
With the 4x PLL you get four instructions per modulated bit (sixteen crystal cycles). This allows use of branching and you can therefore do some slightly more clever ASM. I think I got my code down to 5 instructions to send the whole 90 bit transponder code. The code is calculated beforehand and stored in a buffer.
This makes it much easier to calculate the message and include other data, then send it using a generic loop.