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.

Pulse oxymetre with kentec l35 as a display/menu?

Other Parts Discussed in Thread: TM4C123GE6PM

here is a break up of my programm :

-i set up the screen and the widgets/ button i wanted to use... they work very well by them selfs, i had put the WidgetMessageQueueProcess in an infinite loop.
-i then aded and adc (on one of the pins not used by the kentec l35) set up with a timmer (frequency of 20Hz.... )


-> the problem is when i add the adc to the main code the buttons stop working!!, but the adc works (i checked that the value was changing frequently).

I think the problem is that the adc is interupting the WidgetMessageQueueProcess soo the button press are not processed... 

dose anyone know how to solve this problem.. i tried making a frequent interrupt (10000000hz) to call WidgetMessageQueueProcess ...(that worked but then the adc stoped working -.-)

  • Hi Nathan,

         Welcome to E2E. Provide more relevant details to your post. See, my signature sticky "Information to provide when asking for help". Also, see other sticky in this forum for other guidelines.

    nathan Yapi said:
    -> the problem is when i add the adc to the main code the buttons stop working!!, but the adc works (i checked that the value was changing frequently).

       Post your code here for review.

    - kel

  • i tried making a frequent interrupt (10000000hz) to call WidgetMessageQueueProcess ...(that worked but then the adc stoped working -.-)

    An interrupt each 100 ns, are you serious ?

  • Which pins are you using.  Which for ADC which for Display etc.  Be careful a few of the pins on the Launchpad are zero ohm connected to other pins.  This was for compatibility with 430 launchpads but may cause more problems then it solved.

  • INTEGRIS Dexter said:
    may cause more problems then (than) it solved.

    May cause (Ha!) - surely has and continues to wreak havoc!

    Rather clearly - those "compatibility" 0-ohmers should have been supplied in a bag - to be installed by that (clear minority) user group seeking such compatibility.  (and most likely to have the awareness of that unique signal routing capability...)

  • hi f.m
    as i said i tried as in a took it off the secound i saw it didn t work .... 
    i like the way u helped me -.-

  • hi INTEGRIS Dexter

    here my entire code :

    this is my main file (sets up the menu mostly) :

    /////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////

    //*****************************************************************************
    //
    // Oxymetre de Pouls
    // Ce fichier gere l'ecran et affiche les information essentiel
    //
    //
    // (c) Nathan YAPI
    //*****************************************************************************

    #include <stdbool.h>
    #include <stdint.h>
    #include <stdlib.h>
    #include "inc/hw_memmap.h"
    #include "inc/hw_ints.h"
    #include "driverlib/interrupt.h"
    #include "driverlib/rom.h"
    #include "driverlib/rom_map.h"
    #include "driverlib/systick.h"
    #include "driverlib/sysctl.h"
    #include "driverlib/timer.h"
    #include "grlib/grlib.h"
    #include "grlib/widget.h"
    #include "grlib/pushbutton.h"
    #include "drivers/frame.h"
    #include "drivers/Kentec320x240x16_ssd2119_8bit.h"
    #include "drivers/pinout.h"
    #include "drivers/touch.h"
    #include "AfficherMenu.h"
    #include "AdcTimerRead.h"

    //*****************************************************************************
    //
    // The number of messages we can store in the message queue.
    //
    //*****************************************************************************
    //#define MSG_QUEUE_SIZE 16

    //*****************************************************************************
    //
    // The error routine that is called if the driver library encounters an error.
    //
    //*****************************************************************************
    #ifdef DEBUG
    void
    __error__(char *pcFilename, uint32_t ui32Line)
    {
    }
    #endif

    //*****************************************************************************
    //
    // Gloal variable used to store the frequency of the system clock.
    //
    //*****************************************************************************
    uint32_t g_ui32SysClock;


    //*****************************************************************************
    //
    // Variable Global
    //

    //*****************************************************************************
    tRectangle RectErase;


    char TempObservation[22]="01020304050607080910"; //TempObservation=5;
    uint16_t indexTemp=18;

    char FreqCoupure[68]="0.50.60.70.80.91.01.11.21.31.41.51.61.71.81.92.02.12.22.32.42.5";
    uint16_t indexCoupure=60;

    char FreqEch[32]="05060708091011121314151617181920";
    uint16_t indexEch=30;

    uint32_t valeurLed1[1];

    uint32_t valeurLed2[1];

    uint32_t FreqEchantillonnage=20;

    //*****************************************************************************
    //
    // Forward declarations for the globals required to define the widgets at
    // compile-time.
    //
    //*****************************************************************************
    void OnTempMoin(tWidget *psWidget);
    void OnTempPlus(tWidget *psWidget);
    void OnCoupureMoin(tWidget *psWidget);
    void OnCoupurePlus(tWidget *psWidget);
    void OnEchMoin(tWidget *psWidget);
    void OnEchPlus(tWidget *psWidget);


    //*****************************************************************************
    //
    // The drawing context used to draw to the screen.
    //
    //*****************************************************************************
    static tContext g_sContext;

    //*****************************************************************************
    //
    // Definie les Boutton de l'ecran et les fonction appeler a l'appuie
    //
    //*****************************************************************************

    CircularButton(g_pTempMoin, 0, 0, 0, &g_sKentec320x240x16_SSD2119, 26, 213,
    15, PB_STYLE_FILL | PB_STYLE_OUTLINE | PB_STYLE_TEXT, ClrNavy,
    ClrDimGray, ClrMidnightBlue, ClrSilver,
    &g_sFontCm20, "-", 0, 0, 0, 0,
    OnTempMoin);


    CircularButton(g_pTempPlus, 0, 0, 0, &g_sKentec320x240x16_SSD2119, 138, 213,
    15, PB_STYLE_FILL | PB_STYLE_OUTLINE | PB_STYLE_TEXT, ClrNavy,
    ClrDimGray, ClrMidnightBlue, ClrSilver,
    &g_sFontCm20, "+", 0, 0, 0, 0,
    OnTempPlus);

    CircularButton(g_pCoupureMoin, 0, 0, 0, &g_sKentec320x240x16_SSD2119, 173, 162,
    15, PB_STYLE_FILL | PB_STYLE_OUTLINE | PB_STYLE_TEXT, ClrNavy,
    ClrDimGray, ClrMidnightBlue, ClrSilver,
    &g_sFontCm20, "-", 0, 0, 0, 0,
    OnCoupureMoin);


    CircularButton(g_pCoupurePlus, 0, 0, 0, &g_sKentec320x240x16_SSD2119, 292, 162,
    15, PB_STYLE_FILL | PB_STYLE_OUTLINE | PB_STYLE_TEXT, ClrNavy,
    ClrDimGray, ClrMidnightBlue, ClrSilver,
    &g_sFontCm20, "+", 0, 0, 0, 0,
    OnCoupurePlus);

    CircularButton(g_pEchMoin, 0, 0, 0, &g_sKentec320x240x16_SSD2119, 174, 213,
    15, PB_STYLE_FILL | PB_STYLE_OUTLINE | PB_STYLE_TEXT, ClrNavy,
    ClrDimGray, ClrMidnightBlue, ClrSilver,
    &g_sFontCm20, "-", 0, 0, 0, 0,
    OnEchMoin);


    CircularButton(g_pEchPlus, 0, 0, 0, &g_sKentec320x240x16_SSD2119, 292, 213,
    15, PB_STYLE_FILL | PB_STYLE_OUTLINE | PB_STYLE_TEXT, ClrNavy,
    ClrDimGray, ClrMidnightBlue, ClrSilver,
    &g_sFontCm20, "+", 0, 0, 0, 0,
    OnEchPlus);

    //*****************************************************************************
    //
    // The interrupt-context handler for touch screen events from the touch screen
    // driver. This function merely bundles up the event parameters and posts
    // them to a message queue. In the context of the main loop, they will be
    // read from the queue and handled using TSMainHandler().
    //
    //*****************************************************************************

    //Fonction lier a la modification du temps d'observation
    void OnTempMoin(tWidget *psWidget)
    {

    if(indexTemp>0)
    {
    RectErase.i16XMin = 50;
    RectErase.i16YMin = 200;
    RectErase.i16XMax = 105;
    RectErase.i16YMax = 225;
    GrContextForegroundSet(&g_sContext, ClrBlack);
    GrRectFill(&g_sContext, &RectErase);

    indexTemp=indexTemp-2;
    GrContextForegroundSet(&g_sContext, ClrWhite);
    GrContextFontSet(&g_sContext, g_psFontCmss20);
    GrStringDrawCentered(&g_sContext,(TempObservation+indexTemp), 2,
    80, 213, 0);
    }

    }


    void OnTempPlus(tWidget *psWidget)
    {
    if(indexTemp<18)
    {
    RectErase.i16XMin = 50;
    RectErase.i16YMin = 200;
    RectErase.i16XMax = 105;
    RectErase.i16YMax = 225;
    GrContextForegroundSet(&g_sContext, ClrBlack);
    GrRectFill(&g_sContext, &RectErase);

    indexTemp=indexTemp+2;
    GrContextForegroundSet(&g_sContext, ClrWhite);
    GrContextFontSet(&g_sContext, g_psFontCmss20);
    GrStringDrawCentered(&g_sContext,(TempObservation+indexTemp), 2,
    80, 213, 0);
    }

    }

    //Fonction lier a la modification de la freuqence de coupure
    void OnCoupureMoin(tWidget *psWidget)
    {
    if(indexCoupure>0)
    {
    RectErase.i16XMin = 200;
    RectErase.i16YMin = 150;
    RectErase.i16XMax = 250;
    RectErase.i16YMax = 175;
    GrContextForegroundSet(&g_sContext, ClrBlack);
    GrRectFill(&g_sContext, &RectErase);

    indexCoupure=indexCoupure-3;
    GrContextForegroundSet(&g_sContext, ClrWhite);
    GrContextFontSet(&g_sContext, g_psFontCmss20);
    GrStringDrawCentered(&g_sContext,(FreqCoupure+indexCoupure), 3,
    230, 163, 0);
    }
    }


    void OnCoupurePlus(tWidget *psWidget)
    {
    if(indexCoupure<60)
    {
    RectErase.i16XMin = 200;
    RectErase.i16YMin = 150;
    RectErase.i16XMax = 250;
    RectErase.i16YMax = 175;
    GrContextForegroundSet(&g_sContext, ClrBlack);
    GrRectFill(&g_sContext, &RectErase);

    indexCoupure=indexCoupure+3;
    GrContextForegroundSet(&g_sContext, ClrWhite);
    GrContextFontSet(&g_sContext, g_psFontCmss20);
    GrStringDrawCentered(&g_sContext,(FreqCoupure+indexCoupure), 3,
    230, 163, 0);
    }
    }

    //Fonciton lier a la modification de la frequence d'echantillonage
    void OnEchMoin(tWidget *psWidget)
    {
    if(indexEch>0)
    {
    RectErase.i16XMin = 200;
    RectErase.i16YMin = 200;
    RectErase.i16XMax = 250;
    RectErase.i16YMax = 225;
    GrContextForegroundSet(&g_sContext, ClrBlack);
    GrRectFill(&g_sContext, &RectErase);

    indexEch=indexEch-2;
    GrContextForegroundSet(&g_sContext, ClrWhite);
    GrContextFontSet(&g_sContext, g_psFontCmss20);
    GrStringDrawCentered(&g_sContext,(FreqEch+indexEch), 2,
    230, 213, 0);
    }
    }


    void OnEchPlus(tWidget *psWidget)
    {
    if(indexEch<30)
    {
    RectErase.i16XMin = 200;
    RectErase.i16YMin = 200;
    RectErase.i16XMax = 250;
    RectErase.i16YMax = 225;
    GrContextForegroundSet(&g_sContext, ClrBlack);
    GrRectFill(&g_sContext, &RectErase);

    indexEch=indexEch+2;
    GrContextForegroundSet(&g_sContext, ClrWhite);
    GrContextFontSet(&g_sContext, g_psFontCmss20);
    GrStringDrawCentered(&g_sContext,(FreqEch+indexEch), 2,
    230, 213, 0);
    }
    }

    //*****************************************************************************
    //
    // Fonction necessaire pour dessiner point par point le graphique
    //
    //
    //*****************************************************************************

    void DessinGraph(uint16_t ValeurX, uint16_t ValeurY)
    {
    if(ValeurY>25 && ValeurY<130)
    {
    //Efface l'ancient point
    GrContextForegroundSet(&g_sContext, ClrBlack);
    GrLineDrawV(&g_sContext,ValeurX,26,129);

    //Designe le nouveau point
    GrContextForegroundSet(&g_sContext, ClrBlue);
    GrPixelDraw(&g_sContext,ValeurX,ValeurY);
    }
    }

    //*****************************************************************************
    //
    // Desine le memu a l'ecran
    //
    //*****************************************************************************
    void EcranSetup(void)
    {
    FrameDraw(&g_sContext, "Oxymetre de Pouls");

    //
    // Trace le rectangle autour de la section du graph
    //
    tRectangle sRectGraph;
    sRectGraph.i16XMin = 8;
    sRectGraph.i16YMin = 25;
    sRectGraph.i16XMax = 310;
    sRectGraph.i16YMax = 130;
    GrContextForegroundSet(&g_sContext, ClrBlack);
    GrRectFill(&g_sContext, &sRectGraph);
    //
    // Put a white box around the banner.
    //
    GrContextForegroundSet(&g_sContext, ClrWhite);
    GrRectDraw(&g_sContext, &sRectGraph);

    //
    // Trace le rectangle autour de la section de la Frequence
    //
    tRectangle sRectFreq;
    sRectFreq.i16XMin = 8;
    sRectFreq.i16YMin = 130;
    sRectFreq.i16XMax = 155;
    sRectFreq.i16YMax = 180;
    GrContextForegroundSet(&g_sContext, ClrBlack);
    GrRectFill(&g_sContext, &sRectFreq);
    //
    // Put a white box around the banner.
    //
    GrContextForegroundSet(&g_sContext, ClrWhite);
    GrRectDraw(&g_sContext, &sRectFreq);
    //
    // Put the application name in the middle of the banner.
    //
    GrContextFontSet(&g_sContext, g_psFontCmss14);
    GrStringDrawCentered(&g_sContext, " Frequence | Saturation ", -1,
    83, 137, 0);

    //
    // Trace le rectangle autour de la section de la Frequence
    // de coupure
    //
    tRectangle sRectTemp;
    sRectTemp.i16XMin = 8;
    sRectTemp.i16YMin = 180;
    sRectTemp.i16XMax = 155;
    sRectTemp.i16YMax = 231;
    GrContextForegroundSet(&g_sContext, ClrBlack);
    GrRectFill(&g_sContext, &sRectTemp);
    //
    // Put a white box around the banner.
    //
    GrContextForegroundSet(&g_sContext, ClrWhite);
    GrRectDraw(&g_sContext, &sRectTemp);
    //
    // Put the application name in the middle of the banner.
    //
    GrContextFontSet(&g_sContext, g_psFontCmss14);
    GrStringDrawCentered(&g_sContext, "Temps d'Observation (s)", -1,
    80, 187, 0);

    // char *TempObs="5";
    // itoa (TempObservation,TempObs,10);
    GrContextFontSet(&g_sContext, g_psFontCmss20);
    GrStringDrawCentered(&g_sContext,(TempObservation+indexTemp), 2,
    80, 213, 0);

    //
    // Trace le rectangle autour de la section du Temps
    // d'observation
    //
    tRectangle sRectFreqCoupure;
    sRectFreqCoupure.i16XMin = 155;
    sRectFreqCoupure.i16YMin = 130;
    sRectFreqCoupure.i16XMax = 310;
    sRectFreqCoupure.i16YMax = 180;
    GrContextForegroundSet(&g_sContext, ClrBlack);
    GrRectFill(&g_sContext, &sRectFreqCoupure);
    //
    // Put a white box around the banner.
    //
    GrContextForegroundSet(&g_sContext, ClrWhite);
    GrRectDraw(&g_sContext, &sRectFreqCoupure);
    //
    // Put the application name in the middle of the banner.
    //
    GrContextFontSet(&g_sContext, g_psFontCmss14);
    GrStringDrawCentered(&g_sContext, "Freq Coupure (Hz)", -1,
    230, 137, 0);

    GrContextFontSet(&g_sContext, g_psFontCmss20);
    GrStringDrawCentered(&g_sContext,(FreqCoupure+indexCoupure), 3,
    230, 163, 0);
    //
    // Trace le rectangle autour de la section de la Frequence
    // d'Echantillonage
    //
    tRectangle sRectFreqEch;
    sRectFreqEch.i16XMin = 155;
    sRectFreqEch.i16YMin = 180;
    sRectFreqEch.i16XMax = 310;
    sRectFreqEch.i16YMax = 231;
    GrContextForegroundSet(&g_sContext, ClrBlack);
    GrRectFill(&g_sContext, &sRectFreqEch);
    //
    // Put a white box around the banner.
    //
    GrContextForegroundSet(&g_sContext, ClrWhite);
    GrRectDraw(&g_sContext, &sRectFreqEch);
    //
    // Put the application name in the middle of the banner.
    //
    GrContextFontSet(&g_sContext, g_psFontCmss14);
    GrStringDrawCentered(&g_sContext, "Freq Echantillonage (Hz)", -1,
    230, 187, 0);

    GrContextFontSet(&g_sContext, g_psFontCmss20);
    GrStringDrawCentered(&g_sContext,(FreqEch+indexEch), 2,
    230, 213, 0);
    //
    // Flush any cached drawing operations.
    //
    GrFlush(&g_sContext);

    //Envoie la commande pour peindre les boutton

    WidgetAdd(WIDGET_ROOT, (tWidget *)&g_pTempMoin);
    WidgetAdd(WIDGET_ROOT, (tWidget *)&g_pTempPlus);
    WidgetAdd(WIDGET_ROOT, (tWidget *)&g_pCoupureMoin);
    WidgetAdd(WIDGET_ROOT, (tWidget *)&g_pCoupurePlus);
    WidgetAdd(WIDGET_ROOT, (tWidget *)&g_pEchMoin);
    WidgetAdd(WIDGET_ROOT, (tWidget *)&g_pEchPlus);

    WidgetPaint(WIDGET_ROOT);

    //

    uint16_t x=9;
    uint16_t y=127;

    while(x<310)
    {
    DessinGraph(x, y);
    x+=3;
    y-=1;
    }
    }


    //*****************************************************************************
    //
    // Initialise l'ecran et la structure du menu. Une boulce infinie et ensuite
    // generer pour gerer les message du touchscreen.
    //
    //*****************************************************************************
    int
    main(void)
    {
    //
    // Run from the PLL at 120 MHz.
    //
    g_ui32SysClock = MAP_SysCtlClockFreqSet((SYSCTL_XTAL_25MHZ |
    SYSCTL_OSC_MAIN |
    SYSCTL_USE_PLL |
    SYSCTL_CFG_VCO_480), 120000000);

    //
    // Configure the device pins for this board.
    // This application does not use Ethernet or USB.
    //
    PinoutSet(false, false);

    //
    // Initialize the display driver.
    //
    Kentec320x240x16_SSD2119Init(g_ui32SysClock);

    //
    // Initialize the graphics context.
    //
    GrContextInit(&g_sContext, &g_sKentec320x240x16_SSD2119);


    //
    // Initialize the touch screen driver.
    //
    TouchScreenInit(g_ui32SysClock);

    //
    // Set the touch screen event handler.
    //
    TouchScreenCallbackSet(WidgetPointerMessage);

    //
    // S'Occupe du dessin complet de l'ecran
    //
    EcranSetup();

    //
    // Active les 2 ADC en fonction de la frequence voulu
    //
    AdcTimerRead(FreqEchantillonnage);

    //
    // Loop forever. All the drawing is done in the touch screen event
    // handler.
    //

    while(1)
    {
    WidgetMessageQueueProcess();
    }
    }

    /////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////

    and this is the file with the double adc set up with the same trigger and a phase delay:

    /////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////

    /*
    * AdcTimerRead.c
    *
    * Created on: 12 juil. 2014
    * Author: Nathan
    */

    #include <stdint.h>
    #include <stdbool.h>
    #include "AdcTimerRead.h"
    #include "inc/hw_memmap.h"
    #include "inc/hw_types.h"
    #include "inc/tm4c123ge6pm.h"
    #include "driverlib/interrupt.h"
    #include "driverlib/gpio.h"
    #include "driverlib/sysctl.h"
    #include "driverlib/timer.h"
    #include "driverlib/rom.h"
    #include "driverlib/adc.h"
    #include "grlib/grlib.h"
    #include "grlib/widget.h"
    #include "grlib/pushbutton.h"

    //*****************************************************************************
    //
    // Declaration en avance des fonctions utiliser
    //
    //*****************************************************************************
    void Analogue_Int(void);
    void AdcTimerRead(uint32_t FreqEchantillonnage);

    void AdcTimerRead(uint32_t FreqEchantillonnage)
    {
    uint32_t count=SysCtlClockGet()/FreqEchantillonnage; // calculer le nombre de "coups" de l'horloge interne
    uint32_t channel = ADC_CTL_CH18; // obtenir le canal ADC associé à la pin choisie

    //////////////////////////////////////////////////////////////////////////////////////////////////////////
    ////Configuration des pin qui allimente les LED
    /////////////////////////////////////////////////////////////////////////////////////////////////////////

    GPIODirModeSet(GPIO_PORTK_BASE,GPIO_PIN_0|GPIO_PIN_1, GPIO_DIR_MODE_OUT); //placer les 2 pin en output
    GPIOPadConfigSet(GPIO_PORTK_BASE,GPIO_PIN_0|GPIO_PIN_1,
    GPIO_STRENGTH_8MA, GPIO_PIN_TYPE_STD); //les configurer en push-pull de 8mA
    GPIOPinWrite(GPIO_PORTK_BASE,GPIO_PIN_0|GPIO_PIN_1,0); //Allumer la premiere LED

    //////////////////////////////////////////////////////////////////////////////////////////////////////////
    ////Configuration de l'ADC initer par les timmer
    /////////////////////////////////////////////////////////////////////////////////////////////////////////

    SysCtlPeripheralEnable(SYSCTL_PERIPH_TIMER0); // activer le module (périphérique) TIMER0
    SysCtlPeripheralEnable(SYSCTL_PERIPH_GPIOK);

    TimerConfigure(TIMER0_BASE,TIMER_CFG_PERIODIC); // configurer le timer en mode périodique
    TimerLoadSet(TIMER0_BASE,TIMER_A,count); // définir la durée du décompte du timer


    GPIOPinTypeADC(GPIO_PORTK_BASE, (GPIO_PIN_2)); // configurer la pin GPIO choisie comme ADC

    SysCtlPeripheralEnable(SYSCTL_PERIPH_ADC0); // activer le module (périphérique) ADC0
    ADCSequenceConfigure(ADC0_BASE, 3, ADC_TRIGGER_TIMER, 0); // configurer la séquence de lecture
    ADCSequenceStepConfigure(ADC0_BASE, 3, 0,
    channel | ADC_CTL_IE | ADC_CTL_END); // configurer la séquence d'exécution
    ADCSequenceEnable(ADC0_BASE, 3); // activer la séquence tout juste configurée

    SysCtlPeripheralEnable(SYSCTL_PERIPH_ADC1); // activer le module (périphérique) ADC1
    ADCSequenceConfigure(ADC1_BASE, 3, ADC_TRIGGER_TIMER, 0); // configurer la séquence de lecture
    ADCPhaseDelaySet(ADC1_BASE,ADC_PHASE_22_5); // ajoute un delay entre le trigger et l'aquisition
    ADCSequenceStepConfigure(ADC1_BASE, 3, 0,
    channel | ADC_CTL_END); // configurer la séquence d'exécution
    ADCSequenceEnable(ADC1_BASE, 3); // activer la séquence tout juste configurée

    ADCIntClear(ADC0_BASE, 3); // effacer le registre associées à l'interruption
    IntPrioritySet(INT_ADC0SS3,0);
    ADCIntEnable(ADC0_BASE,3); // activer l'interruption
    ADCIntRegister(ADC0_BASE,3, (*Analogue_Int)); // indiquer quelle fonction sera associée à l'int
    TimerControlTrigger(TIMER0_BASE,TIMER_A,true); // spécifier ce qui déclenche l'activation de l'int
    TimerEnable(TIMER0_BASE,TIMER_A); // activer le TIMER0
    }

    ///////////////////////////////////////////////////////////////////////////////////////////////////////////////
    // Fonction Analogue_Int: fonction associée à l'interruption provoquée; effectue les lectures et stocke les
    // échantillons dans une pile FIFO; filtre le signal et accomplit une transformée de Fourier directe du signal
    ///////////////////////////////////////////////////////////////////////////////////////////////////////////////

    void Analogue_Int(void)
    {
    ADCIntClear(ADC0_BASE,3); // efface les données actuellement présentes associées à l'int
    ADCSequenceDataGet(ADC0_BASE, 3,valeurLed1); // lire la valeur analogique, la transformer en valeur numérique et la

    GPIOPinWrite(GPIO_PORTK_BASE,GPIO_PIN_0|GPIO_PIN_1,1); //eteint la premiere led et allume la seconde
    while(!ADCBusy(ADC1_BASE))
    {
    }

    ADCSequenceDataGet(ADC1_BASE, 3,valeurLed2); // lire la valeur analogiqueet la transformer en valeur numérique
    GPIOPinWrite(GPIO_PORTK_BASE,GPIO_PIN_0|GPIO_PIN_1,0); //eteint la premiere led et allume la seconde
    }

  • i like the way u helped me -.-

    Thank you !

    as i said i tried as in a took it off the secound i saw it didn t work ....


    Not sure if I understand this correctly. But if it worked before,  and stopped working after a software change, the problems seem unrelated to hardware.

    I believe you have a problem with your interrupt handler routines, in regard to runtimes and/or priorities. I guess one of your handlers is now taking longer than it's period time (i.e. is overrun).

    Have you tried to calculate how many instructions a 10MHz interrupt allows, and what a performance load it poses ?

    As a general rule, don't call GUI functions from interrupts, especially when you can't estimate the time they take.

  • Unfortunately I do not have time to look through all of the hundreds of lines of code you posted.

    My suggestion was for you to look at what pins you are using.  Compare those pins to the schematic and carefully examine what else may be in the circuit with those GPIO pins that may be interfering with your system. 

    My guess is that you are falling victim to the dreaded zero ohms and one of your pins is connected to another.  Therefore interfering with the signal. 

  • f.m :

    hmmm what i meant is that i know putting an interupt at such a high frequency is a bad idea soo i took it offf and put the WidgetQueueProcess() in a loop like it was before.  --> this fonction is in grlib and is used to draw/notice if the buttons are pressed ect....

    the problem with that is since i am wanna use an ADC also sooo i set it up with a timmer interupt soo that it can follow a specifique frequency (max 20Hz)... but as soon i add that code:

    - the menu that used to draw itself very very quickly now takes like 2 minutes to draw on the touchscreen 
    and the touchscreen button dont work anymore.


    dexter : 

    the pin i am using is PK2 .. it ise not used by the screen kentec l35 i checked the sheet and it is an analogue in pin

  • Not sure how you realized you implementation, but is seems to be far from optimal. My guess, you have some more experience with PC-based coding, and possibly GUI applications, but none in the MCU area ..

    For the last year, I used almost exclusively a competitors MCU (not TIVA), but the general principle stays the same.

    First, you need to decouple GUI drawing from interrupts. Since the core needs to do most of the gfx work himself, you want to do it as seldom as possible - no separate graphics core here.

    And for the ADC, you need to setup the timer to trigger the ADC sample sequence. This can be done manually in the timer interrupt handler, or with directly configuring the timer as ADC trigger. Not sure how it's done on your TMC4 MCU, look up the datasheet/ TivaWare API documentation.

    To pick up the ADC conversion results, one usually configures the End-Of-Conversion interrupt of the MCU, at least for a single channel. For multiple channels, you may think about using DMA.

    And I suggest reading the ADC section of the MCU datasheet / ref. manual, to understand the working prinziple and configuration options of this peripheral. I guess this should be first on your list...