ADC Values in Hardware

Tip / Sign in to post questions, reply, level up, and achieve exciting badges. Know more

cross mob
lock attach
Attachments are accessible only for community members.
Anonymous
Not applicable

Hello,

   

 

   

I'm not too familier with PSOC terminology yet, so I hope you can understand me:

   

I'm using a PSOC 5 LP prototyping kit - the stick kind.

   

How can I get the ADC values out of the ADC so I can use them in hardware?

   

I think it might be better to draw a picture:

   

http://imgur.com/J16l3hk 

   

To be clear: I've gone through the ADC to UART example. From my understanding of how PSOC works, this is not what I want.  From my understanding, the  main loop runs at about 1 KhZ, and I want to be able to access the full 1 MhZ ADC sampling rate.  From my understanding, if I want the full 1 MhZ, then I need to create everything in the top design file, not programatically.

   

Am I under the correct understanding that whenever I enter something into Main(), it gets executed on the microcontroller portion of the chip?

   

Best Wishes,

   

-TJP

0 Likes
1 Solution
HeLi_263931
Level 8
Level 8
100 solutions authored 50 solutions authored 25 solutions authored

What do you actually want to do? Typically when using the full 1Msps of the SAR ADC, you transfer the values with DMA into memory. From the you can use your code to evaluate them. Alternatively you can use the DMA to transfer the values to other parts of the hardware (e.g. the DAC, or a UDB register).

   

Yes, anything in main() is software and executed in the MCU part. But you can still control the hardware in the chip from there...

View solution in original post

0 Likes
13 Replies
HeLi_263931
Level 8
Level 8
100 solutions authored 50 solutions authored 25 solutions authored

What do you actually want to do? Typically when using the full 1Msps of the SAR ADC, you transfer the values with DMA into memory. From the you can use your code to evaluate them. Alternatively you can use the DMA to transfer the values to other parts of the hardware (e.g. the DAC, or a UDB register).

   

Yes, anything in main() is software and executed in the MCU part. But you can still control the hardware in the chip from there...

0 Likes
Anonymous
Not applicable

I have a pulse from a radiation detector being processed by my PSOC.  I want to determine the slope of the trailing edge of the and the height of the peak, and increment one of two different kinds of counters depending on those values.  I haven't characterized the pulses yet, but I think it's reasonable to suggest that the features are on a micro-second time scale.

0 Likes

Peak detection can be done analog if you want to. You can do it digital in an UDB, using the DataPath. Slope detection is more tricky I guess. But if you only need to compare with a threshold it might be simple: store the previous value, retrieve the new value, calculate the difference and then compare with a threshold.

   

I guess you should look at the UDB / DataPath application notes and videos.

0 Likes
Bob_Marlowe
Level 10
Level 10
First like given 50 questions asked 10 questions asked

You may read an 8-bit ADC value and send it to an 8 bit port together with a control signal indicating to the "Other Stuff" that data is ready. All this can be done using DMA, so only few/none CPU action is needed.

   

 

   

Bob

0 Likes
lock attach
Attachments are accessible only for community members.
odissey1
Level 9
Level 9
First comment on KBA 1000 replies posted 750 replies posted

it is a third request this week for a Geiger counter..., this world goes "nukelar"!

   

On the other note, wouldn't it be easy to measure amplitude and slope separately by making a derivative of the pulse by simple RC circuit and then using peak detector (picture attached)? Basically, this is what people did back in pre-digital age.

   

 

   

For peak detection look into Cypress Application Note AN60321:

   

http://www.cypress.com/documentation/application-notes/an60321-peak-detection-psoc-3-and-psoc-5lp?so...

   

All you need then is to digitize peak amplitude it with ADC (slowly).

odissey1
Level 9
Level 9
First comment on KBA 1000 replies posted 750 replies posted

Answering your original question, the SarADC on PSoC5 does not have digital output bus (unfortunately). Though I suspect that SarADC component can be custom modified to have output bus (with some verilog tinkering).

0 Likes
lock attach
Attachments are accessible only for community members.
odissey1
Level 9
Level 9
First comment on KBA 1000 replies posted 750 replies posted

Good news! ADC_SAR does, actually, has 12-bit output bus, which can be pulled out from schematics with little effort (see picture attached). Does it makes it easy now?

   

   

Anonymous
Not applicable

SarADC Block.PNG

I do not have such SAR ADC Block as shown in previous post. There is no data out available. PSoC 4.2

0 Likes

In which version of PSoC Creator can we get such a component ? It is not available in any versions from 3.3 to 4.2.

0 Likes

The ADC_SAR custom component with digital output bus (ADC_SAR_ex) was developed for PSoC5LP only. See example here:

Re: Can be expanded control register component to 16bit or 32bit? (That meaning is not to use two co...

PSoC4.has very limited UDB resources, so making such component for it is not justified.

/odissey1

0 Likes
doc62
Level 1
Level 1
10 sign-ins 5 replies posted 5 sign-ins

Hello, I would like to use ADC_SAR_ex on PSOC5LP but I can't find it anywere. The link in the previous post is not available. Can you help me, please?

Corrado Caruso

0 Likes
odissey1
Level 9
Level 9
First comment on KBA 1000 replies posted 750 replies posted

doc62,

You can find recent example using ADC_SAR_ex here

ADC-SAR-Filter-VDAC-streaming-demo-using-DMA 

SAR-Filter-VDAC_signed_FIFO_02a_A.png

/odissey1

0 Likes
doc62
Level 1
Level 1
10 sign-ins 5 replies posted 5 sign-ins

Thank you very much!

doc62

0 Likes