Help with PIC Architecture: Timing Diagram & PC Values

  • Thread starter Thread starter mathrocks
  • Start date Start date
  • Tags Tags
    Architecture
AI Thread Summary
The discussion focuses on understanding the PIC16F84 architecture, specifically in creating a timing diagram for a sequence of instructions: BTFSC, ADDLW, and SUBLW. Key points include the need to determine the program counter (PC) values during instruction fetching and execution, emphasizing the importance of cycle counting for real-time programming. The BTFSC instruction can either skip or not skip based on the condition, affecting the clock cycles required. The BTFSC instruction may take 5 cycles to fall through or 10 cycles to branch, while the ADDLW instruction can take 4 cycles for immediate data or 10 cycles for pointer data. Reference materials, including processor handbooks, are suggested for detailed clock cycle counts and operational guidelines.
mathrocks
Messages
105
Reaction score
0
I need some help with the PIC (PIC16F84) architecture. I am suppose to write timing diagram, including values of the PC (program counter), for the following instruction sequence when (a) the BTFSC (bit test register f, skip if set) instruction results in a skip and (b) when it does not.

Address Instruction
50 BTFSC
51 ADDLW
52 SUBLW


Does anyone know what this means? All I know is that I'm suppose to show when instructions are Fetched and Executed.
 
Computer science news on Phys.org
Cycle counting is important if you are doing real time programing.
You need to know it the task can complete in the time allotted for it.

I'm not familiar with the PIC specifically, but you need to look in the processor handbook. It should give the clock cycle counts for the instruction + address mode data fetch clocks + branch clocks.

For example the BTFSC might take 5 clocks to fall thru or 10 clocks to branch.
The ADDLW might take 4 clocks for immediate data or 10 for pointer data.

You seem to have the right idea.
 
These should help you,
ww1.microchip.com/downloads/en/DeviceDoc/35007b.pdf
web.mit.edu/rec/datasheets/PIC16F84.pdf

-- AI
 
In my discussions elsewhere, I've noticed a lot of disagreement regarding AI. A question that comes up is, "Is AI hype?" Unfortunately, when this question is asked, the one asking, as far as I can tell, may mean one of three things which can lead to lots of confusion. I'll list them out now for clarity. 1. Can AI do everything a human can do and how close are we to that? 2. Are corporations and governments using the promise of AI to gain more power for themselves? 3. Are AI and transhumans...
Sorry if 'Profile Badge' is not the correct term. I have an MS 365 subscription and I've noticed on my Word documents the small circle with my initials in it is sometimes different in colour document to document (it's the circle at the top right of the doc, that, when you hover over it it tells you you're signed in; if you click on it you get a bit more info). Last night I had four docs with a red circle, one with blue. When I closed the blue and opened it again it was red. Today I have 3...
Back
Top