哪位高手使用过NE64的外扩功能,窄扩展功能或者宽扩展。 举个简单的例子,例如读写外部0X8000处的数据。 主要是相关寄存器的设置,还有读写程序! .prm中设置: PAGE_32 = READ_WRITE 0x328000 TO 0x32BFFF; DATA_PAGE INTO PAGE_32;
main中设置: #include <hidef.h> /* common defines and macros */ #include <MC9S12NE64.h> /* derivative information */ #pragma DATA_SEG __PPAGE_SEG DATA_PAGE unsigned char MR1@0X80010; #pragma DATA_SEG DEFAULT void main(void) { unsigned char *__far ptr;
CLKSEL=0; CLKSEL_PLLSEL = 0; /* Select clock source from XTAL */ PLLCTL_PLLON = 0; /* Disable the PLL */ SYNR = 11; /* Set the multiplier register 2 2 */ REFDV = 7; /* Set the divider register 7 8 */ PLLCTL = 192; PLLCTL_PLLON = 1; /* Enable the PLL */ while(!CRGFLG_LOCK); /* Wait */ CLKSEL_PLLSEL = 1; /* Select clock source from PLL */
///expended ram init/////////////////////////////////////// RDRIV=0x00; PEAR=0X0C; EBICTL=0X01;//0:free run MISC=0X01; MODE=0XAB;//normal expended wide
ptr=(unsigned char *__far)&MR1; *ptr=0x80; } 但是好像数据不是很对,问题在哪呢!!?? 哪位高手指点一下!!谢谢 |