Discussion in "ARM Development" started by    pravin_35    Jan 13, 2014.
Tue Jan 21 2014, 11:56 pm
#11


Now things are more clear..
1. How you are supplying clock, processor or external?
2. What is clock frequency?
3. ADC tested?

If you have tested your ADC then it will be much easier to do this.

PS: using it for finger print scanning?

Ajay Bhargav



Thanks ajay!!!

Adc is working fine i have tested with all modes... in example code...
Adc clock is 6mhz..internal cpu clock divided by PLL.
Initially i tried with External edge triggered (1MHz same ccd clock) . i feel complicated to print because adc trig controlled by continuous clock..
Now i configured by Software Trigger... which i can control Adc.. but still i dine get Proper ouput..
Today i have modified the code for Software trigger.. but i need to implement microsecond delay.(1us is conversion rate) i am working on it...
code:
here is the code...
while (1)
	{
	//mdelay(1);
	//SI Interrupt enable //
	pio_enable_interrupt(PIN_PUSHBUTTON_2_PIO, PIN_PUSHBUTTON_2_MASK);
    while(g_b_led0_active == false);// wait fot Start pulse //
    pio_disable_interrupt(PIN_PUSHBUTTON_2_PIO, PIN_PUSHBUTTON_2_MASK);
	while(iteration <=127){
	//Start Adc //
	adc_start(ADC);
	mdelay(1); // working for microsecond delay here//
	
           /* Check if ADC sample is done. */
			while (g_adc_sample_data.us_done != ADC_DONE_MASK) ;
			buffer[Data] = g_adc_sample_data.us_value[i] ;
			g_adc_sample_data.us_done = 0;
		    printf("%d ",buffer[Data]);
		iteration = iteration++;
		Data = iteration;	
		}
	
	
	//adc_stop(ADC);
	g_b_led0_active = false;
	
	
	// clear buffer //
	 memset(buffer, 0, sizeof(buffer[127]));
	 iteration =0;
	 puts(" Sample completed ");
	}
  


[ Edited Wed Jan 22 2014, 12:24 am ]
Mon Jan 27 2014, 11:35 am
#12
I would prefer if you can use software to provide clock (manual bitbang for clock). so that you know when to read and when to give next clock. so you never miss any sample. All you have to make sure is minimum clock requirements are met. I guess this can be possible. How much your is your CPU?
 pravin_35 like this.
Mon Jan 27 2014, 12:02 pm
#13
Hi ajay ,

My Cpu is 84 mhz.... (actually Crystal is 12mhz internal PLL gives 84 mhz Cpu clock).

need all samples means... 0 to 127 buffer to 5 scans that is @2d array of 127x5 ... will process this data and i will delete... and start next sample...

Regards
Pravin
Mon Jan 27 2014, 12:25 pm
#14
So Its better you bit bang your clock and at every rising edge give some delay and then read your ADC after falling edge. all you have to do is maintain your clock < 8Mhz. That you can do by checking clock on Scope or controlling your delay loop.
 pravin_35 like this.
Mon Jan 27 2014, 01:59 pm
#15


So Its better you bit bang your clock and at every rising edge give some delay and then read your ADC after falling edge. all you have to do is maintain your clock < 8Mhz. That you can do by checking clock on Scope or controlling your delay loop.

Ajay Bhargav




ok thanks i got it but implementation point i am stuck
sorry ajay i don know bit banding... what it does??
will walkthrough the definiton...
Tue Jan 28 2014, 05:51 pm
#16
Bit Bang means, use GPIO to generate clock..

// loop it for 128 x 5 pix
clk = 0;
delay(2);
clk = 1;
adc = read_adc();
delay(1);
Wed Jan 29 2014, 10:50 am
#17


Bit Bang means, use GPIO to generate clock..

// loop it for 128 x 5 pix
clk = 0;
delay(2);
clk = 1;
adc = read_adc();
delay(1);

Ajay Bhargav



The Delay you have mentioned is Ms or Us .. Do i need to Use Timer For it?? because i need 1 us delay...


[ Edited Wed Jan 29 2014, 10:51 am ]
Mon Feb 03 2014, 11:44 am
#18
Pravin, I just game some random delay. You need to check and make sure you get clock < 8Mhz. so.. accordingly give the delay.
Mon Feb 03 2014, 05:32 pm
#19


Pravin, I just game some random delay. You need to check and make sure you get clock < 8Mhz. so.. accordingly give the delay.

Ajay Bhargav


Thanks ajay..

my thinking is that ADC should keep on loading the Data to Dma.. and in main code without disturbing adc conversion i need to process all the Samples.. and do post processing ... main while loop should not effect with ADC interrupt is it Possible??...

Can i make timer trigger Mode for 1us.. will it be Possible i think you got the point..
Wed Feb 05 2014, 12:43 pm
#20
Your pixel data depends on your clock. So if you're driving the clock you can tell ADC when to read and when not to. Trigger is in your hand. I dont know If I am able to make you understand what I am trying to say

Get Social

Information

Powered by e107 Forum System

Downloads

Comments

ErnestoExpop
Tue Apr 16 2024, 02:57 am
Jamesclepe
Mon Apr 15 2024, 11:10 am
Aliciaelora
Mon Apr 15 2024, 07:59 am
btaletvpcu
Mon Apr 15 2024, 04:36 am
UbvpwcTib
Mon Apr 15 2024, 03:13 am
AmyJow
Sun Apr 14 2024, 11:54 pm
Jamesraw
Sat Apr 13 2024, 08:18 pm
bkCar
Sat Apr 13 2024, 07:13 pm