Thanks gchart, I hadn’t figured these WOx parts.
I’m still not sure what’s needed to setup a simple PWM-output with all this waveform-output/n-Ramp/configuration stuff. But I took a deep breath and did some datasheet diving. I smiled when you wrote you study datasheets for the fun of it… this is a different beast than the 13A.
It seems for the 1616 there is a newer (2020) datasheet than the one you took the pictures from. I noticed the difference in the PortC, where they aren’t digital only (blue) any more but analog (green) instead.
Again, my goal atm is to figure out which pins to connect where on a PCB. For years now it was very straight forward with the 13A/25/85 and its 6 usable pins. Now we have a lot more options, although the multiplexer is less flexible than I initially thought.
So this is my take for now when it comes to the pins. I’d be very happy if errors get corrected and blanks get filled.
Timer/Counter D for PWM
I really like the idea of low power pwm-channels. 2 channels are sufficient for most drivers. 12-bit makes for 16 times the pwm resolution, 10-bit already quadruples it.
The 2 TCD channels WOA and WOB are wired to PA4 and PA5 (and could be mirrored to PC0 and PC1, but that doesn’t seem neccessary).
I found the (output-)compare-register CMPASET and CMPBSET, but can only assume that less than 12 bit are done with the counter prescaler CNTPRES and/or the synchronization prescaler SYNCPRES.
I have no idea what kind of ramp/slope waveform stuff we need.
Other T/C for PWM
Timer/Counter A with 3x 16-bit is wired to PB0, PB1 and PB2, 6x 8-bit would be PB0, PB1, PB2, PA3, PA4 and PA5.
Again, remapping does not seem neccessary (all 6 can only be remapped on a 24 pin MCU anyway).
Timer/Counter B only allows for 8-bit pwm (16-bit counter, but only 8-bit pwm according to datasheet). Still, I’m curious why Timer/Counter A is referred to as “TCA0” and Timer/Counter B as “TCBn”.
But it seems Timer/Counter A will fullfil most needs for pwm channels if the 12 bit or the 2 channels of Timer/Counter D are not enough.
ADC operation
In the past this is what we used for voltage monitoring and the off-time-capacitor.
It seems almost any pin can be configured as ADC input here if needed. PA1, PA2, PA6 and PA7 look preferable as they would not interfere with pwm-channels.
AUX LED (indicator LED) and
Switch pin
I need a heads up here from you guys:
The switch pin needs to recognize when pulled to ground (configured as input).
The aux leds are powered by configuring the pin as output and setting as high.
Is this (both) possible with all 17 usable pins (I dont count vcc, gnd and udpi) or are there any limits to certain pins?
At first glance, PC0, PC1, PC2 and PC3 would be my first choice.
Again, thanks a lot
HQ