This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

MSP430F5239: How to generate specific code with the GPIO

Part Number: MSP430F5239

Hi Team,

I want to use one of the GPIO of MSP430F5239 to generate a signal as below. Can I use Timer with PWM output  to generate the code? Thanks. 

Best regards,

Penny

  • The +/- 1usec for tbit_OSS looks pretty tight. I would start with a UART or an SPI.

    Is tOSS_OFF important? What book did the table come from?
  • It might be possible to use a timer output with compare mode, and program the Set or Reset output mode for the respective next edge in the interrupt handler. This requires the CPU to run fast enough.

    Using SPI, as suggested by Bruce, is much simpler; just output something like 0010xxx0.

    If you really want to use a GPIO, you could also use the DMA controller, triggered by a timer, to write a series of bytes to some PxOUT.
  • Hi Penny,

    As Clemens said, this would be possible, assuming the CPU could execute everything fast enough. This could be affected by multiple factors, especially when dealing with such strict timing requirements, so, if you decide to use the timer and GPIO to do this, I would suggest that you try this out with a target board first to see if you are able to meet your timer requirements (with all the other code that you will need for your design).

    Using SPI or using the DMA to write a series of bytes to a GPIO would be the safest route, as you could be assured of timing requirements. Looking at the datasheets, the device should be able to handle your timing requirements, and using one of these methods (SPI or DMA transfer), would eliminate the reliance on the CPU being able to execute everything fast enough.

    Regards,
    Nathan

**Attention** This is a public forum