7-Segment Display - Segment Control Mode

Each segment of the display can be controlled independently. The segments are “active-low”, e.g. the segment is on if a logic “0” is written to it.

Please make sure the CT Board is in the correct mode.
Supported modes: 1, 2, 3, 4


The registers are read / write.







The code snippet below shows how to use the 7-segment display in segment control mode.

#include "reg_ctboard.h"
 
CT_SEG7->RAW.BYTE.DS0 = (uint8_t) data_byte;           /* Write byte of segment data to DS0. */
CT_SEG7->RAW.HWORD.DS3_2 = (uint16_t) data_halfword;   /* Write half word of segment data to DS3..2. */
CT_SEG7->RAW.WORD = (uint32_t) data_word;              /* Write word of segment data to all displays. */


.equ ADDR_SEG7_RAW,  0x60000110
 
        ldr     r0,  =ADDR_SEG7_RAW
        strb    r1,  [r0, #0]          // Write byte of segment data to DS0.
        strh    r1,  [r0, #2]          // Write half word of segment data to DS3..2.
        str     r1,  [r0, #0]          // Write word of segment data to all displays.


  • ctboard/peripherals/7segment_raw.txt
  • Last modified: 2026/06/25 15:02
  • by scbj