/*
This program Writes the 10 data bytes into the Byte memory from
the array data_array & also reads the same data from the byte memory
and stores it in retrive_array of internal data memory.
Both writing in Byte memory & Reading from the byte memory can
be simulated in the VDSP.
But only Reading from byte memory can be checked using the
2189 EZ-KIT. Because writing in to Flash memory needs unlocking
& locking of the flash memory using some control words.
*/
#include"signal.h"
#include"sysreg.h"
#define BDMA_Word_Count *(int *) 0x3fe4
#define BDMA_Control *(int *) 0x3fe3
#define BDMA_External_Address *(int *) 0x3fe2
#define BDMA_Internal_Address *(int *) 0x3fe1
#define Prog_Flag_Comp_Sel_Ctrl *(int *) 0x3fe6
volatile int dm data_array[10]={1,2,3,4,5,6,7,8,10};
int dm Received_Data[10];
volatile int flag=0;
void BDMA_ISR();
void main()
{
interrupt(SIGBDMA,BDMA_ISR);
BDMA_Control= 0x00007; /* BMPAGE=00000000
BMOVLAY=0000
BCR=0 RUN DURING BDMA
BDIR=1 STORE TO BM
BYTPE= 11 INTERNAL M/M
8 BITS
LSB ALLIGNMENT
*/
BDMA_External_Address=0x00000;
BDMA_Internal_Address=&data_array;
Prog_Flag_Comp_Sel_Ctrl=0x2000; // 2 wait cycles
BDMA_Word_Count=10; // Transmit 10 words
while(flag==0)
{
}
BDMA_Control= 0x0003; /* BMPAGE=00000000
BMOVLAY=0000
BCR=0 RUN DURING BDMA
BDIR=0 LOAD FROM BM
BYTPE= 11 INTERNAL M/M
8 BITS
LSB ALLIGNMENT*/
BDMA_External_Address=0x00000;
BDMA_Internal_Address=&Received_Data;
Prog_Flag_Comp_Sel_Ctrl=0x2000; // 2 wait cycles
BDMA_Word_Count=10; // Transmit 10 words
enable_interrupts();
asm("idle;"); // wait for BDMA interrupt
}
void BDMA_ISR( )
{
flag=1;
}
BDMA.zip_BDMA_VDSP_dma_字节内存
版权申诉
107 浏览量
2022-09-21
21:15:52
上传
评论
收藏 4KB ZIP 举报
JaniceLu
- 粉丝: 78
- 资源: 1万+
最新资源
- 基于matlab实现用有限元法计算电磁场的Matlab工具 .rar
- 基于matlab实现有限元算法 计算电磁场问题 边界条件包括第一类边界和第二类边界.rar
- 基于matlab实现用于计算不同车重下的电动汽车动力性和经济性.rar
- 基于matlab实现遗传算法求解多车场车辆路径问题 有多组算例可以用.rar
- 浏览器.apk
- 基于matlab实现是一个matlab中的power system 中搭建的一个模型
- 基于JSP毕业设计-教学管理系统(源代码+论文).zip
- 基于JSP毕业设计-家政管理系统-毕业设计.zip
- 基于Python实现淘宝商品评论采集(含逆向)源代码
- 基于matlab实现多目标进化算法NSGAⅡ&Matlab讲解.rar
资源上传下载、课程学习等过程中有任何疑问或建议,欢迎提出宝贵意见哦~我们会及时处理!
点击此处反馈