• AVR Freaks

Hot!Selecting a MCU

Author
j0999
New Member
  • Total Posts : 2
  • Reward points : 0
  • Joined: 2018/07/19 11:31:56
  • Location: 0
  • Status: offline
2020/02/11 01:32:56 (permalink)
0

Selecting a MCU

Greetings to all.
I need help in selecting a MCU that can control 36 independent PWM outputs.
The use of the outputs is described below. 
Thank You
 
 
There are 2 cases :
 
CASE 1:
 
These are the list of 6 PWN signals of 12 V that are in use.
 
1) 100% i.e 12V equivalent
2) 75% i.e 9V equivalent
3) 50% i.e 6V equivalent
4) 41.66% i.e 5V equivalent
5) 33.3% i.e 4V equivalent
6) 25V% i.e 3V equivalent
 
There are 36 Outputs.
1) 1 output would only receive 3V to 5V equivalent PWN signa, which ever is called for
2) 1 Output would only receive 6V to 12V equivalent PWN signal, which ever is called for
3) 34 Outputs receive 100% or 33.3% PWM independently. First 100% for 100ms to turn on then 33.3% to remain ON.
 
 
 
CASE 2:
I can even work with 2 PWM signals
1) 100%
2) 33.3%
This will be used for 34 outputs. Outputs receive 100% or 33.3% PWM independently. First 100% for 100ms to turn on then 33.3% to remain ON.
 
Are any of the cases possible?
 
if code says turn ON output 1 : then 100% is given to 1 for 100 ms then it drops to 33% PWM. This will be continuously ON.
while it is on a code could ask output 2 to be ON: then 100% is given to output 2 for 100ms(while other output 1 at 33% isn't affected) after that only 33% is send to output 2.
 
likewise there are 34 outputs.
 
 
(optinal if possible) other 2 outputs can receive any of the below mentioned PWM
 
1) 100% i.e 12V equivalent
2) 75% i.e 9V equivalent
3) 50% i.e 6V equivalent
4) 41.66% i.e 5V equivalent
5) 33.3% i.e 4V equivalent
6) 25V% i.e 3V equivalent.
#1

8 Replies Related Threads

    maxruben
    Super Member
    • Total Posts : 3393
    • Reward points : 0
    • Joined: 2011/02/22 03:35:11
    • Location: Sweden
    • Status: offline
    Re: Selecting a MCU 2020/02/20 00:34:17 (permalink)
    5 (1)
    What frequency do you need?
    PWM can be done with bit banging on any output in software, from e.g. a timer interrupt.
     
    /Ruben
    #2
    al_bin
    Super Member
    • Total Posts : 201
    • Reward points : 0
    • Joined: 2011/02/11 06:28:47
    • Location: 0
    • Status: offline
    Re: Selecting a MCU 2020/02/20 12:49:28 (permalink)
    0
    Or 6 PWM and 36 remapable PPS outputs?
     
    Albert
    #3
    ric
    Super Member
    • Total Posts : 27716
    • Reward points : 0
    • Joined: 2003/11/07 12:41:26
    • Location: Australia, Melbourne
    • Status: online
    Re: Selecting a MCU 2020/02/20 14:18:57 (permalink)
    0
    al_bin
    Or 6 PWM and 36 remapable PPS outputs?

    Good suggestion, but make that "5 PWM and 36 remapable PPS outputs"
    You don't need PWM to generate 100%.
    Also, if one of the PWMs had complementary outputs, you could use it for both 25% and 75%.
     

    I also post at: PicForum
    Links to useful PIC information: http://picforum.ric323.co...opic.php?f=59&t=15
    NEW USERS: Posting images, links and code - workaround for restrictions.
    To get a useful answer, always state which PIC you are using!
    #4
    NorthGuy
    Super Member
    • Total Posts : 6185
    • Reward points : 0
    • Joined: 2014/02/23 14:23:23
    • Location: Northern Canada
    • Status: offline
    Re: Selecting a MCU 2020/02/20 14:28:06 (permalink)
    5 (1)
    It might be hard to find a PIC where every PWM could be PPs'ed on 36 different pins.
     
    If periods are 100 ms and the required accuracy is 1%, then bit-banging from 1 ms interrupt will produce as many independent PWMs as you have pins for.
    #5
    ric
    Super Member
    • Total Posts : 27716
    • Reward points : 0
    • Joined: 2003/11/07 12:41:26
    • Location: Australia, Melbourne
    • Status: online
    Re: Selecting a MCU 2020/02/20 14:44:44 (permalink)
    0
    NorthGuy
    It might be hard to find a PIC where every PWM could be PPs'ed on 36 different pins.

    Good point. I don't know what the most powerful chip can do.
     

    If periods are 100 ms and the required accuracy is 1%, then bit-banging from 1 ms interrupt will produce as many independent PWMs as you have pins for.

    You'd need some pretty heavy filtering on a period that long.
    A 0.1ms interrupt, or even faster, shouldn't be too hard to achieve.
     
    Actually, only a 12 step PWM is required to achieve all those duty cycles.
    They are just 3/12, 4/12, 5/12, 6/12, 9/12, and 12/12
    So the timer ISR only needs to be running at 12x the required period.
     
     
     

    I also post at: PicForum
    Links to useful PIC information: http://picforum.ric323.co...opic.php?f=59&t=15
    NEW USERS: Posting images, links and code - workaround for restrictions.
    To get a useful answer, always state which PIC you are using!
    #6
    al_bin
    Super Member
    • Total Posts : 201
    • Reward points : 0
    • Joined: 2011/02/11 06:28:47
    • Location: 0
    • Status: offline
    Re: Selecting a MCU 2020/02/20 23:38:23 (permalink)
    0
    ric
    Good suggestion, but make that "5 PWM and 36 remapable PPS outputs"
    You don't need PWM to generate 100%.
    Also, if one of the PWMs had complementary outputs, you could use it for both 25% and 75%.

    Good suggestion, but if one of the PWMs has dead times you coud use it for both 50% and  41.66%  ;-)
     
    NorthGuy
    It might be hard to find a PIC where every PWM could be PPs'ed on 36 different pins

    Good point especially for pic32 family.
    But all 100 pins PIC32 with PPS shoud be sufficient for OP cases.
     
    Albert
    #7
    NorthGuy
    Super Member
    • Total Posts : 6185
    • Reward points : 0
    • Joined: 2014/02/23 14:23:23
    • Location: Northern Canada
    • Status: offline
    Re: Selecting a MCU 2020/02/21 10:27:58 (permalink)
    5 (1)
    al_bin
    But all 100 pins PIC32 with PPS shoud be sufficient for OP cases.

     
    Most PIC32 have only limited PPS. They have groups, and the output of a PWM can only be mapped to the pins from the same group. And if one PWM is mappable to a certain group, it might be impossible to map any other PWM to it.
     
    IMHO, the best bet would be dsPIC33C series which have much better PPS.
     
    However, as ric observed, it's only 12 points OP needs, thus bit-banging on PIC16 (e.g. 64-pin PIC16F19197 series) would be much more economical.
     
    #8
    al_bin
    Super Member
    • Total Posts : 201
    • Reward points : 0
    • Joined: 2011/02/11 06:28:47
    • Location: 0
    • Status: offline
    Re: Selecting a MCU 2020/02/21 14:11:04 (permalink)
    0
    NorthGuy
    al_bin
    But all 100 pins PIC32 with PPS shoud be sufficient for OP cases.

     
    Most PIC32 have only limited PPS. They have groups, and the output of a PWM can only be mapped to the pins from the same group. And if one PWM is mappable to a certain group, it might be impossible to map any other PWM to it.
     
    IMHO, the best bet would be dsPIC33C series which have much better PPS.
     
    However, as ric observed, it's only 12 points OP needs, thus bit-banging on PIC16 (e.g. 64-pin PIC16F19197 series) would be much more economical.
     


    Where is the problem?
    Example:
    http://ww1.microchip.com/...N_Family_60001290F.pdf
    OP case 1:
    1. OC1 to RPD0
    2. OC2 to RPD1
    3.  OC3 (33%) to D2, G8, F4, D10, F1, B9, B10, C14, B5, C1, D14, G1, A14
         OC4 (33%) to D3, G7, F5, D11, F0, B1, E5, C13, B3, F3, C4, D15, G0, A15
         OC5 (33%) to D9,G6, B8, B15, D4, B0, E3, B7, B2, F12, D12, F8, C3, E9
         total 40 > 34 passible
     
    OP case 2 is trivial isn't it?
     
    Albert
    #9
    Jump to:
    © 2020 APG vNext Commercial Version 4.5