Oct. 30, 2010
PLC-4 and PLC-8 rev3
|Control power||9.0 to 28 volts, 1 amps max. Fuse: 3A|
|Auxiliary power out:||5 volts, 0.2 amps max|
|Input voltage||3.0 to 100 volts|
|Input optical isolation:||5000 volts|
|Number of digital (contact) inputs:||PLC-8: 8 PLC-4: 4|
|Analog input:||0 to 5 volts|
|Number of analog inputs||1|
|Output:||Single Pole Double Throw relays|
|Output relay current:||
10 amp relay option: 250 VAC, 30 VDC
3 amp option: 250 VAC, 30 VDC
Optional RS22 DB9 connector, PLC-8 only
Otherwise 5v ttl serial
|Programming:||USB A connector. USBtiny protocol|
PLC-4: legnth: 3.3”, width: 3.2”. height: 1.1”
PLC-8: legnth: 6.0”, width: 3.2”. height: 1.1”
Pin IO charts:
Example: Connecting 4 contacts to each bank of inputs, with two different power supplies:
Note: in this example, inputs 8,7,6,5 use the same supply as the PLC. Optical isolation of the input pins on the micro-controller is still active. The power supply is not isolated, so an accidental over-voltage (> 40V) at the contact may blow the fuse on the PLC.
Programming using LDmicro:
Overview: LDmicro is GNU licensed software is generates .hex file, that can then be uploaded to the PLC’s microprocessor, using the programming software, which is a front-end for Avrdude, a GNU microprocessor programmer.
Linux: Download the .tar.gz file that includes LDmicro for Linux, and thew PLC programmer Software. Simply extract to any Linux partition, and the programs are ready to run. They must be in the same directory as the “tools” directory. An ext2 or ext3 linux formatted USB jump drive works well for portability. Note: fat16 or fat32 USB drives need to be reformatted.
Windows: Download the .zip file. Extract anywhere, the programs are ready to run. There is a “tools” directory that must remain in the same directory as the program.hta file.
LD micro is written written by Jonathan Westhues. More information, examples, tutorials and support are here: http://www.cq.cx/ladder.pl
Run LDmicro. Set the micropprocessor to ATmega8:
The Clock speed is set to 4.000mhz by default.
Create the ladder logic by inserting instructions and rungs from the drop-down menus. As instructions are added that are hardware inputs or outputs, the Name will appear in the lower window. Once the item has been named, by double clicking in the ladder diagram, connect it to the corresponding pin by double clicking in the lower window. Choose the corresponding port from the pop-up list. refer to the Port IO Chart in this document.
If serial communications are used, after inserting a UART instruction, set the baud rate of the UART, under “MCU parameters.”
Once the ladder logic is completed, Save the .ld file, and then use menu item “compile” to create the .hex file.
Please do not use spaces in the name of the .hex file
There will be a note about setting the fuses on the micro controller, this has already been done on Waltech PLC’s.
Connect the PLC by USB, and apply power. Note: the PLC must be powered on. The red and blue LED’s will be lit. Run the Upload_to_PLC program (not yet implemented for Windows, see here) Choose the .hex file that was created by LDmicro, and press enter. Once programming has finished, there will be a results screen.
A successful upload will be indicated by
“avrdude: xxxx bytes of flash verified avrdude done. Thank you.” xxxx will be 8192 or less.
|"avrdude: Error: Could not find USBtiny device (0x1781/0xc9f)"||The USB cable is not connected, or the PC has not recognized the programmer.|
"avrdude: initialization failed, rc=-1
Double check connections and try again, or use -F to override this check."
|The USB connection is established, but the PLC is not powered on, and the programmer can’t communicate with the micro controller.|
|"avrdude: error: usbtiny_transmit: error sending control message: Protocol error."||Unplug and replug USB cable.|
"avrdude: bytes of flash verified avrdude done. Thank you."
(note 8192 is the maximum memory on the microprocessor)
|The wrong file was chosen, or the .hex file is too big. It is possible that the file is exactly 8192 bytes, and all is OK, but most likely the program will have to be reduced in size.|
"avrdude: can't open input file /path-to-file/file: No such file or directory
| .hex file name contains spaces. Remove spaces or use underscore
The LDmicro manual is available here: http://www.cq.cx/dl/ldmicro.txt