Experiment 9 Using Embedded Microcontroller Cores To Implement Complex Digital Systems
Experiment 9 Using Embedded Microcontroller Cores To Implement Complex Digital Systems
Using Embedded
Microcontroller Cores to
Implement Complex Digital
Systems
ECE 448 – FPGA and ASIC Design with VHDL George Mason University
PIC Microcontroller implemented inside of
an FPGA device
FPGA
CLK
PIC RESET
µController
STROBE = PORTC(0)
PORTC
PORTB PORTA
7-Seg Decoder
Display PORTA
PROGRAM
CONTROL
PICROM 8 P UNIT
256 x 12 Addr C Address Bus
Data
DATA
12 REGFILE
R8
Instruction Decoder Fsel
8 4 8 R31
CONSTANTS OPCODES FSR
Din Dout
Data Bus 8
W ALU
EXTENDED 4 8 8
COMPUTATIONS ALU PORTA PORTB PORTC
4 8 8
ECE 448 – FPGA and ASIC Design with VHDL 3
Flowchart of our PIC program
RESET
PC Program Counter
05 PORTA
06 PORTB Bidirectional
07 PORTC Input/Output Ports
08 R8
09 R9
0A R10
. Register File
. (General Purpose
Registers)
1E R30
1F R31
TRISA
Direction Registers
TRISB
for Ports A, B & C
TRISC
MOVF f, d
MOVF f, 1
f f <8,31>
MOVF f, 0
k <0,255>
W
MOVWF f MOVLW k
W k
MOVWF f MOVLW k
f W
f f <8,31>
0
CLRW CLRW
INCF f, d
+1
INCF f,1
INCF f,0
ADDWF f, d
W f
ADDWF f, 0 ADDWF f, 1
+
ANDWF f, d
W f
ANDWF f, 0 ANDWF f, 1
and
SWAPF f, d
SWAPF f, 1
fH fL
SWAPF f, 0
RETLW
CALL label
CALL label GOTO label
label
label label
RETLW
BTFSC f, b
f
7 b 0
f(b) = 0? BTFSC f, b
No
Next instruction
Yes
After-next Instruction
BTFSS f, b
f
7 b 0
f(b) = 1? BTFSS f, b
No
Next instruction
Yes
After-next Instruction
TRIS f W
4 8 8
MPASM
MPSIM
Configurable
Logic
Blocks
I/O
Block RAMs
Block RAMs
Blocks
Block
RAMs
8k x 2 4k x 4
4,095
16k x 1 8,191
8+1
0
2k x (8+1)
2047
16+2
0
1023
1024 x (16+2)
16,383
WEB
ENB
RAMB4_S4_S16
0 WEA
1 ENA
Clk_ROM 0 RSTA DOA[17:0] Data[17:0]
CLKA
ADDRA[9:0]
Addr[9:0] DIA[17:0]
WEB
All inputs ENB
12 bits read
Addresses are
shown in red and
data corresponding
to the same
memory location is
shown in black
INIT_0F 0000 0000 0000 0000 0000 0000 0000
ADDRESS FF FE F4 F3 F2 F1 F0