I have an Arduino Nano clone and to test it I am using the AnalogReadSerial example program. I notice that when I upload the program and activate the serial monitor, the data can only be read if I lower the monitor speed to 2400 baud; otherwise, it displays ASCII characters. If I change the code to Serial.begin(2400), it displays ASCII characters at any monitor connection speed. I am using the ATmega328P processor. Whats going on?
I make no sense of your problem description. The serial monitor displays ASCII characters, always, that's what it does.
a7
Using correct tags, post your code?
Also post serial printout.
How is your serial configured in setup() and your serial monitor?
The setting in the serial monitor window has to match the call in the code
Serial.begin(9600);
Anything that does, or does not, happen when they are mismatched is of no interest.
a7
Are you sure your clone has a 328P and not the 328PB or the LGT8F328??
/*
AnalogReadSerial
Reads an analog input on pin 0, prints the result to the Serial Monitor.
Graphical representation is available using Serial Plotter (Tools > Serial Plotter menu).
Attach the center pin of a potentiometer to pin A0, and the outside pins to +5V and ground.
This example code is in the public domain.
https://www.arduino.cc/en/Tutorial/BuiltInExamples/AnalogReadSerial
*/
// the setup routine runs once when you press reset:
void setup() {
// initialize serial communication at 9600 bits per second:
Serial.begin(9600);
}
// the loop routine runs over and over again forever:
void loop() {
// read the input on analog pin 0:
int sensorValue = analogRead(A0);
int sensor2 = analogRead(A1);
// print out the value you read:
Serial.println("A1");
Serial.println(sensor2);
delay(200);
Serial.println("A0");
Serial.println(sensorValue);
delay(200); // delay in between reads for stability
}
I am new in this forum. can i upload a screenshots?
Yes.
Are you sure it is not the LGT8F328?
Close up of other side please.
Are you sure it not the LGT8F328?
I found in this forum a similar problem in abril 2023 that is closed. Nano Serial not working properly
All seam that the issue is from manufacturer. But I did not find a solution. Maybe the solution is to keep serial.begin(9600) and monitor or any other serial connection in 2400. I tested in python and is working fine.
Thanks for your quick answer. Once I have the arduino I will take a picture for the other side.
So I supect you have an LGT8F328, even though you have not answered any of my questions.
So I guess you are not interested in the solution.
You will eventually find that most other Arduino functions also do not work, including analogRead
Jim I am interesting in the solution. So, sorry for not answers your question. I am new working with arduinos and I don’t know how check this information. I am out of home now. But one arrive I will try to answers your questions. I really appreciate your interest to support me.
Let me know how Incan verified if I am using
LGT8F328. I get the arduino in a local storage of electronics and it comes in a transparent bag with any information.
You need to install the board package for the LGT8F328p
Follow the instructions here:
This processor is faster and has many more features than the ATmega328P including a 12bit ADC and a DAC.
However, once you install the package, it will run most programs designed to run on an Uno.
I am here again. This is the other picture. I will follow your instructions and let you known. Thanks so much.
There are no markings on the chip but that fact that there is no crystal and that it has at least 8 analog inputs are good clues that it's an LGT8F328p.
I installed the board following the instruction but when I try to load the sketch appear the folow error:
Sketch uses 2266 bytes (7%) of program storage space. Maximum is 29696 bytes.
Global variables use 194 bytes (9%) of dynamic memory, leaving 1854 bytes for local variables. Maximum is 2048 bytes.
avrdude: stk500_getsync() attempt 1 of 10: not in sync: resp=0x00
avrdude: stk500_getsync() attempt 2 of 10: not in sync: resp=0x00
avrdude: stk500_getsync() attempt 3 of 10: not in sync: resp=0x00
avrdude: stk500_getsync() attempt 4 of 10: not in sync: resp=0x00
avrdude: stk500_getsync() attempt 5 of 10: not in sync: resp=0x00
avrdude: stk500_getsync() attempt 6 of 10: not in sync: resp=0x00
avrdude: stk500_getsync() attempt 7 of 10: not in sync: resp=0x00
avrdude: stk500_getsync() attempt 8 of 10: not in sync: resp=0x00
avrdude: stk500_getsync() attempt 9 of 10: not in sync: resp=0x00
avrdude: stk500_getsync() attempt 10 of 10: not in sync: resp=0x00
Failed uploading: uploading error: exit status 1