TechPaper GLCD RTC Combo

Page 1

AIS Cube

www.aiscube.com 190 Middle Road #04-11, Fortune Centre Singapore 188979 Tel: (65) 6339 3309 Fax: (65) 6333 0188

E-Module: GLCD+RTC Combo Datasheet v1.1

Copyright  2008 AIS Cube. All rights reserved. The FlamingICE(FI) and FIDE are either registered trademarks or trademarks of AIS Cube in Singapore and/or other countries.


AIS Cube

www.aiscube.com 190 Middle Road #04-11, Fortune Centre Singapore 188979 Tel: (65) 6339 3309 Fax: (65) 6333 0188

ELECTRICAL CHARACTERISTICS GLCD: Function: Graphic TFT LCD Vdd: 3.3V DC Backlight: 6V DC Interface Bus: SPI LCD Display: 128 x 128 Pixels; 256 Colours; TFT Colour Format: 8 bit RGB in format BBB/GGG/RR Display Orientation: True x/y Axis y-axis

(0,0)

x-axis

Real Time Clock (RTC): Function: Real Time Clock/ Calendar Vdd: 3.3V DC Battery for Data Retention: 3V lithium coin cell battery (E-CR2032) IC: PCF8583T Memory: 240 x 8-bit low-voltage RAM Interface Bus: I2C Precision: Down to the Hundredth of a Second


AIS Cube

www.aiscube.com 190 Middle Road #04-11, Fortune Centre Singapore 188979 Tel: (65) 6339 3309 Fax: (65) 6333 0188

PINOUT

FRONT

BACK

GLCD RTC

N.C INT SCL SDA RESET DIO CLK CS 3.3V GND

N.C GND 6V

N.C INT SCL SDA RESET DIO CLK CS 3.3V GND

N.C GND 6V

+

RTC GLCD

GLCD + RTC Combo

NOTE: Insert a 3V lithium coin cell battery (E-CR2032) for the Real-Time Clock to keep track of timing when power from the microcontroller is cut off.


AIS Cube

www.aiscube.com 190 Middle Road #04-11, Fortune Centre Singapore 188979 Tel: (65) 6339 3309 Fax: (65) 6333 0188

SCHEMATICS AND CIRCUIT LAYOUT


AIS Cube

www.aiscube.com 190 Middle Road #04-11, Fortune Centre Singapore 188979 Tel: (65) 6339 3309 Fax: (65) 6333 0188

APPENDIX A EXAMPLE CONFIGURATIONS


AIS Cube

www.aiscube.com 190 Middle Road #04-11, Fortune Centre Singapore 188979 Tel: (65) 6339 3309 Fax: (65) 6333 0188

GLCD + RTC Full Connection to the FI80 Audio Board


AIS Cube

www.aiscube.com 190 Middle Road #04-11, Fortune Centre Singapore 188979 Tel: (65) 6339 3309 Fax: (65) 6333 0188

GLCD + RTC Full Connection to the FI40 Board

GLCD

RTC GLCD RTC

TOP BOTTOM

Pin (10)

GND VDD

Pin (9)

NC

Pin Pin (11) (12)

NC

FI40 BOARD

TOP

VIN GND

BOTTOM

NC NC

NC NC

NC

NC

Pin Pin (7) (8) SDA SCL


AIS Cube

www.aiscube.com 190 Middle Road #04-11, Fortune Centre Singapore 188979 Tel: (65) 6339 3309 Fax: (65) 6333 0188

GLCD Connection to the FI80 Audio Board


AIS Cube

www.aiscube.com 190 Middle Road #04-11, Fortune Centre Singapore 188979 Tel: (65) 6339 3309 Fax: (65) 6333 0188

GLCD Connection to the FI40 Board


AIS Cube

www.aiscube.com 190 Middle Road #04-11, Fortune Centre Singapore 188979 Tel: (65) 6339 3309 Fax: (65) 6333 0188

RTC Connection to the FI80 AUD Board

NOTE: Insert a 3V lithium coin cell battery (E-CR2032) for the Real-Time Clock to keep track of timing when power from the microcontroller is cut off.


AIS Cube

www.aiscube.com 190 Middle Road #04-11, Fortune Centre Singapore 188979 Tel: (65) 6339 3309 Fax: (65) 6333 0188

RTC Connection to the FI40 Board

NOTE: Insert a 3V lithium coin cell battery (E-CR2032) for the Real-Time Clock to keep track of timing when power from the microcontroller is cut off.


AIS Cube

www.aiscube.com 190 Middle Road #04-11, Fortune Centre Singapore 188979 Tel: (65) 6339 3309 Fax: (65) 6333 0188

APPENDIX B Programming the Module using FIDE


AIS Cube

www.aiscube.com 190 Middle Road #04-11, Fortune Centre Singapore 188979 Tel: (65) 6339 3309 Fax: (65) 6333 0188

OVERVIEW Libraries and system functions are available to make programming the GLCD + RTC Combo Module a whole lot easier. The RTC Library is one such example, calling the subroutines and functions from the library automatically handle the read and write communications between the FI Microcontroller and the module via I2C.

The FI RTC (Real Time Clock) Module Library The FI RTC is located at the back of the GLCD + RTC Combo Module. Please refer to the PINOUTs for pin specification. You can add the RTC library to your project by selecting Project > Add Module and selecting LIB_RTC. Note that the Library Module is now a part of your project. LIB_RTC Contains 4 Routines; • RTC_READ_TIME •

• •

RTC_READ_TIME_EX RTC_READ_DATE RTC_SET_TIME_AND_DATE

To get the current time, use RTC_READ_TIME(HRS, MIN, SEC). The time in Hours, Minutes and Seconds will be returned in the HRS, MIN, SEC variable. You can display it in the debug window using the instruction Debug.Print.

CODE: Dim SEC, MIN, HRS As Integer Public Sub Main() RTC_READ_TIME(HRS, MIN, SEC) Debug.Print "DATE:"; CStr(HRS); ":"; CStr(MIN); ":"; CStr(SEC); " "; End Sub

For precise timing operations, you can use RTC_READ_TIME_EX(HRS, MIN, SEC, T10, T100) to get precision to a hundredth of a second. To get the current date, use RTC_READ_DATE(DAY, MTH, YRS) to return the date.


AIS Cube

www.aiscube.com 190 Middle Road #04-11, Fortune Centre Singapore 188979 Tel: (65) 6339 3309 Fax: (65) 6333 0188

To set the date and time for the RTC to start keeping track of, you can make use of the function specifying the hours, minutes, year, and month; RTC_SET_TIME_AND_DATE(HRS, MIN, YEARDATE, MTH). Note that you cannot set the seconds. Variables mentioned must be declared by the user.

CODE: Dim T10, T100, SEC, MIN, HRS, DAY, MTH, YEAR As Integer

Programming the GLCD Interacting with the GLCD is a very versatile affair; you can store images to dump into the screen using an External EEPROM, or the FICE SD Card, or programmatically plot the image to the screen pixel by pixel. The FlamingICE Operating System, aka the FI Firmware onboard the FI chip contains system commands to write to the GLCD. The full coverage can be obtained by referring to the FIDE System Library under OS.GLCD. You can also refer to the online tutorial on how to load an image to the GLCD using an external EEPROM. Writing text to the screen is as simple as stating the string you want on the screen by using the OS.GLCD.Print command.

Example: ‘The following program initializes the GLCD, fills the GLCD with the ‘colour white, sets the position of the cursor to the x,y point (5,10), ‘sets the font size to large, and prints the lines at the cursor ‘position. OS.GLCD.Init() OS.GLCD.Fill(255) OS.GLCD.SetPosition(5, 10) OS.GLCD.FontSize(1) OS.GLCD.Print "TEST 1" OS.GLCD.Print "Test 2"


Turn static files into dynamic content formats.

Create a flipbook
Issuu converts static files into: digital portfolios, online yearbooks, online catalogs, digital photo albums and more. Sign up and create your flipbook.