4. ARDUINO DEMO SOFTWARE
IMPORTANT! The demo software to be presented has been developed for the (now old) Arduino 1, whose biggest limit in this project is the reduced output resolution of 8 bits. Even if not yet tested, the same software, probably with a few small modifications, will be able to drive the new Arduino M0 or the newest Arduino M0 PRO. Apart from the significantly bigger operating speed (48 Mhz) the new micros (with a programmable PWM resolution) will guarantee an overall System resolution of up to12 bit, e.g. 2,500/4095 = 0.61 mV. Amended as of 24/2/16: for the time being no proper technical documentation has been made available for Arduino M0 and M0 PRO and judging by the state of confusion reigning, I expect to be able to move to these new devices not before 8/9 months.
4.1 Direct connection
It is possible to test the software without the RS485 Modems, by simply connecting Master & Slave, as shown in the enclosed schematic. This interconnection is also useful when trouble in the Modems is suspected.
4.2 Master & Slave sketches
Unfortunately the original Arduino files are not accepted by the Pico Site and therefore cannot be downloaded. I have copied and downloaded the contents into WORD files. Please carefully copy the text of each file and paste it into an Arduino blank file: it will compile and upload with no trouble. If it does not compile, most probably one or more inverted commas (“”) will have become garbled in the transfer from WORD to Arduino IDE and will have to be manually corrected.
In the sketches almost every step has been commented. However, if anybody needs a logic diagram, will be happy to deliver.
4.3 Quick System testing
Before compiling/uploading the sketches, open the Arduino folder and make sure you have the Software Serial library in the libraries folder. I advise the following steps.
a) Connect the Arduinos with the direct connection (no Modems).
b) Provide the + 2.5 V EXTERNAL REFERENCE voltage with an external PSU: precision is not necessary at this stage.
c) Use two PC's driving the Arduinos thru their USB buses.
d) Upload the sketches and, if there are no problems in compiling/uploading, the System will start working at once, as described in previous Part 2.
e) Problems in compiling/uploading will only depend on errors in transferring the sketch from Word format to Arduino format, so every software entry must be carefully checked against the text in Word format.
f) If nothing is connected to Slave's A0 input, the PWM pin 3 on the Master will be at zero potential (no PWM). Now connect a 10 K multiturn between ground and the +2.5 V reference PSU with the centre pin to Slave's A0 and pin 3 of the Master will become alive.
Once all above done and working, you can proceed with Modem installation, which will be covered next.