Discussion in "8051 Discussion Forum" started by    Kuya_Marc    Mar 16, 2010.
Fri Mar 19 2010, 12:20 pm
#11
Also modified the defines:
//LCD Registers addresses
#define LCD_EN P3_2
#define LCD_RS P1_3
#define LCD_RW P3_7
#define LCD_D7 P1_7

The results are still the same.
Fri Mar 19 2010, 02:00 pm
#12


Here's an image showing the TM-2 configuration.


Kuya_Marc


Have you confirmed that the connections are as shown?.
Which processor do you have ?.

Are you sure that your program is being loaded properly ?.
Have you written other programs that worked, it may not be a "LCD" problem.


[ Edited Fri Mar 19 2010, 02:11 pm ]
Fri Mar 19 2010, 04:46 pm
#13



Here's an image showing the TM-2 configuration.


Kuya_Marc


Have you confirmed that the connections are as shown?.
Which processor do you have ?.

Are you sure that your program is being loaded properly ?.
Have you written other programs that worked, it may not be a "LCD" problem.

ExperimenterUK



I just confirmed the connections, as shown... I upgraded my Proto Board, that's on a solderless breadboard.
I'm testing with 89C2051 MCU. I have 89C4051 MCUs as backups.
I've written working LED, buzzer, and relay programs that have worked on the TM-1 and my original proto board setup. I haven't successfully written a LCD program, yet.




Fri Mar 19 2010, 05:58 pm
#14
PROBLEM IDENTIFIED!!!

When LCD_RS is configured P3_5, instead of P1_3, the LCD is working. I rewired this on my proto board (solderless breadboard).

Alexan's TM-2 has LCD_RS hardwired (soldered) to P1_3, as P3_3, P3_4, and P3_5 are hardwired to matrix keypad.

For the software to run on the TM-2, how can P1_3 be configured as LCD_RS, isolated from P1 LCD data? I don't know how to create code to do this.
Fri Mar 19 2010, 09:31 pm
#15
Great news


For the software to run on the TM-2, how can P1_3 be configured as LCD_RS, isolated from P1 LCD data? I don't know how to create code to do this.

Kuya_Marc


First I'd like to understand the error.

If the RS *is* connected to P1.3 why doesn't the program run with
LCD_RS configured as P1_3 ?.
Does LCD_RS configured as P1_3 actually drive pin 15 ?.


[ Edited Fri Mar 19 2010, 09:32 pm ]
Sat Mar 20 2010, 04:51 pm
#16


Great news


For the software to run on the TM-2, how can P1_3 be configured as LCD_RS, isolated from P1 LCD data? I don't know how to create code to do this.

Kuya_Marc


First I'd like to understand the error.

If the RS *is* connected to P1.3 why doesn't the program run with
LCD_RS configured as P1_3 ?.
Does LCD_RS configured as P1_3 actually drive pin 15 ?.

ExperimenterUK



I'm trying to figure out the error, myself. Using my Fluke 75 DMM on the Alexan TM-2, I've confirmed the hardwire connection between. And when powered with a different program, P1.3 triggers an LED. When the LCD program is run, the P1.3 LED flickers.

Suspicion is... The LCD_RS line as P1.3 is interferred with the 8-bit to 4-bit conversion at the conversion. In other words, improper nibble; 8-bit data is sent to lcd_cmd, which makes P1.3 as an active 3rd bit of port 1. The decompiled LCD demo from Alexan uses the following code:
008A SWAP A
SETB P3.2
ANL P1,#0Fh
ORL P1,A
LCALL 0124h ; Timer
CLR P3.2
RET

I haven't yet, disassembled my compiled .HEX code to see if it is using the same algorithm for lcd_cmd.

Any patching available? I'm thinking conversion should use a register, first before sending to the LCD port, to prevent tampering with the 3rd bit.
Mon Mar 22 2010, 04:31 pm
#17
Glad to hear its working

The code i had provided you was working with me on same pins as mentioned by you. I am sure you could test it again with modifications to connections of LCD.

If you have the board schematic you can post here, it will be easy to identify the problems. than running in circles
Tue Mar 23 2010, 01:50 am
#18
Hello Everybody... More good news here... Alexan's Tech Support modified my original source code to work on the Alexan TM-2 to work, and have E-Mailed me the modified code.

Other than that, my Proto Board is now at version 3, upgraded with keypad, EEPROM, LED Diagnostics, and LM35 Temperature Sensor. It now has a reduced RS-232 port and using a recycled PSP power supply.

Everything is working now, making me 1-week ahead of my schedule. Holy Week is next week, in Philippines...
Tue Mar 23 2010, 06:12 pm
#19
Thats really great

what is your final application? do share your experience with us
Thu Apr 01 2010, 06:01 pm
#20


Thats really great

what is your final application? do share your experience with us

Ajay Bhargav



While the LCD is working fine, another problem came up... Can't use the Keypad... My solderless breadboard mimics the TM-2 LCD & Keypad configuration, but the keypad works fine. Big Mystery! Technically, it should work! I wrote the code for the TM-2, but only works on the solderless breadboard.

Alexan's technical support said the TM-2 is configured for more advanced purposes; specifically has multiple devices sharing a port. LCD, Keypad, EEPROM and 8x8 Matrix LED all share Port 1. So far, I haven't found any 89CX051 circuit design like that. According to Alexan's Technical Support, Alexan's School of Technology (AST) MCU workshop instructs in assembly language, not in C programming language.

Get Social

Information

Powered by e107 Forum System

Downloads

Comments

HazelKt
Thu May 30 2024, 02:03 pm
Bertakiacatt
Thu May 30 2024, 09:33 am
Edwardcleri
Wed May 29 2024, 03:33 pm
Anthonygar
Wed May 29 2024, 03:19 pm
Brandonvab
Wed May 29 2024, 05:35 am
SeymourAdard
Tue May 28 2024, 01:54 pm
DavidAnike
Tue May 28 2024, 08:55 am
BlaineTew
Tue May 28 2024, 06:41 am