找到一個dma的ads工程,將其dma功能整到了原來的ads工程TQ2440_Test裡面
用Linux公社(Linuxidc.com)提供的main.c替換原來TQ2440_Test的main.c
main.c下載地址:
下載在Linux公社的1號FTP服務器裡,下載地址:
FTP地址:ftp://www.linuxidc.com
用戶名:www.linuxidc.com
密碼:www.muu.cc
在 2011年LinuxIDC.com\10月\mini2440之ADS下DMA測試
下載方法見 http://www.linuxidc.net/thread-1187-1-1.html
之所以要介紹DMA,因為它對性能太重要了!只有活用了DMA,CPU的性能才能上去!S3c2410有四個DMA,每個DMA支持工作方式基本相同,但支持的source Dest可能略有不同,具體見Datasheet。
這裡具體DMA CONTROL寄存器(DCON)的配置說明,進而引出DMA的各種工作方式。
Atomic transfer:指的是DMA的單次原子操作,它可以是Unit模式(傳輸1個data size),也可以是burst模式(傳輸4個data size),具體對應DCON[28]。
Data Size:指的是單次原子操作的數據位寬,8、16、32,具體對應DCON[21:20]。
Request Source:DMA請求的來源有兩種,軟件&硬件模塊,由DCON[23]控制;當為前者時,由軟件對DMASKTRIG寄存器的位0置位觸發一次DMA 操作。當為後者時,具體來源由DCON[26:24]控制,不同硬件模塊的某時間觸發一次DMA操作,具體要見不同的硬件模塊。
DMA service mode:DMA的工作模式有兩種,單一服務模式&整體服務模式。前一模式下,一次DMA請求完成一項原子操作,並且transfer count的值減1。後一模式下,一次DMA請求完成一批原子操作,直到transfer count等於0表示完成一次整體服務。具體對應DCON[27]。
RELOAD:在reload模式下,當transfer count的值變為零時,將自動加src、dst、TC的值加載到CURR_DST、CURR_SRC、CURR_TC,並開始一次新的DMA傳輸。該模式一般和整體服務模式一起使用,也就是說當一次整體服務開始後,src、dst、TC的值都已經被加載,因此可以更改為下一次
服務的地址,2410說明文檔中建議加入以下語句來判斷當前的服務開始,src、dst、TC的值可以被更改了:while((rDSTATn & 0xfffff) == 0) ;
Req&Ack:DMA請求和應答的協議有兩種,Demard mode 和 Handshake mode。兩者對Request和Ack的時序定義有所不同:在Demard模式下,如果
DMA完成一次請求如果Request仍然有效,那麼DMA就認為這是下一次DMA請求;在Handshake模式下,DMA完成一次請求後等待Request信號無效,然後把ACK也置無效,再等待下一次Request。這個設計外部DMA請求時可能要用到。
傳輸總長度:DMA一次整體服務傳輸的總長度為:
Data Size × Atomic transfer size × TC(字節)。
- /****************************************************************
- NAME: u2440mon.c
- DESC: u2440mon entry point,menu,download
- ****************************************************************/
- #define GLOBAL_CLK 1
-
- #include <stdlib.h>
- #include <string.h>
- #include "def.h"
- #include "option.h"
- #include "2440addr.h"
- #include "2440lib.h"
- #include "2440slib.h"
- #include "mmu.h"
- #include "profile.h"
- #include "memtest.h"
-
- extern char Image$RO$Limit[];
- extern char Image$RO$Base[];
- extern char Image$RW$Limit[];
- extern char Image$RW$Base[];
- extern char Image$ZI$Limit[];
- extern char Image$ZI$Base[];
-
- void Isr_Init(void);
- void HaltUndef(void);
- void HaltSwi(void);
- void HaltPabort(void);
- void HaltDabort(void);
- void ClearMemory(void);
-
-
- void Clk0_Enable(int clock_sel);
- void Clk1_Enable(int clock_sel);
- void Clk0_Disable(void);
- void Clk1_Disable(void);
-
- extern void Lcd_TFT_Init(void);
- extern void Lcd_TFT_Test( void ) ;
- extern void Test_Touchpanel(void) ;
- extern void Test_Adc(void) ;
- extern void KeyScan_Test(void) ;
- extern void RTC_Display(void) ;
- extern void Test_IrDA_Tx(void) ;
- extern void PlayMusicTest(void) ;
- extern void RecordTest( void ) ;
- extern void Test_Iic(void) ;
- extern void Test_SDI(void) ;
- extern void Camera_Test( void ) ;
-
- volatile U32 downloadAddress;
-
- void (*restart)(void)=(void (*)(void))0x0;
-
- volatile unsigned char *downPt;
- volatile U32 downloadFileSize;
- volatile U16 checkSum;
- volatile unsigned int err=0;
- volatile U32 totalDmaCount;
-
- volatile int isUsbdSetConfiguration;
-
- int download_run=0;
- U32 tempDownloadAddress;
- int menuUsed=0;
-
- extern char Image$RW$Limit[];
- U32 *pMagicNum=(U32 *)Image$RW$Limit;
- int consoleNum;
-
- static U32 cpu_freq;
- static U32 UPLL;
- static void cal_cpu_bus_clk(void)
- {
- U32 val;
- U8 m, p, s;
-
- val = rMPLLCON;
- m = (val>>12)&0xff;
- p = (val>>4)&0x3f;
- s = val&3;
-
- //(m+8)*FIN*2 不要超出32位數!
- FCLK = ((m+8)*(FIN/100)*2)/((p+2)*(1<<s))*100;
-
- val = rCLKDIVN;
- m = (val>>1)&3;
- p = val&1;
- val = rCAMDIVN;
- s = val>>8;
-
- switch (m) {
- case 0:
- HCLK = FCLK;
- break;
- case 1:
- HCLK = FCLK>>1;
- break;
- case 2:
- if(s&2)
- HCLK = FCLK>>3;
- else
- HCLK = FCLK>>2;
- break;
- case 3:
- if(s&1)
- HCLK = FCLK/6;
- else
- HCLK = FCLK/3;
- break;
- }
-
- if(p)
- PCLK = HCLK>>1;
- else
- PCLK = HCLK;
-
- if(s&0x10)
- cpu_freq = HCLK;
- else
- cpu_freq = FCLK;
-
- val = rUPLLCON;
- m = (val>>12)&0xff;
- p = (val>>4)&0x3f;
- s = val&3;
- UPLL = ((m+8)*FIN)/((p+2)*(1<<s));
- UCLK = (rCLKDIVN&8)?(UPLL>>1):UPLL;
- }
- /****************************************************************************************************************/
- static volatile unsigned done;
- struct reg
- {
- volatile U32 DISRC;//初始原基地址寄存器
- volatile U32 DISRCC;//初始源控制寄存器
- volatile U32 DIDST;//初始目的基地址寄存器
- volatile U32 DIDSTC;//初始目的控制寄存器
- volatile U32 DCON;//dma控制寄存器
- volatile U32 DSTAT;//狀態/計數寄存器
- volatile U32 DCSRC;//當前源地址寄存器
- volatile U32 DCDST;//當前目的地址寄存器
- volatile U32 DMASKTRIG;//dma掩碼,觸發寄存器
- };//用於描述某個dma通道的9個寄存器
-
-
- /*
- 此timer用於計時,使用了看門狗定時器
- watchdog timer看門狗也是一個定時器,比普通定時器多了一個功能,就是在定時器定時結束時會觸發
- 一個特殊的事件:重啟cpu
- */
- void timer_start(int time)
- {
- rWTCON=((PCLK/1000000-1)<<8)|(time<<3);
- //rWTCON=((PCLK-1)<<8)|(time<<3);
- rWTCNT=0xffff;
- rWTDAT=0xffff;
- rWTCON=rWTCON &~(1<<5)&~(1<<2)|(1<<5);
- }
- /*
-
- rWTCON
- b8-b15,預分頻值
- b3-b4,
- 時鐘分頻選擇
- 00,16
- 01,32
- 10,64
- 11,128*
-
- b5=1,enable watch dog timer
- b2=0,disable watch dog timer interrupt
-
- 一般
- fclk=400MHZ
- hclk=100MHZ
- pclk=50MHZ
- 可用輸出看一下本板子的頻率
- Uart_Printf("FCLK=%d,HCLK=%d,PCLK=%d\n",FCLK,HCLK,PCLK );
- 為
- FCLK=400000000,HCLK=100000000,PCLK=50000000
- 相關寄存器的設置在其他地方
- cal_cpu_bus_clk來查詢相關寄存器以確定fclk,hclk,pclk
- rWTCON高8位設置為50x10^6/10^6-1=49,//用PCLK/1000000-1設置其高8位,即使PCLK變化,狗的時間計算方法也不必變
- 時鐘分頻選擇11為128
- 根據2440 spec 狗的周期為 t_watchdog = 1/[ PCLK / (Prescaler value + 1) / Division_factor ]=128*10^(-6) S=128/1000ms
- 所以有如下計算所用時間的公式
- src_to_dst=timer_stop()
- Uart_Printf("DMA transfer done time=%u MS\n",src_to_dst*128/1000);
-
- */
-
- int timer_stop(void)
- {
- rWTCON=((PCLK/1000000-1)<<8);
- return (0xffff-rWTCNT);
- }
-
- /*
- 本例使用dma傳輸數據的步驟
- 1.指定dma傳輸完成中斷處理函數,設置源目的寄存器,傳輸次數,傳輸模式等
- 2.向cpu發出dma傳輸請求信號,請求cpu將總線控制權交釋放,dma控制器控制數據在兩個內存區間經由總線傳輸,
- 可以是外部引腳請求dma傳輸,
- 也可以是設置寄存器DMASKTRIG b0來產生請求dma傳輸
- 到底是哪個,由寄存器DCON b23決定
- 3.比如dma0傳輸完成,則自動產生dma0中斷請求信號,要在中斷處理程序中手動清除中斷請求位
- */
- void __irq DMA0done(void)
- {
- done=1;
- ClearPending(BIT_DMA0);
- }
-
- void __irq DMA1done(void)
- {
- done=1;
- ClearPending(BIT_DMA1);
- }
-
- void __irq DMA2done(void)
- {
- done=1;
- ClearPending(BIT_DMA2);
- }
-
- void __irq DMA3done(void)
- {
- done=1;
- ClearPending(BIT_DMA3);
- }
-
- void DMA_move(int ch,int srcaddr,int dstaddr,int tc,int dsz,int tsz)
- {
- int i;
- struct reg *pDMA;
- int src_to_dst;
- int sum0=0,sum1=0;
- int length;
- length=tc*((tsz)?4:1)*((dsz==0)*1+(dsz==1)*2+(dsz==2)*4);
- /*tc傳輸次數
- tsz每次傳輸幾個數據類型,tsz=0為1個,tsz=1為4個
- dsz傳輸的數據類型,dsz=0為字節,dsz=1為半字,dsz=2為字,dsz=3未指定
- 所以有上面的length計算
- 見2440 spec
- */
- switch(ch)
- {
- case 0:
- pISR_DMA0=(unsigned)DMA0done;//指定dma0中斷處理程序為DMA0done
- EnableIrq(BIT_DMA0);//允許dma0通道產生數據傳輸完成中斷(設置中斷掩碼寄存器0x4a000008)
- pDMA=(void *)0x4b000000;//使pDMA指向通道0的9個寄存器
- break;
- case 1:
- pISR_DMA1=(unsigned)DMA1done;
- EnableIrq(BIT_DMA1);
- pDMA=(void *)0x4b000040;
- break;
- case 2:
- pISR_DMA2=(unsigned)DMA2done;
- EnableIrq(BIT_DMA2);
- pDMA=(void *)0x4b000080;
- break;
- case 3:
- pISR_DMA3=(unsigned)DMA3done;
- EnableIrq(BIT_DMA3);
- pDMA=(void *)0x4b0000c0;
- break;
- default:
- Uart_Printf("channel error\n");
- break;
- }
-
- for(i=srcaddr;i<(srcaddr+length);i+=4)//sum0和sum1用於校驗傳輸是夠正確
- {
- *((U32 *)i)=i^0x55aa5aa5;//按位異或
- sum0+=i^0x55aa5aa5;
- }
- Uart_Printf("DMA%d %8xh->%8xh,size=%xh(tc=%xh),dsz=%d,burst=%d\n",ch,
- srcaddr,dstaddr,length,tc,dsz,tsz);
- done=0;
- pDMA->DISRC=srcaddr;//源地址
- pDMA->DISRCC=(0<<1)|(0<<0);//源地址所在總線為ahb,源地址自動增加 0 或1 2 4(由dsz定)
- pDMA->DIDST=dstaddr;//目的地址
- pDMA->DIDSTC=(0<<1)|(0<<0);//目的地址所在總線為ahb,目的地址自動增加0 或1 2 4(由dsz定)
- pDMA->DCON=(1<<31)|(1<<30)|(1<<29)|(tsz<<28)|(1<<27)|(0<<23)|(1<<22)|(dsz<<20)|(tc);
- /*
- b31=1單服務握手
- b30=1與hclk同步,高速外設
- b29=1當所有的傳輸結束時,產生中斷請求
-
- b28=tsz ,每次所要傳輸的數據類型個數
- tsz=1,執行4數據長的突發傳輸 boost
- tsz=0.執行單數據傳輸
- note:dma執行期間,和cpu可以交替占有總線
-
-
- b27=1,全服務傳輸,不查詢dreq,但傳輸一次也要釋放總線
-
- b23=0,由軟件方式產生dma請求,需要用DMASKTRIG寄存器的SW_TRIG位置1觸發
-
- b21-b20=dsz,每次傳輸的數據類型設置
- dsz=00,字節
- dsz=01,半字
- dsz=10,字
- dsz=11,保留
-
- b19-b0=tc,傳輸次數,每次自動減1,直至減到0,便產生dma傳輸完成中斷**********************
- */
-
- pDMA->DMASKTRIG=(1<<1)|(1);
- /*
- b1=1,開放通道
- b0=1,此b0是dma軟件觸發位,實現軟件觸發dma請求
- */
-
-
- timer_start(3);//開始計時
- while(done==0);//在done=1之前cpu一直在此循環,實際中的dma傳輸計時不可能是這樣,dma傳輸期間,cpu可以可以去執行其他任務
- src_to_dst=timer_stop();//停止計時,返回本次dma傳輸所用時間
-
- Uart_Printf("DMA transfer done time=%u MS\n",src_to_dst*128/1000);
- DisableIrq(BIT_DMA0);
- DisableIrq(BIT_DMA1);
- DisableIrq(BIT_DMA2);
- DisableIrq(BIT_DMA3);
-
- for(i=dstaddr;i<(dstaddr+length);i+=4)
- sum1+=i^0x55aa5aa5;
-
- Uart_Printf("sum0=%2x,sum1=%2x\n",sum0,sum1);
- if(sum0==sum1)
- Uart_Printf("DMA test OK\n");
- else
- Uart_Printf("DMA test failured\n");
- }
-
- void DMA_test(void)
- {
- DMA_move(0,_NONCACHE_STARTADDRESS,_NONCACHE_STARTADDRESS+0x800000,0x80000,0,0); //byte,single
- DMA_move(0,_NONCACHE_STARTADDRESS,_NONCACHE_STARTADDRESS+0x800000,0x40000,1,0); //halfword,single
- DMA_move(0,_NONCACHE_STARTADDRESS,_NONCACHE_STARTADDRESS+0x800000,0x20000,2,0); //word,single
- DMA_move(0,_NONCACHE_STARTADDRESS,_NONCACHE_STARTADDRESS+0x800000,0x20000,0,1); //byte,burst
- DMA_move(0,_NONCACHE_STARTADDRESS,_NONCACHE_STARTADDRESS+0x800000,0x10000,1,1); //halfword,burst
- DMA_move(0,_NONCACHE_STARTADDRESS,_NONCACHE_STARTADDRESS+0x800000, 0x8000,2,1); //word,burst
-
- //DMA Ch 1
- DMA_move(1,_NONCACHE_STARTADDRESS,_NONCACHE_STARTADDRESS+0x800000,0x80000,0,0); //byte,single
- DMA_move(1,_NONCACHE_STARTADDRESS,_NONCACHE_STARTADDRESS+0x800000,0x40000,1,0); //halfword,single
- DMA_move(1,_NONCACHE_STARTADDRESS,_NONCACHE_STARTADDRESS+0x800000,0x20000,2,0); //word,single
- DMA_move(1,_NONCACHE_STARTADDRESS,_NONCACHE_STARTADDRESS+0x800000,0x20000,0,1); //byte,burst
- DMA_move(1,_NONCACHE_STARTADDRESS,_NONCACHE_STARTADDRESS+0x800000,0x10000,1,1); //halfword,burst
- DMA_move(1,_NONCACHE_STARTADDRESS,_NONCACHE_STARTADDRESS+0x800000, 0x8000,2,1); //word,burst
-
- //DMA Ch 2
- DMA_move(2,_NONCACHE_STARTADDRESS,_NONCACHE_STARTADDRESS+0x800000,0x80000,0,0); //byte,single
- DMA_move(2,_NONCACHE_STARTADDRESS,_NONCACHE_STARTADDRESS+0x800000,0x40000,1,0); //halfword,single
- DMA_move(2,_NONCACHE_STARTADDRESS,_NONCACHE_STARTADDRESS+0x800000,0x20000,2,0); //word,single
- DMA_move(2,_NONCACHE_STARTADDRESS,_NONCACHE_STARTADDRESS+0x800000,0x20000,0,1); //byte,burst
- DMA_move(2,_NONCACHE_STARTADDRESS,_NONCACHE_STARTADDRESS+0x800000,0x10000,1,1); //halfword,burst
- DMA_move(2,_NONCACHE_STARTADDRESS,_NONCACHE_STARTADDRESS+0x800000, 0x8000,2,1); //word,burst
-
- //DMA Ch 3
- DMA_move(3,_NONCACHE_STARTADDRESS,_NONCACHE_STARTADDRESS+0x800000,0x80000,0,0); //byte,single
- DMA_move(3,_NONCACHE_STARTADDRESS,_NONCACHE_STARTADDRESS+0x800000,0x40000,1,0); //halfword,single
- DMA_move(3,_NONCACHE_STARTADDRESS,_NONCACHE_STARTADDRESS+0x800000,0x20000,2,0); //word,single
- DMA_move(3,_NONCACHE_STARTADDRESS,_NONCACHE_STARTADDRESS+0x800000,0x20000,0,1); //byte,burst
- DMA_move(3,_NONCACHE_STARTADDRESS,_NONCACHE_STARTADDRESS+0x800000,0x10000,1,1); //halfword,burst
- DMA_move(3,_NONCACHE_STARTADDRESS,_NONCACHE_STARTADDRESS+0x800000, 0x8000,2,1);
- }
-
-
- /****************************************************************************************************************/
-
- void Temp_function()
- { Uart_Printf("\nPlease input 1-11 to select test!!!\n"); }
-
- struct {
- void (*fun)(void);
- char *tip;
- }CmdTip[] = {
- { Temp_function, "Please input 1-11 to select test,song" } ,
- { BUZZER_PWM_Test, "Test PWM" } ,
- { RTC_Display, "RTC time display" } ,
- { Test_Adc, "Test ADC" } ,
- { KeyScan_Test, "Test interrupt and key scan" } ,
- { Test_Touchpanel, "Test Touchpanel" } ,
- { Lcd_TFT_Test, "Test TFT LCD" } ,
- { Test_Iic, "Test IIC EEPROM" } ,
- { PlayMusicTest, "UDA1341 play music" } ,
- { RecordTest, "UDA1341 record voice" } ,
- { Test_SDI, "Test SD Card" } ,
- { Camera_Test, "Test CMOS Camera"},
- { DMA_test, "Test dma"};//add by song
- { 0, 0}
- };
-
-
- void Main(void)
- {
- char *mode;
- int i;
- U8 key;
- U32 mpll_val = 0 ;
- //U32 divn_upll = 0 ;
-
- #if ADS10
- // __rt_lib_init(); //for ADS 1.0
- #endif
-
- Port_Init();
-
- Isr_Init();
-
- i = 2 ; //don't use 100M!
- switch ( i ) {
- case 0: //200
- key = 12;
- mpll_val = (92<<12)|(4<<4)|(1);
- break;
- case 1: //300
- key = 13;
- mpll_val = (67<<12)|(1<<4)|(1);
- break;
- case 2: //400
- key = 14;
- mpll_val = (92<<12)|(1<<4)|(1);
- break;
- case 3: //440!!!
- key = 14;
- mpll_val = (102<<12)|(1<<4)|(1);
- break;
- default:
- key = 14;
- mpll_val = (92<<12)|(1<<4)|(1);
- break;
- }
-
- //init FCLK=400M, so change MPLL first
- ChangeMPllValue((mpll_val>>12)&0xff, (mpll_val>>4)&0x3f, mpll_val&3);
- ChangeClockDivider(key, 12);
- cal_cpu_bus_clk();
-
- consoleNum = 0; // Uart 1 select for debug.
- Uart_Init( 0,115200 );
- Uart_Select( consoleNum );
-
- Beep(2000, 1000);
-
- Uart_SendByte('\n');
- Uart_Printf("<***************************************>\n");
- Uart_Printf(" TQ2440 Test Program\n");
- Uart_Printf(" www.embedsky.net\n");
- Uart_Printf(" Build time is: %s %s\n", __DATE__ , __TIME__ );
- Uart_Printf("<***************************************>\n");
-
- rMISCCR=rMISCCR&~(1<<3); // USBD is selected instead of USBH1
- rMISCCR=rMISCCR&~(1<<13); // USB port 1 is enabled.
-
-
- rDSC0 = 0x2aa;
- rDSC1 = 0x2aaaaaaa;
- //Enable NAND, USBD, PWM TImer, UART0,1 and GPIO clock,
- //the others must be enabled in OS!!!
- rCLKCON = 0xfffff0;
-
- MMU_Init(); //
-
- pISR_SWI=(_ISR_STARTADDRESS+0xf0); //for pSOS
-
- Led_Display(0x66);
-
- mode="DMA";
-
- Clk0_Disable();
- Clk1_Disable();
-
- mpll_val = rMPLLCON;
-
- Lcd_TFT_Init() ; // LCD initial
-
- download_run=1; //The default menu is the Download & Run mode.
-
- while(1)
- {
- U8 idx;
-
- Uart_Printf("\nPlease select function : \n");
- for(i=0; CmdTip[i].fun!=0; i++)
- Uart_Printf("%d : %s\n", i, CmdTip[i].tip);
- idx = Uart_GetIntNum_GJ() ;
- if(idx<i)
- {
- (*CmdTip[idx].fun)();
- Delay(20);
- Uart_Init( 0,115200 );
- }
-
- }
-
- }
-
- void Isr_Init(void)
- {
- pISR_UNDEF=(unsigned)HaltUndef;
- pISR_SWI =(unsigned)HaltSwi;
- pISR_PABORT=(unsigned)HaltPabort;
- pISR_DABORT=(unsigned)HaltDabort;
- rINTMOD=0x0; // All=IRQ mode
- rINTMSK=BIT_ALLMSK; // All interrupt is masked.
- }
-
-
- void HaltUndef(void)
- {
- Uart_Printf("Undefined instruction exception!!!\n");
- while(1);
- }
-
- void HaltSwi(void)
- {
- Uart_Printf("SWI exception!!!\n");
- while(1);
- }
-
- void HaltPabort(void)
- {
- Uart_Printf("Pabort exception!!!\n");
- while(1);
- }
-
- void HaltDabort(void)
- {
- Uart_Printf("Dabort exception!!!\n");
- while(1);
- }
-
-
- void ClearMemory(void)
- {
- int memError=0;
- U32 *pt;
-
- Uart_Printf("Clear Memory (%xh-%xh):WR",_RAM_STARTADDRESS,HEAPEND);
-
- pt=(U32 *)_RAM_STARTADDRESS;
- while((U32)pt < HEAPEND)
- {
- *pt=(U32)0x0;
- pt++;
- }
-
- if(memError==0)Uart_Printf("\b\bO.K.\n");
- }
-
- void Clk0_Enable(int clock_sel)
- { // 0:MPLLin, 1:UPLL, 2:FCLK, 3:HCLK, 4:PCLK, 5:DCLK0
- rMISCCR = rMISCCR&~(7<<4) | (clock_sel<<4);
- rGPHCON = rGPHCON&~(3<<18) | (2<<18);
- }
- void Clk1_Enable(int clock_sel)
- { // 0:MPLLout, 1:UPLL, 2:RTC, 3:HCLK, 4:PCLK, 5:DCLK1
- rMISCCR = rMISCCR&~(7<<8) | (clock_sel<<8);
- rGPHCON = rGPHCON&~(3<<20) | (2<<20);
- }
- void Clk0_Disable(void)
- {
- rGPHCON = rGPHCON&~(3<<18); // GPH9 Input
- }
- void Clk1_Disable(void)
- {
- rGPHCON = rGPHCON&~(3<<20); // GPH10 Input
- }
- Please select function :
- 0 : Please input 1-11 to select test,song
- 1 : Test PWM
- 2 : RTC time display
- 3 : Test ADC
- 4 : Test interrupt and key scan
- 5 : Test Touchpanel
- 6 : Test TFT LCD
- 7 : Test IIC EEPROM
- 8 : UDA1341 play music
- 9 : UDA1341 record voice
- 10 : Test SD Card
- 11 : Test CMOS Camera
- 12 : Test dma
- 12DMA0 31000000h->31800000h,size=80000h(tc=80000h),dsz=0,burst=0
- DMA transfer done time=154 MS
- sum0=fffe0000,sum1=fffe0000
- DMA test OK
- DMA0 31000000h->31800000h,size=80000h(tc=40000h),dsz=1,burst=0
- DMA transfer done time=77 MS
- sum0=fffe0000,sum1=fffe0000
- DMA test OK
- DMA0 31000000h->31800000h,size=80000h(tc=20000h),dsz=2,burst=0
- DMA transfer done time=38 MS
- sum0=fffe0000,sum1=fffe0000
- DMA test OK
- DMA0 31000000h->31800000h,size=80000h(tc=20000h),dsz=0,burst=1
- DMA transfer done time=68 MS
- sum0=fffe0000,sum1=fffe0000
- DMA test OK
- DMA0 31000000h->31800000h,size=80000h(tc=10000h),dsz=1,burst=1
- DMA transfer done time=34 MS
- sum0=fffe0000,sum1=fffe0000
- DMA test OK
- DMA0 31000000h->31800000h,size=80000h(tc=8000h),dsz=2,burst=1
- DMA transfer done time=12 MS
- sum0=fffe0000,sum1=fffe0000
- DMA test OK
- DMA1 31000000h->31800000h,size=80000h(tc=80000h),dsz=0,burst=0
- DMA transfer done time=154 MS
- sum0=fffe0000,sum1=fffe0000
- DMA test OK
- DMA1 31000000h->31800000h,size=80000h(tc=40000h),dsz=1,burst=0
- DMA transfer done time=77 MS
- sum0=fffe0000,sum1=fffe0000
- DMA test OK
- DMA1 31000000h->31800000h,size=80000h(tc=20000h),dsz=2,burst=0
- DMA transfer done time=38 MS
- sum0=fffe0000,sum1=fffe0000
- DMA test OK
- DMA1 31000000h->31800000h,size=80000h(tc=20000h),dsz=0,burst=1
- DMA transfer done time=68 MS
- sum0=fffe0000,sum1=fffe0000
- DMA test OK
- DMA1 31000000h->31800000h,size=80000h(tc=10000h),dsz=1,burst=1
- DMA transfer done time=34 MS
- sum0=fffe0000,sum1=fffe0000
- DMA test OK
- DMA1 31000000h->31800000h,size=80000h(tc=8000h),dsz=2,burst=1
- DMA transfer done time=12 MS
- sum0=fffe0000,sum1=fffe0000
- DMA test OK
- DMA2 31000000h->31800000h,size=80000h(tc=80000h),dsz=0,burst=0
- DMA transfer done time=154 MS
- sum0=fffe0000,sum1=fffe0000
- DMA test OK
- DMA2 31000000h->31800000h,size=80000h(tc=40000h),dsz=1,burst=0
- DMA transfer done time=77 MS
- sum0=fffe0000,sum1=fffe0000
- DMA test OK
- DMA2 31000000h->31800000h,size=80000h(tc=20000h),dsz=2,burst=0
- DMA transfer done time=38 MS
- sum0=fffe0000,sum1=fffe0000
- DMA test OK
- DMA2 31000000h->31800000h,size=80000h(tc=20000h),dsz=0,burst=1
- DMA transfer done time=68 MS
- sum0=fffe0000,sum1=fffe0000
- DMA test OK
- DMA2 31000000h->31800000h,size=80000h(tc=10000h),dsz=1,burst=1
- DMA transfer done time=34 MS
- sum0=fffe0000,sum1=fffe0000
- DMA test OK
- DMA2 31000000h->31800000h,size=80000h(tc=8000h),dsz=2,burst=1
- DMA transfer done time=12 MS
- sum0=fffe0000,sum1=fffe0000
- DMA test OK
- DMA3 31000000h->31800000h,size=80000h(tc=80000h),dsz=0,burst=0
- DMA transfer done time=154 MS
- sum0=fffe0000,sum1=fffe0000
- DMA test OK
- DMA3 31000000h->31800000h,size=80000h(tc=40000h),dsz=1,burst=0
- DMA transfer done time=77 MS
- sum0=fffe0000,sum1=fffe0000
- DMA test OK
- DMA3 31000000h->31800000h,size=80000h(tc=20000h),dsz=2,burst=0
- DMA transfer done time=38 MS
- sum0=fffe0000,sum1=fffe0000
- DMA test OK
- DMA3 31000000h->31800000h,size=80000h(tc=20000h),dsz=0,burst=1
- DMA transfer done time=68 MS
- sum0=fffe0000,sum1=fffe0000
- DMA test OK
- DMA3 31000000h->31800000h,size=80000h(tc=10000h),dsz=1,burst=1
- DMA transfer done time=34 MS
- sum0=fffe0000,sum1=fffe0000
- DMA test OK
- DMA3 31000000h->31800000h,size=80000h(tc=8000h),dsz=2,burst=1
- DMA transfer done time=12 MS
- sum0=fffe0000,sum1=fffe0000
- DMA test OK