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的更多相关文章

  1. 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 ...

  2. linux新内核中关闭硬盘的DMA

    vortex86 SIS550 Minit-5250E瘦客户机,使用CF卡启动,显示不支持DMA. 搜索得新内核已基本不再使用ide=nodma参数了,查到这篇文章:“Debian下关闭CF卡的DMA ...

  3. STM32f103------ADC(DMA)

    STM32F10x  ADC 技术指标: 分辨率: 12位分辨率  LSB=Vref+  / 2^(12) 转换时间: 采样一次至少14个ADC时钟周期 ,而ADC最高时钟周期为14MHz  选用采样 ...

  4. STM32CubeMX HAL库串口+DMA数据发送不定长度数据接收

    参考资料:1.ST HAL库官网资料 2.https://blog.csdn.net/u014470361/article/details/79206352#comments 一.STM32CubeM ...

  5. PatentTips - DMA address translation between peer-to-peer IO devices

    BACKGROUND As processing resources have increased, demands to run multiple software programs and ope ...

  6. HAL UART DMA 数据收发

    UART使用DMA进行数据收发,实现功能,串口2发送指令到上位机,上位机返回数据给串口2,串口2收到数据后由串口1进行转发,该功能为实验功能 1.UART与DMA通道进行绑定 void HAL_UAR ...

  7. STM32基于HAL库通过DMA读写SDIO

    通过STM32CUBEMX生成DMA读写sdio的工程,再读写过程中总会卡死在DMA中断等待读写完成的while中,最终发现while等待的标志在SDIO的中断里置位的,而SDIO中断优先级如果小于或 ...

  8. z-stack协议uart分析(DMA)

    1.从ZMain里面的main函数开始分析 2.进入int main( void ); HalDriverInit();   //硬件相关初始化,有DMA初始化和UART初始化 3.进入HalDriv ...

  9. STM32之DMA+ADC

    借用小甲鱼的经典:各位互联网的广大网友们.大家早上中午晚上好..(打下小广告,因为小甲鱼的视频真的很不错).每次看小甲鱼的视频自学都是比较轻松愉快的..我在想,如果小甲鱼出STM32的视频,我会一集不 ...

随机推荐

  1. jquery实现标签上移、下移、置顶

    eg:如在后台的标签列表中,实现上移.下移.置顶功能 思路: 1.先用到的克隆方法.clone(true): 即把当前要移动的项先保存好,备于后用. 2.找到当前标签所对应的相关元素及其相关方法: 如 ...

  2. Int16, Int32, Int64 范围

    Int16, 等于short, 占2个字节. -32768 32767 Int32, 等于int, 占4个字节. -2147483648 2147483647 Int64, 等于long, 占8个字节 ...

  3. 对比DOM和jQuery完善度

    <input type="text" id="username" value="请输入你的用户名"> <script> ...

  4. Spring的定时任务配置2(转)

    spring的定时任务配置分为三个步骤: 1.定义任务 2.任务执行策略配置 3.启动任务 1.定义任务 <!--要定时执行的方法--> <bean id="testTas ...

  5. Titanium系列--Titanium的简介、Titanium Studio安装和配置(一)

    1. 是什么?--是一个可以通过javascript,html,css等web技术开发移动App的的开发框架,媲美原生App体验和性能,目前支持IOS和Android平台. 2. 为什么能做这个? - ...

  6. C++中复制构造函数

    复制构造函数 复制构造函数用于: 根据另一个同类型的对象显示或隐式初始化一个对象 复制一个对象,将它作为实参传给一个函数 从函数返回时复制一个对象 初始化顺序容器中的元素 根据元素初始化式列表初始化数 ...

  7. yum自动脚本

    echo -e "\033[34mstop server:\033[0m" service iptables stop service NetworkManager stop ch ...

  8. 开源免费ERP/CRM/SCM:iDempiere 2.0 安装配置

    首先简单介绍一下iDempiere:iDempiere是一款Java平台的基于Compiere/ADempiere的​开源企业级开源ERP/CRM/SCM系统​, 由于是在ADempiere基础上用O ...

  9. 【WinHec启示录】透过Windows 10技术布局,谈微软王者归来

    每个时代都有王者,王者的成功,往往是因为恰逢其时地发布了一个成功的产品(具有里程碑意义,划时代的产品).Windows 95的成功标示着微软是PC时代的王者:WinXP的成功标示着微软是互联网时代的王 ...

  10. ASP.NET 5中的静态文件处理

    ASP.NET 5 与之前的 ASP.NET 相比,有着翻天覆地的变化.了解与熟悉它需要一个过程,而我选择的了解方式是一步一步从无而有手写一个简单的 ASP.NET 5 程序,然后根据遇到的问题进行学 ...