- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I am using PSoC 5lp to display time on LCD with RTC. The LCD displays wrong time and other characters in between I dont have any errors. I tried changing PLL frequency floating format and stack and heap size. Still no change
please help me in this.
Thank you.
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi,
I tried to emulate LCD with UART, as far as using UART
and when I assigned
==========
buf[0] = 0x23 ;
buf[1] = 0x52 ;
buf[2] = 0x29 ;
==========
Your algorithm seems to be working fine.
So remaining possible cause of trouble are
(1) RTC
(2) LCD
About RTC,
Please test without accessing RTC, what I did was
=================
// if(Read_I2C(ADDR_DS1307, DS1307_REG_SECOND,7,buf)){
buf[0] = 0x23 ;
buf[1] = 0x52 ;
buf[2] = 0x29 ;
...
// } // <= end of if (Read..) block
=================
If now LCD displays 9/52/23 A, then the problem was communication with the RTC.
If LCD does not display above, then the there is/are problem with the LCD.
About the LCD, by any chance are you using CY8CKIT-059?
If so, using P2[1] and P2[2] may cause you trouble as they are used for other components.
=================
LCD_Port[0] : P2[0]
LCD_Port[1] : P2[1] <- LED
LCD_Port[2] : P2[2] <- SW1
LCD_Port[3] : P2[3]
LCD_Port[4] : P2[4]
LCD_Port[5] : P2[5]
LCD_Part[6] : P2[6]
=================
moto
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi,
Would you do either
(1) Attache a project which can reproduce your problem
To do this,
select your project as "Set As Active Project"
menu > Build > Clean <project name>
menu > Archive Workspace/Project...
then attach the result <project>.zip file
(2) Explain
"wrong time" does the time have offset or totally different stream of letters?
what is/are "other chars" ?
(3) At least share a part of program which is displaying the value via LCD.
moto
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi, I tried to attach the file but couldn't do it. Please let me know how can i do that?
Thank you.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi,
Oh, you are using DS1307!?
Assuming that your I2C functions are working OK,
For the seconds, the MSB is CH flag, so I would write
ch_flag = (buf[0] >> 7) & 0x01 ; /* ch_flag == 1, the oscillator is disabled */
s = BCD2DEF(buf[0] & 0x7F) ;
As I don't have DS1307 and LCD,
it would be nice if you can put a picture of LCD
if it still has wrong chars or please type exact letters you are seeing.
moto
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi,
I tried to emulate LCD with UART, as far as using UART
and when I assigned
==========
buf[0] = 0x23 ;
buf[1] = 0x52 ;
buf[2] = 0x29 ;
==========
Your algorithm seems to be working fine.
So remaining possible cause of trouble are
(1) RTC
(2) LCD
About RTC,
Please test without accessing RTC, what I did was
=================
// if(Read_I2C(ADDR_DS1307, DS1307_REG_SECOND,7,buf)){
buf[0] = 0x23 ;
buf[1] = 0x52 ;
buf[2] = 0x29 ;
...
// } // <= end of if (Read..) block
=================
If now LCD displays 9/52/23 A, then the problem was communication with the RTC.
If LCD does not display above, then the there is/are problem with the LCD.
About the LCD, by any chance are you using CY8CKIT-059?
If so, using P2[1] and P2[2] may cause you trouble as they are used for other components.
=================
LCD_Port[0] : P2[0]
LCD_Port[1] : P2[1] <- LED
LCD_Port[2] : P2[2] <- SW1
LCD_Port[3] : P2[3]
LCD_Port[4] : P2[4]
LCD_Port[5] : P2[5]
LCD_Part[6] : P2[6]
=================
moto
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Yes, It displays 9/52/23 and 9/2/1. it fluctuates between numbers. Well, I have connected to port12[6.0] at that time also it was the same problem.
I am using CY8CKIT -059
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi,
In the page 25 of CY8CKIT-059 PSoC 5LP Prototyping Kig Guide Rev.G
there is a table like below. Please try to use the pin with only "GPIO."
moto
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Yes, It displays 9/52/23 and 9/2/1. it fluctuates between numbers. Well, I have connected to port12[6.0] at that time also it was the same problem.
I am using CY8CKIT -059
Thank you
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi,
Although it may not be the direct problem, but
P12[0] I2C_SCL
P12[1] I2C_SDA
P12[6] UAR_RX
P12[7] UART_TX
these seem to be better to avoid.
moto
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Another thing slightly bothering me is
sprintf(str,"%2d/%2d/%2d ", h, m, s );
How about trying
sprintf(str, "%02d:%02d:%02d", h, m, s) ;
Note: I prefer to use color (:) for time and slash for date.
but my point is that the trailing spaces may be affecting the fluctuation..
moto
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi, I tried your code. It displayed h/m/s as 2/0/7 at the beginning and displayed 2/30/17 it is not displaying constant changing of seconds.