Jump to content

Energia COM port help

Recommended Posts

I've been dealing with this since late last night.


Code I upload to the G2LP doesn't work properly either.


// 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()

// debug messages:

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.
Link to post
Share on other sites

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)
Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Create New...