马上注册,结交更多好友,享用更多功能,让你轻松玩转社区。
您需要 登录 才可以下载或查看,没有账号?注册
x
本帖最后由 oldbeginner 于 2014-1-8 14:07 编辑
就在无法深入OC8051代码时,发现了自带的DOC文件"oc8051_design",文件是在..\doc\src目录下,不注意会容易忽略。
浏览了一下文件,感觉这个文件会是理解OC8051的关键突破口。文件只有rev 0.2版的34页,主要内容分3个部分:
1、第一部分,介绍了8051的背景知识,比如输入输出接口;
2、第二部分,就是OC8051的模块设计,每一个模块的功能和相应接口的说明;
3、第三部分,简单介绍了验证文件testbench。
**********************************************************************************
第一部分,
接口输入输出名称:
name direction size description
rst input 1 reset
clk input 1 clock
interrupt interface
int0 input 1 external interrupt 0
int1 input 1 external interrupt 1
timer/counter inputs
t0 input 1 timer 0 input
t1 input 1 timer 0 input
serial interface
rxd input 1 receive
txd output 1 transmit
nterface to external program rom
ea input 1 external access
rom_addr output 16 rom address
op1 input 8 operation 1 input
op2 input 8 operation 2 input
op3 input 8 operation 3 input
nterface to external data ram
adr_o output 16 address
stb_o output 1 strobe
cyc_o output 1 cyrcle
ack_I input 1 acknowlege
dat_I input 8 data input
dat_o output 8 data output
port interface
p0_in input 8 port 0 input
p1_in input 8 port 1 input
p2_in input 8 port 2 input
p3_in input 8 port 3 input
p0_out output 8 port 0 output
p1_out output 8 port 1 output
p2_out output 8 port 2 output
p3_out output 8 port 3 output
********************************************
感觉图有些简陋。自己再找些。
*********************************************
除了接口,另外一个重点就是寻址方式:
-direct addressing (Data Memory and SFRs) In direct addressing the operand isspecified by an 8-bit address field in the instruction. This address mode ispossible only for addressing internal Data RAM and SFRs.
- indirect addressing In indirect addressing the instructionspecifies a register which contains the address of the operand. The addressregister for 8-bit addresses can be R0 or R1 of the selected register bank, orthe Stack Pointer. The address register for 16-bit addresses can only be the 16-bit “data pointer” register, DPTR. Both internal and external RAM can beindirectly addressed.
- register instructionsSpecial instructions are used foraccessing four register banks (containing registers R0 to R7). Thisinstructions have a 3-bit register specification within the opcode of the instruction.
Register bank is selected by two bank selectbits in PSW.
- register- specific instructions/b] Theseare instructions which are specific to a certain register and they don't needan address byte (they always operate with the same register). The most commonare those that use ACC register.
- immediate constants In this address mode the value of a constant follows the opcode.
- indexed addressingIn this mode only Program Memory can be accessed. The address wanted issum of 16 bit base register (DPTR or PC) and accumulator (ACC).
|