abecedarian 330 Posted August 8, 2014 Share Posted August 8, 2014 Energia says the only COM port I have (COM8) is not found, and suggests using a COM port (COM3) ... which I do not have. Quote Link to post Share on other sites
abecedarian 330 Posted August 8, 2014 Author Share Posted August 8, 2014 I've been dealing with this since late last night. Code I upload to the G2LP doesn't work properly either. This: // Crankshaft / camshaft rotation simulation // Engine is V-twin with cylinders at 80 degrees opposed // Connecting rods share a common crankshaft journal // Code is based on a full camshaft cycle (720 degrees rotation) // and when spark plugs should fire. Actual ignition advance is // not factored in yet since advance would move right and left cylinders' // 'trigger' points accordingly and that would cause the right // cylinder to be less than zero. So until I work in that logic, // as of now, both cylinders fire spark plugs with 0 degrees ignition advance. // This means right spark plug would fire when the cam trigger occurs and // left spark plug would fire 440 degrees later: // Left cylinder fires 360 + 80 = 440; // right cylinder would fire 280 degrees afterwards: // 440 + 280 = 720 (or 0 if you prefer). // // Target in Energia IDE is MSP430G2553 @ 16MHz // const uint16_t t1 = 0; // right cylinder baseline spark const uint16_t t2 = 440; // left cylinder baseline spark relative right cylinder const uint8_t cam = 0; // camshaft trigger relative right cylinder TDC const uint8_t AMBER_LED = 5; // LP pin indicating camshaft trigger signal occurrence // I am using existing RED_LED, GREEN_LED for right and left cylinder TDC indicators uint16_t degree = 0; // counter for crankshaft rotation in degrees void setup() { pinMode(RED_LED, OUTPUT); pinMode(GREEN_LED,OUTPUT); pinMode(AMBER_LED, OUTPUT); // debug messages: Serial.begin(9600); } void loop() { for (degree = 0; degree < 720; degree++) { Serial.print(degree); // debug message Serial.print(" "); // Camshaft: digitalWrite(AMBER_LED,(degree >= cam && degree < cam+100)); Serial.println((degree >= cam && degree < cam+100)); // debug message // Right cylinder: digitalWrite(RED_LED,(degree >= t1 && degree < t1+50)); Serial.print((degree >= t1 && degree < t1+50)); // debug message Serial.print(" "); // Left cylinder: digitalWrite(GREEN_LED,(degree >= t2 && degree < t2+50)); Serial.print((degree >= t2 && degree < t2+50)); // debug message Serial.print(" "); // delay(5); } }Blinks an LED every 4 seconds or so, but should be blinking them faster than I can detect. Quote Link to post Share on other sites
abecedarian 330 Posted August 8, 2014 Author Share Posted August 8, 2014 When I try to open the terminal window / serial monitor, I get: processing.app.SerialNotFoundException: Serial port 'COM8' not found. Did you select the right one from the Tools > Serial Port menu? at processing.app.Serial.<init>(Serial.java:165) at processing.app.Serial.<init>(Serial.java:92) at processing.app.SerialMonitor.openSerialPort(SerialMonitor.java:209) at processing.app.Editor.handleSerial(Editor.java:2630) at processing.app.Editor$20.actionPerformed(Editor.java:777) 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.AbstractButton.doClick(AbstractButton.java:337) at javax.swing.plaf.basic.BasicMenuItemUI$Actions.actionPerformed(BasicMenuItemUI.java:1194) at javax.swing.SwingUtilities.notifyAction(SwingUtilities.java:1636) at javax.swing.JComponent.processKeyBinding(JComponent.java:2851) at javax.swing.JMenuBar.processBindingForKeyStrokeRecursive(JMenuBar.java:670) at javax.swing.JMenuBar.processBindingForKeyStrokeRecursive(JMenuBar.java:678) at javax.swing.JMenuBar.processBindingForKeyStrokeRecursive(JMenuBar.java:678) at javax.swing.JMenuBar.processKeyBinding(JMenuBar.java:649) at javax.swing.KeyboardManager.fireBinding(KeyboardManager.java:267) at javax.swing.KeyboardManager.fireKeyboardAction(KeyboardManager.java:254) at javax.swing.JComponent.processKeyBindingsForAllComponents(JComponent.java:2928) at javax.swing.JComponent.processKeyBindings(JComponent.java:2920) at javax.swing.JComponent.processKeyEvent(JComponent.java:2814) at processing.app.syntax.JEditTextArea.processKeyEvent(JEditTextArea.java:1718) at java.awt.Component.processEvent(Component.java:6040) 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.KeyboardFocusManager.redispatchEvent(KeyboardFocusManager.java:1848) at java.awt.DefaultKeyboardFocusManager.dispatchKeyEvent(DefaultKeyboardFocusManager.java:704) at java.awt.DefaultKeyboardFocusManager.preDispatchKeyEvent(DefaultKeyboardFocusManager.java:969) at java.awt.DefaultKeyboardFocusManager.typeAheadAssertions(DefaultKeyboardFocusManager.java:841) at java.awt.DefaultKeyboardFocusManager.dispatchEvent(DefaultKeyboardFocusManager.java:668) at java.awt.Component.dispatchEventImpl(Component.java:4502) at java.awt.Container.dispatchEventImpl(Container.java:2099) at java.awt.Window.dispatchEventImpl(Window.java:2475) 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) Quote Link to post Share on other sites
abecedarian 330 Posted August 8, 2014 Author Share Posted August 8, 2014 Well I guess... never mind. Rebooted twice and now it seems okay. I'm at a loss. Quote Link to post Share on other sites
bobnova 59 Posted August 8, 2014 Share Posted August 8, 2014 I've found that I have COM port issues if I have the serial monitor open when I plug a launchpad in. That's guaranteed failure, like the above. The solution for me is to unplug the launchpad, close the serial monitor, and re-plug the launchpad. That's the only similar thing I've run into. abecedarian 1 Quote Link to post Share on other sites
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.