| Home |
by Martin Clausen (mc AT rotgradpsi DOT de)
This circuit employs a MCU to digitalize the photo current of up to eight photodiodes or any other current or voltage sources with 16 bit resolution.
The line end character can be changed easily, just send me a mail with your demands.
The LED will be on after power-up. After each correct command it will toggle between on and off. If a buffer overflow occurs, the LED will stay permanently off and the MCU is stopped.
The measurement is done when a falling edge appears on the interrupt pin. If you want to control this pin via RS232 you could use a GPIO pin. There is no direct control of this feature via software.
The GPIO is written via the lower byte of command 3, all other bytes are dummies. Reading is possible via command 4. Here all bytes send are dummies. The state of the GPIO after reset is high.
Note that you need to write an one to a GPIO before it is possible to use it as an input, if it has been used as an output since the last reset.
The GPIO lines are located at P2 of the MCU. They are open collector outputs with a weak pull-up resistor and contain also a circuit for read back. Refer to the microcontroller datasheet for details.
Messages from the controller are sent with its own address first and then followed by the data in hex-code (nibble by nibble from msb to lsb).
| MSB - LSB | Baudrate / kbps |
|---|---|
| 111 | 115.2 |
| 110 | 57.6 |
| 101 | 38.4 |
| 100 | 19.2 |
| 011 | 9.6 |
| 010 | 4.8 |
| 001 | 2.4 |
| 000 | 1.2 |
Meaning of 1 and 0 in this table:
| Sign | Switch |
|---|---|
| 1 | closed |
| 0 | open |
The baudrate jumper are read up on reset.
Capacitors:
Resistors:
Mechanic: