This is an old revision of the document!


7 Segment Display

There are 4 7 segment displays mounted on the CT Board. The displays can be accessed over two different interfaces:

  • The binary interface, for HEX representation of binary values
  • The "raw" interface, for independent controll over each segment

Depending on the used addresses the display will switch automatically.

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


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

The code snippet bellow 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. */


ADDR_SEG7_RAW   EQU      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.


The Registers are read / write.







Additionally the display can be used as HEX display. All 4 displays can directly show a 16 bit binary value.
In this mode the display can't be switched off, use the raw interface.

The code snippet bellow shows how to use the 7 segment display as HEX display.

#include "reg_ctboard.h"
 
CT_SEG7->BIN.BYTE.DS1_0 = (uint8_t) data_byte;        /* Write byte of binary data to DS1..0. */
CT_SEG7->BIN.HWORD = (uint16_t) data_halfword;        /* Write half word of binary data to all displays. */


ADDR_SEG7_BIN   EQU      0x60000120
 
                LDR      r0, =ADDR_SEG7_BIN
                STRB     r1, [r0, #0]                     ; Write byte of binary data to DS1..0.
                STRH     r1, [r0, #0]                     ; Write half word of binary data to all displays.


The Registers are read / write.







  • ctboard/peripherals/7segment.1456402266.txt.gz
  • Last modified: 2016/02/25 12:11
  • by feur