You need to log in to create posts and topics.

[AVR (& others MCUs ?)] buggy Clock Out

Hello,

Some MCUs have an option to output the clock on a pin. (In the UI that's the "Clock Out" option). But in simulation, it doesn't work. Well i'm lying a little bit : it works but it slows down the simulation realy realy hard, barely unusable.

The clock out is toggled each (simulated) picosecond. We only need a toogle each 1/2 of the frequency of the mcu.

in ./src/microsim/mcuintosc.cpp, we can add a line :

    31| void McuIntOsc::stamp()
   ...|
    42|            setPinMode( output );
--> 43|            m_psInst = m_mcu->psInst()/2;
    44|            Simulator::self()->addEvent( m_psInst, this );

 

Consequences for Clock In Pin : i guess that can impact to have MCUs controlled by an external clock (the event must be checked often) ; but i saw that feature is currently disabled : when activated on UI, the CLKI pin is disabled (blued).

Yes, I see. that variable is not initialized for AVRs.

Thanks, I will fix it.