I'm having an issue working out what libraries I have access to. I understand that I can use the Atmel Studio 6 IDE to program the microcontroler (Atmega328p) in C++; however, I can't work out where it is documented what libraries I have access to. For example, can I use the STL (so like, vectors, deques...)? If someone could point me towards some documentation, that'd be great.
Thanks.
Atmel Studio 6 doesn't come with an implementation of STL. There are some libraries that avr-gcc comes with--look in:
C:\Program Files (x86)\Atmel\Atmel Toolchain\AVR8 GCC\Native\3.4.2.1002\avr8-gnu-toolchain\avr\include\
That does not contain <vector> or <deques>, but it does have <string>. There are lots of STL implementations ported over to Atmel Studio though: take a look at:
http://www.gammon.com.au/forum/?id=11119
http://andybrown.me.uk/wk/2011/01/15/the-standard-template-library-stl-for-avr-with-c-streams/
Related
Several days ago, when I started to learn OpenCL, I needed a good IDE to write OpenCL C kernel language, which provides some basic functions like syntax highlighting and static analysis. I was surprised to find out that Qt Creator is able to do the job.
Everything was fine until today I started to use some feature in OpenCL 2.0:
It looks like Qt Creator use libclang to do the parsing and libclang treats my source files as OpenCL 1.0. But My machine supports OpenCL 3.0 and the code was ok to compile and run. So I doubt it only supports OpenCL 1.0.
My questions are:
How to make Qt Creator (or the libclang plugin in it) support OpenCL 2.0?
How do you guys write OpenCL 2.0? Is there any better IDEs or editors?
Thank you guys, I am really a newbie here.
I tried to rename the file's postfix to ".cl2", but it doesn't work.
I read the OpenCL support documentation of LLVM, but failed to find out the solution.
QtCreator uses KDE syntax highlighting engine. The definitions are simple XML files. You can find them here, but opencl.xml doesn't look updated for 2.0/3.0 language. You can try to change it, and then put it into $HOME/.config/QtProject/qtcreator/generic-highlighter/syntax and it should pick it up.
In QtCreator, you can download newer definitions by going to Tools -> Options, select "Text editor" in left, then "Generic highlighter" tab. This will put the updated files in $HOME.local/share/org.kde.syntax-highlighting/
I would like to know if it is possible to use selective arduino libraries in our AVR projects. For Example: I am using Atmega328 and Atmel studio. I would like to use DS1307 related library file(twi.c and Wire.c source files I guess) in my project. Can we use individual libraries and then include applicable header files in our build? If so where are these libraries located and what is the extension? I saw few articles on building entire arduino project in Atmel studio and I am not interested in that. I want to manage without installing arduino if possible (I can install arduino only to get library if needed). I thought of including source files, but they are in C++ and I started getting error messages when included in C project. Is it possible to do without modifying the source files much?
After searching, i found that
Any 5V microcontroller with I2C built-in can easily use the DS1307.
check also first lines here.
I look quickly at DS1307.c and found it is not using any functions from wire.c
But instead of all that you could get source code for DS1307.c and implement any function begin with i2c by yourself and small modifications for interrupt functions. and you can use it in your code. i downloaded the library from this link.
There are a lot of twi/i2c libraries for avr, you could download most suitable one and rename it's function like the function called from DS1307.c
How do I do that? I can't find any tutorial describing this. Well, I've downloaded win7 64bit version of Qt 5, I installed this (more than 1gb, wow...). However, I still cannot include any Qt library.
#include <QApplication> displays - cannot open source blah blah blah.
What else should I do, am I missing something here?
Another thing is - won't this 1gb Qt thing slow down my application? I'm not writing any big projects, just simple algorithms, cpp files usually don't go more than 20kb.
And one more - what does nokia has to do with Qt? I've already seen a couple of times the nokia company name while I was reading something about the Qt.
What else should I do, am I missing something here?
Install qt vs addin v 1.2.x
Another thing is - won't this 1gb Qt thing slow down my application?
Nope. Why do you think, that data stored on your drive will slowdown your programs? Your music / video will not, same qt libraries.
Btw, Qt runtime is quiet small (about 4 mb for simple GUI applications).
what does nokia has to do with Qt?
Nokia bought Trolltech with qt for their mobile platforms. And now it sells qt to Digia.
Feel free to use google ;)
Also check that all the Qt includes should be accessible/visible for Visual Studio after installation, like probably through PATH environment variable.
I've attempted this myself by compiling the Arduino libraries into their own standalone library and linking to a project in Eclipse, but have had a couple of issues along the way.
Is there a decent guide on how to get this up and running? I've been hard pressed to find one online that actually works... The arduino.cc guide has a couple of flaws in, and troubleshooting drove me insane.
I'm on Mac OS X 10.5 with an Uno board.
Edit: Might be worth noting that most Arduino C guides don't specify the baud rate necessary, just the MCLK frequency (16 MHz). Make sure you've changed this or AVRDude won't understand how to flash your IC.
Other people have had some success using the guide Using Eclipse with Arduino Duemilanove.
Arduino will not work in pure C setup as it requires a C++ compiler. However if you want to include arduino core and other libraries inside your project then read on. Here we can see how to use Arduino Ethernet Library with our code.
STEP BY STEP GUIDE
Get Arduino cores and variants/ files.
Get relevant library, e.g. Arduino Ethernet library
The directory structure is
/
lib/arduino/cores
lib/arduino/variants//pins_arduino.h
lib/arduino/makefile
lib/arduino/build
lib/
The sample make file can be downloaded from:
https://gist.github.com/rjha/b7cda6312552c3e15486
First create Arduino core as a static library. To do so:
$cd to lib/arduino folder
$ make clean
$ make lib
This will create lib/arduino/build/libarduino.a static library file.
Next we goto main project Makefile. There we can define any Arduino library,e.g. Arduino SPI or Arduino Ethernet as a make target that compiles against Arduino core library.
Inside our own make target, we can include Arduino Target that in turns include Arduino core.
For (7) and (8) example, see this gist
https://gist.github.com/rjha/e7b123d3dc4346b5830c
(9) when creating Hex and general linking, link using -larduino and keep the libarduino.a in the search PATH. #see above Gist for an example.
(10) Using this structure you can use any Arduino libraries inside your own code.
Most of the Arduino libraries are a mess dependencies wise and the code quality is also poor. The only benefit is that you can get some ready made libraries to link against your code.
I'd like to get FreeRTOS running on an MSP430 processor using Code Composer Essentials v3.1. I found an example of just this at http://www.westmorelandengineering.com/toc.htm. Specifically I’m working with FreeRTOS_Demo.zip, the top one. When I try to open it with CCE I get an error that the workspace "was not created by this version of Code Composer". So I tried to import the project and I get an error "The Managed Make project could not be read because of the following error: Project type com.ti.ccstudio.managedbuild.ui.programTargetID not found. Managed Make functionality will not be available for this project."
I’m wondering what my problem is and how I can get the project to build, or should I go about this a different way?
FreeRTOS support many, many, many chips and many, many, many compilers. Anything that is not standard C code is kept in a port layer.
The next FreeRTOS release (V7, out in the next couple of weeks and already available in the SVN repository) includes a CCS4 port and demo for the MSP430F5438 (MSP430X core).
Regards.
I was told that TI's CCS compiler suite (used in CCE/CCS) will not build the FreeRTOS sources because the FreeRTOS sources include stuff written in gnu assembler syntax (file extension .s is common between CCS asm and Gnu asm, but syntax is not the same). Until FreeRTOS is "ported" to the CCS compiler suite, your best bet is to use the full CCS with the GCC compiler instead of the CCS compiler.
reviving a zombie thread... not sure if CCE is even relevant now... you can get CCS 5.3 with code-size limited free MSP430 support.
I recently ported FreeRTOS to the CC430 using the new MP430Ware driver library from TI and Code Composer Studio 5.3, get it here:
http://www.freertos.org/Interactive_Frames/Open_Frames.html?http://interactive.freertos.org/entries/22894958-cc430f5137-ccs-5-3