Four phase signal with 16F690

Discussion in 'Embedded Systems and Microcontrollers' started by cd.103a, Mar 28, 2007.

  1. cd.103a

    Thread Starter New Member

    Mar 28, 2007
    2
    0
    I need to make a four phase signal, I would like to be able to do this with a PIC like the 16F690.
    Frequency is app 40kHz. Duty cycle and frequency is important, I need the PIC to perform other tasks as well so i need the PWM block, I dont have bandwidth in the processor to bitbang this pattern.
    It is difficult to see if this operation is possible with this processor. If not any sugestions for a similar processor with this capabillity ?

    The four phases have 25% duty cycle, and should be 90dgr seperated,

    Illustration:
    --______--______--
    __--______--______
    ____--______--____
    ______--______--__

    /Casper
     
  2. Papabravo

    Expert

    Feb 24, 2006
    10,166
    1,797
    What you wish to do is not possible with the available hardware of the 16F690. Why not configure a PISO shift register to do the 4 phase clock gneration?
     
  3. cd.103a

    Thread Starter New Member

    Mar 28, 2007
    2
    0
    I need to limit the number of components on the board, one PIC plus a driver. The current solution uses a 555 and a shift register and some NAND gates to do the logic.
    /Casper
     
  4. kender

    Senior Member

    Jan 17, 2007
    263
    0
    You can do the 4 phase with a timer interrupt running (according to your timing diagram) at 120kHz. If your PIC is running at 40MHz, this gives you about 33 instructions per timer interrupt. Transitioning into and out of ISR will consume most of them (this somewhat depends on your C compiler, though). Although, this will not give PIC much time to do other things. IMHO, your best bet is to use external logic (possibly programmable, such as GAL).

    What are you going to do with these wave forms? Where do they go? May be there's room for some systemic cleverness.
     
  5. Papabravo

    Expert

    Feb 24, 2006
    10,166
    1,797
    I should have clarified my earlier response by saying that the ECCP hardware is not capable of performing this task by itself. You can certainly try using a single timer interrupt, but 33 instructions is not much time for doing the clock generation and some other useful function.
     
  6. kender

    Senior Member

    Jan 17, 2007
    263
    0
    As a side note, 68HC08 has a counter with multiple digital comparators that can toggle pins without calling the ISR. So, the task at hand is not entirely out of the realm of a lone microcontroller.

    Come to think of it. It could be useful for an original poster to mirror this question on the Microchips forum and on the CCS forum.
     
  7. Papabravo

    Expert

    Feb 24, 2006
    10,166
    1,797
    Absolutely. All the PIC would require is 4 CCP Modules. In fact the 80C196KC which Intel custom designed for Ford's EEC-4 electronic engine control unit had a content addressable memory which could control up to eight outputs. Scheduled events could be place anywhere in the CAM and it could be set up once and free run.
     
Loading...