Sure I can.
1. Arduino is opened, and the connection box on bottom right message is "Teensy 3.0 on (USB Port)"
2. Upon pressing the "Upload" button, the sketch is compiled successfully (code below) and uploaded to the board, message is "Done Uploading"
Teensy in Auto mode has messaged "Programming" and "Reboot OK".
3. Board is running user code.
4. Tools -> Serial Monitor is selected and nothing happens except this error message:
This report would have more information with
"Show verbose output during compilation"
enabled in File > Preferences.
Arduino: 1.0.5 (Windows 7), Board: "Teensy 3.0"
get_line: "code_size:131072"
get_line: "EOT"
status read, retry 23
send: status - at Sun Aug 11 15:00:14 2013
sent: status - at Sun Aug 11 15:00:14 2013
get_line: "dir:C:\Users\TIMECO~1\AppData\Local\Temp\build805608916718828376.tmp\"
get_line: "file:New_RMS_test.cpp.hex"
get_line: "readable:1"
readable = 1
get_line: "auto:1"
auto = 1
get_line: "online:0"
online = 0
get_line: "online_count:7"
online_count = 0
get_line: "offline_count:0"
offline_count = 0
get_line: "state:0"
state = 0
get_line: "code_size:131072"
get_line: "EOT"
status read, retry 24
send: status - at Sun Aug 11 15:00:14 2013
sent: status - at Sun Aug 11 15:00:14 2013
get_line: "dir:C:\Users\TIMECO~1\AppData\Local\Temp\build805608916718828376.tmp\"
get_line: "file:New_RMS_test.cpp.hex"
get_line: "readable:1"
readable = 1
get_line: "auto:1"
auto = 1
get_line: "online:0"
online = 0
get_line: "online_count:7"
online_count = 0
get_line: "offline_count:0"
offline_count = 0
get_line: "state:0"
state = 0
get_line: "code_size:131072"
get_line: "EOT"
status read, retry 25
send: status - at Sun Aug 11 15:00:14 2013
sent: status - at Sun Aug 11 15:00:14 2013
get_line: "dir:C:\Users\TIMECO~1\AppData\Local\Temp\build805608916718828376.tmp\"
get_line: "file:New_RMS_test.cpp.hex"
get_line: "readable:1"
readable = 1
get_line: "auto:1"
auto = 1
get_line: "online:0"
online = 0
get_line: "online_count:7"
online_count = 0
get_line: "offline_count:0"
offline_count = 0
get_line: "state:0"
state = 0
get_line: "code_size:131072"
get_line: "EOT"
status read, retry 26
send: status - at Sun Aug 11 15:00:14 2013
sent: status - at Sun Aug 11 15:00:14 2013
get_line: "dir:C:\Users\TIMECO~1\AppData\Local\Temp\build805608916718828376.tmp\"
get_line: "file:New_RMS_test.cpp.hex"
get_line: "readable:1"
readable = 1
get_line: "auto:1"
auto = 1
get_line: "online:0"
online = 0
get_line: "online_count:7"
online_count = 0
get_line: "offline_count:0"
offline_count = 0
get_line: "state:0"
state = 0
get_line: "code_size:131072"
get_line: "EOT"
status read, retry 27
send: status - at Sun Aug 11 15:00:14 2013
sent: status - at Sun Aug 11 15:00:14 2013
get_line: "dir:C:\Users\TIMECO~1\AppData\Local\Temp\build805608916718828376.tmp\"
get_line: "file:New_RMS_test.cpp.hex"
get_line: "readable:1"
readable = 1
get_line: "auto:1"
auto = 1
get_line: "online:0"
online = 0
get_line: "online_count:7"
online_count = 0
get_line: "offline_count:0"
offline_count = 0
get_line: "state:0"
state = 0
get_line: "code_size:131072"
get_line: "EOT"
status read, retry 28
send: status - at Sun Aug 11 15:00:14 2013
sent: status - at Sun Aug 11 15:00:14 2013
get_line: "dir:C:\Users\TIMECO~1\AppData\Local\Temp\build805608916718828376.tmp\"
get_line: "file:New_RMS_test.cpp.hex"
get_line: "readable:1"
readable = 1
get_line: "auto:1"
auto = 1
get_line: "online:0"
online = 0
get_line: "online_count:7"
online_count = 0
get_line: "offline_count:0"
offline_count = 0
get_line: "state:0"
state = 0
get_line: "code_size:131072"
get_line: "EOT"
status read, retry 29
send: status - at Sun Aug 11 15:00:14 2013
sent: status - at Sun Aug 11 15:00:14 2013
get_line: "dir:C:\Users\TIMECO~1\AppData\Local\Temp\build805608916718828376.tmp\"
get_line: "file:New_RMS_test.cpp.hex"
get_line: "readable:1"
readable = 1
get_line: "auto:1"
auto = 1
get_line: "online:0"
online = 0
get_line: "online_count:7"
online_count = 0
get_line: "offline_count:0"
offline_count = 0
get_line: "state:0"
state = 0
get_line: "code_size:131072"
get_line: "EOT"
status read, retry 30
send: status - at Sun Aug 11 15:00:14 2013
sent: status - at Sun Aug 11 15:00:14 2013
get_line: "dir:C:\Users\TIMECO~1\AppData\Local\Temp\build805608916718828376.tmp\"
get_line: "file:New_RMS_test.cpp.hex"
get_line: "readable:1"
readable = 1
get_line: "auto:1"
auto = 1
get_line: "online:0"
online = 0
get_line: "online_count:7"
online_count = 0
get_line: "offline_count:0"
offline_count = 0
get_line: "state:0"
state = 0
get_line: "code_size:131072"
get_line: "EOT"
status read, retry 31
send: status - at Sun Aug 11 15:00:15 2013
sent: status - at Sun Aug 11 15:00:15 2013
get_line: "dir:C:\Users\TIMECO~1\AppData\Local\Temp\build805608916718828376.tmp\"
get_line: "file:New_RMS_test.cpp.hex"
get_line: "readable:1"
readable = 1
get_line: "auto:1"
auto = 1
get_line: "online:0"
online = 0
get_line: "online_count:7"
online_count = 0
get_line: "offline_count:0"
offline_count = 0
get_line: "state:0"
state = 0
get_line: "code_size:131072"
get_line: "EOT"
status read, retry 32
send: status - at Sun Aug 11 15:00:15 2013
sent: status - at Sun Aug 11 15:00:15 2013
get_line: "dir:C:\Users\TIMECO~1\AppData\Local\Temp\build805608916718828376.tmp\"
get_line: "file:New_RMS_test.cpp.hex"
get_line: "readable:1"
readable = 1
get_line: "auto:1"
auto = 1
get_line: "online:0"
online = 0
get_line: "online_count:7"
online_count = 0
get_line: "offline_count:0"
offline_count = 0
get_line: "state:0"
state = 0
get_line: "code_size:131072"
get_line: "EOT"
status read, retry 33
send: status - at Sun Aug 11 15:00:15 2013
sent: status - at Sun Aug 11 15:00:15 2013
get_line: "dir:C:\Users\TIMECO~1\AppData\Local\Temp\build805608916718828376.tmp\"
get_line: "file:New_RMS_test.cpp.hex"
get_line: "readable:1"
readable = 1
get_line: "auto:1"
auto = 1
get_line: "online:0"
online = 0
get_line: "online_count:7"
online_count = 0
get_line: "offline_count:0"
offline_count = 0
get_line: "state:0"
state = 0
get_line: "code_size:131072"
get_line: "EOT"
status read, retry 34
send: status - at Sun Aug 11 15:00:15 2013
sent: status - at Sun Aug 11 15:00:15 2013
get_line: "dir:C:\Users\TIMECO~1\AppData\Local\Temp\build805608916718828376.tmp\"
get_line: "file:New_RMS_test.cpp.hex"
get_line: "readable:1"
readable = 1
get_line: "auto:1"
auto = 1
get_line: "online:0"
online = 0
get_line: "online_count:7"
online_count = 0
get_line: "offline_count:0"
offline_count = 0
get_line: "state:0"
state = 0
get_line: "code_size:131072"
get_line: "EOT"
status read, retry 35
send: status - at Sun Aug 11 15:00:15 2013
sent: status - at Sun Aug 11 15:00:15 2013
get_line: "dir:C:\Users\TIMECO~1\AppData\Local\Temp\build805608916718828376.tmp\"
get_line: "file:New_RMS_test.cpp.hex"
get_line: "readable:1"
readable = 1
get_line: "auto:1"
auto = 1
get_line: "online:0"
online = 0
get_line: "online_count:7"
online_count = 0
get_line: "offline_count:0"
offline_count = 0
get_line: "state:0"
state = 0
get_line: "code_size:131072"
get_line: "EOT"
status read, retry 36
send: status - at Sun Aug 11 15:00:15 2013
sent: status - at Sun Aug 11 15:00:15 2013
get_line: "dir:C:\Users\TIMECO~1\AppData\Local\Temp\build805608916718828376.tmp\"
get_line: "file:New_RMS_test.cpp.hex"
get_line: "readable:1"
readable = 1
get_line: "auto:1"
auto = 1
get_line: "online:0"
online = 0
get_line: "online_count:7"
online_count = 0
get_line: "offline_count:0"
offline_count = 0
get_line: "state:0"
state = 0
get_line: "code_size:131072"
get_line: "EOT"
status read, retry 37
send: status - at Sun Aug 11 15:00:15 2013
sent: status - at Sun Aug 11 15:00:15 2013
get_line: "dir:C:\Users\TIMECO~1\AppData\Local\Temp\build805608916718828376.tmp\"
get_line: "file:New_RMS_test.cpp.hex"
get_line: "readable:1"
readable = 1
get_line: "auto:1"
auto = 1
get_line: "online:0"
online = 0
get_line: "online_count:7"
online_count = 0
get_line: "offline_count:0"
offline_count = 0
get_line: "state:0"
state = 0
get_line: "code_size:131072"
get_line: "EOT"
status read, retry 38
send: status - at Sun Aug 11 15:00:15 2013
sent: status - at Sun Aug 11 15:00:15 2013
get_line: "dir:C:\Users\TIMECO~1\AppData\Local\Temp\build805608916718828376.tmp\"
get_line: "file:New_RMS_test.cpp.hex"
get_line: "readable:1"
readable = 1
get_line: "auto:1"
auto = 1
get_line: "online:0"
online = 0
get_line: "online_count:7"
online_count = 0
get_line: "offline_count:0"
offline_count = 0
get_line: "state:0"
state = 0
get_line: "code_size:131072"
get_line: "EOT"
status read, retry 39
send: status - at Sun Aug 11 15:00:15 2013
sent: status - at Sun Aug 11 15:00:15 2013
get_line: "dir:C:\Users\TIMECO~1\AppData\Local\Temp\build805608916718828376.tmp\"
get_line: "file:New_RMS_test.cpp.hex"
get_line: "readable:1"
readable = 1
get_line: "auto:1"
auto = 1
get_line: "online:0"
online = 0
get_line: "online_count:7"
online_count = 0
get_line: "offline_count:0"
offline_count = 0
get_line: "state:0"
state = 0
get_line: "code_size:131072"
get_line: "EOT"
status read, retry 40
send: status - at Sun Aug 11 15:00:16 2013
sent: status - at Sun Aug 11 15:00:16 2013
get_line: "dir:C:\Users\TIMECO~1\AppData\Local\Temp\build805608916718828376.tmp\"
get_line: "file:New_RMS_test.cpp.hex"
get_line: "readable:1"
readable = 1
get_line: "auto:1"
auto = 1
get_line: "online:0"
online = 0
get_line: "online_count:7"
online_count = 0
get_line: "offline_count:0"
offline_count = 0
get_line: "state:0"
state = 0
get_line: "code_size:131072"
get_line: "EOT"
status read, retry 41
send: status - at Sun Aug 11 15:00:16 2013
sent: status - at Sun Aug 11 15:00:16 2013
get_line: "dir:C:\Users\TIMECO~1\AppData\Local\Temp\build805608916718828376.tmp\"
get_line: "file:New_RMS_test.cpp.hex"
get_line: "readable:1"
readable = 1
get_line: "auto:1"
auto = 1
get_line: "online:0"
online = 0
get_line: "online_count:7"
online_count = 0
get_line: "offline_count:0"
offline_count = 0
get_line: "state:0"
state = 0
get_line: "code_size:131072"
get_line: "EOT"
status read, retry 42
send: status - at Sun Aug 11 15:00:16 2013
sent: status - at Sun Aug 11 15:00:16 2013
get_line: "dir:C:\Users\TIMECO~1\AppData\Local\Temp\build805608916718828376.tmp\"
get_line: "file:New_RMS_test.cpp.hex"
get_line: "readable:1"
readable = 1
get_line: "auto:1"
auto = 1
get_line: "online:0"
online = 0
get_line: "online_count:7"
online_count = 0
get_line: "offline_count:0"
offline_count = 0
get_line: "state:0"
state = 0
get_line: "code_size:131072"
get_line: "EOT"
status read, retry 43
send: status - at Sun Aug 11 15:00:16 2013
sent: status - at Sun Aug 11 15:00:16 2013
get_line: "dir:C:\Users\TIMECO~1\AppData\Local\Temp\build805608916718828376.tmp\"
get_line: "file:New_RMS_test.cpp.hex"
get_line: "readable:1"
readable = 1
get_line: "auto:1"
auto = 1
get_line: "online:0"
online = 0
get_line: "online_count:7"
online_count = 0
get_line: "offline_count:0"
offline_count = 0
get_line: "state:0"
state = 0
get_line: "code_size:131072"
get_line: "EOT"
status read, retry 44
send: status - at Sun Aug 11 15:00:16 2013
sent: status - at Sun Aug 11 15:00:16 2013
get_line: "dir:C:\Users\TIMECO~1\AppData\Local\Temp\build805608916718828376.tmp\"
get_line: "file:New_RMS_test.cpp.hex"
get_line: "readable:1"
readable = 1
get_line: "auto:1"
auto = 1
get_line: "online:0"
online = 0
get_line: "online_count:7"
online_count = 0
get_line: "offline_count:0"
offline_count = 0
get_line: "state:0"
state = 0
get_line: "code_size:131072"
get_line: "EOT"
status read, retry 45
send: status - at Sun Aug 11 15:00:16 2013
sent: status - at Sun Aug 11 15:00:16 2013
get_line: "dir:C:\Users\TIMECO~1\AppData\Local\Temp\build805608916718828376.tmp\"
get_line: "file:New_RMS_test.cpp.hex"
get_line: "readable:1"
readable = 1
get_line: "auto:1"
auto = 1
get_line: "online:0"
online = 0
get_line: "online_count:7"
online_count = 0
get_line: "offline_count:0"
offline_count = 0
get_line: "state:0"
state = 0
get_line: "code_size:131072"
get_line: "EOT"
status read, retry 46
send: status - at Sun Aug 11 15:00:16 2013
sent: status - at Sun Aug 11 15:00:16 2013
get_line: "dir:C:\Users\TIMECO~1\AppData\Local\Temp\build805608916718828376.tmp\"
get_line: "file:New_RMS_test.cpp.hex"
get_line: "readable:1"
readable = 1
get_line: "auto:1"
auto = 1
get_line: "online:0"
online = 0
get_line: "online_count:7"
online_count = 0
get_line: "offline_count:0"
offline_count = 0
get_line: "state:0"
state = 0
get_line: "code_size:131072"
get_line: "EOT"
status read, retry 47
send: status - at Sun Aug 11 15:00:16 2013
sent: status - at Sun Aug 11 15:00:16 2013
get_line: "dir:C:\Users\TIMECO~1\AppData\Local\Temp\build805608916718828376.tmp\"
get_line: "file:New_RMS_test.cpp.hex"
get_line: "readable:1"
readable = 1
get_line: "auto:1"
auto = 1
get_line: "online:0"
online = 0
get_line: "online_count:7"
online_count = 0
get_line: "offline_count:0"
offline_count = 0
get_line: "state:0"
state = 0
get_line: "code_size:131072"
get_line: "EOT"
status read, retry 48
send: status - at Sun Aug 11 15:00:16 2013
sent: status - at Sun Aug 11 15:00:16 2013
get_line: "dir:C:\Users\TIMECO~1\AppData\Local\Temp\build805608916718828376.tmp\"
get_line: "file:New_RMS_test.cpp.hex"
get_line: "readable:1"
readable = 1
get_line: "auto:1"
auto = 1
get_line: "online:0"
online = 0
get_line: "online_count:7"
online_count = 0
get_line: "offline_count:0"
offline_count = 0
get_line: "state:0"
state = 0
get_line: "code_size:131072"
get_line: "EOT"
status read, retry 49
Please press the RESET BUTTON on your Teensy to upload your sketch. Auto-reboot only works if the Teensy is running a previous sketch.
processing.app.SerialException: no connection
at processing.app.FakeSerial.<init>(SerialMonitor.java:274)
at processing.app.SerialMonitor.openSerialPort(SerialMonitor.java:229)
at processing.app.Editor.handleSerial(Editor.java:2593)
at processing.app.Editor$17.actionPerformed(Editor.java:681)
at javax.swing.AbstractButton.fireActionPerformed(AbstractButton.java:1995)
at javax.swing.AbstractButton$Handler.actionPerformed(AbstractButton.java:2318)
at javax.swing.DefaultButtonModel.fireActionPerformed(DefaultButtonModel.java:387)
at javax.swing.DefaultButtonModel.setPressed(DefaultButtonModel.java:242)
at javax.swing.AbstractButton.doClick(AbstractButton.java:357)
at javax.swing.plaf.basic.BasicMenuItemUI.doClick(BasicMenuItemUI.java:1225)
at javax.swing.plaf.basic.BasicMenuItemUI$Handler.mouseReleased(BasicMenuItemUI.java:1266)
at java.awt.Component.processMouseEvent(Component.java:6263)
at javax.swing.JComponent.processMouseEvent(JComponent.java:3267)
at java.awt.Component.processEvent(Component.java:6028)
at java.awt.Container.processEvent(Container.java:2041)
at java.awt.Component.dispatchEventImpl(Component.java:4630)
at java.awt.Container.dispatchEventImpl(Container.java:2099)
at java.awt.Component.dispatchEvent(Component.java:4460)
at java.awt.LightweightDispatcher.retargetMouseEvent(Container.java:4574)
at java.awt.LightweightDispatcher.processMouseEvent(Container.java:4238)
at java.awt.LightweightDispatcher.dispatchEvent(Container.java:4168)
at java.awt.Container.dispatchEventImpl(Container.java:2085)
at java.awt.Component.dispatchEvent(Component.java:4460)
at java.awt.EventQueue.dispatchEvent(EventQueue.java:599)
at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:269)
at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:184)
at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:174)
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:169)
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:161)
at java.awt.EventDispatchThread.run(EventDispatchThread.java:122)
5. In the current action text box, the message "no connection" is printed.
6. The code is here:
#include "IntervalTimer.h"
#include <IEEE1547.h>
#include <ADC.h>
/* Test code
// IEE1547 timers needed:
1. ADC timer for one sample every 20usec
2. Millisecond timer for real time loop and for IEEE1547 trip point time compares
1. Do RMS calculation every ac cycle 16.6 or 20msec, average result for two cycles
2. After 10 cycles of failure, set 10 cycle fail flag
3. After 1 seconds of failure, set 1 secs fail flag
4. After 2 seconds of failure, set 2 secs fail flag
5. Base real time loop on input zero crossing positive or negative going, either approx 8.33 or 10 msecs
After uploading this to your board, use Serial Monitor
to view the message. When Serial is selected from the
Tools > USB Type menu, the correct serial port must be
selected from the Tools > Serial Port AFTER Teensy is
running this code. Teensy only becomes a serial device
while this code is running! For non-Serial types,
the Serial port is emulated, so no port needs to be
selected.
*/
int val;
int led = 13; // name the LED pin
int debugout = 3; // debug scope output pin
unsigned long milliseconds = 0 ;
bool debugPrint = true; // turn flag on or off for debug print
// rms vars
unsigned long MeanOfSquares = 0;
unsigned long Accum = 0; // clear accumulator
bool zero_cross = false;
unsigned long NumOfSamples = 0;
// PIT - periodic interval timer for Freescale ARM chip
IntervalTimer timer0; // use for ADC sample int
IntervalTimer timer1; // use for real time loop and msec trip compare
// ADC timer function
void timerCallback0() {
// do ADC stuff here
digitalWrite(led, HIGH); // turn the LED on (HIGH is the voltage level)
val = analogRead(0); // read ADC ch 0
NumOfSamples ++;
digitalWrite(led, LOW); // turn the LED off by making the voltage LOW
// this is new RMS part
// check for zero crossing pos going
if (zero_cross == true)
{
MeanOfSquares = Accum/NumOfSamples; // find mean of the squares
Accum = 0; // clear accumulator
zero_cross = false;
NumOfSamples = 0;
}
// Sum = 0; // clear accumulator variable
Accum = Accum + ((val)*(val)); // multiply and accumulate
// do accum tests here
//if (Accum > 5000) // approx 50 vac?
}
// Real time loop timer
void timerCallback1()
{
// count msecs here
milliseconds ++;
if (milliseconds == 10) milliseconds = 0; // set real time loop to 10 msec for now
zero_cross = true; // fake a zero crossing here
}
void setup()
{
timer0.begin(timerCallback0, 65); // Set timer0 to 65 usec sample period for ADC
// 16.666msec/65usec = about 256+ samples
// 10 msec/25usec = about 307+ samples
// use zero crossing detector to calculate actual samples
timer1.begin(timerCallback1, 1000); // Set timer1 to 1 msec
Serial.begin(9600);
analogReadResolution(15); // 12 bit almost 100ks/s doing nothing but ADC
// 13 bit res = 80ks/s
// 14 bit res = 77ks/s or 13 usecs
// 15 bit res = ??????? measure!!!!!!!!!!!!!!!
// 16 bit = about 40ks/s ADC
// initialize the LED pin as an output.
pinMode(led, OUTPUT);
pinMode(debugout, OUTPUT);
// setup zero crossing comparator here
// tim use an adc trigger to get evenly timed samples
//analogReadAveraging(4);
//and then triggering the ADC sampler from the PIT (interrupt timer) that was controlling the loop, by setting
// 0101 PIT trigger 1
//SIM_SOPT7 = ( SIM_SOPT7 & 0xFFF0 ) + 5;
// See page 235 of the reference manual pdf (chapter 12: System Integration Module) for the documentation on the SIM_SOPT registers.
}
void loop()
{
if (debugPrint == true)
{
digitalWrite(debugout, HIGH); // turn the debug pin high
Serial.print("analog 0 is: ");
Serial.println(val);
Serial.print("Mean of the squares is: ");
Serial.println(MeanOfSquares);
Serial.print("Number of samples: ");
Serial.println(NumOfSamples);
}
// delay(1); // debug only remove for final program tim
Serial.print("time in msecs is: ");
Serial.println(milliseconds);
while (milliseconds != 0)
{ // wait here until loop timer zeros, then restart real time loop
if (debugPrint == true) digitalWrite(debugout, LOW); // turn the pin low
}
// end of main loop ... no code past here
}