About the voltage drop, I can live with that up to 500 or even 600 mV.
The problem is the dissipation of the transistor if it has to pass 1.2 A 
with a drop of 3 V as VCE  (Voltage rail = 5 V, Vbase = VEmitter = 2 V).   
This is more than 3.5 W to dissipate.
Multiply this by 6 channels.....   

>From there, on the eevblog forum, we discuss the possibility to use a small 
fake-LM2596 (actual LM2576) switching module from chinese resellers, one 
per channel..
I could adjust them with the help of one DAC buffered by an OPA configured 
as Unity gain (all within the PIC).

Problems:
- There are not enough independant 10-bit DAC's (only 3) and OPA's (only 3) 
in the PIC16F1778 I use for 6 channels
- I am still struggling to understand exactly how to drive the ADJ (or 
Feedback) pin of the regulator....



This is off topic here, but if you got ideas, feel free to join the 
discussion on weblog 

(For the mails, strangely, I only receive a notification when *I* and only 
me post a subject to either list (jallist or jallib) )

Le vendredi 12 avril 2024 à 19:04:37 UTC+2, Rob CJ a écrit :

> Hi David,
>
> Strange that you are not notified. On Google Groups it says that you would 
> get an e-mail every time something happens.
>
> The PWM should work since I tested all your channels except for PWM12 
> since I do not have that PIC but the code is the same as PWM11.
>
> I am still in the process of cleaning up some code. Next to that I removed 
> the 16-bit code for PWM7, 8, 9, and 10  (I mention that in the 
> pwm_common.jal file) since they do not yet exist for 16-bit, only 10-bit. I 
> do that because I apply YAGNI (You Ain't Gonna Need It) and only add code 
> for which the hardware exists.
>
> I think I will test the other PWM channels this weekend and will then 
> upload the final version for PWM1..PWM12 but let me know if you got it 
> working.
>
> Last week I discovered something new. There are PICs with 10-bit PWM where 
> you can assign another timer to the PWM output than only timer 2 so that 
> each PWM (like the 16-bit version) can have a different frequency. Since 
> there is no request for that I will not create that now.
>
> About your project. If you use an emitter follower you will not be able to 
> create 5 Volt due to the voltage drop. You almost need to make some kind of 
> buck converter ...
>
> Good luck with your project.
>
> Kind regards,
>
> Rob
>
> ------------------------------
> *Van:* [email protected] <[email protected]> namens David VB <
> [email protected]>
> *Verzonden:* vrijdag 12 april 2024 18:44
>
> *Aan:* jallib <[email protected]>
> *Onderwerp:* Re: [jallib] PWM modules in PIC16F177* family
> Hi Rob,
>
> Thanks for your efforts !
> (No matter what, I cannot subsribe to the emails again.... and have to 
> check directly the list on the website....  that's why I didin't see your 
> messages before)
>
> This week-end, I hope to be able to experiment more with this project.
> I also openend a discussion on eevblog for a rather totally different 
> subject (but it's about the same project)
> You can see it here: 
> https://www.eevblog.com/forum/beginners/variable-voltage-with-high-current/
>
> In short, I have, from one PIC, to drive six channels that may use up the 
> 1.2 or 1.5 A (very worst case).
> I MUST have the voltage varying between around 2 V and around 5 V.    PWM 
> is allowaed to control, but the ouptut voltage must be somewhat clean
> And now I am struggling: ADC to control a switching regulator, or 
> (filtered) PWM to control a emitter-follower transisotr.....  
> Tough choice....
>
> A lot of experimentation foreseen this week-end....
>
> Kind regards,
>
> David
>
> Le samedi 6 avril 2024 à 19:55:46 UTC+2, Rob CJ a écrit :
>
> Hi David,
>
> I got it working. The nice thing about these 16-bit PWM's is that each has 
> its own timer register. This means that the frequency can be set for each 
> of these PWM's individually which is not the case for the 10-bit PICs that 
> all seem to use Timer2. For the 10-bit you can only change the duty cycle 
> individually.
>
> I still need to clean things up and check with other PICs what the names 
> of the PWM modules are.
>
> For example PWM5 seems to be a 10-bit PWM for the PIC16F18323 but is a 
> 16-bit PWM for the 16F1778. 
>
> In the attached zip-file I only did the 10-bit and 16-bit modifications 
> for  PWM5 and PWM6 and I only created the 16-bit PWM version for PWM11 and 
> PWM12 so that at least you can use it for your project.
>
> As said, I need to check other PICs to see for which modules there is 
> overlap in the names  for 10-bit and 16-bit.
>
> I could not test PWM12 since my 16F1778 does not have it but I assume it 
> works.
>
> Let me know if it works for you too.
>
> Thanks
>
> Kind regards,
>
> Rob
>
>
> ------------------------------
> *Van:* [email protected] <[email protected]> namens Rob CJ <
> [email protected]>
> *Verzonden:* zaterdag 6 april 2024 10:40
>
> *Aan:* [email protected] <[email protected]>
> *Onderwerp:* Re: [jallib] PWM modules in PIC16F177* family
>  
> Hi David,
>
> Update. I did a test but it does not yet work for the 16-bit PWM's. I am 
> in the process of getting it working.
>
> Will give you an update as soon as I have more info.
>
> Kind regards,
>
> Rob
> ------------------------------
> *Van:* [email protected] <[email protected]> namens Rob CJ <
> [email protected]>
> *Verzonden:* vrijdag 5 april 2024 19:49
> *Aan:* [email protected] <[email protected]>
> *Onderwerp:* Re: [jallib] PWM modules in PIC16F177* family
>  
> Hi David,
>  
> I did a quick program change. 
>
> I just extended the existing 6 standard pwm's to 12 and all compiles. In 
> the sample program I am using pwm 3, 4, 5, 6, 9 and 11 since that is what 
> the PIC16F1778 has on board so you may have changed the number for your PIC 
> (that's why I made it up to 12).
>
> Did not test it yet but you can give it a try. I attached a zip-file but 
> not sure if it is blocked or not.
>
> I will see if it works this weekend.
>
> If the zipfile does not work I can send it via wetransfer.
>
> Kind regards,
>
> Rob
>
>
>
> ------------------------------
> *Van:* [email protected] <[email protected]> namens Rob CJ <
> [email protected]>
> *Verzonden:* vrijdag 5 april 2024 18:51
> *Aan:* [email protected] <[email protected]>
> *Onderwerp:* Re: [jallib] PWM modules in PIC16F177* family
>  
> Hi David,
>
> When I took over the device file generation scripts of Rob Hamerling I 
> also got all his - hundreds - of PIC samples and  because of that I do have 
> a PIC16F1778 which is of the same family and has 6 PWM's (three 10-bit and 
> three 16-bit) so I could give it a try if I can extend the current PWM 
> library with the 16-bit addition providing the same basic functionality.
>
> Not sure how long it will take but will start this weekend.
>
> Kind regards,
>
> Rob
>
>
> ------------------------------
> *Van:* [email protected] <[email protected]> namens David VB <
> [email protected]>
> *Verzonden:* vrijdag 5 april 2024 15:49
> *Aan:* jallib <[email protected]>
> *Onderwerp:* Re: [jallib] PWM modules in PIC16F177* family
>  
> To be honest, in my application, I need 6 PWM signals.
> Since they must be equivalent to one another, I will use some 16-bits 
> modules but without those new features, and with a duty cycle defined with 
> only the 10 MSB
>
> So, as far as I am concerned, there is no need for a specific 16-bit PWM 
> library *now*, but it would be a nice addition to the lib, just to keep 
> its attractiveness in the future and avoid a technical debt when more and 
> more PIC's will implement these new modules.  
>
> (The same goes for the ADCC module, the new CLB module)
>
> I cannot commit to write a specific library since I can never be sure to 
> be ok with all of the rules of the style guide, not to be extensive in the 
> funcitonnalities written, but I can offer to send here some libraries to 
> serve as a starting point, if someone can review and amend them as needed.
>
> Kr,
>
> D.
>
> Le jeudi 4 avril 2024 à 19:12:22 UTC+2, Rob CJ a écrit :
>
> Hi David,
>
> In 2022 I added PWM5 and PWM6 like the previous pwm's.
>
> What is foreseen is what is requested 🙂 (and there is a need for it).
>
> So it can be straight forward to add the 10-bit PWM 9 and PWM 10 but not 
> sure if there is a need for it.
>
> For the 16-bit I think we need a complete new library, something like 
> pwm16_hardware.jal and add more features. That may take quite some time. 
>
> Do you - or does anybody else - have plans to use the 16-bit pwm with all 
> its nice features?
>
> Kind regards,
>
> Rob
>
>
>
>
>
> ------------------------------
> *Van:* [email protected] <[email protected]> namens David VB <
> [email protected]>
> *Verzonden:* woensdag 3 april 2024 23:14
> *Aan:* jallib <[email protected]>
> *Onderwerp:* [jallib] PWM modules in PIC16F177* family
>  
> Hi there,
>
> It appears that the PIC16F177* family have PWM modules named up to PWM12, 
> which is not foreseen in Jallib
>
> Example: PIC16F1777 or 1779 have:
> PWM3, PWM4, PWM9, PWM10 : 10 bits PWM modules
> PWM5, PWM6, PWM11, PWM12 : 16 bits PWM modules (with more functionnalities 
> as 10-bit modules, such as four offset modes, and different operation modes)
>
> Is there anything foreseen for those in Jallib ?
>
> Kind regards,
>
> David
>
>
> --
> You received this message because you are subscribed to the Google Groups 
> "jallib" group.
> To unsubscribe from this group and stop receiving emails from it, send an 
> email to [email protected].
> To view this discussion on the web visit 
> https://groups.google.com/d/msgid/jallib/ab0fbea9-025c-49bf-b37f-18159885fa2fn%40googlegroups.com
>  
> <https://groups.google.com/d/msgid/jallib/ab0fbea9-025c-49bf-b37f-18159885fa2fn%40googlegroups.com?utm_medium=email&utm_source=footer>
> .
>
> --
> You received this message because you are subscribed to the Google Groups 
> "jallib" group.
> To unsubscribe from this group and stop receiving emails from it, send an 
> email to [email protected].
> To view this discussion on the web visit 
> https://groups.google.com/d/msgid/jallib/0a1fcd7f-71a5-4350-be8f-8c4f19d17d5an%40googlegroups.com
>  
> <https://groups.google.com/d/msgid/jallib/0a1fcd7f-71a5-4350-be8f-8c4f19d17d5an%40googlegroups.com?utm_medium=email&utm_source=footer>
> .
> --
> You received this message because you are subscribed to the Google Groups 
> "jallib" group.
> To unsubscribe from this group and stop receiving emails from it, send an 
> email to [email protected].
> To view this discussion on the web visit 
> https://groups.google.com/d/msgid/jallib/GVXP195MB1637AAA978040122D51160CBE6032%40GVXP195MB1637.EURP195.PROD.OUTLOOK.COM
>  
> <https://groups.google.com/d/msgid/jallib/GVXP195MB1637AAA978040122D51160CBE6032%40GVXP195MB1637.EURP195.PROD.OUTLOOK.COM?utm_medium=email&utm_source=footer>
> .
> --
> You received this message because you are subscribed to the Google Groups 
> "jallib" group.
> To unsubscribe from this group and stop receiving emails from it, send an 
> email to [email protected].
> To view this discussion on the web visit 
> https://groups.google.com/d/msgid/jallib/GVXP195MB163782D393B2E28BE5F78E2AE6032%40GVXP195MB1637.EURP195.PROD.OUTLOOK.COM
>  
> <https://groups.google.com/d/msgid/jallib/GVXP195MB163782D393B2E28BE5F78E2AE6032%40GVXP195MB1637.EURP195.PROD.OUTLOOK.COM?utm_medium=email&utm_source=footer>
> .
> --
> You received this message because you are subscribed to the Google Groups 
> "jallib" group.
> To unsubscribe from this group and stop receiving emails from it, send an 
> email to [email protected].
> To view this discussion on the web visit 
> https://groups.google.com/d/msgid/jallib/GVXP195MB1637BD28336238E909950AC9E6022%40GVXP195MB1637.EURP195.PROD.OUTLOOK.COM
>  
> <https://groups.google.com/d/msgid/jallib/GVXP195MB1637BD28336238E909950AC9E6022%40GVXP195MB1637.EURP195.PROD.OUTLOOK.COM?utm_medium=email&utm_source=footer>
> .
>
> -- 
> You received this message because you are subscribed to the Google Groups 
> "jallib" group.
> To unsubscribe from this group and stop receiving emails from it, send an 
> email to [email protected].
> To view this discussion on the web visit 
> https://groups.google.com/d/msgid/jallib/b04a5ad9-3311-411c-8c96-605656d5615fn%40googlegroups.com
>  
> <https://groups.google.com/d/msgid/jallib/b04a5ad9-3311-411c-8c96-605656d5615fn%40googlegroups.com?utm_medium=email&utm_source=footer>
> .
>

-- 
You received this message because you are subscribed to the Google Groups 
"jallib" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/jallib/6cc5e75b-b988-4162-8002-0c8407bb894dn%40googlegroups.com.

Reply via email to