SFUSatClub / obc-firmware

Firmware for our cubesat's On-Board Computer using the TMS570LS0432 and FreeRTOS v9
16 stars 3 forks source link

Infinite Packet Length #47

Open TobiNakamura opened 6 years ago

TobiNakamura commented 6 years ago

CHIME calibration signal will use the infinite packet mode to continuously transmit arbitrary lengths of Gold's Code. Current implementation only supports fixed length packet mode with packet length < FIFO length.

TobiNakamura commented 6 years ago

See section 2.3 of DN500 and the infiniteLink example.

  1. Set PKTCTRL0.LENGTH_CONFIG = 2 (10) (Infinite packet length).
  2. Set FIFOTHR.FIFO_THR = 0b1110
  3. Set GDO.CFG = 0x02
  4. Pre-program the PKTLEN register to 0.
  5. Transmit 64 bytes
  6. repeat 5.A on falling edge interrupt load 59 bytes to FIFO 5.B reattach interrupt
  7. Set PKTCTRL0.LENGTH_CONFIG = 0 (00) (Fixed packet length) to end transmission

Interrupt: GDO is set to mode 2 which will inform the OBC to top up the TX FIFO. GDO transitions to low when the contents of the FIFO falls below the number of bytes specified in register 0x03: FIFOTHR.

richarthurs commented 6 years ago

This might be a good candidate for a FreeRTOS stream buffer: https://www.freertos.org/RTOS-stream-message-buffers.html (just a thought, I don't know much about them)

They're not available until v10 (we're currently on v9), but upgrading is fairly easy and we'll upgrade for CSDC5/CCP.