http://www.wavecom.com/forum

Open AT ®  Release version:
3.13

Sample - LCD Clock

Changes

Dependencies

This sample depends on the following libraries :

Application Description

This application automaticaly gets the current time from the SMS service center, and displays it on a LCD, using the bus API for I2C, SPI and parallel bus, and the LCD drivers of the Drivers library.

As this application uses the MultiApp library, the following start/stop command has to be used to control the application execution.

 

  AT+LCDSTART (LCD Clock start/stop command)
CommandAnswers
AT+LCDSTART?+LCDSTART: <state>
OK
AT+LCDSTART=?+LCDSTART: (0-1)
OK
AT+LCDSTART= <state> +CME ERROR: 3
or
OK
 
ParameterValues rangeDescriptionDefault value
state0-1The current application running state. This parameter is stored in non-volatile memory.0

The init entry point sent to the MultiApp library is the lcdclk_init() function. The start/stop entry points linked to the +LCDSTART command are the lcdclock_Start() and lcdclock_Stop() functions.

This application displays the current time and date on a LCD, using the bus API for IIC, SPI or Parallel bus, and the LCD drivers of the Drivers sample library.
The LCD parameters are set via the +LCDSET command :

 

  AT+LCDSET (LCD settings command)
CommandAnswers
AT+LCDSET?+LCDSET: <lcd>
OK
AT+LCDSET=?+LCDSET: (0-2)
OK
AT+LCDSET= <lcd> +CME ERROR: 3
or
OK
 
ParameterValues rangeDescriptionDefault value
lcd0-20 to use Samsung KS0719 SPI LCD driver
1 to use IIC via PCF8574 LCD driver
2 to use Parallel LCD driver
unset

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.


Updated: Wed Apr 4 13:13:26 CEST 2007;