Continue to Site

Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

BRA command in PIC16F877A

Status
Not open for further replies.

Dragnovith

Junior Member level 1
Junior Member level 1
Joined
Apr 17, 2021
Messages
17
Helped
0
Reputation
0
Reaction score
0
Trophy points
1
Activity points
104
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.
 
Last edited by a moderator:

Solution
GOTO will work if you know the destination address but the only branching on 8-bit devices is forwards or backwards 127 addresses by loading the offset into W and adding it to the program counter. Be aware that you may create an overflow/underflow of the high register of PC if your branch crosses a page boundary.

PIC18 are far more advanced devices than PIC16, particularly when it comes to addressing.

Brian.

betwixt

Super Moderator
Staff member
Advanced Member level 7
Joined
Jul 4, 2009
Messages
15,788
Helped
5,084
Reputation
10,193
Reaction score
4,947
Trophy points
1,393
Location
Aberdyfi, West Wales, UK
Activity points
133,712
GOTO will work if you know the destination address but the only branching on 8-bit devices is forwards or backwards 127 addresses by loading the offset into W and adding it to the program counter. Be aware that you may create an overflow/underflow of the high register of PC if your branch crosses a page boundary.

PIC18 are far more advanced devices than PIC16, particularly when it comes to addressing.

Brian.
 
Solution

Dragnovith

Junior Member level 1
Junior Member level 1
Joined
Apr 17, 2021
Messages
17
Helped
0
Reputation
0
Reaction score
0
Trophy points
1
Activity points
104
GOTO will work if you know the destination address but the only branching on 8-bit devices is forwards or backwards 127 addresses by loading the offset into W and adding it to the program counter. Be aware that you may create an overflow/underflow of the high register of PC if your branch crosses a page boundary.

PIC18 are far more advanced devices than PIC16, particularly when it comes to addressing.

Brian.
Right, thanks!
 

Status
Not open for further replies.

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Top