Question: CH340 USB to TTL Serial Adaptor Then Connecting Max232 Then Connecting ATMEG Chip 328P I am able to send the singnal but I am unable

CH340 USB to TTL Serial Adaptor Then Connecting Max232 Then Connecting ATMEG Chip 328P

I am able to send the singnal but I am unable to upload my program code to the chip by using the above serial communication device! Help me to sort out the problem Folowing are the codes!

void setup() {

// put your setup code here, to run once:

Serial.begin(9600);

pinMode(13, OUTPUT);

pinMode(12, OUTPUT);

pinMode(11, OUTPUT); } void loop() {

// put your main code here, to run repeatedly:

int val = Serial.read() - '0' ;

if (val == 1)

{ Serial.println ("on");

digitalWrite (13, HIGH);

}

else if (val == 0)

{

Serial.println("OFF");

digitalWrite(13, LOW);

}

if (val == 2)

{

Serial.println ("on");

digitalWrite (12, HIGH);

}

else if (val == 3)

{

Serial.println("OFF");

digitalWrite(12, LOW);

}

if (val == 4)

{

Serial.println ("on");

digitalWrite (11, HIGH);

}

else if (val == 5)

{

Serial.println("OFF");

digitalWrite(11, LOW);

}

while (Serial.available() == 0 );

Serial.println(val);

}

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!