Skip to content
This repository has been archived by the owner on Dec 15, 2024. It is now read-only.

Latest commit

 

History

History
87 lines (68 loc) · 3.79 KB

README.md

File metadata and controls

87 lines (68 loc) · 3.79 KB

PSoC6_RTC_TFT

In this project a clock is made that you can set using the capsense sensor.
Video

What has been used

Material

Software

Peripheries

  • Capsense sensor
    • Slider
    • Button0
    • Button1
  • TFT-display
  • Ambient light sensor
  • RTC
    • RTC general
    • RTC alarm interupt
  • Timer
    • Timer general
    • Timer interrupt

How does it work

In the photo below you see the start screen afther programming the PSoC. TFT_Start_Screen

By sliding from the left to the right side of the capsence slider, you select the next time element (eg: From year to month, from month to day). By sliding from the right to the left side of the capsence slider, you can select the previous time element (eg: From month to year, from day to month) Capsense flowchart

WIth the left capsence button (button 0) you can decrease your time element, and with the right capsence button (button 1) you can increase your time element.

Flowchart of configuring year

Year_Flowchart

Flowchart of configuring month

Year_Flowchart

Flowchart of configuring day

Year_Flowchart

Flowchart of configuring hour

Year_Flowchart

Flowchart of configuring minute

Year_Flowchart

Flowchart of configuring second

Year_Flowchart

The values on the TFT-display will be updated and shown. TFT_Set_Time

When you configured the right time, you can push the user button (sw2). By presing this button the RTC will set himself with this time. And the time will be displayed on the TFT-shield.

Every second a timer will generate an interrupt to update the current time on the TFT-shield. First I wanted to use a RTC interrupt for it, but the TFT-shield does not wanted to work in a RTC interrupt. TFT_Time

With the ambient light sensor you can check the light intensity in the room. When the sensor measure a light intesity that is to low (eg: During the night) it will change the color of the text on the TFT-shield from white to red. If the light intesity is hight enough, the text will change again from red to white. TFT_Light_Sensor

Experience

  • The TFT-Shield does not want to work in a RTC interrupt, but will work in a timer interrupt. But the RTC interrupt does want to execute the GUI_Clear() function.
  • When there is text displayed on the TFT-shield, and you overwrite this text with a shorter text then the last characters of the longer text will be still displayed.
  • When a new day start it is better to clear the whole TFT-shield. Otherwise it is possible that text from the previous day is still displayed.

Source

ModusToolbox documentation