/* ******************************************************************************** SIEMENS C511/C513 STARTER KIT -------------------------------------------------------------------------------- PROGRAM ssc_led -------------------------------------------------------------------------------- MODUL NAME ssc_led.c -------------------------------------------------------------------------------- DESCRIPTION This program is an example for a SSC application, running on a C511/C513 microcontroller. The controller is configured to run in master mode. Data are sent to the LED display via SSC interface. -------------------------------------------------------------------------------- FUNCTIONS void main(void) ; void Wait(); void InitUsart(void); -------------------------------------------------------------------------------- NOTE No connection to the SSC slave controller in socket U5 can be established with the Starter Kit board, because Tasking CrossView uses INT0 interrupt which is also used on the miniCON-513 as PVCC# signal. -------------------------------------------------------------------------------- ENVIRONMENT The program runs on the C511/C513 Starter Kit board miniCON-513. The program is dedicated for the SAB-C513A-RN microcontroller in socket U1. -------------------------------------------------------------------------------- VERSION V1.0 -------------------------------------------------------------------------------- COMPILER Tasking C Demo V4.0 -------------------------------------------------------------------------------- DATE 18/10/95 -------------------------------------------------------------------------------- MODIFICATIONS none ******************************************************************************** */ /*********************** Compiler Includes ******************************/ /*********************** C513 SFR Includes ******************************/ #include "sfr_c513.h" /*********************** miniCON-513 Includes ******************************/ #include "board513.h" /*********************** ext. Module Includes ******************************/ /*********************** Prototypes ******************************/ void Wait(void); void InitUsart(void); /*********************** Program Code ******************************/ void main(void) { int i; /* initialization */ InitUsart(); /* init async. serial interface */ /* SSC configuration: SCEN = 1: SSC subsystem enabled TEN = 1: no function in master mode MSTR = 1: master mode selected CPOL = 1: SCLK idle state is high CPHA = 1: first data bit is shifted out with first SCLK edge and sampled with the second clock edge BRS2-BRS0: divide factor is set to 8; baudrate = 1.5 MBaud */ SSCCON = 0xF9 ; S513_SLS = 0 ; /* P1.5 enable LED (U5 is not enabled because PVCC# == 1) */ /* check SSC, check LED display */ while (1) { for (i=0;i<256;i++) { STB = i; while (!TC); Wait(); } } } /* -------------------------------------------------------------------------- */ void Wait(void) { int i,j; for (i=0; i< 1000; i++) { j += i*j; } } /* -------------------------------------------------------------------------- */ void InitUsart(void) { RC2L = 0xD9; RC2H = 0xFF; TL2 = 0xD9; TH2 = 0xFF; SCON = 0x5A; T2CON = 0x34; }