SENT protocol based sensor configuration with nrf boards

hey there, i have a project which uses  nrf9151 with a pressures sensor from BOSCH which uses SENT protocol to transfer data, my question is

1. Is it possible to configure the SENT protocol on the nrf9151
2. if yes, how am i gonna configure what should i use?

  • Hi,

    thank you for clearing it out,

    regarding your questions, the measuring unit is Tick and 1 tick Minimum is 3us and the Minimum pulse time can be 12 Ticks which is 36us.

  • That sounds very fast, so not sure this would work. It would be difficult to guarantee that you have access to the CPU every 3µs. What if you get any other interrupts, e.g. from the modem. Even without any other interrupts, I don't know if your handler will be able to finish within the 3µs (in case you get two 0x0 in a row).

    Best regards,

    Edvin

  • One way of slowing down the required interrupt time is to use Counter3 on the falling edge of the signal with CC registers set at 1, 2, 3, 4, 5, 6 counts such that each CC trip will trigger a 32-bit 16MHz timer capture. A single Timer4 could be used, but also using a second Timer5 provides more time to read out data. If using 2 timers the Counter3-CC0 TASK will TRIGGER both Timer4 and Timer5, only one of which will be running at any one time.

    A single timer might be adequate, since only one interrupt every 3 falling edges. Timer4 (and Timer5 if used) could be cleared automatically or not, might be useful to not. Assuming if the timer is stopped the CC capture is disabled, if not as well as modifying the SHORTS the PPI would need updating in the interrupt if using 2 timers.

    // SENT protocol
    // SENT tick ranges from 3us to about 90us, with clock-rate tolerances as high as +-25%. Each
    // nibble begins with a 5us logic low followed by a variable-width logic-high pulse
    //
    // A SENT message frame includes a sync signal followed by eight nibbles and an optional pause,
    // the latter  to make up fixed-length messages
    // A nibble ranges from 12 to 27 ticks (representing 0x0 to 0xF), optional Pause is 12-768 ticks
    //
    //             |--------Fast Channel Data--------|       Optional
    // Sync Status   DN1   DN2   DN3   DN4   DN5   DN6   CRC    PAUSE
    // ==== ====== ===== ===== ===== ===== ===== ===== ===== ========
    //  56  12-27  12-27 12-27 12-27 12-27 12-27 12-27 12-27 (12-768)  <== Tick range
    //   0      1      2     3     4     5     6     7     8      (9)  <== Falling Edge No.
    //
    // Using single timer - repeat capture 6 falling edges, read out every 3
    //  Counter3-CC0=1, CC1=2, CC2=3, CC3=4, CC4=5, CC5=6
    //  START Timer4
    //  START COUNTER3
    //  Single Message
    //  {
    //      Counter3-CC0 Event ==> capture Task Timer4-CC0 Sync    
    //      Counter3-CC1 Event ==> capture Task Timer4-CC1 Status  
    //      Counter3-CC2 Event ==> capture Task Timer4-CC2 DN1    Interrupt read out Timer4 CC0-CC2
    //      Counter3-CC3 Event ==> capture Task Timer4-CC3 DN2     
    //      Counter3-CC4 Event ==> capture Task Timer4-CC4 DN3
    //      Counter3-CC5 Event ==> capture Task Timer4-CC5 DN4    Interrupt read out Timer4 CC3-CC5
    //                   Event ==> SHORT CLEAR Task Counter3
    //      Counter3-CC0 Event ==> capture Task Timer4-CC0 DN5
    //      Counter3-CC1 Event ==> capture Task Timer4-CC1 DN6
    //      Counter3-CC2 Event ==> capture Task Timer4-CC2 CRC   
    //      Counter3-CC3 Event ==> capture Task Timer4-CC3 PAUSE  Interrupt read out Timer4 CC0-CC3
    //                   Event ==> SHORT CLEAR Task Counter3
    //  }
    //
    // Using two timers - repeat capture 6 falling edges, read out every 6
    //  Counter3-CC0=1, CC1=2, CC2=3, CC3=4, CC4=5, CC5=6
    //  (Counter3-CC5 Event SHORT CLEAR Task Counter3)
    //  START Timer4 and Timer5 together (use PPI event)
    //  START COUNTER3
    //  Single Message
    //  {
    //      Counter3-CC0 Event ==> capture Task Timer4-CC0                Sync
    //      Counter3-CC1 Event ==> capture Task Timer4-CC1                Status
    //      Counter3-CC2 Event ==> capture Task Timer4-CC2                DN1
    //      Counter3-CC3 Event ==> capture Task Timer4-CC3                DN2
    //      Counter3-CC4 Event ==> capture Task Timer4-CC4                DN3
    //      Counter3-CC5 Event ==> capture Task Timer4-CC5, STOP Timer4   DN4
    //                   Event ==> START Task Timer5
    //                   Event ==> Interrupt (Counter3-CC3 Event SHORT CLEAR Task Counter3)
    //      Counter3-CC0 Event ==> capture Task Timer5-CC0                DN5
    //      Counter3-CC1 Event ==> capture Task Timer5-CC1                DN6
    //      Counter3-CC2 Event ==> capture Task Timer5-CC2                CRC
    //      Counter3-CC3 Event ==> capture Task Timer5-CC3, STOP Timer5  PAUSE
    //                   Event ==> Interrupt
    //                             ==> read out Timer4 CC0-CC5 and Timer5 CC0-CC3
    //  }
    

  • Hello,

    thank you replying, sorry to say but i didnt understand what you want me to do. can you please explain it a little bit more.

    thanks and regards 

    Akbar shah

  • I updated the bare-metal algorithm, but not sure if I can get time to write the code. Maybe edvin might have a spare moment ..

Related