Help with PIC Architecture: Timing Diagram & PC Values

  • Thread starter Thread starter mathrocks
  • Start date Start date
  • Tags Tags
    Architecture
Click For Summary
SUMMARY

The discussion focuses on the timing diagram and program counter (PC) values for the PIC16F84 architecture, specifically analyzing the BTFSC (Bit Test File Skip if Clear) instruction and its impact on subsequent instructions. It is established that the BTFSC instruction can take either 5 or 10 clock cycles depending on whether it results in a skip. The ADDLW (Add Literal to WREG) instruction may require 4 or 10 clock cycles based on the addressing mode. Accurate cycle counting is crucial for real-time programming, and users are directed to the PIC16F84 processor handbook for detailed clock cycle counts.

PREREQUISITES
  • Understanding of PIC16F84 architecture
  • Familiarity with instruction cycle timing
  • Knowledge of assembly language programming for microcontrollers
  • Ability to interpret technical documentation, specifically processor handbooks
NEXT STEPS
  • Study the PIC16F84 processor handbook for detailed instruction cycle timings
  • Learn how to create timing diagrams for microcontroller instructions
  • Explore the implications of instruction cycle counts on real-time programming
  • Investigate the differences in addressing modes for the ADDLW instruction
USEFUL FOR

Embedded systems engineers, microcontroller programmers, and anyone involved in real-time application development using the PIC16F84 architecture will benefit from this discussion.

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
 

Similar threads

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