how to change sampling frequency

キャンセル
次の結果を表示 
表示  限定  | 次の代わりに検索 
もしかして: 

how to change sampling frequency

752件の閲覧回数
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by SantiagoElias on Tue Nov 15 13:16:55 MST 2011
Hello.

I am new on LPC, and I'm trying to change the sampling frequency on a LPC1114.

I tried so far changing some variables, such as

  LPC_ADC->CR = ((SystemCoreClock/LPC_SYSCON->SYSAHBCLKDIV)/ADC_Clk-1)<<8;
or
  #define ADC_CLK2400000/* set to 2.4Mhz */

but it did not success.:mad:

How can I test it?
Thank you so much!

S.
0 件の賞賛
返信
1 返信

718件の閲覧回数
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by Ex-Zero on Tue Nov 15 14:06:06 MST 2011
That's your clock divider CLKDIV, see user manual:


Quote:

20.5.1 A/D Control Register (AD0CR - 0x4001 C000)

15:8 CLKDIV The APB clock (PCLK) is divided by CLKDIV +1 to produce the clock for the ADC, which
should be less than or equal to 4.5 MHz. Typically, software should program the smallest
value in this field that yields a clock of 4.5 MHz or slightly less, but in certain cases (such
as a high-impedance analog source) a slower clock may be desirable.

Your sampling frequency depends on something like ADCRead(i), where you can find the start of conversion :)

If you want to use a fixed frequency you can use 'Optional conversion on transition on input pin or Timer Match signal' :eek:

User manual:

Quote:

Table 268. A/D Control Register (AD0CR - address 0x4001 C000) bit description

26:24 START When the BURST bit is 0, these bits control whether and when an A/D conversion is
started:
0
0x0 No start (this value should be used when clearing PDN to 0).
0x1 Start conversion now.
[COLOR=Red]0x2 Start conversion when the edge selected by bit 27 occurs on
PIO0_2/SSEL/CT16B0_CAP0.
0x3 Start conversion when the edge selected by bit 27 occurs on
PIO1_5/DIR/CT32B0_CAP0.
0x4 Start conversion when the edge selected by bit 27 occurs on CT32B0_MAT0[1].
0x5 Start conversion when the edge selected by bit 27 occurs on CT32B0_MAT1[1].
0x6 Start conversion when the edge selected by bit 27 occurs on CT16B0_MAT0[1].
0x7 Start conversion when the edge selected by bit 27 occurs on CT16B0_MAT1[1].[/COLOR]

0 件の賞賛
返信