problem about atmel-Collection of common programming errors
James
microcontroller avr pcb-design atmel xmega
Problem: I get Errors when trying to connect to the MicroController using the PDI interface. How does a MicroController behave when it hasn’t been programmed? Is there a pin that will toggle to show me it’s OK? Kind of a hardware “Hello World”?I would like a way to confirm if the MicroController has failed or if I’ve done something else wrong.Additional Information:I’ve designed and had manufactured a custom board for an Atmel XMEGA MicroController, ATXMega64D3 to be exact. I’m using the ATXMega
BobStein-VisiBone
exception-handling arduino interrupt-handling atmel atsam3x
Occasionally I will get an unexpected interrupt, and my code will hang inside Dummy_Handler() in exceptions.c of the Atmel Studio Framework (ASF). I am using the ATSAM3X8E microcontroller of the Arduino Due.void Dummy_Handler(void) {while(1) {} }Any ideas how to determine which interrupt it was? Of course I could replace this single handler with unique dummy handlers, one for each exception. (There are about fifty of them.) For example change each line in the same exceptions.c file:void HardF
nonsensickle
c uart atmel cortex-m3
I’ve stumbled across a peculiar problem with my PDC (Peripheral DMA Controller) where using the PDC to transfer a constant string from flash over UART 0 seems to produce an unexpected result. The correct number of bytes is sent but they are all zero.The string is defined in the global namespace as followschar* str = “Hello world!”;I only send it once at the start of main like this:UART0->UART_TPR = str; // PDC transfer pointer UART0->UART_TCR = strlen(str); // PDC count
Chetan Bhargava
arduino programming atmel compiler atmel-studio
I see that on the official Arduino website, the reference page contains the functions and vales you would use specified to the Arduino compiler. http://arduino.cc/en/Reference/HomePageWhat would you use instead, if you are working with Atmel Studio?
mFeinstein
voltage-regulator atmel avr32 uc3
I am not pretending to use this, but as a general curiosity, when the AT32UC3C2512C datasheet says in page 1259, Table 40-20, parameter Iout, that the internal 3.3V regulator has a 35mA DC output current, does it mean I can actually use it as a power source, as long as I don’t use more then 35mA out of it? EDIT:As requested:
Maus
arm linux-device-driver embedded-linux atmel
I’m customising Linux for an ARM9 Atmel AT91SAM960 board. In the device file Atmel named all the USART the same atmel_usart. Of course with id enumeration:static struct platform_device at91sam9260_uart0_device = {.name = “atmel_usart”,.id = 1,.dev = { …} }According to the Linux Device model, all these devices (5 UARTS on a SAM9260) would be bind to the driver named atmel_usart.I don’t want to set a TTYS driver on all UARTS which will be registerd. I have severa
Daniel Hedberg
atmel
In AVR programming with atmega32, I can’t assign a value to an array. I am getting the error:Assignment of read-only str[i]What am I doing wrong?My code is:const char str[1000]; void Serial_tx(unsigned char ch) {for (i = 0; i < 10; i++){str[i] = ch;} }
cyphunk
arduino avr atmel timer
Is it possible to monitor a block of code and determine the number of processor clock cycles that code took on an Arduino and/or AVR atmel processor? or, should I rather monitor microseconds passed before and after code run? Note: I’m not concerned with real time (as in, how many real seconds passed) as much as I am in “how many clock cycles does this code require from the CPU”The current solution I can come up with is from time.c:#define clockCyclesPerMicrosecond() ( F_CPU / 1000000L ) #define
PeterJ
c# atmel
I am adapting some test software that is used to upload a .bin file to one of our products via USB. The product has a Atmel AT91SAM7X256 processor. The software is all written in c# and is running on a windows XP machine.The previous programmer (no longer with the company) uses a dll file called AT91BootDLL.dll to scan USB ports for an ateml processor and obtain an handle on it. Then it can open a USB connection and do various things like read, write etc. This all works fine but every now and th
trygvis
arduino usb atmel lufa
I have an Arduino Uno r3 board which has an atmega16u2 chip that normally contains the usb to serial firmware that allows the board to communicate with the IDE. I have been learning how to flash that chip with different firmwares that let it act as other types of USB devices ( Keyboard / Mouse specifically ). I have found some hex files that I can use online, but I am trying to learn how to build my own version of the keyboard and mouse hex files.Here are the variables that I’ve set in the make
SVFeingold
c increment avr atmel
Having a strange problem. I finally figured out how to turn a variable “i” that increments inside a loop into a string that I can pass to a function which turns it into a character that is output to a display. The trouble is, the value increments by 2 rather than by 1! I have tried a few different things but I’m not sure where the problem lies. Initially, I thought that perhaps, if you have a function that calls another function, and they both use the same variable to increment (i.e. for(int i=0
Spectrem
arduino atmel avr-studio5 avr-studio4
I have tried setting up AVR studio 5.1 and 6 to use my Arduino libraries. The instructions I have followed are here: http://www.engblaze.com/tutorial-using-avr-studio-5-with-arduino-projects/ My project includes the necessary libraries and they are within the same directory. They have also been added to the project within AVR Studio. I am still having issues with undefined references to everything.My questions are: How can I fix this issue? Does anyone else have these same issues after jumping t
Long Hoang
linux microcontroller avr avr-gcc atmel
I have a ATXMega16a4u mcu of Atmel and try to compile code with avr-gcc 4.7.2 (Fedora 4.7.2-1.fc17). I got this error:Unrecognized argument in option ‘-mmcu=atxmega16a4u’So I tried to compile code with -mmcu=atxmega16a4 (without ‘u’ in the end). And get some ‘undeclared’ errors:error: ‘ADC_CH_GAIN_DIV2_gc’ undeclared (first use in this function)Is my microcontroller not supported yet by avr-gcc? Is there any possibility to make it work on Fedora, avoiding using avr studio (and windows)?Thanks Lo
nonsensical
c function extern cortex-m3 atmel
I’ve been trying to understand the linkage error that I’m getting regarding the _sbrk function and stumbled across this function definition in a library.extern caddr_t _sbrk(int incr);// … some other definitions …extern caddr_t _sbrk(int incr) { static unsigned char *heap = NULL; unsigned char *prev_heap;if (heap == NULL) {heap = (unsigned char *)&_end; } prev_heap = heap;heap += incr;return (caddr_t) prev_heap; }Now, I know what extern does on a function declaration but I don’t know its
Travis Griggs
c embedded valgrind avr atmel
I’m working on an embedded program. I use the avr-gcc tool chain to compile the C source from my MacBook Pro. Until recently things have been going pretty well. In my latest development iteration though, I seem to have introduced some sort of intermittent bug that I’m suspecting is some sort of stack or other memory corruption error.I’ve never used Valgrind, but it seems it gets rave reviews, but most of the references seem to refer to malloc/free types of errors. I don’t do any malloc’ing. It’s
vsz
c assembly embedded atmel
The short story:What are those reset conditions, which will not set a bit in MCUSR of an ATmega processor, but still cause a reset?The long story:I use brown-out detection in an ATmega168, and have a place in my code to handle it. If my system loses power, a capacitor keeps it above brown-out level for around a half second, and when I restore power, the brown-out handling routine successfully runs. (I check the brown-out bit in the MCUSR)However, when I slowly decrease voltage on the system, and
otto
compilation avr-gcc atmel
Instructions in the blinky.zip, gcc-section, Teensy++ v.2. Makefile and blinky.c are in the zip. I modified the blinky.c by defining F_CPU at the start because not using Makefile, please, see below. So why do I get the errs and how can I compile the C-files for at90usb1286 chip?$ avr-gcc -mmcu=atmega88 blinky.cIn file included from blinky.c:28: /usr/local/lib/gcc/avr/4.2.2/../../../../avr/include/util/delay.h:90:3: warning: #warning “Compiler optimizations disabled; functions from <util/delay
DC177E
arm atmel
I’m creating a simple program to familiarize myself with Atmel Studio 6 (running on Win 7 X64), using the ASF supplied libraries/drivers for a SAM4S microcontroller. In compiling, I get several (19) undefined reference errors on the startup_sam4s.c file. I have heard that this usually implies a file missing from project/missing linker files, but I’m (reasonably) confident that I have added all required files into my solution.The errors are all of the “undefined reference to _szero” sort, and are
jorrebor
c++ include atmel
this code:#include “SoftwareSerial.h”> #include <avr/io.h> #include <HardwareSerial.h> #include <avr/interrupt.h>void read_response();int main () {sei();Serial.begin(2400);uint8_t receivePin = 2;uint8_t transmitPin = 3;SoftwareSerial softSerial(receivePin, transmitPin);softSerial.begin(2400);while(1){softSerial.println(“to soft serial”);Serial.print(softSerial.read());} }gives me this error at compile time:undefined reference to `SoftwareSerial::SoftwareSerial(unsigned ch
SVFeingold
ide header-files atmel
I know there are a lot of questions on this topic, and I’ve looked through a fair number of them. However I am still having problems. I started writing a test program for a prototype PCB, and now that it’s grown to nearly 1000 lines I’m trying to break it up into libraries that I can use for particular functions. I thought this would be very simple. Make .c and .h files for each library that I need. I.e. I would have OLED.h and OLED.c for functions that control an OLED display. Copy the appropr
Anubis
arduino atmel avrdude
I’ve just got my first brand new Arduino mega 2560 board. I’ve downloaded Arduino 1.0.1 software. When I first plugged in the board, it failed to detect the device. So I opened device manager and pointed to the “…\arduino-1.0.1\drivers” folder to update the driver for the unidentified Arduino Mega 2560 device.Now comes my first problem; (O/S is window 7 32bit)Following warning came. I chose to install anyway. Is that wrong??However driver is successfully installed.Then I opened Arduino 1.0.1
Heather
c cross-compiling atmel
When compiling Atmel example with arm cross-compiler getting :../at91lib/utility/stdio.c:64:8: error: variable ‘r’ has initializer but incomplete typethe code is :struct _reent r = {0, (FILE *) 0, (FILE *) 1, (FILE *) 0};I don’t know what can I do here since first I need here is to understand what this code must mean?And then can I re code it for my compiler? Or must I downgrade compiler to some other version?My version : arm-unknown-linux-uclibcgnueabi-gcc (Buildroot 2012.05-git-00423-g4205dbd)
Web site is in building