different mode of input channels of ADC

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.
urchc_1533771
Level 5
Level 5
5 likes given First like received First like given

ADC have possibility to select different mode of input channels but when I select it I receive error ( see pic).

   

Something wrong with configuration or it`s not possible to mix ?

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

You cannot use two muxes one after the other.  Best solution for you will be to increase the number of channels for the ADC and remove the hardware mux.

   

 

   

Bob

0 Likes
lock attach
Attachments are accessible only for community members.
urchc_1533771
Level 5
Level 5
5 likes given First like received First like given

I made it but it`s not work 😞

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

My crystal ball is out of order ;-), so can you tell me what does not work?

   

As a general tip: The sequencing ADC will scan all its enabled sources (one after the other) with a single call. So there is no need to manually select one input after the other.

   

 

   

Bob

0 Likes
urchc_1533771
Level 5
Level 5
5 likes given First like received First like given

I tried without it but same result. Value is 0

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

Designing binary: Runs or doesn't run   😉

   

What values have

   

    static int32 temperature  
    int32 thermistorResistance
    int16 referenceVoltage
    int16 thermistorVoltage
    int16 offsetVoltage

   

at end of  ProcessTemperature()

   

and which kit are you using? CY8CKIT-0???

   

 

   

Bob

0 Likes
urchc_1533771
Level 5
Level 5
5 likes given First like received First like given

1.

   

   

2.

   

 

   

 

   

   

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

CY8CKIT ?

0 Likes
rola_264706
Level 8
Level 8
50 likes received 25 likes received 10 likes received

Channel 2 of the ADC  is connected to Ground so it will always read 0.

0 Likes
lock attach
Attachments are accessible only for community members.
urchc_1533771
Level 5
Level 5
5 likes given First like received First like given

Same KIT , same project

0 Likes
urchc_1533771
Level 5
Level 5
5 likes given First like received First like given

bobgoar you right it`s always 0 but work

   

0 Likes
rola_264706
Level 8
Level 8
50 likes received 25 likes received 10 likes received

The program you sent only prints out one reading Temperature=25 on my system.  The window you sent in the last post is printing out 4 additional readings. The code for this is not in the program you sent.  Have you modified the program? Please send the latest revision that you have.

0 Likes
lock attach
Attachments are accessible only for community members.
urchc_1533771
Level 5
Level 5
5 likes given First like received First like given

Attached first version with Mux ( I just added printf for all variables). After I used ADC channels instead of Mux it`s not worked.

   

Code is in prev message.

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

I needed the kit's number because some of the GPIOs are connected to caps for special use. Wanted to make sure you didn't use one of them.

   

Your referenceVoltage being zero is a bug. Check that with a voltmeter. Probably a bad/broken connection.

   

@Bob(goar) That shorted connection to GND is OK. The ADC value from this channel is used to cancel any offsets. Quite useful when converting to 16 bits and more, but the effect at 12 bit resolution might be rather small (Zero).

   

 

   

Bob

0 Likes
urchc_1533771
Level 5
Level 5
5 likes given First like received First like given

I use Pioner Kit as in PDF :CY8CKIT-042-BLE Bluetooth® Low Energy (BLE) Pioneer Kit

   

I run this 2 projects on same kit and same hardware and same PC. Example with Mux is worked, changed to use ADC is not.

   

I think that man did this example used some trick because not was reason to add Mux.

0 Likes
urchc_1533771
Level 5
Level 5
5 likes given First like received First like given

Hi Gurus !

   

Anybody knows what a problem ?

0 Likes
EmHo_296241
Level 5
Level 5
10 solutions authored 50 replies posted 25 replies posted

Hi,

You are missing one important point. The temperature.c file is used for the calculation in the project with mux. In which the mux channel is varied for each calculation. If you are trying to remove the mux component, you have to write similar code for ADC. Replacing the hardware will not do the job.

Holmes

0 Likes

Do you saw my code ? Seems to me not.

   

Because you`l see this strings :

   

   //AMuxSeq_Next();
   ADC_SetChanMask(channel ); 

   

as you can see Mux used for switch channels and I used for this ADC swap possibility.

   

If you think it`s not right please change it and I`l happy to check it.

0 Likes
lock attach
Attachments are accessible only for community members.
EmHo_296241
Level 5
Level 5
10 solutions authored 50 replies posted 25 replies posted

Hi,

I think the issue is with giving the inputs directly to ADC and their drive mode. The pins cannot be software driven and AMUXA/AMUXB connected at the same time as per HSIOM register values. With the setup you have done it may not be possible.

I assume that your requirement was to measure one external voltage along with the temperature from the code you have given. I added one more channel to the external mux and have implemented that. This should solve your problem.
Note: Measure channel input 2nd terminal is connected to ground pin p3[2] currently. You may change it according to your need.
 

0 Likes
urchc_1533771
Level 5
Level 5
5 likes given First like received First like given

Thanks ! I`l check it.

0 Likes
urchc_1533771
Level 5
Level 5
5 likes given First like received First like given

Thanks Holmes ! It`s work as need . 

0 Likes