2 Replies Latest reply on Feb 11, 2015 4:23 AM by jasonrc

    Using the thermistor and adc on the ACKme NUMBAT module

    rkelly_1917671

      I have the ACKme Seabass eval board with the NUMBAT module. I have compiled and tested

      most of the demos with the WICED SDK and NUMBAT board support package.

      I am happy with the uart, digital io, but require one or two analog inputs for my applications.

      Has anyone got the Temp control demo to read the thermistor on the Seabass board ?

       

      The temp_control demo works except for the thermistor readings. The adc result is always returning 0

      which led me to dig into the NUMBAT platform files and other WICED files.

       

      The thermistor on the Seabass board is connected to PIN 30 of the NUMBAT module.

      This is documented as WICED GPIO_20, Port B Pin 1 and ADC1_9 of the CPU internal to the NUMBAT.

       

      I made the following changes to platform.h and platform.c I have not been able to get a non-zero value

      from the ADC. I suspect there may be other missing bits, or defines that need to be corrected for the

      Seabass with NUMBAT module.

       

      Any suggestions ?

       

      Cheers,

      Roger K.

       

      =====platform.h=========================================

      /* Components connected to external I/Os */

      #define WICED_LED1 ( WICED_GPIO_16 )   //2015Jan28 RJK changed to reflect Seabass schematic

      #define WICED_LED2 ( WICED_GPIO_13 )  //2015Jan28 RJK changed to reflect Seabass schematic

      #define WICED_BUTTON1 ( WICED_GPIO_0 )  //2015Jan28 RJK changed to reflect Seabass schematic

      #define WICED_BUTTON2 ( WICED_GPIO_22 )  //2015Jan28 RJK changed to reflect Seabass schematic

       

       

      // 2015Jan28 RJK added for thermistor demo

      #define WICED_THERMISTOR ( WICED_GPIO_20 )     // added to reflect Seabass schematic

      /* I/O connection <-> Peripheral Connections */

      //#define WICED_LED1_JOINS_PWM ( WICED_PWM_2 )

      //#define WICED_LED2_JOINS_PWM ( WICED_PWM_1 )

      #define WICED_THERMISTOR_JOINS_ADC ( WICED_ADC_3 )

      ===========platform.c===================================

      [WICED_ADC_3] = {ADC1, ADC_Channel_9, RCC_APB2Periph_ADC1, 1, &platform_gpio_pins[WICED_GPIO_20]},

        • 1. Re: Using the thermistor and adc on the ACKme NUMBAT module
          rkelly_1917671

          Got a tip from ACKme. I think it is going to work now. Possible enum problem in platform.h

          • 2. Re: Using the thermistor and adc on the ACKme NUMBAT module
            jasonrc

            Before I provide the tip here, it is worth noting that if you had been using WiConnect, ADCs work out of the box.

             

            "But", I hear you say, "I need an additional processor since WiConnect provides a serial interface and I can't program on your modules".

             

            Not so fast! We are working on a technology that solves all your problems in one, so watch this space!

             

            Now, here's the tip for the benefit of all:

             

            This is a quick an dirty copy and paste but should point you in the right direction:

             

            In platform.c

             

            #define ADD_ADC_CHANNEL(adc_num, gpio_num) [WICED_ADC_ ## adc_num] = {ADC1, ADC_Channel_ ## adc_num, RCC_APB2Periph_ADC1, 1, (platform_gpio_t*)&platform_gpio_pins[WICED_GPIO_ ## gpio_num]}

            const platform_adc_t const platform_adc_peripherals[] =

            {

            ADD_ADC_CHANNEL(0, 22),

            ADD_ADC_CHANNEL(1, 23),

            ADD_ADC_CHANNEL(2, 19),

            ADD_ADC_CHANNEL(3, 17),

            //ADD_ADC_CHANNEL(4, 1), // not available as gpio (used as sflash CS)

            ADD_ADC_CHANNEL(5, 7),

            ADD_ADC_CHANNEL(6, 6),

            ADD_ADC_CHANNEL(7, 8),

            ADD_ADC_CHANNEL(8, 21),

            ADD_ADC_CHANNEL(9, 20),

            };

             

            The platform_adc.c driver is attached.

             

            To call something like:

             

            wiced_adc_init(adc, 16, gain);

            wiced_adc_take_sample_stream(adc, sample_buffer, ADC_SAMPLE_COUNT);


            Note that the Broadcomm BCM943362WCD4 eval board has a 43K sense resistor, the Seabass has a 10K.

             

            The thermistor is however the same on Seabass as the one in the Broadcomm thermistor.c file

            thermistor.c -->> Thermistor is Murata NCP18XH103J03RB (Digi-key 490-2436-1-ND )