|
我在看陈猛写的sjf4510源程序时,有些问题不明白,请斑竹和高手指点:
(1)pin4510.h中
#define S4510_MAX_CELL_INDEX 233 //the number of internal pads
//DATA BUS
#define DATA0_31_CON (127) //1-input, 0-output
#define DATA0_IN (126)
#define DATA0_OUT (125)
#define DATA1_IN (124)
#define DATA1_OUT (123)
#define DATA2_IN (122)
#define DATA2_OUT (121)
#define DATA3_IN (120)
#define DATA3_OUT (119)
#define DATA4_IN (11
#define DATA4_OUT (117)
#define DATA5_IN (116)
#define DATA5_OUT (115)
#define DATA6_IN (114)
#define DATA6_OUT (113)
#define DATA7_IN (112)
#define DATA7_OUT (111)
#define DATA8_IN (110)
#define DATA8_OUT (109)
#define DATA9_IN (10
#define DATA9_OUT (107)
#define DATA10_IN (106)
#define DATA10_OUT (105)
#define DATA11_IN (104)
#define DATA11_OUT (103)
#define DATA12_IN (102)
#define DATA12_OUT (101)
#define DATA13_IN (100)
#define DATA13_OUT (99)
#define DATA14_IN (9
#define DATA14_OUT (97)
#define DATA15_IN (96)
#define DATA15_OUT (95)
#define DATA16_IN (94)
#define DATA16_OUT (93)
#define DATA17_IN (92)
#define DATA17_OUT (91)
#define DATA18_IN (90)
#define DATA18_OUT (89)
#define DATA19_IN (8
#define DATA19_OUT (87)
#define DATA20_IN (86)
#define DATA20_OUT (85)
#define DATA21_IN (84)
#define DATA21_OUT (83)
#define DATA22_IN (82)
#define DATA22_OUT (81)
#define DATA23_IN (80)
#define DATA23_OUT (79)
#define DATA24_IN (7
#define DATA24_OUT (77)
#define DATA25_IN (76)
#define DATA25_OUT (75)
#define DATA26_IN (74)
#define DATA26_OUT (73)
#define DATA27_IN (72)
#define DATA27_OUT (71)
#define DATA28_IN (70)
#define DATA28_OUT (69)
#define DATA29_IN (6
#define DATA29_OUT (67)
#define DATA30_IN (66)
#define DATA30_OUT (65)
#define DATA31_IN (64)
#define DATA31_OUT (63)
//ADDR BUS & CONTROL LINE
#define ADDR_CS_RW_CON (184) //sbz for output
#define ADDR0 (149)
#define ADDR1 (14
#define ADDR2 (147)
#define ADDR3 (146)
#define ADDR4 (145)
#define ADDR5 (144)
#define ADDR6 (143)
#define ADDR7 (142)
#define ADDR8 (141)
#define ADDR9 (140)
#define ADDR10 (139)
#define ADDR11 (13
#define ADDR12 (137)
#define ADDR13 (136)
#define ADDR14 (135)
#define ADDR15 (134)
#define ADDR16 (133)
#define ADDR17 (132)
#define ADDR18 (131)
#define ADDR19 (130)
#define ADDR20 (129)
#define ADDR21 (12
//CONTROL LINE
#define nOE (17
#define nECS0 (183)
#define nECS1 (182)
#define nECS2 (181)
#define nECS3 (180)
#define nRCS0 (175)
#define nRCS1 (169)
#define nRCS2 (168)
#define nRCS3 (167)
#define nRCS4 (166)
#define nRCS5 (165)
#define nRAS0 (164)
#define nRAS1 (163)
#define nRAS2 (162)
#define nRAS3 (161)
#define nCAS0 (160)
#define nCAS1 (159)
#define nCAS2 (158)
#define nCAS3 (157)
#define nDWE (156)
#define nWBE0 (155)
#define nWBE1 (154)
#define nWBE2 (153)
#define nWBE3 (152)
#define PP7_CON (39)
#define PP7_IN (41)
#define PP7_OUT (40)
#define PP6_CON (42)
#define PP6_IN (44)
#define PP6_OUT (43)
#define PP5_CON (45)
#define PP5_IN (47)
#define PP5_OUT (46)
#define PP4_CON (48)
#define PP4_IN (50)
#define PP4_OUT (49)
#define PP3_CON (51)
#define PP3_IN (53)
#define PP3_OUT (52)
#define PP2_CON (54)
#define PP2_IN (56)
#define PP2_OUT (55)
#define PP1_CON (57)
#define PP1_IN (59)
#define PP1_OUT (58)
#define PP0_CON (60)
#define PP0_IN (62)
#define PP0_OUT (61)
这些定义是怎么来的??
(2)39vf160.c中
void NOR_WrHW(U32 addr,U16 data)
{
S4510_SetPin(DATA0_31_CON ,LOW);
S4510_SetAddr(addr);
S4510_Assert_nGCS(addr);
S4510_SetDataHW(data);
JTAG_ShiftDRStateNoTdo(outCellValue); //tCOS
S4510_SetPin(nWBE0,LOW);
JTAG_ShiftDRStateNoTdo(outCellValue);
S4510_SetPin(nWBE0,HIGH);
JTAG_ShiftDRStateNoTdo(outCellValue); //tCOH
S4510_SetPin(DATA0_31_CON ,HIGH); //nBE is deasserted here.
S4510_Deassert_nGCS(addr);
JTAG_ShiftDRStateNoTdo(outCellValue);
}
short NOR_RdHW(U32 addr)
{
S4510_SetPin(DATA0_31_CON ,HIGH);
S4510_SetAddr(addr);
S4510_Assert_nGCS(addr);
S4510_SetPin(nOE,LOW);
JTAG_ShiftDRStateNoTdo(outCellValue);
S4510_SetPin(nOE,HIGH);
S4510_Deassert_nGCS(addr);
JTAG_ShiftDRState(outCellValue,inCellValue);
return S4510_GetDataHW();
}
我不明白如何通过jtag把指令发送到lumit4510中执行??
(3)在看lumit4510v1.4电路图中,其中画的关于Nor Flash和我拿到的开发板的实物不一样,而我的开发板实物和DIY手册是一样的,请斑竹能否解释一下?
谢谢!!
注:附件是源程序!! |
本帖子中包含更多资源
您需要 登录 才可以下载或查看,没有账号?注册
×
|