Hi, on PIC18 it is possible to use BRA, but which command is relative to BRA on PIC16? Was it GOTO? For example I would like to use a BRA SENSOR, but on the PIC16.
All right, clarified me. Thanks!If the details of how the destination address is computed do not matter, then you can use the GOTO instruction to make an unconditional transfer of control to the destination address. In the PIC16 architecture you have 'skip' instructions which evaluate a condition an either execute the next instruction or skip it. I do not believe that the original PIC16 architecture (e.g. 16F84 & 16F877A) has the concept of a relative branch instruction. However it appears the the PIC16F1xxx family members do support the BRA and the BRW instructions.
So sayeth the datasheet.BRA is an unconditional relative branch: execution transfers to <PC+constant>
GOTO is an unconditional absolute branch: execution transfers to <constant>
where <constant> is the number following the instruction.
Therefore, they do exactly the same thing, but the number following the instruction would be different.
At my university I specifically have the PIC18F452 and PIC16F877A models. So, I wanted to have the code for both of them.Out of curiosity, may I know why would you port some (working code) in the 18F family to another in the 16F realm which is more limited and with the added banking complication?
IIRC they are almost 100% pin compatible.
If everyone read the datasheet, the only section of this forum we would need is "off topic"So sayeth the datasheet.
True that, and if that were the case, there would be little reason to be here.If everyone read the datasheet, the only section of this forum we would need is "off topic"
by Aaron Carman
by Duane Benson
by Aaron Carman
by Aaron Carman