LPC4370 ACDHS speed and DMA
LPC4370 ACDHS speed
AHB clock BASE_M4_CLK CLK_M4_ADCHS up to 204 MHz. For register interface.
ADCHS clock BASE_ADCHS_CLK CLK_ADCHS up to 80MHz For conversion rate.
How do I set up the BASE_M4_CLK or the AHB clocks for high speed ADC?
How do I verify the BASE_ADCHS_CLK is running (204Mhz ) fast enough for 80Msample?
But in reality, the HSADC clock structure is very simple and can be setup by directly setting the HSADC base clock with this one function:
Chip_Clock_SetBaseClock(CLK_BASE_ADCHS, BaseClock_XXXX, true, false);
You can attach the HSADC base clock to any of the following clock inputs:
/**
* @brief CGU clock input list
* These are possible input clocks for the CGU and can come
* from both external (crystal) and internal (PLL) sources. These
* clock inputs can be routed to the base clocks (@ref CHIP_CGU_BASE_CLK_T).
*/
typedef enum CHIP_CGU_CLKIN {
CLKIN_32K, /*!< External 32KHz input */
CLKIN_IRC, /*!< Internal IRC (12MHz) input */
CLKIN_ENET_RX, /*!< External ENET_RX pin input */
CLKIN_ENET_TX, /*!< External ENET_TX pin input */
CLKIN_CLKIN, /*!< External GPCLKIN pin input */
CLKIN_RESERVED1,
CLKIN_CRYSTAL, /*!< External (main) crystal pin input */
CLKIN_USBPLL, /*!< Internal USB PLL input */
CLKIN_AUDIOPLL, /*!< Internal Audio PLL input */
CLKIN_MAINPLL, /*!< Internal Main PLL input */
CLKIN_RESERVED2,
CLKIN_RESERVED3,
CLKIN_IDIVA, /*!< Internal divider A input */
CLKIN_IDIVB, /*!< Internal divider B input */
CLKIN_IDIVC, /*!< Internal divider C input */
CLKIN_IDIVD, /*!< Internal divider D input */
CLKIN_IDIVE, /*!< Internal divider E input */
CLKINPUT_PD /*!< External 32KHz input */
} CHIP_CGU_CLKIN_T;
Connect the 204MHz main PLL to a divider input, set the divider to 3, and use the divider for the HSADC base clock.
Gives 204 / 3 = 68Mhz. Just make sure you aren't using those dividers for anything else!
Chip_Clock_SetDivider(CLK_IDIV_A, CLKIN_MAINPLL, ); /* Setup divider A for main PLL rate divided by 3 */
Chip_Clock_SetBaseClock(CLK_BASE_ADCHS, CLKIN_IDIVA, true, false); /* HSADC base clock = divider A input */
Use the USB PLL rate (typically 480MHz) with a divide by 6 to get 80MHz. (Note different dividers have different maximum divider values)
Chip_USB0_Init(); /* Sets USB PLL to 480Mhz */
Chip_Clock_SetDivider(CLK_IDIV_D, CLKIN_USBPLL, ); /* Setup divider D for USB PLL rate divided by 6 */
Chip_Clock_SetBaseClock(CLK_BASE_ADCHS, CLKIN_IDIVD, true, false); /* HSADC base clock = divider D input */
I think you might not be getting 20 MHz you will be getting 2MHz, as the only divider that can be sourced from USB0PLL is Divider A
(Max divider value supported by DIV_A is 4), if you attempt to source others [DIV_B to DIV_D] from USB0PLL it will default to IRC (12MHz).
Hence you will get "IRC CLK"/6 as the output. To get 80 MHz you can try the following
Chip_USB0_Init(); /* Initialize the USB0 PLL to 480 MHz */
Chip_Clock_SetDivider(CLK_IDIV_A, CLKIN_USBPLL, ); /* Source DIV_A from USB0PLL, and set divider to 2 (Max div value supported is 4) [IN 480 MHz; OUT 240 MHz */
Chip_Clock_SetDivider(CLK_IDIV_B, CLKIN_IDIVA, ); /* Source DIV_B from DIV_A, [IN 240 MHz; OUT 80 MHz */
Chip_Clock_SetBaseClock(CLK_BASE_ADCHS, CLKIN_IDIVB, true, false); /* Source ADHCS base clock from DIV_B */
Chip_Clock_EnableOpts(CLK_ADCHS, true, true, ); /* Enable the clock */ 480MHZ / 2 / 3 = 80 MHZ
Chip_Clock_GetRate(CLK_ADCHS);
Finally I've got some adequate results. ADCHS clock is 80MHz, but sample rate is only 40Msps, not 80Msps as I expected.
Chip_Clock_EnableOpts(CLK_ADCHS, true, true, ); /* Enable the clock */
Every time I've tried to set SAMPLERATE to values more than 4000000 - UART stopped working.
Is it real to get 80Msps?
The original hsadc.c file used TIMER1 to trigger a software event to trigger to start the ADC.
In my modification I tried to us the TIMMER1 to stop the ADC sampling but it did not work.
I found that there were too many IRQ events (with higher priority than the UART) causing the UART not to get service
and also the descriptor would not update.
I left the code in and set the SAMPLERATE to 100 which cause TIMER1 to file every 10ms.
I used this to toggle GPIO port 3 bit 7 for testing.
1111111111111
LPC4370 ACDHS speed and DMA的更多相关文章
- LabTool : LPC LINK2, LPC4370 cheap scope: 80Ms/s 12 bit
80MHz 12 bit ADC processor LPC4370.LPCxpresso do a LPC LINK2 and LABTOOLS open source oscilloscope d ...
- linux新内核中关闭硬盘的DMA
vortex86 SIS550 Minit-5250E瘦客户机,使用CF卡启动,显示不支持DMA. 搜索得新内核已基本不再使用ide=nodma参数了,查到这篇文章:“Debian下关闭CF卡的DMA ...
- STM32f103------ADC(DMA)
STM32F10x ADC 技术指标: 分辨率: 12位分辨率 LSB=Vref+ / 2^(12) 转换时间: 采样一次至少14个ADC时钟周期 ,而ADC最高时钟周期为14MHz 选用采样 ...
- STM32CubeMX HAL库串口+DMA数据发送不定长度数据接收
参考资料:1.ST HAL库官网资料 2.https://blog.csdn.net/u014470361/article/details/79206352#comments 一.STM32CubeM ...
- PatentTips - DMA address translation between peer-to-peer IO devices
BACKGROUND As processing resources have increased, demands to run multiple software programs and ope ...
- HAL UART DMA 数据收发
UART使用DMA进行数据收发,实现功能,串口2发送指令到上位机,上位机返回数据给串口2,串口2收到数据后由串口1进行转发,该功能为实验功能 1.UART与DMA通道进行绑定 void HAL_UAR ...
- STM32基于HAL库通过DMA读写SDIO
通过STM32CUBEMX生成DMA读写sdio的工程,再读写过程中总会卡死在DMA中断等待读写完成的while中,最终发现while等待的标志在SDIO的中断里置位的,而SDIO中断优先级如果小于或 ...
- z-stack协议uart分析(DMA)
1.从ZMain里面的main函数开始分析 2.进入int main( void ); HalDriverInit(); //硬件相关初始化,有DMA初始化和UART初始化 3.进入HalDriv ...
- STM32之DMA+ADC
借用小甲鱼的经典:各位互联网的广大网友们.大家早上中午晚上好..(打下小广告,因为小甲鱼的视频真的很不错).每次看小甲鱼的视频自学都是比较轻松愉快的..我在想,如果小甲鱼出STM32的视频,我会一集不 ...
随机推荐
- DateTools时间插件
import java.text.DateFormat;import java.text.ParsePosition;import java.text.SimpleDateFormat;import ...
- 杀死你网站SEO的5个技术
胡亮亮先生(网迈SEO总监)在其微信公众帐号里发布了文章<杀死你网站SEO的5个技术>,发出来给大家分享一下: 应百度站长平台邀请,抽空把这篇文章做一些细节上的补充 ,欢迎大家关注并讨论. ...
- GATK使用说明-GRCh38(Genome Reference Consortium)(二)
Reference Genome Components 1. GRCh38 is special because it has alternate contigs that represent pop ...
- 2016/10/28 很久没更了 leetcode解题 3sum
15. 3Sum Given an array S of n integers, are there elements a, b, c in S such that a + b + c = 0? Fi ...
- UICollectionCell可移动的逻辑
- AngularJs的$http使用随笔
AngularJs的$http服务是Angularjs自带的核心服务之一,用来与HTTP远程服务器交互. 关于$http使用,我体会的一下几点注意: 1.在使用是报“Uncaught Referenc ...
- 【收藏】android WebView总结
来自:http://blog.csdn.net/chenshijun0101/article/details/7045394 浏览器控件是每个开发环境都具备的,这为马甲神功提供了用武之地,window ...
- PHPCMS联动菜单的调用函数get_linkage方法详解
v9联动菜单调用方法[注意此为内容页调用方法 {get_linkage($areaid,1,' >> ',1)} 显示效果: 湖北省 >> 武汉市 >> 汉阳区 [ ...
- C语言中scanf()的用法!
好文章转自:http://blog.tianya.cn/blogger/post_show.asp?BlogID=287129&PostID=3668453 scanf详解 scanf 原型: ...
- 《Linux内核设计与实现》读书笔记(二十)- 补丁, 开发和社区
linux最吸引我的地方之一就是它拥有一个高手云集的社区, 还有就是如果能=为linux内核中贡献代码, 一定是一件令人自豪的事情. 下面主要总结一些和贡献代码相关的主要内容. 加入社区 编码风格 提 ...