cancel
Showing results for 
Search instead for 
Did you mean: 

PSoC 4 MCU

New Contributor II

I have a design that uses a thermistor with an ADC SAR and AmuxSeq UDB on a PSOC 4 BLE.

   

Trying to use the new EZ-BLE for a project. As the CYBLE-022001-00 does not have an AMUXSeq UDB, is there a sample design on how to implement a similar set of functionality? There are plenty of GPIOs, but need to use the SAR on multiple pins.

   

 

   

Any ideas would be appreciated.

0 Likes
Reply
1 Solution
Esteemed Contributor

Use the sequencing SAR ?

   

 

   

   

 

   

Regards, Dana.

View solution in original post

0 Likes
Reply
10 Replies
Esteemed Contributor

Use the sequencing SAR ?

   

 

   

   

 

   

Regards, Dana.

View solution in original post

0 Likes
Reply
Esteemed Contributor II

I would suggest you to open the example project for SAR ADC and then change the device to PRoC 022001 module which will compile without error. You do not need an AMUX, it is already integated into the sequencing SAR-ADC.

   

 

   

Bob

New Contributor II

 Thank you both for the quick response. That works. I appreciate the pointers.

   

The Thermistor calculator does not appear to work with that processor. I'll have to write some code, but at least I have the SAR working.

0 Likes
Reply
Esteemed Contributor

By using an AMUX you can add a buffer between it and SAR and get a

   

high Z in for all channels you need with just one OpAmp.

   

 

   

   

 

   

Regards, Dana

Honored Contributor II

 You can use fast thermistor calculator from here

   

https://secure.cypress.com/?app=forum&id=2492&rID=107492

0 Likes
Reply
New Contributor II

 Thanks odissey1 , but the fast thermistor component does not seem compatible with CYBLE-022001-00. When I try to Build, Creator3.1  gives red error that this component cannot be used with CYBLE-022001-00 otherwise known as EZ_BLE.

0 Likes
Reply
Honored Contributor II

 I can't test it, I am on travel. Fast Thermistor calculator is purely software based- try to copy source code directly into your code. 

   

 

   

Can you post error log?

   

odissey1

New Contributor II

 Thanks for the suggestion. I think I got it working as per your suggestion. By just having the code included, all I had to do was add a few Steinhart-Hart Equation variables that were giving error. They were #defined in the header file, so I just made them float32 vars. Easy enough to change as needed. 

   

 

   

float GetTempExact(float R_th)

   

 {

   

    float32 myThermistor_1_THA = 1.1259E-03;  // Steinhart-Hart Equation

   

    float32 myThermistor_1_THB = 2.346498E-4;  // Steinhart-Hart Equation

   

    float32 myThermistor_1_THC = 8.564001E-08;  // Steinhart-Hart Equation

   

    float32 myThermistor_1_K2C = 273.15f;

   

...

   

Many thanks!

0 Likes
Reply
Honored Contributor II

@apineda,

   

You are using Sheinhart-Hart coefficients for specific 10k thermistor TS-91. To obtain correct temperature readings you must calculate S-H coefficients using online calculator.

   

Other note: Fast Thermistor Calculator component does not use standard log() function, but fast approximation to it along with some other code optimization. As a result it calculates temperature ~15 times faster than the code you posted above.

   

odissey1

New Contributor II

Hi odissey1,

   

Thanks and yes I understand that the values are specific to a given thermister and have to be adjusted. I was just confirming that I can get the code to compile correctly with the CYBLE-022001-00 by creating the variables.

   

I have not gone through all the testing yet, but this gave me a great starting point.

   

Thanks again.

0 Likes
Reply