Continue to Site

Welcome to our site!

Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

  • Welcome to our site! Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

LCD display and Hyperterminal communication with 16F877

Status
Not open for further replies.

peter83

New Member
I am writing an assembly program which uses the 16F877 Pic, LCD display and 3 switches. The requirements are:

When no switch is ON, the LCD display should be blank. Note that
when a switch is OFF, the microcontroller detects logic 1 on the pin
connected to the switch. For example, if the switch is connected to RB0,
it finds that RB0 is set. When the switch is ON, then RB0 is reset.

SW1 ON, LCD display “Welcome to Pic World" on line 1 and
the second line should display "Ready to start !". In addition, the Hyperterminal should display "Welcome to the Pic World" on the
first line, the date in the format dd/mon/yyyy on the second line. The details to be displayed on the hyperterminal are transmitted to it by the
microcontroller.

SW2 ON, when a four-digit hexadecimal number is entered into
the hyperteminal and then followed by pressing of the ENTER key, the
microcontroller should respond by displaying the entered data on the
LCD screen on the first line as follows. For example, if ABCD is entered
on the hyperterminal followed by pressing the ENTER key, the first line
on LCD display reads:
HEX. DIGITS: ABCD
(16 Characters displayed on 1 line)
The microcontroller should convert the hex number into a decimal
number and display it on the second line. It reads:
DECIMAL No: xxxxx(All 16 Characters Used)

SW3 ON, the microcontroller is in the PWM mode. Set the
frequency for PWM operation to be the lowest possible. (PR2 is loaded
with FF and the the prescaler is set to 16). The PWM count loaded
initially into CCPR1L is H’02'. Reset bits 5 and 4 of CCP1CON.
Then every 10 ms, increment the CCPR1L count till it reaches D’252'.
Connect the RC2 pin to an LED to show the effect of PWM. Note that
the LED will be ON when the output on RC2 pin is low and it will be
OFF the output on RC2 pin is high. Once the count reaches D’252', start
decrementing by count every 10 ms till the count reaches H’02',
whereupon reverse the process to count up.

If more than one switch is closed, execute the higher priority task using polling technique to detect the status of switches (SW3 has highest priority).

Anyone can give me some hints as details as possible.
I don't know how to use the switch to control the program flow, the microcontroller communicate with the hyperterminal, convert hexa -> decimal, and what is PWM.

Thanks in advanced.
 
PWM is pulse width modulation, where you vary the width of a 'pulse' and the width defines how much a servo needs to rotate and in which direction. You should check out Nigels tute page, look for his sig in some of his other posts. Got a very nice guide on the basics....

....but he should be around shortly helping you out. Gonna be keeping a watchfull eye on this :D
 
Status
Not open for further replies.

New Articles From Microcontroller Tips

Back
Top