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.

MSP430FR6989: Generating 2us pulse signal for SINGLE-WIRE communication protocol

Part Number: MSP430FR6989

Hi Everyone,

I am referring to this single-wire interface solution posted on TI-website::  http://www.ti.com/lit/an/slaa768/slaa768.pdf

The above solution is based on MSP430FR2XXX devices.

The issue I have is the slave-device communication with MSP430FR6989 has LOGIC-1 pulse width of 2uS and LOGIC-0 pulse-width of 10uS. Generating a pulse-width of 2us is the challenge here.

I have tried GPIO bit-banging and the pulse widths I am seeing is 3.5uS.

Is there a way I can generate the pulse width of 2uS using the bit-banging and/or using TIMERS?

Would really appreciate your feedback and support.

  • I'm not familiar with SDQ, but it looks superficially like a number of other one-wire protocols.

    My first thought: Most of these protocols are not that picky; 3.5us instead of 2.0us is probably fine. I'm pretty sure the sample_host isn't getting exactly the timings they claim, since their numbers don't appear to take into account the bit-manipulation instructions in between. I.e.: You may be OK now.

    Also, their code seems to claim that a 1 is 6us (rather than 2us), and a 0 is 60us (with a 10us pause afterward).

    To answer your question: It would be possible to generate a 2us pulse using a timer -- just set CCRx=(2-1) and use OUTMOD=7 (Reset/set), but you'll also need to set TA0R (e.g.) to CCR0-2 and start it. There are enough setup steps that those by themselves will throw your timing off.

    I would be tempted to use an SPI at 500kHz (only connect MOSI) with UC7BIT: Each SDQ bit is 70us, or 5 bytes.

    To send a 1, send a byte with 6/2=3 high order 0s, followed by 1s, i.e. 0x0F (7-bit bytes, remember). Then send four all-1s bytes (0x7F).

    A 0-bit would be four bytes of 0s followed by 0x1F (five 1s = 10us).

    You'll want to keep the SPI busy (no pauses), but that's not too hard; using DMA would guarantee this.
  • Hi,

    Why you need 2us such high speed? As far as I know, the 1-wire protocol is 60us for 1 bit read/write. What's your slave device? Could you share the datasheet with me?

    Best Regards,

    If my post helped solve your issue, please click on the  VERIFY ANSWER    button. 

    Winter,

    Search E2E! Your questions may already be answered! 

  • Hi Sanjeev,

    I have worked with one-wire before without any problems. You should be able to easily get that pulse width. The MCU is capable of 16MHz frequency, which means you should be able to have pulse width as low as ~60ns .

    What is the frequency you are running the MCU at?

**Attention** This is a public forum