This blog documents focuses on the RTOS approach for the electronic load that peteroakes, jc2048 and Jan Cumps designed. |
- CCS 8 with MSP432 compiler TI v 16.12.0.STS or >
- TI-RTOS for MSP43X, any SimpleLink version
RTOS Tasks overview
Task | Priority | Vital | Stack | Argument0 (schedule) | Comments |
---|---|---|---|---|---|
threadHeartBeat | 1 | no | 1024 | 1000 | pulse led as visual clue of RTOS health |
threadUART | 10 | no | 1024 | 0 Managed by Semaphore SEM_uart_rx | react on incoming traffic on UART. Send to SCPI lib. |
threadDisplay | 10 | no | 2048 | 1000 | updates LCD display according to schedule |
threadADC | 10 | no | 1024 | 1000 | samples according to schedule |
threadDAC | 10 | no | 1024 | 0 Managed by QUEUE_NAME_DAC | reacts on a mail message to set the DAC output value |
threadControl | 15 | no | 512 | 10000 | experimental: if a control strategy (e.g.: constant voltage) needs adjustment at regular times, this task will call that function at scheduled time. As not needed by constant current strategy (feedback handled by the hardware), this is now scheduled conservative. It's up to later control strategies to adapt the schedule to the own needs... |
threadInputEnable | 10 | no | 1024 | 0 Managed by QUEUE_NAME_INPUTENABLE | reacts on a mail message to enable or disable the input |
threadTemperatureOverProtection | 10 | no | 512 | 1000 | over-temperature watchdog |
RTOS Semaphore overview
Semaphore | Scope | Type | Comment | Functions |
---|---|---|---|---|
SEM_uart_rx | library: uart_impl | binary | halts the UART read task until char receive interrupt. This avoids polling. The UART read functionality takes no processor time unless it receives data. | wait: threadUART() release: UART00_IRQHandler() |
RTOS Event and MailBox overview
Queue | Message count | Comment | Functions |
---|---|---|---|
QUEUE_NAME_DAC | 1 | halts the DAC read task until an mbDAC message arrives. This avoids polling. The DAC functionality takes no processor time unless it receives a message. | wait: threadDAC() send: eloadRawSetDac() |
QUEUE_NAME_INPUTENABLE | 1 | halt the Input Enable task until an mbInputEnable message arrives. | wait: threadInputEnable() send: eloadInputEnable() |