Go Down

Topic: Problems with arduino due's Native Port (Read 505 times) previous topic - next topic

yash13

Hi,

I have just bought one arduino due from Amazon.

I successfully programmed the due with simple codes such as binking LED etc. I was using Programming port at that time.

Now I want to see the Due's performance with Native port. I tried programming  the Native port but as soon as the sketch gets uploaded the COM port of my due changes. IDE does not even recognize that it is Due's Native port as it is not mentioned under the ports tab of tools. (Before uploading the sketch, it was mentioned)

Also even if I use SeriaUSB class,  I can not see anything printing on the serial monitor.

What seems to be the problem??

Please help!!

weird_dave


yash13

Here is the code that I am trying to run.

I want to see sampling rate of ADC through the native port.


int analogPin = A0;   

int val = 0;
float eVal;
long t1;
int frequency = 0;


void setup()

{

  SerialUSB.begin(250000);         
  while (!SerialUSB) {
    ;
  }
 
}



void loop()

{
  t1=millis();
  frequency=0;
  while(millis()-t1<1000)
  {
     val = analogRead(analogPin);
     eVal=map(val,0,1023,0,5);
     SerialUSB.println(eVal);
     frequency=frequency+1;   
    }
  SerialUSB.print("frequency = ");
   SerialUSB.println(frequency);
}

weird_dave

There seems to be a driver issue, I have just spent an hour fiddling with a combination or erase/reset and drivers. Your code works.
The final thing I did before it worked was to go to the arduino drivers folder and install arduino.inf. Thing is, I had no issue 2 weeks ago when I was last playing with my Dues, I haven't even rebooted since then! I've had this sort of problem a few times now with the Due native port, it's starting to really piss me off :(

Go Up