Help with PIC Architecture: Timing Diagram & PC Values

  • Thread starter Thread starter mathrocks
  • Start date Start date
  • Tags Tags
    Architecture
Click For 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
 
Thread 'ChatGPT Examples, Good and Bad'
I've been experimenting with ChatGPT. Some results are good, some very very bad. I think examples can help expose the properties of this AI. Maybe you can post some of your favorite examples and tell us what they reveal about the properties of this AI. (I had problems with copy/paste of text and formatting, so I'm posting my examples as screen shots. That is a promising start. :smile: But then I provided values V=1, R1=1, R2=2, R3=3 and asked for the value of I. At first, it said...

Similar threads

Replies
3
Views
3K
Replies
6
Views
4K
  • · Replies 10 ·
Replies
10
Views
3K
  • · Replies 3 ·
Replies
3
Views
2K
  • · Replies 4 ·
Replies
4
Views
4K
  • · Replies 4 ·
Replies
4
Views
3K
  • · Replies 12 ·
Replies
12
Views
7K
Replies
25
Views
9K
  • · Replies 5 ·
Replies
5
Views
3K