Digital Alarm Clock in C
I have some good news and some not so good news; I have found out that the LCD is not fried and does work just fine, also that the program included in the HEX file is functioning because I am able to hear the buzzer go on/off and can be set with the switches. The downside I found out is that on my 8951 there are apparently predefined pins for each function, so what I was able to figure out is how to match the corrected pins up to the LCD.
I took your advice and created a simple display code and ran it, I think you’ll like the outcome , and found that the pin corrections worked. Now my question to you is in the HEX file can I reset the LCD pin connections to the following changes:
you need to change the opcodes wherever LCD is using P2
change it to P0. thats why i said.. hard
as the program is in C so.. that makes it more hard why don't you use P2?
And also you have to change the D7 from P2.7 to P0.7 lot of changes.. and hard to find in big hex file..
you need to interchange the address where the data is suppose to move.. i mean!
like 0xA0(P2) to 0x80(P1) as you wanted. but the thing is what if 0x80 comes in data so you gonna ruin the program.. and moreover if you are directly editing the .hex file then you need to calculate the checksum of each line and then put a new one. its a tough job. but its easy if you edit in a buffer or uploader program.
Still i wont recommend you do this rest is your wish!
your previous idea of changing P2 to P0 is much simpler than the one you just gave
|Pin 3||VD||-||1K Resistor|
|Pin 4||RS||Low: Instruction code input||?|
|High: Data input||?|
|Pin 5||R/W||Low: Data Write||P3.6|
|High: Data Read||P3.7|
|Pin 6||E||Enable signal||P3.5|
|Pin 7||DB0|| Data bus lines |
When interface is 4bits long
Data is on DB4-DB7When interface is 8bits long
Data is on DB0-DB7
|Pin 3||1K Resistor|
In a text document put in a zip because .rtf not allowed
Do not confuse yourself. Simply follow the schematic as described. and make the connections. It will work.
You cannot use your configuration, because you cannot edit the hex file!! Hope you understood..
so.. please accept this.. you don't know what you are talking about..
Do you really know about LCD?
Please consult a book and study LCD properly.
i tell you about LCD in brief
LCD has three portion of hardware connectivity
Power and Contrast
Power and Contrast Pins: For powering the LCD and changing contrast. Contrast pin sometimes work with -ve voltage for some of the LCDs.
Data Pins: For sending Data to the LCD. The seventh data pin of LCD i.e. D7 is used as busy flag for checking the status of LCD.
Control Pins: There are three control pins in an LCD.
a) Register Select (RS)
b) Read/Write (RW)
c) Enable (EN)
a) RS: the pin RS is used to select register. either data or command register.
if RS = 1 » Data Register
RS = 0 » Command Register
b) RW: This pin is used for selecting the operation of LCD, either read/write.
if RW = 0 » Write
RW = 1 » Read
c) EN: To enable the LCD. usually a high means enable.
So now we conclude that.. there is only one pin needed for RW and one pin for RS.. not two pins.. i hope you understood.
|Pin 3||VD||-||1K Resistor||1k to GND|
|Pin 4||RS||Low: Instruction code input||P3.7||RD|
|Pin 4||RS||High: Data input||P3.7||RD|
|Pin 5||R/W||Low: Data Write||P3.6||WR|
|Pin 5||R/W||High: Data Read||P3.6||WR|
|Pin 6||E||Enable signal||P3.5||T1(timer)|
|Pin 7||DB0||Data Bus Line*||P2.0||Data 1|
|Pin 8||DB1||Data Bus Line*||P2.1||Data 2|
|Pin 9||DB2||Data Bus Line*||P2.2||Data 3|
|Pin 10||DB3||Data Bus Line*||P2.3||Data 4|
|Pin 11||DB4||Data Bus Line**||P2.4||Data 5|
|Pin 12||DB5||Data Bus Line**||P2.5||Data 6|
|Pin 13||DB6||Data Bus Line**||P2.6||Data 7|
|Pin 14||DB7||Data Bus Line**||P2.7||Data 8|
**When interface is 4bits long Data is on DB4-DB7
*When interface is 8bits long Data is on DB0-DB7
What do you think?