Continue to Site

Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

[SOLVED] Problem in using Arduino Libraries in Atmel Studio 6.2?

Status
Not open for further replies.

xpress_embedo

Advanced Member level 4
Advanced Member level 4
Joined
Jul 5, 2011
Messages
1,154
Helped
161
Reputation
396
Reaction score
189
Trophy points
1,353
Location
India
embeddedlaboratory.blogspot.in
Activity points
10,591
Hello!!
I am trying to use Arduinio Libraries in Atmel Studio 6.2, for that i had copied all Arduino Libraries and make a project named Template, so that i can use it for new projects.
I managed to compile my code, without any error.
I am attaching the code below.
But when i simulate the code in Proteus, it is working slowly.
Here is my Code.

Code C - [expand]
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
#include "Template.h"
 
void setup()
{
    pinMode(13,OUTPUT);
    Serial.begin(9600); 
    Serial.print("Hello World!");
}
 
void loop()
{
    digitalWrite(13,LOW);
    //delay(1);
    delayMicroseconds(1);
    digitalWrite(13,HIGH);  
    //delay(1);
    delayMicroseconds(1);
}


When setting delay to delayMicroseconds(1); then Pin13 of Arduino Board in Proteus blinks rapidly.
Even delayMicroseconds(1000) is working which is equivalent to delay(1)
But when setting delay(1); means 1millisecond delay, my controller doesn't responds.
No Data on virtual terminal.
Please help me.

View attachment Template.rar
 

What tool did you use to compile the code? The Compiler that comes with Arduino IDE or Atmel Studio ?
 

I used Atmel Studio 6.2 and nothing else.
Arduino IDE to uses avr-gcc to compile the code with just a wrapper in which one doesn't write main() function.

So i directly copy paste the arduino libraries and tried to build the project.
The project builds but not working properly in proteus.

i think there is a problem with delay function.
 

Status
Not open for further replies.

Similar threads

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top