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.

Using DIVSLCK (PQ4) as clock source for other IC

Hello all.

I'm using the EK-1294 eval kit, and i read on the datasheet that it is possible to use the pin PQ4 as clock source (in my case the purpose is to clock a motion controller).

Does anyone used this feature?

I know that this isn't synchronized with the clock that powers the main mcu, but is there any other limitations that one should be aware of when using this mode?

Appreciate your insights on this.

Kind Regards

Nuno Lopes

  • Hi Nuno, (portuguese name? :P)

    You are talking about the launchpad right?

    Unless i am not aware the Tiva doesn't have a output for the CLK. Can i ask why PQ4 of all the pins the Tiva has?

    Oh there is something like that. Tivaware in the System Control API supports it. It's 

    void
    SysCtlClockOutConfig(uint32_t ui32Config,
    uint32_t ui32Div)

    The first parameter is just to enable or disable (SYSCTL_CLKOUT_EN or SYSCTL_CLKOUT_DIS)

    you make a logical or with the folowing to select the source:

    SYSCTL_CLKOUT_SYSCLK - use the current system clock as the source (default).
    SYSCTL_CLKOUT_PIOSC - use the PIOSC as the source.
    SYSCTL_CLKOUT_MOSC - use the MOSC as the source.

    The second parameter is to chose the division from 1-256

    You can use a PWM output with any of the timers or PWM module with half the main CLK frequency though.

    Now for problems, i don't see any noted in the datasheet. It says it's to work as a source clk for other devices. It isn't synchronized but you should not need that, when communicating with other devices the communication protocol should have it's own synchronization method.

  • Luis Afonso said:
    can use a PWM output with any of the timers or PWM module with half the main CLK frequency

    Indeed you can employ the Timer's PWM Mode - and output beyond (more than) one-half of the System Clock.  (or far less than that - and thus you gain great frequency (and duty cycle, too) control.)

    As the Timer runs directly from System Clock - depending upon your divide ratio - you may be in "near" synchronization, too.

  • Hi cb1,

    PWM with a frequency beyhond 1/2 of the System Clock? Is it something to do with the prescaler or any other function i am unaware? 

    For synchronization of 2 or more devices it would be better for them to have the same source clock input (external clk for both), and that would still be just near synchronization, i think. Haven't gotten much into something like dual core 

  • Hi Luis,

    I'm dead wrong here - glad you corrected.

    There are certain ARM MCUs which allow the main system clock to operate @ less than full-speed - but enable select peripherals to (still) dial in (a higher) maximum speed.  And - as poster suggests here - that hi-speed ability is confined to "special pin(s)."

    I don't believe that's the case here though - so beg the court for mercy - plead (temporary, one hopes) insanity...

  • Hi,

    One possible unwanted effect would be elevated EMC for some configurations. We had once such problem, the prototype failed international approval, micro had clock output...

    Petrei

  • Hello Nuno

    Please do look at the latest errata on TM4C129 SYSCTL#18 for limitations on the DIVSCLK

    Other than that, the forum has better inputs.

    Regards

    Amit

  • Hi.

    @Luis: Indeed i am Portuguese! ;)

    The two "slaves" that i need to clock, they can operate at 16MHz or 32MHz.
    Depending on the selected frequency they then can drive stepper motors at rates of 1MHz or 2 Mhz respectively.

    I think that the step rate of 1MHz is more than enough, so if the pin was able to work with 16MHz it's fine.

    The reason to choose this, it's only to save placing another crystal on the board, i know it doesn't add much cost, but still...

    Or a timer would be better suited for this?

    Petrei, do you think that 16Mhz can cause high EMC?

    Thank's all for the comments

    Regards