9 years, 7 months ago.

Use all PWMout of LPC1549 ?

Hello,

during some simple tests with the LPC1549, there might be a problem with the MBED pwmout_api.c in the context of initialize the SCT.

If more than 4 PWMout are initialized the controller hangs and nothing more happens. Although the LPC1549 has up to 26 PWM Outputs in the 64pin version, i suppose that with each initialization of one PWM Channel/Pin one SCTx is blocked.

The question is now, how can i configure all PWM Channels of this device, in order that there is no Ticker/Timer conflict? As far as i could analyze the api, ony the match0 and match1-register are used for PWM. In My case i will use SCT0 with all 7 pwm match-registers.

Best regards Julien

1 Answer

9 years, 7 months ago.

The original mbed lpc1768 hardware supported only one timer for a maximum of 4 PWM outputs. The result is that all PWMs have the same period, but can have a different pulsewidth. The mbed lib was therefore implemented in this way. Note that this lib also does not use all features of the PWM hardware. You could for example also generate two non-overlapping PWMs to drive a transistor or FET output for a switched mode powersupply. When I did some work on the LPC812 PWM and on the LPC824 I noticed that the SCT is intended for PWM generation. The LPC81x has only one SCT and 4 Outputs, the LPC82x has one SCT and 6 Outputs. The PWM lib has the same behaviour as for the LPC1768. That is all PWMs have the same period. The LPC1549 on the other hand has 4 SCTs and 16 Outputs. The current lib supports 4 outputs but uses a separate SCT for each of those. That should give you the possibility to have 4 outputs with different periods. Obviously the hardware on the LPC1549 has more features that are currently not available through the pwmout_api. You can make use of those features by writing your own lib, possibly using the the mbed source code as example. Details are found in the datasheet. Preferably this new lib development should be done while staying compatible with the original API.

The ticker/timer is implemented separately from the SCTs. On the LPC8xx the MRT is used for the ticker, on the LPC1549 the RIT provides the ticker. This should not give you any conflicts.

Thanks for your comment. After a detailed view in the mbed lib, i wrote a new lib for the SCT Timer. Now everything works fine an is compatible with rest of the mbed lib.

posted by Julien Mintenbeck 10 Jun 2015