Back in 2019 I nearly finished a microcontroller design using the ATmega32U2. I had written the code using the Arduino IDE and had a rather rich instruction set communicated over the Serial interface. I ran into some "life getting in the way" things along with some "keep it simple, stupid" ideas which forced me to take the design back to the drawing board in an effort to reduce component count and thereby cost.
I created Fab D and got the PCB design back from OSHpark and I re-factored the code I already had and attempted to use it. Welp, sometime between 2019 and now I rebuilt my computer and had to re-install windows 10 clean. I still have the code; but now I can't get the Arduino code to work. Specifically the Serial calls work in that I'm able to send data from the device back to the serial port.
But I'm not able to receive anything from the computer into the device.
I have the HEX files from the original code; and they do indeed receive/transmit. But newly compiled code doesn't work to receive.
I've even went so far as to install one of the "SerialEvent" demos which also doesn't work.
I did a clean install of Arduino software and a clean install of the https://www.mattairtech.com/software/arduino/package_MattairTech_index.json
file in board manager.
Same issue of not being able to receive data from host computer.
Below is my current test code - which I've obviously reduced to bare minimum to show the issue.
All I get is the blinking LED; which doesn't change frequency and I never get
"Got Input:"
which would indicate to me that Serial.available() is never returning True.
Thoughts? Things I can try?
/*
Serial Event example
When new serial data arrives, this sketch adds it to a String.
When a newline is received, the loop prints the string and
clears it.
A good test for this is to try it with a GPS receiver
that sends out NMEA 0183 sentences.
Created 9 May 2011
by Tom Igoe
This example code is in the public domain.
http://www.arduino.cc/en/Tutorial/SerialEvent
*/
String inputString = ""; // a string to hold incoming data
boolean stringComplete = false; // whether the string is complete
#define LED_USB 13 /*D13 = PD0*/
#define LED_TOGGLE PORTD ^= (1<<PD0); /*PD0*/
#define LED_OFF PORTD |= (1<<PD0);
#define LED_ON PORTD &= ~(1<<PD0);
#define MySerial Serial
void setup() {
pinMode(LED_USB, OUTPUT); LED_TOGGLE;
// initialize serial:
MySerial.begin(9600);
// reserve 200 bytes for the inputString:
inputString.reserve(200);
}
uint16_t lastms = millis();
void loop()
{
if (! MySerial.available() ) {
if ((millis() - lastms) > 1000 ) {
LED_TOGGLE;
lastms = millis();
MySerial.print('*');
}
} else {
MySerial.print("\nGot Input: ");
MySerial.println(MySerial.read());
}
}
--
You received this message because you are subscribed to the Google Groups "LUFA Library Support List" group.
To unsubscribe from this group and stop receiving emails from it, send an email to lufa-support...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/lufa-support/b6451e0c-2429-4c8c-848b-c7f2b8153026n%40googlegroups.com.