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 (Smart Regulator.. for the 3.3v regulator)
- 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 10" in the source code from 10 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..
- 10 was chosen to allow operation via the Bluetooth at 9600 baud.
- If you reduce this number to say 1 (which is needed many times when debugging), you should turn off the Bluetooth module, and then change '#define SYSTEM_BAUD' from 9600 to 115200 and run the serial terminal at that speed.
- 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 search for 'DBG:' in the source code to get an idea what data is being sent out. And if you do have any issues with the regulator, 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. Make sure to restore '#define SYSTEM_BAUD' if you changed it.