阅读:1523回复:0
救命呀!pc104总线上挂接双口ram(8kx8)
最近做一个项目,需要用双口ram和pc104(华北工控的pcmb-6680)通信 ,本来想用READ_PORT_UCHAR WRITE_PORT_UCHAR 搞定结果发现cpu(amd geode lx700)只提供了6个io端口而且每个端口最大解码空间为128字节 六个通道都用上也不过700多个字节其中还不包阔已经被占用的地址
电路都已经做好了郁闷 , 希望牛人们给点建议,网上好象有人用dma 解决这个问提,我试过但好象只能访问到内存,下面是程序 void CWhatDlg::OnButton5() { ULONG HWAddress=0x800c8; ULONG Size=0xfff; ULONG inIoSpace = 0; PHYSICAL_ADDRESS PhysicalAddress = {HWAddress, 0 }; PVOID pVirtual = NULL; unsigned char *pData; UCHAR buf; //unsigned short f; if(TransBusAddrToVirtual(Internal,0,PhysicalAddress,0xfff,&inIoSpace,&pVirtual ))//&MemType, { //MmUnmapIoSpace( rawbuf, 0x01 ); if(pVirtual == NULL)return; pData=(unsigned char *)pVirtual; //调试的时侯这里是0x6000c8 buf = *pData; buf = *(pData+1); buf = *(pData+2); MmUnmapIoSpace( pVirtual, 0x01 ); } |
|