C++ code for interacing ADC0804 to PC

E

Thread Starter

Endris

Hi,

This is to ask help for the accomplishment of our final year project on the Prepaid Electricity meter Design with PC simulation. Here we downsize the power line, buffer it and finally digitize using ADC0804 for both current and voltage. The problem here is we can't interface ADC0804 with a printer (parallel) port to the PC for processing using C++ code and the pin connections.

Task we need:
The C++ coed to interface ADC0804 to PC with parallel port and the pin Connection Diagrams If so can we connect a second parallel port as expansion slot?

urs
 
Asad here, from Federal Urdu university Islamabad, 2yr, Electrical Engineering (electronics) dept.

It's simple programming in C++.

There are two commands:
inportb(<port's register adress from recieving data >);

&
outportb(<port adress to sent data>,<data value>);

If you need complete help, I may also help you, because I'm also in my project on the same port and using ADC0804. You can mail me to ask, and also tell me about yourself man. :D

dasa459 @ hotmail. com
 
Hello,

I am also having an Issue...

I am trying to interface my PC with a microcontroller to take in user entered values and store them in the MC registers... and also receive data from the microcontroller. This is being done through serial ports.

The protocol is of this format:
9600 baud, 8-N-1

Protocol format:

<address> <length> <command> <…data …> <checksum>

address = device address: PC = 0x7B (123), controller = 0x01

length = length of remaining bytes in message, including checksum

checksum = 0xFF – (8-bit sum of all other bytes in message)

byte order of 2-byte values is little-endian (lsb,msb)

Data Flow:

PC is the “master” – the controller board will never send any unsolicited messages.

All commands sent by the PC will result in a response from the controller.

Can anyone help? Thanks.
 
Top