The idea came to me in connection with the Arduino PLC. It's great to be able to change the program on the hardware. It works very well in the living room or at the desk. But I also use the PLC in my RC models and there I rarely have the opportunity, after installation, to get to the 3 keys. Let alone the patience to hack the codes. Everybody owns a smart cell phone by now. So, I figured out a way how to get my programs into the PLC by using a cell phone, some hardware and an internet service.
What you need:
he actual download of the program to the PLC is done via a serial protocol. This can even be done with a simple terminal program (or the built-in serial monitor in the ArduinoIDE).
This new programming mode is entered, if after a reset of the PLC and the the SEL (and only this one ) button remains pressed. This protocol only knows 3 commands R (ead), W (rite) and E (xit).
With Read the current program is output and with Write a new one is written in. The Format used is Intel HEX for both options. With Exit or a new Reset you leave this mode.
To communicate using the mobile phone with the PLC, you also need a USB / serial converter. The most common ones are found under the name FTDI. This is a simple USBtoSerial converter that works with both - the PC and a mobile phone. Furthermore, the phone must support USB OTG. (Just google it to find out about your cellphone) In this way we have now a simple serial port on the phone. Now add a terminal program app onto the phone, job done.
Finally, you have to convert your program idea into the IntelHEX format. This is achieved via this little service here on my website.
Like any other assembler, this assembler translates the handwritten mnemonic code into a machine-readable program. Here to a program for the TPS / PLC.
The following features are supported:
You can find the online version here: Online TPS Assembler public BETA
The following mnemonics are supported:
Each hardware option has another max. Program size – based on the EEPROM area available.
* Everything over 256Byte Program Size can only be used by using subroutines (DFSB and CASB).
By using this Online SPSAssembler , you can enter and compile your source code. The output format is a simple text file with the corresponding representation for direct input into the TPS.
Alternatively, you can output the data as Intel HEX file. My Arduino_TPS and Tiny_TPS can receive both formats via the serial port. The following steps are necessary for this:
The ATTiny84 uses pins 11 (RX) and pin 12 (TX). A protocol with 9600 baud, 0 parity, 1 stop bit is used. The connection is made to the Tiny_TPS board via the input pin row.
Pin | Signal | FTDI |
---|---|---|
2 | Din.2, TX | RX |
3 | Din.3, RX | TX |
5 | GND | GND |
(This translation was made by juergen pintaske, many thanks for your effort.)