=============================================================================== W A V E C O M =============================================================================== OPEN AT V1.10 Updated : April 23th, 2002 =============================================================================== (To print this file : use Notepad and remove all margins and default header.) --------------------------------- Content of this file --------------------------------- Sample application n°6 (LCD Clock) description I. Changes II. Application description III. Application States I - Changes =========== * 02/04/23 - V1.10 Initial revision. II - Application description ============================ This application displays the current time and date on a LCD, using the bus API for I2C or SPI bus, and the LCD drivers of the Wavecom sample library. The LCD parameters are set via the "AT+LCDSET" command : (Test Command) AT+LCDSET=? +LCDSET: (0-1),(0-1) OK (Read Command) AT+LCDSET? +LCDSET: ,,, OK : 0 to use Samsung KS0719 SPI LCD driver 1 to use Parallel Text LCD on Philips PCF8574 I2C I/O remote expander driver : 0 for bus API mode 1 for bus AT commands mode : depends on the used LCD * KS0719 : Gpio used to handle the register select signal (default : Wismo Quik GPIO 4) * LCD via PCF8574 : Gpio used to handle the I2C SDA signal (default : Wismo Pac GPIO 2) : depends on the used LCD * KS0719 : Chip Select used for the LCD on SPI bus (default : SPI_EN Chip Select) * LCD via PCF8574 : Gpio used to handle the I2C SCL signal (default : Wismo Pac GPIO 3) These two last parameters can only be changed by modifying and compiling the "appli.c" file of the application. (Parameters Command) AT+LCDSET=, OK or +CME ERROR: 3 : 0 to use Samsung KS0719 SPI LCD driver 1 to use Parallel Text LCD on Philips PCF8574 I2C I/O remote expander driver : 0 -> the driver use the Open-AT bus API to control the LCD 1 -> the driver use AT commands to control the LCD These parameters are stored in flash objects on each change. This command is only available in IDLE state, once the PIN code has been entered, and out of an LCD writing operation. The first time the application is downloaded, it sends an SMS to itself, using the first entry of the MSISDN ("ON" in +CPBS command) phonebook returned by the +CNUM command. This entry should be correctly set, otherwise the application will not work. When the SMS is received, the time and date are set using "AT+CCLK" command, and starts displaying it on the current LCD. The current year is stored in a flash object. On further application executions, the current year is compared to the stored one, and if they are equals, the SMS initialization is not done, because the current date was kept. III - Application States ======================== | First IDLE : check flash objects values | +----------------------------------+ | | | Objects exist, get +CLCK current | objects do not exist, | state. | initialize SMS parameters, | | and get +CNUM first value. V V **************** ************ * GET 1ST TIME *------------------->* GET CNUM * Sends SMS to itself. **************** Bad Year value ************ | | | Good Year value | Receive SMS | V | ************ | * SET CCLK * Set CCLK value | ************ | | +----------------------------------+ V ************ +->* INIT LCD * Initialize current LCD with current mode. | ************ Start cyclic 1s timer to display current time. LCDSET | | command| | | V +--******** * IDLE * Wait for timer, or "+LCDSET" command. +->******** | | | | Cyclic timer expiration. | V | ************ | * GET TIME * Request +CCLK current value | ************ | | | | | V | **************** +--* DISPLAY TIME * Display current time on the LCD ****************