All Projects → perdidor → Arduino-MDB-UART

perdidor / Arduino-MDB-UART

Licence: other
Atmega1284 PLC as MDB-UART converter/MDB Master/MDB VMC emulator

Projects that are alternatives of or similar to Arduino-MDB-UART

lwpkt
Lightweight packet protocol structure for multi-device communication focused on RS-485
Stars: ✭ 71 (+1.43%)
Mutual labels:  master
Firmware Over The Air
graduation project of ITI, flashing a new firmware over the air for automotive industry
Stars: ✭ 18 (-74.29%)
Mutual labels:  uart
diypowerflow
DIY Powerflow
Stars: ✭ 19 (-72.86%)
Mutual labels:  diy
r e c u r
an open diy py/pi based video sampler
Stars: ✭ 220 (+214.29%)
Mutual labels:  diy
ble-serial
"RFCOMM for BLE" a UART over Bluetooth low energy (4.0+) bridge for Linux, Mac and Windows
Stars: ✭ 134 (+91.43%)
Mutual labels:  uart
JBC SolderingStation
JBC_SolderingStation
Stars: ✭ 63 (-10%)
Mutual labels:  diy
mdb4-react-ui-kit
React Bootstrap with Material Design - Powerful and free UI KIT
Stars: ✭ 74 (+5.71%)
Mutual labels:  mdb
ATtiny85-TinyLoad
Electronic Dummy Load
Stars: ✭ 32 (-54.29%)
Mutual labels:  diy
TonUINO
Alternative TonUINO Firmware
Stars: ✭ 112 (+60%)
Mutual labels:  diy
OpenAVRc Dev
The Next Step ...
Stars: ✭ 60 (-14.29%)
Mutual labels:  diy
ATtiny85-TinyDFPlayer
MP3-Player
Stars: ✭ 22 (-68.57%)
Mutual labels:  diy
BenEaterVHDL
VHDL project to run a simple 8-bit computer very similar to the one built by Ben Eater (see https://eater.net)
Stars: ✭ 30 (-57.14%)
Mutual labels:  uart
coap-go
Lobaro CoAP for GoLang - server and client applications
Stars: ✭ 20 (-71.43%)
Mutual labels:  uart
Quad-Serial
Quad serial project with FTDI CI's, Isolation and 1.8~5.5v UART port.
Stars: ✭ 17 (-75.71%)
Mutual labels:  uart
Controller-for-WLED-firmware
Wi-Fi controller based on ESP-07S module with external antenna for WLED firmware.
Stars: ✭ 48 (-31.43%)
Mutual labels:  diy
jean-pierre
A Raspberry Pi robot that helps people make their grocery list.
Stars: ✭ 41 (-41.43%)
Mutual labels:  diy
docker-mysql-replication
master master & master slave replication in mysql
Stars: ✭ 33 (-52.86%)
Mutual labels:  master
mdbsvelte
Svelte Bootstrap with Material Design
Stars: ✭ 65 (-7.14%)
Mutual labels:  mdb
simple-spectro
Very cheap, autonomous and precise spectrophotometer for DIY biology and chemistry.
Stars: ✭ 36 (-48.57%)
Mutual labels:  diy
LipSync
An open-source mouth operated sip and puff joystick that enables people with limited hand function emulate a mouse on their computer and/or smartphone.
Stars: ✭ 27 (-61.43%)
Mutual labels:  diy

Русская версия описания находится ниже

Arduino-MDB-UART

Atmega1284 PLC (or Arduino Mega, or any other ATmega chip with 2 UARTs) acts as man-in-the-middle between MDB peripheral and master PC (VMC) serial port. It off-loads MDB bus polling and converting data between 9-bit MDB and 8-bit RS232 tasks from VMC, effectively delivers data by using hardware interrupts and provides conformity for required timing restrictions (see MDB datasheet for details). Command received from master PC (VMC) via serial port (RXD1 on AtMega1284), then sent to MDB serial port (TXD0) with 9-bit format.

Compiled_firmware folder contains ready-to-burn firmware images in hex format, for both "Through-hole ATmega1284" and "new rev2a" versions, see instructions inside. Docs folder contains manuals for operating device with firmware included.

HOW CAN I USE IT?

It's for connecting PC or other computer with "usual" 8-bit COM port ("Master", "VMC") to MDB devices (slaves such as coin charger, bill validator etc...), to control these devices and receive messages from them. It's NOT for emulating coin charger or something like it (for these purposes you'll need another adapter). It's NOT for MDB sniffing, schematics will differ too, due MDB lines are optoisolated current loops. See user manual for actual supported device list.

Get Started

It will be simple to repeat, all components are available and cheap (see parts_list.txt). "Sprint Layout 6.0" software required to view and edit PCB design file "mdb-rs232.lay6".

IMPORTANT:

  • LED mounting height 14mm;
  • DO NOT use device without radiator.

Repository contains enclosure files for 3D printing (for single-side board adapter only).

Burning firmware into adapter's MCU:

This section was added after I sent out dozens of similar responses to requests for assistance via email. It looks like a lot of new people have come to hardware development due to the fucking covid pandemic. OK here's a quick guide on how to start the device after assembly.

So, we need to do three operations: flash the hex file of the main program, flash the eep file with the adapter settings, and set the correct fuses values. The firmware is compiled with the expectation that the chip clocked from an external crystal at 16 MHz, so if the fuses values are incorrect, the chip will not be able to work at best due to incorrect timing, at worst the chip will be impossible to flash using any serial method for the same reason.

Prerequisities:

For the firmware upload, you will need:

For the programmer to work, you need a driver (not for all OS), you can download it on the device developer's website https://www.fischl.de/usbasp/

  1. Connect the adapter and the programmer with 6 wires. Look for the pinout of the ICSP10 connectors in Google, for the adapter it is located in the component designation file (for the double-sided version) or on the board.

  2. Set the correct fuse values, for example, for Atmega644P they will be as follows:

Find the required values for atmega1284 yourself in the datasheet or numerous calculators on the Internet.

You can also set fuse values using the Arduino IDE: select the desired chip, frequency and clock source, programmer and / or port, and click "Burn Bootloader" in the same menu.

  1. Select the desired hex firmware file and eep settings file, and flash them in the same order (Programm button).

Check the result:

As a result, after a successful firmware upload and the absence of assembly and manufacturing defects, you will have a working device. It will look like this: in the absence of a connected peripheral device (coin acceptor, bill acceptor), the MDB Tx indicator blinks, when power is applied, and the VMC UART in 9600-8-N-1 mode outputs the firmware version and that's it. When connecting supported devices (see the manual), the MDB Rx indicator should blink - this is the answers from them to the adapter, and information about the connected devices will appear in the VMC UART output.

If the behavior differs from the one described - either it is incorrectly assembled or it is incorrectly programmed, nobody's advice will help here, read again and do everything carefully, checking each step.

Live demo with ICT A7\V7 bill validator and Currenza C2 Blue coin changer:

Video

Assembled enclosure (render, more in Enclosure folder) Собранный корпус (рендер, остальные в том же каталоге)

PCB design included is one-sided FR4 70x80mm (render) Внешний вид печатной платы 70х80мм (рендер)

PCB rev2a complete package included (render, double-side, RTM)

rev2a finished device photo:

Credits

Inspired by MDB-Sniffer project https://github.com/MarginallyClever/MDB-Sniffer

========================End of English version==========================

Конвертер MDB-UART на базе Arduino

Микроконтроллер Atmega1284 или любой другой (например плата Arduino Mega на основе ATmega2560), имеющий два аппаратных UART на борту, может использоваться как конвертер между обычным компьютером или другим устройством с обычным RS-232 портом, и периферийными устройствами, работающими по протоколу MDB. Он разгружает управляющий компьютер от задач, связанных с опросом шины MDB и конвертированием между 9 и 8 битным форматом, обеспечивает соответствие временным ограничениям протокола и эффективно использует аппаратные прерывания. Обмен данными с управляющих компьютером осуществляется через UART1, с шиной MDB через UART0.

Каталог Compiled_firmware содержит готовые к прошивке образы в офрмате Intel hex, для обеих аппаратных версий адаптера (на базе ATmega1284 и ATmega644PA). Каталог Docs содержит инструкции по работе с прошитым устройством.

Зачем нужен этот девайс?

Чтобы управлять устройствами приема наличных и исполнительными устройствами, входящими в состав киосков самообслуживания (торговых автоматов), по протоколу MDB. Девайс НЕ ПРЕДНАЗНАЧЕН для эмуляции вышеперечисленных устройств, для этого нужен другой адаптер. См. инструкцию для уточнения актуального списка поддерживаемых устройств.

Приступаем

Это не очень трудно, компоненты дешевы и доступны (список компонентов в файле parts_list.txt, магазин запчастей с доставкой http://www.chipdip.ru). Обычно получается дешевле 20 долларов (без корпуса). Файл дизайна печатной платы "mdb-rs232.lay6" для просмотра требует ПО "Sprint Layout 6.0"

ВАЖНО:

  • Высота установки светодиодов 14мм;
  • Без радиатора на регуляторе напряжения использовать не рекомендуется.

Для двухстороннего варианта платы (rev2a) есть архив с полным комплектом технологической документации, для заказа изготовления в стороннем сервисе.

Репозиторий содержит файлы для заказа или самостоятельной печати корпуса устройства (для варианта с односторонней платой) на 3D принтере (каталог "Enclosure").

Рендеры корпуса и печатных плат в английской версии выше.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].