A/D sampling rate 8KHZ using LP

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

A/D sampling rate 8KHZ using LP

1,973 Views
dhineshe
Contributor II

currently i am doing voice recording project using LPC1768 with mic(ADC). i am going store the ADC sampling data 8KHz in flash memory (in datasheet shows the 200khz).  please anyone send ADC configuration of LPC1768 with 8KHz sampling rate and my CCLK is 100MHZ.

0 Kudos
11 Replies

1,541 Views
dhineshe
Contributor II

Thank you..............

0 Kudos

1,541 Views
dhineshe
Contributor II

Hi frnds,

i am trying to program led blinking in P0_30 using LPC1225/301 microcontroller. there is no error in this program. but led is not blinking. can anyone suggest me what is wrong in this program.

#include<lpc122x.h>
void delay(unsigned short int ms) ;
int main(void)
{

LPC_SYSCON->SYSAHBCLKCTRL |=(1UL<<31)|(1<<30)|(1<<29)|(1<<16);
LPC_IOCON->PIO0_30 &=~0xFF;
LPC_IOCON->PIO0_30 |= (1<<4)|(1<<7); 

LPC_GPIO0->DIR |= (1<<30);

LPC_GPIO0->CLR |= (1<<30);
while(1)
{


LPC_GPIO0->SET |= (1<<30);
delay(1000); 

LPC_GPIO0->CLR |= (1<<30); 
delay(1000); 

}

} 
void delay(unsigned short int ms) 
{
unsigned short int j;
unsigned long i;

for(j=0;j<ms;j++) 
for(i=0;i<1700;i++);
}

0 Kudos

1,541 Views
jeremyzhou
NXP Employee
NXP Employee

Hi Dhinesh E,

Thanks for your reply.

I'd highly recommend you to refer to BLINKY demo from the ARM Keil for details.

pastedImage_3.png

MCB1200 User's Guide: Example Programs
Have a great day,
TIC

-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------

0 Kudos

1,541 Views
jeremyzhou
NXP Employee
NXP Employee

Hi Dhinesh E,

Thank you for your interest in NXP Semiconductor products and 
for the opportunity to serve you.
It will needs 64 or 65 clocks to complete a ADC conversion, as a non-burst mode conversion requires
65 clocks and a burst mode conversion requires 64 clocks, regarding to your question, it requires 512~520 KHz ADC clock from the APB clock, which means the CLKDIV should be between 193~195.
Hope this is clear.

Have a great day,
TIC

 

-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------

0 Kudos

1,541 Views
TEMCEFF
Contributor IV

Hi, 

I got a small doubt. In LPC1768/69 ADC is SAR type. for 12 bit resolution it should take 12 cycles for compete conversion. But in user manual mentioned that,

A non-burst mode conversion requires
65 clocks and a burst mode conversion requires 64 clocks. 

Can you explain this?

Regards,

Muralidhar.

0 Kudos

1,541 Views
dhineshe
Contributor II

Hi jeremyzhou,

Good Morning!

Thank you so much for response my queries.

As i mentioned i need sample rate 8000Hz. Based on your calculation i divide CLKDIV 193 ~ 195 

i got frequency

7971 HZ for CLKDIV 193                                   how I calculated:  100MHz / 193 = 518134

7730 HZ for CLKDIV 194                                                                  then, 518134 / 65 = 7971 Hz

7889 HZ for CLKDIV 195

Based on my calculation i got those value in that 7971HZ is nearest of my sample rate 8000Hz .

IS IT OK FOR MY ADC requirement? or still i need to optimize the to get the 8000Hz

Thank you,

Dhinesh E

0 Kudos

1,542 Views
jeremyzhou
NXP Employee
NXP Employee

Hi Dhinesh E,

Thanks for your reply.

I think it is Okay.

Have a great day,
TIC

-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------

0 Kudos

1,542 Views
dhineshe
Contributor II

Hi jeremyzhou,

Good Morning............!

Thank you for your reply,

I am using the MIC as a input for ADC. As you suggested i configured the ADC sample rate 8000Hz.

Now i am going to store the voice signal for 5 sec in flash memory.(same like voice recoder IC).

After whenever i need i will playback again the 5 sec of stored voice through DAC(speaker).

can you tell me how to store the voice signal into the flash memory at least 5 sec?????

Important note:

Using LPC1768,

CCPU rate: 100MHz

ADC sample rate: 8000HZ

12 bit ADC

flash memory 512 K bytes 

Thank you 

Have a beautiful day.

0 Kudos

1,542 Views
dhineshe
Contributor II

Do you have any sample code please share me.............

0 Kudos

1,542 Views
jeremyzhou
NXP Employee
NXP Employee

Hi Dhinesh E,

Thanks for your reply.

I don't think the way of storing the ADC value in the flash is good choice, and I'd highly recommend that you can store the ADC values by using the DMA mechanism, otherwise the DMA mechanism is also suit for the transferring the ADC values to the DAC.

These application will give you some inspirations.

www.nxp.com/docs/en/application-note/AN10917.zip

www.nxp.com/docs/en/application-note/AN11178.zip

Have a great day,
TIC

-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------

0 Kudos

1,542 Views
dhineshe
Contributor II

Dear jeremyzhou,

Thanks you so much for your reply.

yes what you said correct, otherwise i will use external flash memory using SPI protocol. i will store the ADC value(using MIC) in external SPI flash memory.

Do you have any code or any study material for storing the ADC(using MIC) value in any External SPI flash memory. 

Have a beautiful day

Dhinesh E

Embedded Engineer - R&D

0 Kudos