Deusch/German  Deutsch

English/Englisch  English

YADRO-Logo

Home

News

What is it?

Using YADRO

In Detail

Downloads

where to buy

Newsletter

links

Contact

DRO:int4 in Detail

The DRO:int4 is (currently) coming as a kit version. See the dealer's page for options regarding cables, plugs and cases. They might also have scales that are guaranteed to work together with the interface.

The interface can be used without the DRO:ddisp-software if one is willing to write his own DRO-software. The interface has a set of commands that communicate with the scales, setup the interface and, most of all, gets the readings of the scales.

The sections:

DRO:int4 Commands:

If you connect the YADRO-interface to your PC, start a terminal program (having set up the baud-rate properly) and then power up the YADRO-interface, you will be welcomed by:

*** Welcome to YADRO-land! ***
(c) 2005 Nick Mueller // www.yadro.de

I have assembled a very simple terminal program (TERM.EXE) for you that connects to COM1 and sets the baud rate to 19200Bd. Nothing valuable, but it works under DOS. You can change the default-port (COM1) by invoking Y-TERM with -c:COMx (x being the port#).
You don't have to terminate commands with a CR or so.

YADRO's RS232 characteristics:

  • 19200 baud
  • 8 bit
  • 1 stop bit
  • no handshake (neither XON/XOFF, nor RTS/CTS)

Note, that commands are case-sensitive! All responses from the controller are terminated by a CR/LF

command
(Typed in a the console)
action
(happening inside the controller)
response
(from the controller)
v version
Displays version of firmware
YADRO-DROINT v0.2c
d0
d1
d2
d3
Debug/display device #0… device #3 verbose information.
Valid range is 0..3. If you are out of range, you'll get a warning.

A "d"-command prepares the interface for reading from a (connected) device. If you start the YADRO for the very first time, you need to do at least a "da" or a "d0" etc. for each digital scale connected. If you don't do that, you will get error-warnings when trying to read from that port.

This command may take up to 2 seconds. It will even take longer if you connect some low frequency generating device to it. But you don't.

If nothing is connected to the port:
Checking device #0...
Clock :stuck H
Data  :stuck H

If something is connected:

Checking device #0...
Clock : Signal
Data  : Signal

If that something is recognized:

Checking device #0...
Clock : Signal
Data  : Signal
Device: 7BCDs ('B')

or

Checking device #0...
Clock : Signal
Data  : Signal
Device: 2*24bits ('L')
da Does a "d0", "d1", "d2", "d3" for your convenience in one block. see d0…d3
dw Writes the information gathered by a "da" or "d0"…"d3" command into the interfaces non volatile memory (EEPROM). If you switch off and back on again, that information is read back automatically, so you don't have to go through a "da" sequence every time you power the YADRO-interface up.
OK
dr dr is the inverse of dw. It reads the configuration from the EEPROM. You normally don't need that command, as YADRO reads that information after each reset/power up. But it helped me to find a nasty bug. So I'll leave it in there.
The numbers you get are 8bit hex and representing the number of bits the scale connected to the ports (from left to right / from dev0 to dev3) is reading. 00 means nothing connected. A 31 would be a type "L" scale.
31313100 OK
r0
r1
r2
r3
Read from device #0…#3. You have to have set up the interface at least once with a "da" command.
The output is in hex, terminated with a CR. The bit order is exactly the same as it was received. There is no interpretation at all.
After the device#, there is a character indicating the type of device connected. It is either a "B" or a "L"
DRO#0B:0x00112233

or

DRO#0L:0x0011223344
s0
s1
s2
s3
Sample device 10 times. This is a burst read from one device. E.g. like calling 10 times the "r" command very fast. You can use this to find out (during setting up) whether your digital scale can be switched to fast mode. It also might help in averaging the reading of that port on the PC side. 10 times like a r0, r1, r2, r3
a Active mode. In this mode, all ports are read in an infinite loop and, whenever a port changes it's value, it is sent. When no reading changes, no data is sent at all
OK

Then: see r0, r1, r2, r3

p Passive mode. Just terminates the active mode. The passive mode (or "polling mode") is the mode when the YADRO is powered up.
To get readings in that mode, you have to ask (to poll) values with "r0"…"r3" or with "s0"…"s3"
OK
c0C
c1C
c2C
c3C
Config port, by pulling Clock high. This command pulls the Clock line of the digital scale to high (1.55V) for 1 second. It helps in switching modes. See the previous pages and the description for details.

Note that the second "C" is capital.

OK
c0D
c1D
c2D
c3D
Config port, by pulling Data high. This command pulls the Data line of the digital scale to high (1.55V) for 1 second. It helps in switching modes. See the previous pages and the description for details.

Note that the "D" is capital!

OK
R Resets the interface. This is a software-reset, and the command might be quite useless. But it exists. The welcome text

Be friendly to your interface! Do not flood with commands, but wait 'till you get a response. If you do send a command before you got a response, the command will simply be lost. The controller only buffers one complete command and empties that buffer after the command is processed. If you send unrecognized commands, they will simply be purged without any comment.

Schematics

For reference, here is the schematic of the DRO:int4. Sorry for the bad quality of the PDF.

Publishing the schematic does not mean that it is freeware. (C) is still by me and any commercial usage prohibited!

BOM

Part# Spec. Comment
Capacitors
C1…C5, C10, C12, C13, C15 100n ceramic
C8, C9 22p ceramic
C6 10u electrolytic, 6.3V
C11, C16 1000u electrolytic, 33V
C7 22u electrolytic, 6.3V
C14 1u tantalum, 6.3V
not drawn 1u tantalum, 2V min., going in each digital scale
Resistors
R1, R2, R5…R12 100 R1, R2 metal film, 1%
R3 56 metal film, 1%
R4 220 metal film, 1%
R14, R15, R23 330
R16, R19..R22 3k9
R13, R17, R18 10k
Diodes
B1 B40C800 bridge rectifier; minimum 20Volts, 200mA;
LED1 -- power on LED; high eff type
Integrated Circuits
IC1 MAX232N (TI) or MAX232ACPE (Maxim)
IC2 LM317LZ TO92 case
IC3, IC4 LM2901N
IC5 CD4051N (DIL case) can be 4051B to
IC6 Atmel ATtiny2313-20PI a Atmel 90S2313 does not work
IC7 uA78S05 1.5 Amps (200mA would be enough)
OK1, OK2 HCPL4502 or 6N136
Misc
Q1 20MHz (HC18 case) can be the higher case to
DC1 5V/5V DC/DC 5v-5v DC/DC converter; isolated; 1W; output unregulated +/-10% SIL4-case.
They are all called "xxx0505S".
J1 MTA02-100 Molex
J2 MTA03-100 Molex
X2 9 pin D-sub male get a PCB mounting or a front mounting one
SV2…SV5 6 pin header pin 6 is NC
SV1 10 pin DIL-header, male might be left out depending on your programming means.
not drawn power supply 7 …9 V AC, 200mA min.
not drawn null-modem cable 9 pin female/female length as required

All Rs are 1/4Watt, 10%. Except R1, R2, R3 and R4 that should be 1% metal film.
Voltages of electrolytic caps can be higher as long as they fit onto the PCB.

I

For curiosity, here is my first full prototype of the DRO:int4

Reprogramming the µC:

The DRO:int4's micro-controller can be reprogrammed. But I will offer a service for a programmed uC if the need should be.

If you are willing to invest in a very simple interface or have a ISP for the ATMEL-line of uCs you can use it together with the programming adapter on the board (ISP, 10 pin header near the processor).

After you have the necessary programming interface, download the current version of the controller's firmware here, load it into the programmer's software and flash it into the YADRO-interface. Current version is V0.2c.

Do not forget to set the configuration bits of the uC when programming it. DWEN, EESAVE, WDTON, BODLEVEL0, BODLEVEL1, CKDIV8, CKOUT, SUT0, SUT1, CKSEL0, CKSEL1, CKSEL2 have to be unchecked. Only exception is BODLEVEL2 that has to be checked.
See the screenshot, if checking/unchecking/programm/set/whatever confuses me like it does you.

If you forget to set BODLEVEL2, chances are that you are loosing the configuration after disconnecting the power. BODLEVEL is brown out detection, if you care.

Look twice where pin 1 of the ISP-interface is! This detail of the PCB is not the current layout, but the orientation of the ISP relative to the uC has not changed.

This is the simples programming-interface (called TwinAVR) you can imagine. If you decide to use that one (I haven't, but got good feedback), you can build a simpler interface (compared to the one shown at the TwinAVR's page) that connects to the 10 pin head (SV1):

The "X-PC" connector goes to your PCs Centronics printer port. You just need 2 Rs with 220 Ohms. While programming you have to connect the power supply to the DRO:int4.

Set the configuration and security bits this way:

Programming with PonyProg:

You can download a plan for a ISP-interface and software for programming the uC here. This solution is more complicated but saver. If you intend to do your own projects with ATMELs, I would suggest using this one (or something similar). ISP-compatible interfaces are available at many dealers for around $10.

Set the configuration and security bits this way: