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.

How to set interrupt handler to enter only once

Other Parts Discussed in Thread: TM4C123GH6PM

Hello, i am currently writing a programme, however i only want my code to run through the interrupt handler once only. Do u guys have any idea how to do so? Currently my interrupt handler code enters it twice instead of once.

//Enable GPIO Port E IntHandler
GPIOIntTypeSet(GPIO_PORTE_BASE, GPIO_PIN_0, GPIO_RISING_EDGE); // Rising edge to detect from high to low
GPIOIntRegister(GPIO_PORTE_BASE, PortEIntHandler);//Activate port
GPIOIntEnable(GPIO_PORTE_BASE, GPIO_INT_PIN_0);//Interrupt due to activity on Pin 0 of Port E
IntEnable(INT_GPIOE);//enable interupt port e
IntMasterEnable();
while(1){

}
}

//======================================================================================================================
//Port E int handler
void PortEIntHandler(void){
GPIOIntClear(GPIO_PORTE_BASE, GPIO_INT_PIN_0);//clear interrupt
GPIOPinWrite(GPIO_PORTF_BASE,GPIO_PIN_3,0x08); // Turn on green LED
SysCtlDelay(20000);//Period
GPIOIntUnregister(GPIO_PORTE_BASE);//Activate port

//GPIOIntTypeSet(GPIO_PORTE_BASE, GPIO_PIN_0, 0); // Rising edge to detect from high to low

//IntDisable(INT_GPIOE);//Disable PortE so that interrupt handler only activate on first rising edge output

GPIOPinWrite(GPIO_PORTE_BASE,GPIO_PIN_1,GPIO_PIN_1);//Set PE0 high
SysCtlDelay(2000);//Period

GPIOPinWrite(GPIO_PORTE_BASE,GPIO_PIN_1,0);//Set PE0 low

GPIOPinWrite(GPIO_PORTF_BASE,GPIO_PIN_1,0x02); // Turn on red LED
//GPIOIntTypeSet(GPIO_PORTE_BASE, GPIO_PIN_0, GPIO_RISING_EDGE); // Rising edge to detect from high to low
//IntEnable(INT_GPIOE);//Enable PortE so that interrupt handler only activate on first rising edge output
GPIOIntRegister(GPIO_PORTE_BASE, PortEIntHandler);//Activate port

GPIOPinWrite(GPIO_PORTF_BASE,GPIO_PIN_3,0); // Turn off green LED
}

  • How are you setting the input pin state?

    Why a HUGE delay call inside the interrupt routine?

    Why are you setting an interrupt pin high inside it's response to a rising edge?

    Robert
  • Hello,
    1) I have an input 10 high and low pulse being generated from another TIVA micro board
    2) The huge delay is required for my project
    3) My project requires the TIVA board to generate a single high and low pulse as an output
    Sorry if i didn't specify the details
  • 1. Good, I was worried you were using a switch. Next question, how fast and linear is the rise? What conditioning do you have on the signal? How long is the connection between the micros? What is your power supply configuration?

    2. I don't doubt that, but the interrupt is absolutely the wrong place to put a busy wait delay. Actually, I don't think there are many right places, SysCtlDelay is one of TivaWare's most dangerous functions.

    3. Hmm, it looks like the line I was worried about is commented out. You need to clean up the code a little and probably use the code formatting so indentation is preserved.

    Robert
  • Hi,

    First, do not play with GPIOIntRegister/GPIOIntUnRegister inside interrupts - in fact you need to remove those line from your code. Since you have the source code inside driverlib take a look at those functions - they silently enable/disable the interrupts, so your code may be totally wrong.

    The minimum needed is to disable the interrupt of that port, inside your interrupt routine. If you need that at some time to re-use that interrupt, just enable it as usual. 

  • Hello Desmond,

    So does the scenario pan out as: Get the input of 10 high and low pulses before generating a single high and low as output?

    Regards
    Amit
  • Hello, thanks for commenting, for Question 2 i would like to ask what other kind of delay can we use if SysCtlDelay is one of the most dangerous function?
  • Could u elaborate a little further about GPIOIntRegister? Without it wouldn't the interrupt handler not be able to be triggered?
  • Yes. It consists of 2 TIVA boards, one to generate the 10 high and low pulses (Essentially 10 square waves) . Currently i have reduced the 10 waveforms to only one, as using more would cause the output to have 2 high and low, which is not what i am looking for.
  • Don't use a delay function.

    Most importantly, never use a delay function in an interrupt.

    There are ways of doing this without a delay in the interrupt. The easiest is to use polling outside of the interrupt. The best response would be a hardware timer if the timers will support it (and I suspect that's possible on a TIVA)

    Robert
  • Next question, how fast and linear is the rise? What conditioning do you have on the signal? How long is the connection between the micros? What is your power supply configuration?
  • Hello Desmond,

    I still do not get the argument "Currently i have reduced the 10 waveforms to only one, as using more would cause the output to have 2 high and low". Could you please explain?

    Regards
    Amit
  • Hello, could u explain what will happen if a delay function is used in an interrupt?
  • I currently have 2 TIVA boards. 1 TIVA board will generate 10 pulses, meaning i set the pin to low, after that i set the pin to high. After that the 2nd TIVA board will receive the pulses, and using the rising edge function, i use it to allow the 2nd TIVA board to output a single pulse.
    Here comes the problem, i have 2 pulses instead of 1 pulse, which means the interrupt in the 2nd TIVA board is entered twice. Thus, if i set the 1st TIVA board to only generate 1 pulse, it solves the problem temporarily. I hope i explained it clearly.
  • Hello Desmond,

    After counting the 10 pulses, set a flag in the interrupt handler and the counter for 10 must be reset to 0. In the main application code if the flag is set then toggle the output pin and then clear the flag.

    Regards
    Amit
  • Desmond, latency rises, you miss events. You effectively make the processor much slower.

    Robert
  • Okay thanks, i will try it out and get back to u.
  • Hi Robert, thanks for your explanation, could u suggest me a way of using delays (or something similar) if it is not advised to use sysctldelay in an interrupt?
  • Hello Desmond,

    Can you please explain why delay is needed in the Interrupt Handler for your application?

    Regards
    Amit
  • Hello, i am using it as a stimulated delay for my project, as my original project will have a delay.
  • This is the program used to generate the pulses
    /*
    * Current program only uses 1 output pulse (10ms) However, program will be editted in the future to have 10 pulses, problem is that
    * 10 pulses will generate 2 interrupts instead of one. Drive 10 pulses thru PE3

    *
    */
    #include <stdint.h>
    #include <stdbool.h>
    #include "inc/hw_memmap.h"
    #include "inc/hw_types.h"
    #include "driverlib/debug.h"
    #include "driverlib/sysctl.h"
    #include "driverlib/adc.h"
    #include "driverlib/gpio.h"
    #include "driverlib/interrupt.h"
    #include "inc/tm4c123gh6pm.h"
    #include "driverlib/timer.h"
    #include "grlib/grlib.h"
    //////////////////////////////////////////
    #include "driverlib/rom.h"
    #define TARGET_IS_BLIZZARD_RB1// Make the memory of the program smaller

    //.............................................
    #define ON_COUNT 1
    #define OFF_COUNT 780
    #define oneusDelay 8//Delay of 1us
    uint32_t ui32PulseDelay=oneusDelay;//8, 1us
    uint32_t ui32Burst_count = ON_COUNT; //20
    uint32_t ui32Stop_count =0 ;
    //...............................................
    void Timer0IntHandler(void); //define Timer0Int
    //======================================================================================
    int main(void) {
    uint32_t ultrasoundPeriod;

    SysCtlClockSet(SYSCTL_SYSDIV_4 | SYSCTL_USE_PLL | SYSCTL_OSC_MAIN | SYSCTL_XTAL_16MHZ);//Set up the system clock again to run at 50MHz.

    //Enables PortE to drive 10 pulses thru PE2
    SysCtlPeripheralEnable(SYSCTL_PERIPH_GPIOE);
    GPIOPinTypeGPIOOutput(GPIO_PORTE_BASE,GPIO_PIN_3);//Drives 10 pulses

    //LED Green
    SysCtlPeripheralEnable(SYSCTL_PERIPH_GPIOF); // Enable port F to drive LED
    GPIOPinTypeGPIOOutput(GPIO_PORTF_BASE,GPIO_PIN_3);//Drive green LED

    // Timer Configuration for 80kHz interrupt 12.5us
    SysCtlPeripheralEnable(SYSCTL_PERIPH_TIMER0); // Enable Timer0 to produce 10 pulses
    TimerConfigure(TIMER0_BASE, TIMER_CFG_PERIODIC); // To configure Timer0 would keep on counting in period
    ultrasoundPeriod = (SysCtlClockGet() / 80000); // A desired 80Khz frequency, and 1 clock cycle = 80k (1 high 1 low)
    TimerLoadSet(TIMER0_BASE, TIMER_A, ultrasoundPeriod -1);
    IntEnable(INT_TIMER0A);
    TimerIntEnable(TIMER0_BASE, TIMER_TIMA_TIMEOUT);
    TimerEnable(TIMER0_BASE, TIMER_A);

    IntMasterEnable();
    while(1){
    }
    }
    //======================================================================================================================

    void Timer0IntHandler(void){ // interrupt for 10ms
    TimerIntClear(TIMER0_BASE,TIMER_TIMA_TIMEOUT); // Clear Timer0 interrupt
    GPIOPinWrite(GPIO_PORTF_BASE,GPIO_PIN_3,0x08); // Turn on green LED

    //Generate 10 pulses
    if (ui32Burst_count > 0){ //1 count
    //Toggle PE2
    GPIOPinWrite(GPIO_PORTE_BASE,GPIO_PIN_3,GPIO_PIN_3);
    GPIOPinWrite(GPIO_PORTE_BASE,GPIO_PIN_3,0);
    ui32Burst_count --;
    if (ui32Burst_count == 0) {
    ui32Stop_count = OFF_COUNT;//780
    //ui32startingTime = TimerValueGet(TIMER1_BASE,TIMER_A); // Count 6

    }
    }

    //Pause period 9.75ms
    if (ui32Stop_count > 0){ //780
    ui32Stop_count --;
    if (ui32Stop_count == 0){
    ui32Burst_count = ON_COUNT;//20
    }
    }

    GPIOPinWrite(GPIO_PORTF_BASE,GPIO_PIN_3,0); // Turn off green LED
    }

    //---------------------------------------------------------------------------
  • This program is used to receive the pulses and then generate a single pulse. Using the pulse i will calculate the delay between the generated and received pulse and plot the difference on the LCD. Sorry for the late reply.
    /*
    *This program is to read from gpio port E pin 0 and generate a pulse from the first rising edge from PE 1. Current program used
    *Includeds the codes to allow LCD to be used, still in progress as pixels not displayed
    *
    *LCD Display uses PB5, PB0, PB1, PE4, PE5, PB4, PA5, PA6, PA7, PF2, PB3, PB2, PB7, PB6, PA4, PA3, PA2.
    *Currently using PE0, PE1, PF1, PF3.
    */
    #include <stdint.h>
    #include <stdbool.h>
    #include "inc/hw_memmap.h"
    #include "inc/hw_types.h"
    #include "driverlib/debug.h"
    #include "driverlib/sysctl.h"
    #include "driverlib/adc.h"
    #include "driverlib/gpio.h"
    #include "driverlib/interrupt.h"
    #include "inc/tm4c123gh6pm.h"
    #include "driverlib/timer.h"
    #include "grlib/grlib.h"
    /////////////////////////////////////
    #include "grlib/widget.h"
    #include "grlib/canvas.h"
    #include "Kentec320x240x16_ssd2119_8bit.h"
    #include "touch.h"
    #include "images.h"
    #include "grlib/pushbutton.h"
    #include "driverlib/adc.h"

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


    tContext sContext;
    tRectangle sRect;
    extern tCanvasWidget g_sBackground;
    extern tCanvasWidget g_sBackground2;
    extern tPushButtonWidget PushNext;
    extern tPushButtonWidget PushBack;
    void OnPushNext(tWidget *pWidget);
    void OnPushBack(tWidget *pWidget);
    void NextScreen(void);
    void BackScreen(void);
    uint32_t i32X;
    uint32_t i32Y=35;

    uint32_t ui32startingTime;
    uint32_t ui32endingTime;
    uint32_t ui32timeTaken;
    uint32_t ui32distance;
    uint32_t g_usercount=0;
    uint32_t x=0;
    uint32_t g_ui32countvalue;
    uint32_t aui16Datatable[]={2000,2200,2400,2000,2500,1000,3000,2400,2200,2600};

    void PortEIntHandler(void);//Interrupt for port E
    void Timer1IntHandler(void); //define Timer1Int
    //-------------------------------------------------------------------------------------------------
    Canvas(g_sHeading1, &g_sBackground, 0, &PushNext,
    &g_sKentec320x240x16_SSD2119, 0, 0, 320, 35,
    (CANVAS_STYLE_FILL | CANVAS_STYLE_OUTLINE | CANVAS_STYLE_TEXT),
    ClrBlack, ClrWhite, ClrRed, g_psFontCm20, "User-Interface", 0, 0);

    Canvas(g_sBackground, WIDGET_ROOT, 0, &g_sHeading1,
    &g_sKentec320x240x16_SSD2119, 0, 35, 200, 250 ,
    CANVAS_STYLE_FILL, ClrBlack, 0, 0, 0, 0, 0, 0);

    RectangularButton(PushNext, &g_sBackground, 0 , 0,
    &g_sKentec320x240x16_SSD2119, 270, 190, 50, 50,
    PB_STYLE_IMG | PB_STYLE_TEXT, ClrBlack, ClrBlack, 0,
    ClrSilver, &g_sFontCm20, "+", g_pucBlue50x50, g_pucBlue50x50Press, 0, 0, OnPushNext);
    //-------------------------------------------------------------------------------------------------
    Canvas(g_sHeading2, &g_sBackground2, 0, &PushBack,
    &g_sKentec320x240x16_SSD2119, 0, 0, 320, 35,
    (CANVAS_STYLE_FILL | CANVAS_STYLE_OUTLINE | CANVAS_STYLE_TEXT),
    ClrBlack, ClrWhite, ClrRed, g_psFontCm20, "Values", 0, 0);
    Canvas(g_sBackground2, WIDGET_ROOT, 0, &g_sHeading2,
    &g_sKentec320x240x16_SSD2119, 0, 35, 200, 200,
    CANVAS_STYLE_FILL, ClrBlack, 0, 0, 0, 0, 0, 0);
    RectangularButton(PushBack, &g_sBackground2, 0, 0,
    &g_sKentec320x240x16_SSD2119, 200, 190, 50, 50,
    PB_STYLE_IMG | PB_STYLE_TEXT, ClrBlack, ClrBlack, 0,
    ClrSilver, &g_sFontCm20, "-", g_pucBlue50x50, g_pucBlue50x50Press, 0, 0, OnPushBack);
    //---------------------------------------------------------------------------------------------------

    int main(void) {
    //Initialise all the starting background configs
    Kentec320x240x16_SSD2119Init();
    TouchScreenInit(); //Only work in adc seq 3
    TouchScreenCallbackSet(WidgetPointerMessage);
    WidgetAdd(WIDGET_ROOT, (tWidget *)&g_sBackground);
    WidgetPaint(WIDGET_ROOT);
    GrContextInit(&sContext, &g_sKentec320x240x16_SSD2119);

    //================================================
    SysCtlClockSet(SYSCTL_SYSDIV_5|SYSCTL_USE_PLL|SYSCTL_OSC_MAIN|SYSCTL_XTAL_16MHZ);//Set up the system clock again to run at 40MHz
    //Setting the initial background
    GrContextFontSet(&sContext, g_psFontCm20);
    GrContextForegroundSet(&sContext, ClrPaleGoldenrod);
    GrStringDraw(&sContext, "Desmond", 8, 210, 70, 0);
    GrStringDraw(&sContext, "Sian-Li", 8, 210, 90, 0);
    GrStringDraw(&sContext, "Mr. ", 8, 210, 110, 0);
    GrStringDraw(&sContext, "Johnny ", 8, 210, 130, 0);
    GrStringDraw(&sContext, "Chee", 8, 210, 150, 0);
    //==================================================
    //Enable port F for LED
    SysCtlPeripheralEnable(SYSCTL_PERIPH_GPIOF); // Enable port F to drive LED
    GPIOPinTypeGPIOOutput(GPIO_PORTF_BASE,GPIO_PIN_1);//red LED
    GPIOPinTypeGPIOOutput(GPIO_PORTF_BASE,GPIO_PIN_3);//green LED
    //Enable GPIO port E and PE 0 & 2
    SysCtlPeripheralEnable(SYSCTL_PERIPH_GPIOE);
    GPIOPinTypeGPIOInput(GPIO_PORTE_BASE,GPIO_PIN_0);//PE0 that receives the signal
    GPIOPinTypeGPIOOutput(GPIO_PORTE_BASE,GPIO_PIN_1);//PE1 generates pulse

    //Timer config
    SysCtlPeripheralEnable(SYSCTL_PERIPH_TIMER1); // Enable Timer1
    //SysCtlPeripheralEnable(SYSCTL_PERIPH_TIMER0); // Enable Timer1
    TimerConfigure(TIMER1_BASE, TIMER_CFG_ONE_SHOT_UP); // To configure Timer1 would start from 0 and go all the way till it disabled
    TimerLoadSet(TIMER1_BASE, TIMER_A, 500000); // Put a high value (unreachable)
    // IntEnable(INT_TIMER1A);
    // TimerIntEnable(TIMER1_BASE, TIMER_TIMA_TIMEOUT);


    //Enable GPIO Port E IntHandler
    GPIOIntTypeSet(GPIO_PORTE_BASE, GPIO_PIN_0, GPIO_RISING_EDGE); // Rising edge to detect from high to low
    GPIOIntRegister(GPIO_PORTE_BASE, PortEIntHandler);//Activate port
    GPIOIntEnable(GPIO_PORTE_BASE, GPIO_INT_PIN_0);//Interrupt due to activity on Pin 0 of Port E
    IntEnable(INT_GPIOE);//enable interupt port e

    IntMasterEnable();

    while(1){

    g_ui32countvalue=aui16Datatable[g_usercount];//To allow the delay to have different values, which will be measured
    //To draw the initial background
    sRect.i16XMin = 0;
    sRect.i16XMax = 200;
    sRect.i16YMin = 35;
    sRect.i16YMax = 239;
    GrContextForegroundSet(&sContext, ClrPink);
    GrRectDraw(&sContext, &sRect);
    //========================================
    //To allow pixel draw
    i32X=ui32timeTaken-56700;//TimeTaken need to be subtracted as the initial value is too big to be plotted as a pixel
    i32Y++;
    if(i32Y>=239) i32Y=35;
    GrContextForegroundSet(&sContext, ClrAqua);
    GrPixelDraw(&sContext, i32X, i32Y);
    //======================================================


    WidgetMessageQueueProcess();

    }
    }
    /*void Timer1IntHandler(void){ // interrupt for 10ms
    TimerIntClear(TIMER1_BASE,TIMER_TIMA_TIMEOUT); // Clear Timer0 interrupt
    } */
    //==================================================================================================
    void OnPushNext(tWidget *pWidget){//Next button to gait parameters
    WidgetRemove((tWidget *)&g_sBackground);
    WidgetAdd(WIDGET_ROOT, (tWidget *)&g_sBackground2);
    WidgetPaint(WIDGET_ROOT);
    NextScreen();
    }
    void OnPushBack(tWidget *pWidget){ //Back button to user interface
    WidgetRemove((tWidget *)&g_sBackground2);
    WidgetAdd(WIDGET_ROOT, (tWidget *)&g_sBackground);
    WidgetPaint(WIDGET_ROOT);
    BackScreen();
    }
    void NextScreen(){ //Function to clear 1st page
    sRect.i16XMin = 200;
    sRect.i16YMin = 35;
    sRect.i16XMax = 320;
    sRect.i16YMax = 240;
    GrContextForegroundSet(&sContext, ClrBlack);
    GrRectFill(&sContext, &sRect);
    GrContextFontSet(&sContext, g_psFontCm20);
    GrContextForegroundSet(&sContext, ClrPapayaWhip);
    GrStringDraw(&sContext, "Gait-", 100, 210, 45, 0);
    GrStringDraw(&sContext, "Parameter:", 100, 210, 65, 0);
    GrFlush(&sContext);
    }
    void BackScreen(){ //Function to clear 2nd page
    sRect.i16XMin = 200;
    sRect.i16YMin = 35;
    sRect.i16XMax = 320;
    sRect.i16YMax = 240;
    GrContextForegroundSet(&sContext, ClrBlack);
    GrRectFill(&sContext, &sRect);
    GrContextFontSet(&sContext, g_psFontCm20);
    GrContextForegroundSet(&sContext, ClrPaleGoldenrod );
    GrStringDraw(&sContext, "Desmond", 8, 210, 70, 0);
    GrStringDraw(&sContext, "Sian-Li", 8, 210, 90, 0);
    GrStringDraw(&sContext, "Mr. ", 8, 210, 110, 0);
    GrStringDraw(&sContext, "Johnny ", 8, 210, 130, 0);
    GrStringDraw(&sContext, "Chee", 8, 210, 150, 0);
    GrFlush(&sContext);
    }
    //======================================================================================================================
    //Port E int handler
    interrupt void PortEIntHandler(void){
    GPIOIntClear(GPIO_PORTE_BASE, GPIO_INT_PIN_0);//clear interrupt
    TimerEnable(TIMER1_BASE, TIMER_A);

    g_usercount++;
    ui32startingTime = TimerValueGet(TIMER1_BASE,TIMER_A); //Get value of the time at the start of the initial 10 generated pulses

    //x = TimerValueGet(TIMER1_BASE,TIMER_A); //Get value of the time at the start of the initial 10 generated pulses

    //TimerLoadGet(TIMER1_BASE,TIMER_A);// Get the 50k value
    //GPIOPinWrite(GPIO_PORTF_BASE,GPIO_PIN_1,0x02); // Turn on red LED

    SysCtlDelay(g_ui32countvalue);//Delay

    ui32endingTime = TimerValueGet(TIMER1_BASE,TIMER_A); //Get value of time at start of output pulse
    TimerDisable(TIMER1_BASE, TIMER_A); // To disable timer1 from continuous counting
    ui32timeTaken = ui32endingTime - ui32startingTime;
    if (ui32timeTaken <= 500000){//50,000

    // ui32distance = ui32timeTaken * 3.46;//Still need to understand why multiply by pi
    if(ui32timeTaken <= 500000) GPIOPinWrite(GPIO_PORTF_BASE, GPIO_PIN_1, 0x02); //Turn on LED green light PF3
    else GPIOPinWrite(GPIO_PORTF_BASE, GPIO_PIN_3, 0x08); //Turn on LED red light PF1
    }
    GPIOPinWrite(GPIO_PORTE_BASE,GPIO_PIN_1,GPIO_PIN_1);//Set PE0 high
    // SysCtlDelay(2000);//Period
    GPIOPinWrite(GPIO_PORTE_BASE,GPIO_PIN_1,0);//Set PE0 low

    if(g_usercount>=9){ // to use a different value in the array table provided
    GPIOPinWrite(GPIO_PORTF_BASE,GPIO_PIN_1|GPIO_PIN_3,0); // Turn off LED

    g_usercount=0;
    }


    }
  • Desmond, do not use delays. You haven't provided any reasons that would justify usa delay.

    Obvious methods are

    Set a semaphore/ flag for another task to respond to
    Start a timer that triggers an interrupt that performs the output. One of the advantages of cortex micros is they usually have an embarrassment of timers.

    I'm sure you can think of others. Really at this point I've done too much hand holding

    Robert
  • Robert Adsett72 said:
    Desmond, do not use delays. You haven't provided any reasons that would justify use (of) a delay.  

    Indeed Robert - and (yours) is not the (only) pot which has reached, "boiling point."

    That said - might an even more fundamental issue lurk?   Why are TWO MCUs required?  All that's been "pulled" from poster is the requirement for a (still non-described/unspecified) delay.   Cannot any such delay - quite easily - be measured w/in a single MCU?   (Ans: mais certainement)

    When unguided posters dictate (both) the pathways & playing field - trail (too often) zig-zags - leads to nowhere!   

    Poster's "need" for delay remains unexplained - along w/the need for a 2nd MCU.   The case for either has proved far from compelling - and the trail "doubles back upon itself - endlessly."

  • Good question, and a rather odd triggering pattern as well. The original question of multiple interrupt triggers does not appear to be resolved but rather ignored.

    I am reminded of a student out of their depth looking for a solution rather than insight that would lead to understanding.

    Robert
  • Yes. I have currently ignored the issue as i am unclear on how to solve it...
  • Desmond Ong51 said:
    I have currently ignored the issue as i am unclear on how to solve it...

    Such varies (somewhat) from "textbook" solution.    Why are TWO MCUs required?   (inquiring minds)

  • It is part of a project i am currently working on. One MCU is needed to generate and transmit 10 pulses into the hardware circuit, which will then be able to make use of the signals as ultrasound signals. A receiver will receive the ultrasound signal, which will generate a single pulse. The second MCU will then calculate the time of the start of the 10 pulses and the time of the received signal. Where it will convert the value into pixels to be generated into LCD.
    Sorry if i am not explaining it clearly.
  • Why can that not be done in a single micro?

    Robert