This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

FLASH and RAM difference for Example_2806xLaunchPad

Other Parts Discussed in Thread: CONTROLSUITE

Hi

I have modified as said in

e2e.ti.com/.../1448940

the    .ebss               : >> RAML2 | RAML3,      PAGE = 1

to make it run in Flash and every thing went fine, the Temperature display

7===========================7777777777777777II77777=========================7
7| Texas Instruments       |77777777777777777777777| Current Temperature:  |7
7| Incorporated            |77777777777777777777777| 45 Celcius = Ref + 2  |7
7===========================77777777777777777777777=========================7

(by the way, you have to add 

LOAD_SIZE(_RamfuncsLoadSize), 

if you use 

e:\ti\controlSUITE\device_support\f2806x\v150\F2806x_common\cmd\F28069M.cmd

instead of the modified

e:\ti\controlSUITE\device_support\f2806x\v150\F2806x_common\cmd\F28069.cmd    or v140 file)

then I wanted to run it in RAM (much faster for dev...) and I had to found a modified CMD file, here it is attached, also found in

e:\ti\controlSUITE\device_support\f2806x\v150\F2806x_common\cmd\f28069M_ram_lnk.cmd

it works, but the temperature output is different !

it always 300 or so more, instead of 1 or 2 °C which is more logical:

7===========================7777777777777777II77777=========================7
7| Texas Instruments       |77777777777777777777777| Current Temperature:  |7
7| Incorporated            |77777777777777777777777| 46 Celcius = Ref + 306 7
7===========================77777777777777777777777=========================7

is there a problem of DMA access for ADC ?

  • update:

    While in RAM config and run/debug

    If I pause the process and reload, it works fine

    if I put a breakpint just before

       referenceTemp = sampleTemperature();

    and reload then run, it works fine

    if I put a large delay before the first      referenceTemp = sampleTemperature();  or if I let it run without stop

    it will not work (it gives large ref false : referenceTemp int -260 0x00BE3D@Program.)

    puzzling...

  • Hi Lotfi,

    Does the temperature get sampled continuously in a loop?  If so, does the temperature eventually converge on a reasonable value, or does it always stay bad if you don't add a breakpoint?  The ADC needs about 1ms to power-up after it is enabled, I wonder if the function that does this in the InitAdc() function is not getting correctly linked.  The delay function is called DELAY_US().  You could try adding a delay loop before at the point where you are setting a breakpoint to see if this helps.

  • Dear Devin

    It is the (only) example given for the Launchpad XL 28069M 

       EALLOW;
       AdcRegs.ADCCTL2.bit.ADCNONOVERLAP = 1;	//Enable non-overlap mode
       AdcRegs.ADCCTL1.bit.TEMPCONV  = 1; 		//Connect channel A5 internally to the temperature sensor
       AdcRegs.ADCSOC0CTL.bit.CHSEL  = 5; 		//Set SOC0 channel select to ADCINA5
       AdcRegs.ADCSOC0CTL.bit.ACQPS  = 25; 		//Set SOC0 acquisition period to 26 ADCCLK
       AdcRegs.INTSEL1N2.bit.INT1SEL = 0; 		//Connect ADCINT1 to EOC0
       AdcRegs.INTSEL1N2.bit.INT1E  =  1; 		//Enable ADCINT1
    

    ...

    the sampling is in a loop

        //Main program loop - continually sample temperature
        for(;;) {
            
    
            //Convert the raw temperature sensor measurement into temperature
            currentTemp = sampleTemperature();
            
            updateTemperature();
            
            DELAY_US(1000000);
            
        }
    

    with :

    int16_t sampleTemperature(void)
    {
    	int16_t temp;
    
        //Force start of conversion on SOC0
        AdcRegs.ADCSOCFRC1.all = 0x01;
    
        //Wait for end of conversion.
        while(AdcRegs.ADCINTFLG.bit.ADCINT1 == 0){}  //Wait for ADCINT1
        AdcRegs.ADCINTFLGCLR.bit.ADCINT1 = 1;        //Clear ADCINT1
    
        //Get temp sensor sample result from SOC0
        temp = AdcResult.ADCRESULT0;
    
        //Convert the raw temperature sensor measurement into temperature
        return(GetTemperatureC(temp));
    
    }
    

    the temperature is ok, I am talking about the beginning of the programm, it samples a "reference temperature"

    I already put lot of delay but without success, the only way  (when starting in RAM) to obtain a good reference temp is to put a break point before the initial sampling

    this is curious

  • There are a couple ways we can go in the debug of this. One thing that would be interesting to see would be the raw ADC conversion result. Your temperature delta appears to be really high in a positive direction, so I think that means the first ADC reading is very low. Adding a breakpoint seems to indicate that there is some type of timing issue with reading the sample, but placing it before initial sampling is not where I would expect it to help.
    There are also quite a few other examples that will run on this launchpad HW. You can find them in ControlSUITE in ..\controlSUITE\device_support\f2806x\v150\F2806x_examples_ccsv5. One of these is actually a temperature sensor example, adc_temp_sensor_conv, which you could also try out.