LCD version of the heart rate monitor.
A simple LCD version of the heart rate monitor is shown below. This is just a modification of the above circuit.LCD displays are very popular now a most of the embedded system designers prefer them over multiplexed seven segment LED displays. Using LCD displays you can display text, custom characters, graphics and a lot of other stuff and it is a great advantage over the LED counterparts. JHD162 is the LCD display used here. It is a 16X2 LCD display based on the HD44780 driver IC. Go through the following link for knowing more about JHD162 and its interfacing to the 8051 microcontroller. Interfacing LCD display to 8051. The circuit diagram of the LCD version of the heart rate monitor is shown below.
Data/command input pin DB0 to DB7 of the display is interfaced to Port0 of the microcontroller. Resistor network R17 is used for pulling up thePort0. Port0 needs external pull up for proper functioning. Preset resistor R1 is used for adjusting the contrast of the display. R2 limits the current through the back light LED. Other parts of the circuit are similar to the LED version.
Program.
RS EQU P2.7 RW EQU P2.6 EN EQU P2.5 ORG 000H ACALL INIT ACALL TEXT1 ACALL LINE2 ACALL TEXT3 MOV DPTR,#LUT MOV P1,#00000000B MOV P0,#00000000B MAIN: MOV R6,#230D SETB P3.5 MOV TMOD,#01100001B MOV TL1,#00000000B MOV TH1,#00000000B SETB TR1 BACK: MOV TH0,#00000000B MOV TL0,#00000000B SETB TR0 HERE: JNB TF0,HERE CLR TR0 CLR TF0 DJNZ R6,BACK CLR TR1 CLR TF0 CLR TF1 MOV A,TL1 MOV B,#4D MUL AB ACALL SPLIT ACALL INIT ACALL TEXT1 ACALL LINE2 ACALL TEXT2 ACALL BPM SJMP MAIN INIT: ACALL CMD MOV A,#0FH ACALL CMD MOV A,#01H ACALL CMD MOV A,#06H ACALL CMD MOV A,#83H ACALL CMD MOV A,#3CH ACALL CMD RET TEXT1: MOV A,#48H ACALL DISPLAY MOV A,#65H ACALL DISPLAY MOV A,#61H ACALL DISPLAY MOV A,#72H ACALL DISPLAY MOV A,#74H ACALL DISPLAY MOV A,#20H ACALL DISPLAY MOV A,#52H ACALL DISPLAY MOV A,#61H ACALL DISPLAY MOV A,#74H ACALL DISPLAY MOV A,#65H ACALL DISPLAY RET LINE2: MOV A,#0C0H ACALL CMD RET TEXT2: MOV A,#62H ACALL DISPLAY MOV A,#70H ACALL DISPLAY MOV A,#6DH ACALL DISPLAY MOV A,#20H ACALL DISPLAY RET TEXT3: MOV A,#63H ACALL DISPLAY MOV A,#6FH ACALL DISPLAY MOV A,#75H ACALL DISPLAY MOV A,#6EH ACALL DISPLAY MOV A,#74H ACALL DISPLAY MOV A,#69H ACALL DISPLAY MOV A,#6EH ACALL DISPLAY MOV A,#67H ACALL DISPLAY MOV A,#2EH ACALL DISPLAY MOV A,#2EH ACALL DISPLAY MOV A,#2EH ACALL DISPLAY RET BPM: MOV A,R1 ACALL ASCII ACALL DISPLAY MOV A,R2 ACALL ASCII ACALL DISPLAY MOV A,R3 ACALL ASCII ACALL DISPLAY RET CMD: MOV P0,A CLR RS CLR RW SETB EN CLR EN ACALL DELAY RET DISPLAY:MOV P0,A SETB RS CLR RW SETB EN CLR EN ACALL DELAY RET DELAY: CLR EN CLR RS SETB RW MOV P0,#0FFh SETB EN MOV A,P0 JB ACC.7,DELAY CLR EN CLR RW RET DELAY1:MOV R5,#255D HERE2:DJNZ R5,HERE2 RET SPLIT: MOV B,#10D DIV AB MOV R3,B MOV B,#10D DIV AB MOV R2,B MOV R1,A RET ASCII: MOVC A,@A+DPTR RET LUT: DB 48D DB 49D DB 50D DB 51D DB 52D DB 53D DB 54D DB 55D DB 56D DB 57D END
No comments:
Post a Comment