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 porting serial.begin(9600) from Arduino IDE to Windows AVR Visual Studio 6.0

Status
Not open for further replies.

joseMiguel

Member level 5
Member level 5
Joined
Jan 10, 2011
Messages
86
Helped
10
Reputation
20
Reaction score
10
Trophy points
1,288
Location
Montpellier FRANCE
Visit site
Activity points
1,967
Hi,

I am building a project on AVR Visual Studio 6.0 using all the macros, functions and methods from the Arduino IDE. (I am starting this port stuff)

When i use Serial.begin(9600) i must include the "Hardware_Serial.h", the
"stream.h", the "Print.h", the "WString.h" and the "Printable.h" files.

The problem is that the compiler does not find the system file <new.h>.
When i add this file to my include directory (this file is present on the
.\arduino-1.0.5-r2\hardware\arduino\cores\arduino directory)
i have stranges errors messages.
Error 1 expected '=', ',', ';', 'asm' or '__attribute__' before 'new'

i have tried to put __attribute__ before the new keyword without any success.

Could you please help me
Jose Miguel
 

I am building a project on AVR Visual Studio 6.0 using all the macros, functions and methods from the Arduino IDE

If you want to use the Arduino functions then why don't you code in the Arduino IDE?

If you want to start writing bare code then you should start from the ground up writing the actual code or using AVR libraries rather than trying to port the Arduino environment in Atmel studio.
 
Hi Alexan_e,

In fact i am a beginner with ATMEL Visual Studio and Arduino IDE.

I don't know the already existing libraries on AVR Studio.
My first look at this was that it seems not easy and it does not have so many job done
than in the Arduino IDE.

The other reason to port the Arduino platform to AVR Studio is that Arduino IDE only permit to have one .ino file and you do not have the control of all the files implied in the project.
Working witn AVR Studio makes it more transparent i think.

Sorry, for my english which is not so fluent.
Please help me on finding that bug.

Jose Miguel
 

Arduino is designed with a specific task of hiding much of the underlying complexity of low level programming by providing ready to use libraries and function in order to attract a wider audience and maybe help users dedicate more time with their creativity than trying to figure out how to write code to make things work.

The problem with the Arduino libraries is that you usually can't isolate them, one calls the other and that one another etc and that means that things get pretty complicated when you try to port them.
I haven't worked much with Arduino other that using some of the boards with low level C rather than Arduino code.

You can easily find libraries for AVR by a simple search in Internet, usually they will provide more functionality that the Arduino function.

I understand that the transition from one platform to the other can be hard and it will take a while to gather or create a set of libraries but that is the price you ghave to pay to gain control of everything in the project (rather than rely on someone else decision), after that you will have more freedom to customize code parameters and the mcu behaviour.

Here is a source of three open source libraries, one of the is UART

**broken link removed**


  • I2C Master Interface
    This library consists of a C include file i2cmaster.h and an assembler module i2cmaster.S.
    It can be used to communicate with I2C devices (serial eeprom, serial RTC etc) from any AVR device.
    **broken link removed** **broken link removed**l **broken link removed**
  • LCD library for HD44870 based LCD's
    This library can be used to access a HD44780-based character LCD module. The library can be operated in both the memory-mapped mode and in the 4-bit I/O port mode, depending on the value of LCD_IO_MODE in lcd.h.
    **broken link removed** **broken link removed** **broken link removed**
  • UART library
    This library can be used to transmit and receive data through the built-in UART.
    **broken link removed** **broken link removed** **broken link removed**

Regarding the errors you mention, I'm not familiar with the Arduino libraries so I'm afraid I can't help
 
Hi all,

My error was stupid, I created a ".c" project and not a ".cpp" project.
So, it was for this reason that the compiler was unable to compile the new prototype.

Thank you.
Jose Miguel.
 

Status
Not open for further replies.

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top