Go Down

Topic: Error Uploading (Read 5705 times) previous topic - next topic

Nandan_Shukla

Hey  there!

  My arduino is misbehaving. When I upload sketch the rx tx led blink one by one and then it says Error uploading. If it's blown up please guide me.

With Warm Regards,
Nandan Shukla

kostos

Hello, Nandan!
You know that gx and tx connections should be disconnect from Arduino when you load a sketch.

----
Regards, Konstantin.

Nandan_Shukla


Nandan_Shukla


pran4ajith

Did you check the port number under the tools menu-->serial ports.
And also please check if your board shows up under the ports section of your device manager.

Nandan_Shukla

Yes,
I checked it all but since you are insisting i'll check it again.
thanks for your assistance.

Nandan_Shukla

yup ,
It's showing.
Now what?

MADHAN

I have an uploading error. Can someone tell me how to clear the memory or reset Arduino's memory?

CHANDRAN-K

Tell me if the atmel is heating during uploading or not and tell me wether your last program is working.



nilimashinde

hello ,

   i am new to arduino ,i am trying to program AS5600 i.e. hall effect magnetic sensor with arduino uno i can read angle but i am not able to set  zero and maximum position manually , also ii am facing this problem of "expected primary-expression before ')' token"
   my program is as follows
#include <Wire.h>
#include <EEPROM.h>

int AS5600_ADR = 0x36;
const int raw_ang_hi = 0x0c;
const int raw_ang_lo = 0x0d;
const int ang_hi = 0x0e;
const int ang_lo = 0x0f;
const int stat = 0x0b;
const int agc = 0x1a;
const int mag_hi = 0x1b;
const int mag_lo = 0x1c;
const int ZMCO = 0x00;
const int ZPOS_hi = 0x01;
const int ZPOS_lo = 0x02;
const int MPOS_hi = 0x03;
const int MPOS_lo = 0x04;
const int BURN_angle  = 0xFF;
const int BURN_setting = 0x40;
const int CONF_hi =0x07;
const int CONF_lo = 0x08;


void setup() {
  Serial.begin(9600);
Wire.begin();
}

void startup()
{
 
}

void loop()
{
// Wire.beginTransmission(AS5600_ADR);
// Wire.write(0x);
// Wire.write(0x00);
// Wire.endTransmission();
//***************************************************************


// Read Raw Angle Low Byte
Wire.beginTransmission(AS5600_ADR);
Wire.write(raw_ang_lo);
Wire.endTransmission();
Wire.requestFrom(AS5600_ADR, 1);
while(Wire.available() == 0);
int lo_raw = Wire.read();
// Read Raw Angle High Byte
Wire.beginTransmission(AS5600_ADR);
Wire.write(raw_ang_hi);
Wire.endTransmission();
Wire.requestFrom(AS5600_ADR, 1);
while(Wire.available() == 0);
word hi_raw = Wire.read();
hi_raw = hi_raw << 8; //shift raw angle hi 8 left
hi_raw = hi_raw | lo_raw; //AND high and low raw angle value
float Raw_Ang = hi_raw *0.0879;
Serial.print("Serial AS5600 Raw Angle = "); Serial.println(Raw_Ang, DEC);
//**********************************************************
// Read Angle Low Byte Wire.beginTransmission(AS5600_ADR);
Wire.write(ang_lo);
Wire.endTransmission();
Wire.requestFrom(AS5600_ADR, 1);
while(Wire.available() == 0);
int lo_ang = Wire.read();
//Read Angle High Byte
Wire.beginTransmission(AS5600_ADR);
Wire.write(ang_hi);
Wire.endTransmission();
Wire.requestFrom(AS5600_ADR, 1);
while(Wire.available() == 0);
word hi_ang = Wire.read();
hi_ang = hi_ang << 8;
hi_ang = hi_ang | lo_ang;
float Ang = hi_ang * 0.0879;
Serial.print(" AS5600 Angle = "); Serial.println(Ang, DEC);
//******************************************************
// read the input on analog pin A0:
  int sensorValue = analogRead(A0);
  // Convert the analog reading (which goes from 0 - 1023) to a voltage (0 - 5V):
  float voltage = sensorValue * (5.0 / 4095.0);
  // print out the value you read:
  Serial.print("voltage =");
  Serial.println(voltage);
//******************************************************
//read zero position
//read low byte
Wire.beginTransmission(AS5600_ADR);
Wire.write(ZPOS_lo);
Wire.endTransmission();
Wire.requestFrom(AS5600_ADR, 1);
while(Wire.available() == 0);
int lo_ZPOS = Wire.read();
//read high byte
Wire.beginTransmission(AS5600_ADR);
Wire.write(ZPOS_hi);
Wire.endTransmission();
Wire.requestFrom(AS5600_ADR, 1);
while(Wire.available() == 0);
word hi_ZPOS = Wire.read();
hi_ZPOS = hi_ZPOS << 8;
hi_ZPOS = hi_ZPOS | lo_ZPOS;
float  ZPOS = hi_ZPOS * 0.0879;
Serial.print(" AS5600 Zero position = "); Serial.println(ZPOS,DEC );
word ZPOS_ang;
Serial.print("enter new zero position to set", ZPOS_ang= );
Serial.println(ZPOS_ang);
ZPOS_ang = Serial.read();
//hi_ZPOS = zero_ang ;

////*********************************************
//read Maximum  position
//read low byte
Wire.beginTransmission(AS5600_ADR);
Wire.write(MPOS_lo);
Wire.endTransmission();
Wire.requestFrom(AS5600_ADR, 1);
while(Wire.available() == 0);
int lo_MPOS = Wire.read();
//read high byte
Wire.beginTransmission(AS5600_ADR);
Wire.write(MPOS_hi);
Wire.endTransmission();
Wire.requestFrom(AS5600_ADR, 1);
while(Wire.available() == 0);
word hi_MPOS = Wire.read();
hi_MPOS = hi_MPOS << 8;
hi_MPOS = hi_MPOS | lo_MPOS;
float MPOS = hi_MPOS * 0.0879;
Serial.print(" AS5600 Maximum  position = ");
Serial.println(MPOS , DEC);
word MPOS_ang ;
Serial.print ("enter maximum angle position to set", MPOS_ang = );
Serial.println(MPOS_ang);
MPOS_ang = Serial.read();
//hi_MPOS = max_ang;
//*************************************************

//*************************************************
Wire.beginTransmission(AS5600_ADR);
Wire.write(BURN_angle);
Wire.endTransmission();
Wire.requestFrom(AS5600_ADR, 1);
String ans;
while(Wire.available() == 0);

Serial.print("want to burn angle ???? ");
Serial.println(ans);
ans = Serial.read();
String sread ="yes";
int count =3;
{
if (ans.equals(sread))
{
EEPROM.write(BURN_angle , 0x80);
count = count-1;
}
//for(int count=0;count<3;count++)
else

  Serial.print(" number of burns = " );
  Serial.println(count,DEC);
}
}


please guide ...
   

Go Up