Docsity

Microcomputer Hardware Design - Lab 9 | ECET 456, Lab Reports of Electrical and Electronics Engineering

Toggle sidebar
bg1
Purdue University Calumet
ECET-456
Microcomputer Hardware Design
Page 1 of 4
Lab #9
Lab Objective:
Write a Software for 16F88 to take Analog Inputs from the Port A0, A1, And Vdd
and take the digital output on Port B. Resolution of ADC is 10 bits and Clock rate ,
800000.
Write software for PC to take input from the Port B of 16F88 through PortA of
USB-1024LS. And show it to the monitor.
Schematic:
USB-1024LS
PC
A7 28
A6 27
A5 26
A4 25
A3 24
A1 22
A0 21
B3 9
B2 8
B1 7
B0 6
A2 23
B7 13
B6 12
B5 11
B4 10
29
17 RA0
14 Vdd
2 Vref
18 RA1
ANALOG INPUTS
+5V
Program for the 16F88.
#include<16F88.h>
#device ADC=10
#fuses INTRC_IO, NOWDT, PUT, NOMCLR, NOBROWNOUT, NOLVP
pf3
pf4

Partial preview of the text

Download Microcomputer Hardware Design - Lab 9 | ECET 456 and more Lab Reports Electrical and Electronics Engineering in PDF only on Docsity!

ECET-

Microcomputer Hardware Design

Lab

Lab Objective:

Write a Software for 16F88 to take Analog Inputs from the Port A0, A1, And Vdd and take the digital output on Port B. Resolution of ADC is 10 bits and Clock rate ,

Write software for PC to take input from the Port B of 16F88 through PortA of USB-1024LS. And show it to the monitor.

Schematic:

USB-1024LS

PC

A7A6 2827

A5A4 2625

A3 24

A1A0 2221 B3B2 98 A2 23 B1B0^76

B7B6 1312

B5B4 1110 29

17 RA

14 Vdd

2 Vref

18 RA1 ANALOG

INPUTS

+5V

Program for the 16F88.

#include<16F88.h> #device ADC= #fuses INTRC_IO, NOWDT, PUT, NOMCLR, NOBROWNOUT, NOLVP

ECET-

Microcomputer Hardware Design

#use delay(clock=8000000) long readValue(void); void updateDisplay(long num); long value=0; void main(void) { set_tris_a(0xFF); set_tris_b(0x00); setup_adc_ports(sAN0 | sAN1 | VSS_VDD); setup_adc(ADC_CLOCK_DIV_64); output_b(0xFF); while(1) { value = readValue(); updateDisplay(value); } } long readValue(void) { float result=0.0, fiveDividedBy1024=0.0048828125;

ECET-

Microcomputer Hardware Design

output_b(display[num]); }