Jamie Morken's C++ Version of A2DMAX
The following email was received from Jamie
Morken, who has worked hard on this project. We thank him for his contributions.
I haven't tried to compile this myself, and cannot answer questions about
I finally was able to make c/c++ software to communicate with the max186!
Your code helped me and those hard to read 'maxim' datasheets did too.
Feel free to do whatever you want to with the code, since you wrote the
first version anyway! My code doesn't need the timing channel hooked up
to the chip, but it will still work if the timing channel is hooked up.
It is based on the circuit you made and is 100% compatible with it. You
can select any number between 1 to 8 of the analogue in channels, and it
will read them in order. It is quite fast, certainly over 5000 samples/second.
Using a routine I found on the net, the code autodetects the parallel port
base address (DPORT), given the LPT port number, so the user only needs
enter his/her LPT port number. I hope to make a graphical version, but
I have a software problem that I was hoping you could help me with first.
The code will only work on standard parallel ports. I took it to my friends
house to try it out (he has a ps/2 port) and it didn't work. PS/2 ports
can be set to input or output using bit 5 on the control register (DPORT+2)
but this wouldn't work for me. This is a big thing holding me back, as
I want to make it compatible with newer computers which have ps/2 ports,
before I put any graphical components into it. Thanks for being generous
enough to put your design on the web, it was the only reason that I was
able to make the c/c++ version. If you need a compiled version, please
mail me back. I used Borland c++ 4.52, but the source should work with
any standard c++ compiler. It won't compile under c because I used <iostream.h>,
a c++ input/output library.
Sincerly, Jamie Morken
CLICK HERE FOR JAMIE'S C++ CODE