To capture the ASCII stream, you will need to do the following:
- Attach a USB <--> TTL adapter to the Service Port
- Open up the Arduino IDE
- Select the serial port used by the USB <--. TTL adapter in Step #1 via Tools/Serial Port
- Make sure the correct Board type is selected via Tools/Board (Arduino Uno for the controller)
- Open the Controller 'sketch' (source code).
- Un-comment the line #define DEBUG (remove the two // at the start of the line)
- This will cause an extra set of debug information to be sent to the serial port.
- Consider changing "#define SDM_SENSITIVITY 20" in the source code from 20 to a smaller number, especially if looking at load-dumps, or some odd issue. This #define controls how may times through manage_alt() before a debug string is sent out. Setting it to 1 gives the most data, and the largest files..
- Upload the new sketch.
Example debug output. |
Oh you can use a 3rd party terminal program. Myself, I like to use PuTTY as it is simple, reliable, fast, and you can enable it to automatically capture the .txt file. To use PuTTY take note which serial port is being used by the Arduino IDE to communicate with your controller (Step #3). Then download PuTTY using the following link: http://www.chiark.greenend.org.uk/~sgtatham/putty/download.html
Once installed, open PuTTY and make the following changes:
- On the opening screen (Session screen), enter the Serial port and Speed from step #3 above. Click the 'Serial' button.
- On the Session/Logging screen, click the 'Printable output' button and enter a log filename. Each time you run PuTTY data will be captured into this log file.
- On the Window screen, change the columns to something large, like 400.
- Not really needed, the log file will be OK w/o this change.
- Just makes the visible screen look a little nicer.
- Then go back to the Sessions screen and click the 'default setting' profile and press the Save button.
If you would then Email it to me, I can use it to help look for ways to improve the code.
You can look for the function debug_print_common(); to get an idea what data is being sent out. And if you do have any issues with the generator, make sure to set the sensitivity to 1 and capture all the data. Note that the 1st number sent out is a time mark, so in the preamble it would be good to comment on what you see going wrong, and referencing to the approx timestamp if you can.
And when finished you can reload the firmware with the #define DEBUG commented out - disabling the ASCII strings. Not sure it really matters, I tend to leave DEBUG mode enabled on my generator.
No comments:
Post a Comment