PWM GENERATION OF 25nS - 70nS outputs


Closed Thread
Results 1 to 25 of 25
  1. #1
    Join Date
    Feb 2012
    Location
    PERTH AUSTRALIA
    Posts
    838

    Default PWM GENERATION OF 25nS - 70nS outputs

    Hi guys is it possable to generate PWM with output in 25ns - 70ns timing on 18F26k22 ?

  2. #2
    Join Date
    May 2013
    Location
    australia
    Posts
    2,386


    Did you find this post helpful? Yes | No

    Default Re: PWM GENERATION OF 25nS - 70nS outputs

    its not a question that can be answered unless you state the pwm period and the pwm resolution required along with fosc
    PWM Period = PRx+ 1  4 TOSC (TMRx Prescale Value
    Pulse Width = CCPRxL:CCPxCON<5:4> T OSC (TMRx Prescale Value)
    I cant get the duty cycle formula to paste into this properly , its in the data sheet

  3. #3
    Join Date
    Feb 2012
    Location
    PERTH AUSTRALIA
    Posts
    838


    Did you find this post helpful? Yes | No

    Default Re: PWM GENERATION OF 25nS - 70nS outputs

    hI RICHARD ,

    thinking 64mhz internal , with a 25ns - 70ns pulse , with a off time of about 30ns

    output drive a high speed Mosfet driver chip

  4. #4
    Join Date
    May 2013
    Location
    australia
    Posts
    2,386


    Did you find this post helpful? Yes | No

    Default Re: PWM GENERATION OF 25nS - 70nS outputs

    @64Mhz every clock cycle is 15.6 nS you could in theory have 2bit pwm
    70nS+30nS /15.6=5

  5. #5
    Join Date
    Feb 2012
    Location
    PERTH AUSTRALIA
    Posts
    838


    Did you find this post helpful? Yes | No

    Default Re: PWM GENERATION OF 25nS - 70nS outputs

    mmm have you ever tried to get a pwm at such a speed and it work reliably richard ?

  6. #6
    Join Date
    May 2013
    Location
    australia
    Posts
    2,386


    Did you find this post helpful? Yes | No

    Default Re: PWM GENERATION OF 25nS - 70nS outputs

    it even tricky on a 800mhz raspberry pi
    http://www.raspberrypi.org/forums/vi...p?f=72&t=67741
    maybe
    MAX9471/MAX9472 clock generator

  7. #7
    Join Date
    Sep 2009
    Posts
    737


    Did you find this post helpful? Yes | No

    Default Re: PWM GENERATION OF 25nS - 70nS outputs

    That is more RF circuitry than digital...
    To get square wave at that speed you are talking about frequency components of tens of MHz, at least... You must use transmission lines, matched source and load to get it working.
    And that isn't PWM because you have fixed off time. So it's variable frequency with constant off time. You can check out constant on time DC/DC for ideas, just invert output.
    If I was doing that, I'll try create something like NE555 with LTC1394, fixed OFF time, and adjustable current source for charging on time capacitor...
    You can find some ideas in Linear AN94 for delay circuit.
    So use pic just to adjust charging current.
    EDIT:
    Just replace R1 with variable constant current
    http://www.electronics-tutorials.ws/waveforms/tim47.gif
    And build NE555 on steroids...
    Then ON time depending linearly on C and current. Off depending on R2 and C.
    Last edited by pedja089; - 16th October 2014 at 10:13.

  8. #8
    Join Date
    Feb 2012
    Location
    PERTH AUSTRALIA
    Posts
    838


    Did you find this post helpful? Yes | No

    Default Re: PWM GENERATION OF 25nS - 70nS outputs

    yes i have done a 555 at 100ns , and used the inverter and resister / cap arrangement to produce a 30ns time , with a about 200ns space between , other way i just use a powered xtl with buffer and programaable counter for speed changes in multipuls for the base xtl , but its not about how to make the pulse from other parts

    i have used the 64mhz clockref out pin from these chips though an external buffer to clean up the waveform but i not sure if i can use that approch as an input for the hpwm and its control ?? and still get it to work

  9. #9
    Join Date
    May 2004
    Location
    NW France
    Posts
    3,614


    Did you find this post helpful? Yes | No

    Default Re: PWM GENERATION OF 25nS - 70nS outputs

    Quote Originally Posted by longpole001 View Post
    yes i have done a 555 at 100ns ,
    With a datasheet stating 3 MHz as a max frequ ??? ... and moreover with rise time OR fall time @ 100 ns ... ???

    Hum, hum ...

    Alain
    ************************************************** ***********************
    Why insist on using 32 Bits when you're not even able to deal with the first 8 ones ??? ehhhhhh ...
    ************************************************** ***********************
    IF there is the word "Problem" in your question ...
    certainly the answer is " RTFM " or " RTFDataSheet " !!!
    *****************************************

  10. #10
    Join Date
    Feb 2012
    Location
    PERTH AUSTRALIA
    Posts
    838


    Did you find this post helpful? Yes | No

    Default Re: PWM GENERATION OF 25nS - 70nS outputs

    it was to trigger a laser pulse at 30 ns , and am looking at how i can do this from pic

  11. #11
    Join Date
    May 2013
    Location
    australia
    Posts
    2,386


    Did you find this post helpful? Yes | No

    Default Re: PWM GENERATION OF 25nS - 70nS outputs

    @64 MHz 1 clock = 15.6 ns , 1 instruction 62.4 ns . its not going to fly

  12. #12
    Join Date
    Feb 2012
    Location
    PERTH AUSTRALIA
    Posts
    838


    Did you find this post helpful? Yes | No

    Default Re: PWM GENERATION OF 25nS - 70nS outputs

    http://www.jensign.com/opto/ledlaserdrivers/index.html

    using the hand drawn image - as test for laser driver

  13. #13
    Join Date
    Feb 2012
    Location
    PERTH AUSTRALIA
    Posts
    838


    Did you find this post helpful? Yes | No

    Default Re: PWM GENERATION OF 25nS - 70nS outputs

    ok thanks richard

  14. #14
    Join Date
    Oct 2005
    Location
    Sweden
    Posts
    3,520


    Did you find this post helpful? Yes | No

    Default Re: PWM GENERATION OF 25nS - 70nS outputs

    Hmmm, actually, in PWM mode the CCP module is run from TMR2 which is concatenated with the two bits from the internal clock divider (which is where the "extra" bits of resolution comes from) so each "dutycycle bit" represents one TOsc - not four. From the 18F25K22 datasheet;
    PulseWidth = CCPRxL : CCPxCON<5:4> * TOsc * TMRxPrescaler value
    So with a 64MHz oscillator it should be possible to generate 15.625ns pulses using the CCP module.

    /Henrik.

  15. #15
    Join Date
    Feb 2012
    Location
    PERTH AUSTRALIA
    Posts
    838


    Did you find this post helpful? Yes | No

    Default Re: PWM GENERATION OF 25nS - 70nS outputs

    any code worth putting into the 18f67k22 i have on hand hendrick , i am assuming the simple commands wont cut it and the registers need to be setup to make use of it ?
    Code:
     define HPWM4_TIMER 2       ' HPWM4 TO USE TIMER 2 
    
     hpwm 4 ,xx ,xxx   'CPP4  Wduty , freq

  16. #16
    Join Date
    May 2013
    Location
    australia
    Posts
    2,386


    Did you find this post helpful? Yes | No

    Default Re: PWM GENERATION OF 25nS - 70nS outputs

    as I stated in post 4 for the range of pulses you specified the pwm resolution is very limited
    0b000 = 0ns
    0b001=15.6ns
    0b010=31.2 ns
    0b011=46.8 ns
    0b100=62.4 ns
    0b101= over range

    and as pedja089 stated a fixed 30ns deadtime means hpwm will not cut it / the period reg will need to be changed with every change in pulse width to maintain the dead time

  17. #17
    Join Date
    Feb 2012
    Location
    PERTH AUSTRALIA
    Posts
    838


    Did you find this post helpful? Yes | No

    Default Re: PWM GENERATION OF 25nS - 70nS outputs

    ok ill give it try and see ,

  18. #18
    Join Date
    May 2013
    Location
    australia
    Posts
    2,386


    Did you find this post helpful? Yes | No

    Default Re: PWM GENERATION OF 25nS - 70nS outputs

    pulsewidth var byte ; 0 -5 max is 5

    ccp1con=12; pwm mode active high

    pr2= pulsewidth+2
    ccpr1l=pulsewidth.2
    ccp1con= 12+ ((pulsewidth&3)<<4) ;low bits and set the pwm


    if you change the pulsewidth you must change pr2 and ccpr1l also
    don't expect the output to propagate far without severe deformation
    note that 74series gates have propagation delays of 90ns and 20ns rise/fall times ,74f is better at 8 and 3 . ecl would be better still


    ps needless to say the tris bit for the output must be cleared

    you will need a good cro to measure this 200mhz+ to get a good look
    Last edited by richard; - 18th October 2014 at 01:14. Reason: ps

  19. #19
    Join Date
    Feb 2012
    Location
    PERTH AUSTRALIA
    Posts
    838


    Did you find this post helpful? Yes | No

    Default Re: PWM GENERATION OF 25nS - 70nS outputs

    ok thanks richard , i have 74f's on hand , and 200mhz cro

  20. #20
    Join Date
    Feb 2012
    Location
    PERTH AUSTRALIA
    Posts
    838


    Did you find this post helpful? Yes | No

    Default Re: PWM GENERATION OF 25nS - 70nS outputs

    has anyone used a standalone PWM chip interfaced back to a pic for this , i know the dsPIC33F support a high speed PWM unit , but that not any good when using PBP

  21. #21
    Join Date
    May 2005
    Location
    Rockford IL
    Posts
    5


    Did you find this post helpful? Yes | No

    Default Re: PWM GENERATION OF 25nS - 70nS outputs

    Have you looked at the 16F1786, it has a 16bit PWM that can run at 64MHz
    Marv

  22. #22
    Join Date
    Oct 2005
    Location
    Sweden
    Posts
    3,520


    Did you find this post helpful? Yes | No

    Default Re: PWM GENERATION OF 25nS - 70nS outputs

    Now that is one cool chip.
    16bit PWM with a boatload of modes and complementary outputs, 12bit ADC with differential inputs, 8bit DAC, 2 opamps, 4 comparators + the all the usuall stuff - and IOC on all pins, individual pullups.
    As far as I can see though, the max operating frequency is 32MHz.

    I'll make sure to include a couple in my next Digikey order.

    Thanks Marv!

  23. #23
    Join Date
    Feb 2012
    Location
    PERTH AUSTRALIA
    Posts
    838


    Did you find this post helpful? Yes | No

    Default Re: PWM GENERATION OF 25nS - 70nS outputs

    yes its 32mhz from what i can see.

  24. #24
    Join Date
    May 2005
    Location
    Rockford IL
    Posts
    5


    Did you find this post helpful? Yes | No

    Default Re: PWM GENERATION OF 25nS - 70nS outputs

    Max operating frequency is 32MHz, but the PWM can operate at 64MHz.

    From the data sheet:

    24.2.5 PSMC TIME BASE CLOCK
    SOURCES
    There are three clock sources available to the module:
    • Internal 64 MHz clock
    • Fosc system clock
    • External clock input pin
    Marv

  25. #25
    Join Date
    Jan 2005
    Location
    Montreal, Quebec, Canada
    Posts
    2,597


    Did you find this post helpful? Yes | No

    Default Re: PWM GENERATION OF 25nS - 70nS outputs

    Quote Originally Posted by HenrikOlsson View Post
    Now that is one cool chip.
    16bit PWM with a boatload of modes and complementary outputs, 12bit ADC with differential inputs, 8bit DAC, 2 opamps, 4 comparators + the all the usuall stuff - and IOC on all pins, individual pullups.
    As far as I can see though, the max operating frequency is 32MHz.

    I'll make sure to include a couple in my next Digikey order.

    Thanks Marv!
    Interesting.

    Am I right in believing that it is better to move towards 18F because 16F are an older generation and most likely to be retired "eventually"?

    Robert

Similar Threads

  1. Sinusoidal PWM generation Using PIC 18f4431
    By oswalam in forum mel PIC BASIC
    Replies: 3
    Last Post: - 23rd February 2013, 15:49
  2. 4 x PWM outputs
    By Scampy in forum mel PIC BASIC Pro
    Replies: 4
    Last Post: - 7th February 2012, 06:40
  3. Generation of PWM wave six - PIC18f4431
    By Salatiel_lobato in forum mel PIC BASIC Pro
    Replies: 3
    Last Post: - 25th March 2011, 19:37
  4. PWM generation with PIC16F628
    By Marin in forum mel PIC BASIC Pro
    Replies: 4
    Last Post: - 16th July 2010, 09:50
  5. sine pwm generation using pic16f72
    By kvrajasekar in forum mel PIC BASIC Pro
    Replies: 2
    Last Post: - 13th October 2008, 09:02

Members who have read this thread : 1

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