Arduino vend serial (MDB) help

First of all, thank you to everyone in the arduino forums. I've done some really fun stuff and am having a great time learning. This is my first question to the forum (long time listener, first time caller).
I am attempting to use my arduino (2009) to communicate with a bill validator (sometimes called a bill acceptor) and a coin mechanism using the MDB protocol. The arduino will be the master and the two devices will be slaves.
To power the two devices (ranges of 20VDC to 34VDC), I've cut a laptop power adapter and spliced in.
To communicate with the devices, thats my trouble.... I am using the NewSoftSerial for the rx/tx with the two devices. MDB is supposed to be a bus but I'm trying to break it up onto two pins.

if(vendSerial.available())
{
incoming=vendSerial.read();
Serial.print(incoming, BIN);
}

if(Serial.available())
{
incoming=Serial.read();
vendSerial.print(incoming, BIN);
}

When I turn the devices on, I will get a byte of 1's for each device. So I'm thinking that I have everything setup to listen. I'm not getting any response when I send the following: 00110000

00110 is the bill validator (address is b3 through b7) and 000 is the command RESET (command is b0 through b2)
MDB is 9bit and with this extra bit setting the mode (mode is either 1 for an address byte or 0 for data) - I've tried to send it at the start or end with no luck.
A detaied run through of the protocol can be found on section 2 and the bill validators are on section 6:
http://vending.org/technology/MDB_Version_4-2.pdf

Outside of not speaking the MDB language correctly, my only other thought is that I'm not being heard when sending from the arduino to bill validator. According to 4.2 - Buss tx/rx specs, a peripheral slave (bill validator) max input current is 15mA@4V and min sink current is 15mA@1V. I've tried with and without a resistor to take the arduino's sending to slightly below 15mA and still hasn't made a difference.

I'm okay with code(over one year), but still learning on the electronics/current side (no experience).

If anyone can shed some/any light on the problem (rather specific), it would be awesome. Outside of a couple mentions from kegbot makers, I haven't found much on the topic of MDB and arduino. Thanks everyone
-John

Hi John,

late reply but possibly it helps you :slight_smile:
I've implemented MDB on an AtMega644P (STK500 Dev Board) and its working :smiley:
The implementation simulates a Cashless Device which is connected to the vending machine and to a PC.

See the demo video here

I plan to port the code to an Arduino Mega 2560 soon!

When i have a working version i will post it here (or in a ne thread)

Greets Bouni

Hi,

any news on your MDB routines for mega 2650 ?

I plan to buy a mega 2650 and implement mdb protocol to access mdb clients (card readers)
I did this allready on pc and windows CE base, but like to do it with a arduino.

do you plan to publish your mdb-serial code?

regards
Mirko

ps: Ich hab mir schon überlegt mal im reaktor23 vorbei zu schauen. Sind aber 2 Stunden fahrt :wink:

Hi,

sorry for the late reply :confused:

I plan to buy a mega 2650 and implement mdb protocol to access mdb clients (card readers)

I just started to implemnt this, so far the serial communication seems to be ok :slight_smile:
But i did it in c and not in Arduino/c++ because im not very familiar wit c++ and my plans to extend the HWSerial Lib of arduino failed.

I did this allready on pc and windows CE base, but like to do it with a arduino.

I not even tried this because i've read so much about the difficulties of 9Bit on a normal RS232 Port.

do you plan to publish your mdb-serial code?

Definitely, YES :smiley:
But not my current code (its a pain in the ass, and buggy too) :wink:

ps: Ich hab mir schon überlegt mal im reaktor23 vorbei zu schauen. Sind aber 2 Stunden fahrt :wink:

Evtl. lohnende 2 Stunden :smiley: Ruf auf jeden Fall an oder frag auf der ML ob jemand da sein wird!

Has anyone beign able to finish this project with arduino if so any help will be apreciated

Good day!

Guys anyone managed to implement communication protocol MDB?
I would really appreciate your feedback.

Hi defaust,

i still work on implementing MDb on an Arduino Mega 2560.
I write the code in c, because im not familiar with cpp so far and the Arduino HW Serial lib does not support 9Bit Mode.

You can find infos abiout my progress here:

https://reaktor23.org

Hi Dear Bouni!
I downloaded the files you made ??available on the site (main, usart, uplink and mdb), but do not know how to compile on the Atmel Studio. You can help me?
Where should i install the files *.h and *.c?

Thanks!!!!