Looking for programable low freq PWM chip

Discussion in 'General Electronics Chat' started by Duxthe1, Jul 8, 2016.

  1. Duxthe1

    Thread Starter New Member

    Sep 27, 2008
    9
    0
    I'm looking for a chip that can output a low freq, ~10 hz, pwm signal that I can control with a microcontroller via serial or similar. I've tried to search but "PWM" is a keyword that's too common to be useful. Its a control signal only so current handling isn't an issue. Prefer thru hole but not opposed to SMT if it can do what I need. I'm sure a part like this exists but I don't know how to find it. Any help appreciated.
     
  2. Lestraveled

    Well-Known Member

    May 19, 2014
    1,957
    1,215
    Why don't you use your microcontroller to generate the PWM signal? That is a very easy task.
     
  3. Duxthe1

    Thread Starter New Member

    Sep 27, 2008
    9
    0
    My microcontroller will have to bit bang such a low freq PWM. I'd prefer it monitor the inputs and do the calculations and only have to serial out a byte (or so) to a dedicated PWM chip which will always need to output a signal, even for "off".
     
  4. GopherT

    AAC Fanatic!

    Nov 23, 2012
    6,015
    3,789
    What microcontroller frequency do you need? If you can live with 100kHz Microcontroller speed, a 1:16 prescaler setting will allow 10Hz - assuming a PIC or a chip with similar abilities.
     
    Last edited: Jul 9, 2016
  5. Sensacell

    Well-Known Member

    Jun 19, 2012
    1,128
    266
    This chip will not exist, there is no market need for such a thing- people make chips to make money.
    Do it in software, as suggested. If your PWM frequency is only 10 Hz, the timing jitter resulting from the MCU doing other tasks could be insignificant, if you code it correctly.
     
    atferrari likes this.
  6. benta

    Member

    Dec 7, 2015
    101
    24
    The CDP68HC68W1 will do what you want, but it's a very old part and may not be available any more.

    Benta.
     
  7. atferrari

    AAC Fanatic!

    Jan 6, 2004
    2,648
    762
    How precise those 10 Hz have to be?

    Are you sure you cannot select a micro with a built in PWM peripheral?
     
  8. dannyf

    Well-Known Member

    Sep 13, 2015
    1,782
    360
    There are a few pwm chips, from NXP, ti, or WS. But they don't go down to that low of a frequency.

    A more realistic solution is to code a mcu as a dedicated pwm controller. Assuming that you aren't looking for super high resokytuin, 10hz is doable even for a slow MCU.
     
    absf likes this.
  9. jpanhalt

    AAC Fanatic!

    Jan 18, 2008
    5,685
    900
    I favor the microcontroller approach that has been mentioned, since you want to control the PWM with a serial link. You can run many chips at 32kHz and lower. If you take a chip with built in PWM (e.g., 12F1840), you will have built in serial (MSSP and EUSART) and PWM functions. Just use a watch crystal for your system clock. You can go even go slower. At 32.768 kHz , Tcy will be 8192 Hz (122 us) Your baud maximum rate will slower that 9600, but still usable.

    John
     
  10. dannyf

    Well-Known Member

    Sep 13, 2015
    1,782
    360
    To show how you could do it via a mcu, I repurposed this little piece of code I wrote (4-ch of pwm for motor speed controllers and 2-ch of pwm for leds) to deliver 9 channels of pwm (two of which are complimentary: RC0 / RC5, and RA2 / RA5). ~100ms period, 7+bits of resolution (can be higher). On a 1MIPS PIC, it takes less than 100KIPS to run the code (all in a isr).

    Here is the entirely of the main loop.

    Code (Text):
    1.  
    2. void main(void) {
    3.     mcu_init();                            //reset the mcu
    4.     //IO_OUT(LED_DDR, LED);
    5.     pwm1_init(TMR1PS_2x);               //initialize the pwm1 module
    6.     pwm1_setdc(_pwm_pr/10 * 1);           //set up duty cycle
    7.     pwm2_setdc(_pwm_pr/10 * 2);           //set up duty cycle
    8.     pwm3_setdc(_pwm_pr/10 * 3);           //set up duty cycle
    9.     pwm4_setdc(_pwm_pr/10 * 4);           //set up duty cycle
    10.     pwm5_setdc(_pwm_pr/10 * 5);           //set up duty cycle
    11.     pwm6_setdc(_pwm_pr/10 * 6);           //set up duty cycle
    12.     pwm7_setdc(_pwm_pr/10 * 7);           //set up duty cycle
    13.     pwm8_setdc(_pwm_pr/10 * 8);           //set up duty cycle
    14.     pwm9_setdc(_pwm_pr/10 * 9);           //set up duty cycle
    15.     ei();
    16.     while (1) {
    17.         //IO_FLP(LED_PORT, LED);
    18.     }
    19.     return;
    20. }
    21.  
    22.  
    16f pwm_sw.PNG
     
    absf likes this.
  11. Duxthe1

    Thread Starter New Member

    Sep 27, 2008
    9
    0
    Benta, I checked out the datasheet on that chip and it is exactly what I'm looking for. Thanks a million. There are literally a couple on Ebay right now from international sellers.

    I appreciate all of the replies, thank you guys. For this project its a better solution to serial the data into the chip and not worry about the PWM output again until the code requests a change in PWM.
     
  12. JWHassler

    Member

    Sep 25, 2013
    201
    33
    Out of curiosity, what is the application for such a low PWM frequency?
     
  13. ian field

    Distinguished Member

    Oct 27, 2012
    4,415
    783
    DDS is the alternative to using a PIC/AVR with PWM outputs.
     
  14. benta

    Member

    Dec 7, 2015
    101
    24
    Duxthe1, glad to help.
    When I read your post I was reminded of a similar project some 20 years ago, so the device popped into my mind, though it is not well known.

    Good luck with your project.

    Benta.
     
  15. Duxthe1

    Thread Starter New Member

    Sep 27, 2008
    9
    0
    It's just a control signal going to a motor speed controller.
     
  16. atferrari

    AAC Fanatic!

    Jan 6, 2004
    2,648
    762
    Maybe PIC 18F4431, designed precisely for motor control. All you need, and more.
     
  17. jpanhalt

    AAC Fanatic!

    Jan 18, 2008
    5,685
    900
    There are probably details in the datasheet for the CDP68HC68W1 chip that I missed, but two aspects stand out:
    1) With an expected PWM frequency of 10 Hz, the clock frequency (input) to the chip will be limited to 5100 Hz:
    upload_2016-7-10_5-48-8.png

    2) Moreover, the serial communication may be severely limited to about 50 baud:
    upload_2016-7-10_5-51-12.png

    Neither of those specifications provides an advantage over any of the MCU chips that have been mentioned. For example, a 12F1840 with a system clock of 170 kHz will allow 10-bit PWM resolution at 10 Hz. An estimate of the maximum baud rate for serial communication is 600 baud.

    There is often a reason that chips are obsoleted and become very expensive at secondary sources.

    John
     
  18. ian field

    Distinguished Member

    Oct 27, 2012
    4,415
    783
    A real simple route is to use an SMPSU control chip and drive the PWM control with an analogue level via a DAC.

    That on its own isn't programmable like the TS asked, but the DAC can be driven by an MPU or some simple "glue logic".

    The SMPSU chip has to be chosen carefully because many have UVLO - for example; the UC 384x family come in two UVLO ratings, the lowest of which is somewhere around 9V or so.
     
  19. benta

    Member

    Dec 7, 2015
    101
    24
    1: Generating a clock signal of 5100 Hz will probably speak straight to the hearts of the 555 fans on this site:

    2: This is not true. There is no relationship between the CLK signal (for the PWM) and the SCK signal for the serial interface. You can run the SPI at 1 MHz if you like with no consequences for the PWM. Please read the datasheet carefully.

    Benta.
     
    Last edited: Jul 10, 2016
  20. jpanhalt

    AAC Fanatic!

    Jan 18, 2008
    5,685
    900
    My apologies, I missed the SCK part in my brief read.

    John
     
Loading...