serial not print antill open the serial window

Hi all,

I am using arduino Micro, in that i need to get serial input from hyperterminal , My code is working with Serial window(com port) of arduino successfully, but when i try to give same inputs from hyperterminal it is not working.

But i cross checked with arduino nano with same code, where i got successful output in both hyper terminal and serial window.

But only issue with giving serial inputs from serial interface/window other than default arduino serial com port.

For verification i put a string in loop in coding.

in that case my micro tx led is not blinking till i open the com port in arduino. Once i open com port, tx led is blinking. i dont know Why?
this is my code if even am using example serial code that time also we get the same issue
please any one help me this is my humble request.

Can anyone tell me what issue i have?? :slight_smile:

my code is

#include <Wire.h>
#include <ivafruit_ADS1015.h>
#include <Adafruit_ADS1015.h>
#include <SoftwareSerial.h>
#include<string.h>
#include<stdio.h>
Adafruit_ADS1115 ads1115 (0x49);
ivafruit_ADS2224 ads2224 (0x48);
String inputString = "";
String newstring="";
#define disk1 0X10//Address of dac chip
#define relayadd 0X41 //Address of dac chip
int integerValue=0;
unsigned int outValue=0xff; //intial off state for relay
//////////
const int buttonPin0 =A0;
const int buttonPin1 =A1; // the number of the pushbutton pin
int buttonState0, buttonState1 =HIGH;
const int EN =9;
const int a0 =10;
const int a1 =11;
////////////////
void dac(int deviceaddress, unsigned int eeaddress,int data )
{

Wire.beginTransmission(deviceaddress);
Wire.write((int)(eeaddress));
Wire.write((int)(data >> 4));
Wire.write((int)(data << 4));
Wire.endTransmission();
}
void relay(int address, unsigned int count,int out )
{

Wire.beginTransmission(address);
Wire.write((int)(count));
Wire.write((int)( out ));
Wire.endTransmission();
}

void setup(void)
{
pinMode(buttonPin0, INPUT);
pinMode(buttonPin1, INPUT);
pinMode(EN, OUTPUT);
pinMode(a0, OUTPUT);
pinMode(a1, OUTPUT);
Serial.begin(9600);
Wire.begin();
ads1115.begin();
ads2224.begin();
//ads1115.setGain(GAIN_SIXTEEN);
}

void loop(){
unsigned int address = 0X30; // this for relay address
int16_t adc0;
int16_t outputValue;
int16_t iadc0, iadc1;
float ivolt0, ivolt1,volt0;
long int volt1;
unsigned int cont = 0X03;// this relay control select bit
buttonState0 = digitalRead(buttonPin0);
buttonState1 = digitalRead(buttonPin1);

if (buttonState0 == LOW) {
//DO SOME
}
if (buttonState1 ==LOW) {
//DO SOME
}
if(Serial.available()) {
int inChar = Serial.read(); // char
inputString += (char)inChar;
if (inChar == '*') {
if(inputString[0]=='Y')
{
outValue=0xf0;

}
if(inputString[0]=='N')
{
outValue=0xff;

}

//Serial.println( inputString);
if(inputString[0]=='I')
{
int i;
int len=inputString.length();
for(i=0;i<len;i++)
{
if (isDigit(inputString*))*

  • {*
    _ char m=inputString*;_
    _
    newstring += m;_
    _
    }_
    _
    }_
    _
    integerValue= newstring.toInt();*_
    _ integerValue= (integerValue)*40; //to convert the user value into arround 4000 range_

* }*
* if(inputString[0]=='L')*
* {*
* int k=26;*
* Serial.println('k');*
* }*
* if(inputString=="S1")*
* {*
* digitalWrite(EN,HIGH);*
* digitalWrite(a0,LOW);*
* digitalWrite(a1,LOW);*
* }*
* else if(inputString=="S2")*
* {*
* digitalWrite(EN,HIGH);*
* digitalWrite(a0,HIGH);*
* digitalWrite(a1,LOW);*
* }*
* else if(inputString=="S3")*
* {*
* digitalWrite(EN,HIGH);*
* digitalWrite(a0,LOW);*
* digitalWrite(a1,HIGH);*
* }*
* else if(inputString=="S4")*
* {*
* digitalWrite(EN,HIGH);*
* digitalWrite(a0,HIGH);*
* digitalWrite(a1,HIGH);*
* }*
* else*
* {*
* digitalWrite(EN,LOW);*
* digitalWrite(a0,LOW);*
* digitalWrite(a1,LOW);*
* } inputString = "";*
* newstring=" " ;*
* }*
* }*
* Serial.println(integerValue);*
* dac(disk1, address, integerValue);*
* relay(relayadd, cont, outValue);*
* adc0 = ads1115.readADC_SingleEnded(0);
iadc0 = ads2224.readADC_SingleEnded1(0);
_ volt0 = adc00.000188;
* volt0 = adc0/4926.470588;*
* ivolt0 = iadc0/4926.470588;*
//volt1=volt0*100;_

* //Serial.print(adc0);*
* //Serial.print(",");*
* //Serial.print("RCV");*
* Serial.println(volt0,3);*
* Serial.println(ivolt0,3);*
* //delay(1000);*
*} *

Can anyone tell me what issue i have??

You have several issues.

You don't seem to be able to use just one ?.
You don't seem to be able to properly indent your code.
You don't seem to be able to properly post your code.
You don't seem to be able to say what the problem is with the code.

If the problem is that HyperTerminal does not properly open it's end of the serial port, that is not an Arduino code issue.

if problem in hyterminal means, when i connect my arduino nano that time they communicate than what is the problem .

if problem in hyterminal means, when i connect my arduino nano that time they communicate than what is the problem .

The Micro (and Leonardo) differ from the Nano (and UNO and Duemilanove and others) in that it uses a different kind of chip/communication process. For the Leonardo (and Micro, presumably), the DTREnable property must be set to true. Most communication applications do not set that property, which defaults to false.