Continue to Site

Welcome to our site!

Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

  • Welcome to our site! Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

What does BRA do?

Status
Not open for further replies.
All 16 series instructions are 1 word and most are 1 cycle. The two cycle ones are ones that jump to a new location, call goto btfss etc.

Most 18 series instructions use 1 word but some, goto movff etc, are two words.

In all the Microchip data sheets there is a section called "Instruction Set Summary" which list the words/cycles taken.

Mike.
 
In all the Microchip data sheets there is a section called "Instruction Set Summary" which list the words/cycles taken.

I have not been able to fine that list showing the umber of words used. The lists I have seen only show instruction cycles.

I even checked this morning's version for the 12F509, and it is not there:
View attachment 61430

There is a lot of confusion on instruction "word" number versus "cycle" number, and it doesn't seem to matter whether one is on the Microchip forum, here, or any other forum.

While it is easy to see why the number of cycles is important in terms of timing and program performance, I find it much harder to understand why the number of words that make up an instruction such as "goto" makes a significance difference in real practice.

Unless there is a good example, the one-word versus two-word matter seems to be a distinction without a difference, as lawyers are fond of saying.

John
 
And here is the comparable section for the 12F5xx. Note that GOTO does not say two words. The column that shows a "2" is for instruction cycles. I picked the 12F5xx as most people accept that GoTo is a two-word instruction for that chip.

View attachment 61436

Still, what difference does it make in real life?

John
 
This is from a pic18fxxx datasheet

It describes two word / one word

The pic12 won't have two word instructions...but then again it doesn't use BRA..

Either you missed John saying he was studying enhanced mid-range instructions in post #1, or you are not aware that there are no two word enhanced mid-range instructions, yes, no?
 
Last edited:
I found it !:D At least for the mid-range devices.

It is document DS31029A, which may also be known as 33023A, ©1997, "Mid-Range MCU Family Reference Manual, Chapter 29. This document contains enhanced descriptions of the mid-range instructions. Page 29-23 states that GOTO is one word. Apparently, that applies to all mid-range devices.

Further searches for a corresponding document for the baseline devices returned nothing on the Microchip site. (Actually, it returned over 200 pages, and I was too lazy to search all of them, as the first couple of pages were not at all related to the question.) Is there something else baseline devices are called?

Aside from that small point regarding the baseline devices, I think we can conclude and reference that GOTO is a one- word instruction for all of the chips in the 16F series.

John
 
Last edited:
Either you missed John saying he was studying enhanced mid-range instructions in post #1, or you are not aware that there are no two word enhanced mid-range instructions, yes, no?

I don't think so... The question was clearly about the instruction " BRA ".. To my knowledge this is a pic18fxxx instruction (I wondered why we had traveled onto pic12fxxx)
All instructions are less than one word on these chips..
 
I don't think so... The question was clearly about the instruction " BRA ".. To my knowledge this is a pic18fxxx instruction (I wondered why we had traveled onto pic12fxxx)..

Then perhaps your knowledge is limited? The question was about the BRA instruction in the enhanced mid-range instruction set. It's an understandable mistake if you're not familiar with the newer enhanced mid-range devices...
 
Last edited:
I am familiar with the newest pic16 range but I mainly program in C... Unless I need to write a tight routine, as you said, I wouldn't pick it up.

OK I've just looked at the datasheet... I see where the confusion has been...

Sorry John if I confused you....
 
Last edited:
Status
Not open for further replies.

Latest threads

New Articles From Microcontroller Tips

Back
Top