Is there any hardware documentation on the PWM setup. The NS9360 says that PWM is available, but not how to set it up. I can’t even determine what the potential PWM frequency and resolution is.
Please help.
Is there any hardware documentation on the PWM setup. The NS9360 says that PWM is available, but not how to set it up. I can’t even determine what the potential PWM frequency and resolution is.
Please help.
See at page 124 and 125 of the NS9360_Hardware_reference.pdf. You have to configure the port in PWM mode (0xa). Then concatenate two timers, e.g. 0x8005 for timer4 control and 0x8035 for timer5 control.
This is the first PWM mode, which is nearly useless, because you can configure duty cycles of 1:1, 1:2, 1:3…, only (see the diagram in the datasheet. I’ve measured it with my scope, it is really as useless as described, compared to other PWM generators in other chips).
The second method described in the datasheet works with delay loops, which is not very accurate, unless you disable all interrupts (not a good idea, if you are running an OS on the chip) and write some sophisticated delay loops.
Thanks for the info. I have moved on to other problems. But to use the delay method, I figure that you could set the delay by writing new counter values while they are running??? Anyway, thanks again.