interfacing high speed ADC using GPIO......

Hi guys, there is been a lot of discussion on this but still I have
found Fredericho and he has done it so I thought
if some break through is possible... So here are our older discussions
and I wait for a reply,

Regards

Mohit

Dear Fredericho,

10 Msps at 12 bit resolution is fine for me.... Please help me how did
you do it through GPIO and parallal interface... is it possible
because I saw that GPIO plainly works at around 1 - 2 MHz... How could
you generate such high speed using GPIO.... If you could help me...

Just one question: you said 40MSPS, 100ms and 4096?! To acquire 4096
samples in 100ms, you only need about 10KSPS. I am not sure if I got
right...

No, it is 40Msps for 100ms and then compute multiple 4096 point FFT
and then take average of it...

Please respond regards

Mohit

Hello Mohit,
I have done a test before to check the speed which I could acquire
data using the GPIOs. I am not sure now about the value but I think
that it was around 13MHz. Nowadays, if I am not wrong, I have been
working something around half of it.
Actually, the resolution of your ADC up to 18 bits does not make any
difference for the GPIOs. Because GPIO5 from BBs processor has 18 pins
direct connected to the expansion header (according to Table 20.
Expansion header signals of the BB System Reference Manual). The 18
bits can be read using using register 0x49056038 (GPIO_DATAIN).
So, what I do is to save register 0x49056038 using DMA. The data has
to be organized and then, analysed.
I have asked engineers from Texas Instruments about the speed of GPIO
on BB but they couldn't tell exactly how it works or I didn't
understand. I can not say for sure which clock controls that, I would
have to take a look again in the Datasheet. However, I have done an
experiment with a square wave and I was able to get the values I told
you above.
I hope that helps you a little bit.
Regards,
Frederico

Hi frederico,

Even i have done the experiment through square wave but i got 1 - 2 MHz… I can show
the code and I could not get the speed that you have achieved… I did not use DMA
of course

all others on BB confirmed that we cannot get higher speed… May be some trick is missed by me …
even pwm got me around 4 MHz square wave

Any further insight will be appreciated.

thanks & regards

Mohit

Hello Mohit,

Even i have done the experiment through square wave but i got 1 - 2 MHz...
I can show the code and I could not get the speed that you have achieved...
I did not use DMA of course

I am not an expert but I believe 1 to 2 MHz is not much.
I believe the problem might be the way you are trying to save your
data and that is mainly the reason that I have been using DMA to
acquire the data.
If you want I could take a look in your program but I can't promise
anything...

even pwm got me around 4 MHz square wave

I think what you are mentioning above is about the gptimers 9, 10 or
11. I have just measured my gptimer10 and the frequency was about
13MHz.
I have set the following for my gptimer registers:

gptimer[0x028/4] = 0xFFFFFFFE;
gptimer[0x02C/4] = 0xFFFFFFFE;
gptimer[0x024/4] = 0x000004C3;

Regards,
Frederico

Dear Frederico,

have u generated square wave using gp timer 10 and GPIO and getting 13 MHz…???

when i tried to read 8 bit data on GPIO from expansion connector… still i got a frequency of 4 MHz…

I think DMA is doing the trick

Hi Frederico,

could you tell me that your start of conversion pulse to ADC using beagle board, doesn’t it become jittery
as my pulse at 1 MHz or 2 MHz becomes very jitter prone due to OS.

My use of acquiring data is to do DSP work, and I am sure you might also be facing jitters … do you
find some way of managing it or such accuracy is not required at your end.

regards

mohit

guys , sorry for interruption…
How do you compile the code in that link, given by mohit… ?
i tried to compile using arm-linux-gnueabi-gcc present in my board’s /bin. But it could not identify the headers included in that code.
Where can i locate those headers?

Thank you

Hello Yaswanth,

How do you compile the code in that link, given by mohit.. ?
i tried to compile using arm-linux-gnueabi-gcc present in my board's /bin.
But it could not identify the headers included in that code.
Where can i locate those headers?

You should probably take a look at this website if you don't know GCC
which is a compiler:

It is easy to check if you have GCC. Just type "gcc -v" in the command
line and you will see the version which you have.

You probably already have it in your card and you don't know.
You can just copy the file and past it in a script using "vi" for
example. "vi" is an editor in Linux. You can see the commands in the
following website:

After saving the file in "vi", you only have to compile with GCC and
run. Very simple...

Regards,
Frederico

Hello Mohit,

have u generated square wave using gp timer 10 and GPIO and getting 13
MHz....???

If you check again at "Table 20. Expansion Header Connector Signals",
you will see that you either use a certain GPIO if MUX 4 is set or you
can use one of the Gptimers if the MUX is set to 2. So, I am actually
only using a Gptimer, not a GPIO. But you mentioned above something
about PWM and I sort of understood you wanted to saying about
GPT10_PWMRVT (or 9 or 11) which are available on the Expansion Header.

when i tried to read 8 bit data on GPIO from expansion connector... still i
got a frequency of 4 MHz....

As I mentioned before, from 8 bits to 18 bits, that will not make any
difference on the speed.

I think DMA is doing the trick

I believe that you should give it try...

Regards,
Frederico

Hi,

follow this path if you have angstrom set up :

/usr/local/angstrom/arm/arm-angstrom-linux-gnueabi/bin/cc

regards

mohit

Hi,
Those memory location addresses, must be same for all the boards using omap3530 irrespective of the Board type right?

see i have installed angstrom and then C6run and this is my path… see if you can find it there…

sorry…
, i was not asking about the compiler…
i was asking about the code…

pinconf[0x2158/4] = 0x011C011C;

these commands use a memory location for each pin on the expansion board… i was taking about those memory locations… not about angstrom location.

absolutely correct, they will remain the same…

Those memory location addresses, must be same for all the boards using
omap3530 irrespective of the Board type right?

That is right!
The registers are in the processor and you can find the addresses on
the "Table 7.4 - Core Control Module Pad Configuration Register
Fields" in Chapter 7 of the "OMAP25x Applications Processor, Technical
Reference Manual".

Hi fredricho,

I am confused about the entire thing slightly. Are you using GPIO for interfacing with ADC? and are you using gptimer for generating square wave for some other purpose?? Right… I am slightly mixed up in the responses

I will try DMA with GPIO to speed up ADC read.

regards.

Hello Mohit,

Are you using GPIO for interfacing with ADC?

Yes, I have a 12 bits ADC connected to my BB's expansion header. They
all use GPIO5 from the processor.

and are you using gptimer for generating square wave
for some other purpose??

I am not currently using the square wave as an output of the expansion
header now but that is one possibility.
Regards,
Frederico

where is the table located exaclty.?
in the omap35x technical reference manual??

Hey,

the best way to locate them is to go in the technical reference manual and search say for e.g. 4800 0130 say i.e. registers you are concerned with, and you will find the table in the TRF.

no worries…

regards

mohit

Hi Frederico,

I have read omap document (SDMA Request Mapping table, page 978), but
as i see, there are only DMA lines for MCBSP, SPI, UART, or DMA. I
don't see any DMA support for gpio. Can you tell me, which DMA line
did you use to transfer the data with GPIO port ?

thank in advance

Regards,
NgocSon