Oscillator/Clockout


Closed Thread
Results 1 to 9 of 9

Hybrid View

  1. #1

    Question Oscillator/Clockout

    I need to drive a motor driver chip with a PIC and can't decide the best way to go. The driven chip needs its own oscillator (input pin) along with a strobe, clock, and data lines. Should I run the PIC with INTRC_OSC_CLKOUT, using the PIC clockout as the clock input to the chip? OR: Use two oscillators, one would drive the motor chips osc.pin and the other would drive the PIC and clock input of the chip. This would run in EC_OSC with the PIC. Looking for the better way, always. JS

  2. #2
    Join Date
    Feb 2005
    Location
    Kolkata-India
    Posts
    563


    Did you find this post helpful? Yes | No

    Default Which chip are you using ?

    Hi,

    It would be better to know the chip and comment.

    Regards

    Sougata

  3. #3
    Join Date
    Mar 2003
    Location
    Commerce Michigan USA
    Posts
    1,166


    Did you find this post helpful? Yes | No

    Default

    fowardbias, Yes you can use the oscillator from the pic as the master oscillator in your circuit if you use the external oscillator drive circuitry for the pic. However I would buffer the oscillator from the pic output pin as to not load the oscillator circuitry for the pic.

    Dave Purola,
    N8NTA

  4. #4


    Did you find this post helpful? Yes | No

    Default Osc.re

    The PIC is 16F628 driving The Allegro A3958SB H-Bridge. The serial input uses three lines for input: strobe, clock and data. The bit stream is 20 bits wide and doesn't fall into a structure (no defined baud rate or parity). Each of the bits along with a few other external pins defines what the chip does. Details of this is on their web site. I haven't got to the breadboard stage yet, only planning. Later J.S.

  5. #5
    Join Date
    Feb 2005
    Location
    Kolkata-India
    Posts
    563


    Did you find this post helpful? Yes | No

    Default As far the datasheet goes.

    Hi,

    The datasheet says that the oscillator input freq. range is between 2.9 and 6.1 MHz. So using the internal oscillator @ 4Mhz will give you a clock out at 1MHz.(Instruction cycle clock). You can use an external crystal oscillator @4MHz and buffer the oscout pin to feed into your allegro chip. Since the data is 20 bit MSB first, the possibility of Shiftout rules out. Keep the different controls in different bytes and use your own routine to dump the data. It should be easy in a for-next loop doing a clock toggle at around 100uS and dumping the databits. Since each instruction clock cycle at 4MHz takes 1uS it will be better to use a slower clock so that your overall timing are not effected by other tasks (like getting individual bits and dumping to the data line). Remember to start the operation with the Strobe line.

    Regards

    Sougata

  6. #6
    Join Date
    Mar 2003
    Location
    Commerce Michigan USA
    Posts
    1,166


    Did you find this post helpful? Yes | No

    Default

    fowardbias, I don't know what sougata is talking about, Yes you can just use the SEROUT command to shift out as many bits as you like. You just need to break it up into something usable such as 2 bytes and 4 bits or 1 16 bit word and 4 bits as long as the largest variable is no longer than 16 bits. I do it as such:
    SHIFTOUT UCN_DATA,UCN_CLK,MSBFIRST,[OUTPUTS(1)\4,OUTPUTS(0)\16]
    PULSOUT UCN_STB,PULSE 'STROBE UCN5832A DATA LATCH
    With this type of device the data is "clocked" in so it does not matter if there is a slight pause between the data bits.

    Dave Purola,
    N8NTA

Members who have read this thread : 0

You do not have permission to view the list of names.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts