Hello Oliver,
Indeed, PIC18F27J13 could be a candidate. I overlooked this one too
quickly (I already ranted about the parametric search tool on the µchip
site :-{ )
I'll check for the other characteristics.
No internal OPAMP and internal VREF are a bit annoying, but if it's the
only missing parts, it's ok.
Anyway, what about a PIC that would be programmed as a I²C generator with
several independant channels, and I²C slave.
He would have nothing else to do than generating the signals.
Consider one channel:
- A register contains the value of its duty cycle (from 0 to 255)
- In the main loop, a 8-bit counter is incremented.
- At each increment, its value is compared to the duty cycle register,
and if needed, the corresponding output is toggled.
You could generate as many PWM signals as there are IOs available.
The I²C-slave interface would be handled by the MSSP module with interrupts
(yes, this could cause glitches in the PWM signals if the time needed to
process the I²C processes is greater than the time it takes to increment
the PWM counter by one, but if it is only to dim some LED's, I think I
could live with it)
The frequency could be adjusted by changing the oscillator frequency and/or
adding delays in the main loop when the main counter is incremented
Just for the sake of it, I think I will give it a try.....
Hoping I am not overlooking a major impediment
Thanks for your suggestion, Oliver (or Kiste ?)
Le mardi 20 juin 2023 à 20:43:01 UTC+2, Oliver Seitz a écrit :
> Hi!
>
> A software PWM library isn't easy. Without a timer, it blocks everything.
> With a timer, it's complicated and would only add a few channels. I've done
> software PWM for 120 LEDs independently with a 28 pin controller, but it
> couldn't do much more than that at 64MHz.
>
> Have you had a look at, say, PIC18F27J13? It has 3+7 independent ccp
> modules (with 3 TMR2-type timers).
>
> Greets,
> Kiste
>
> Am Dienstag, 20. Juni 2023 um 19:49:33 MESZ hat [email protected] <
> [email protected]> Folgendes geschrieben:
>
>
> Hi,
>
> I'm falling short of PWM outputs for a project.
> I need 6 independant outputs, and the only way to get them is to use a
> 64-pin 18fxxxx, which is a bit overkill for me, or use a second PIC, bond
> to the first (I²C or SPI) which is also overkill but could be acceptable in
> the absence of another "clean" solution.
>
> It will only be used for dimming LED's, and I don't need particular
> features like dead-band, half or full bridges, precise or stable
> frequency.....
>
> To my surprise, I didn't find a software PWM library in Jallib 1.8.....
> Or do I miss something ?
>
> Have a nice day
>
>
>
>
>
>
> --
> 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/923bd215-4855-49d9-b7e1-17e02482c219n%40googlegroups.com
>
> <https://groups.google.com/d/msgid/jallib/923bd215-4855-49d9-b7e1-17e02482c219n%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/9aad71fb-a1f2-47f3-8cc4-82a1110327c2n%40googlegroups.com.