avr

Using a rotary encoder with AVR Micro controller

I'm having trouble getting a rotary encoder to work properly with AVR micro controllers. The encoder is a mechanical ALPS encoder, and I'm using Atmega168. Clarification I have tried using an External Interrupt to listen to the pins, but it seems like it is too slow. When Pin A goes high, the interrupt procedure starts and then checks ...

Best platform for learning embedded programming?

Hi, I'm looking to learn about embedded programming (in C mainly, but I hope to brush up on my ASM as well) and I was wondering what the best platform would be. I have some experience in using Atmel AVR's and programming them with the stk500 and found that to be relatively easy. I especially like AVR Studio and the debugger that lets y...

Simple serial AVR programmer for beginner

What is the cheap and good way to make a serial (RS232) programmer for AVR atMega and atTiny? There are several circuits in the Internet, but which one is better? I'd like to be able to program my controller from Linux and Windows using some standard tools. ...

Protocols used to talk between an embedded CPU and a PC.

I am building a small device with its own CPU (AVR Mega8) that is supposed to connect to a PC. Assuming that the physical connection and passing of bytes has been accomplished, what would be the best protocol to use on top of those bytes? The computer needs to be able to set certain voltages on the device, and read back certain other vol...

(avr-gcc) Makefile support for sub-directories

Hi; I am working on an AVR project and have multiple folders containing my code. The makefile I am using is the "Standardized AVR Makefile Template" by Pat Deegan. It's capable of compiling every cpp file in every folder correctly and generate the right object (.o) files. However, the linker fails because it try to find to .o files i...

Help required in WinAvr programming

hello, i am trying to run a source code of win avr . after making the makefile when i try to send it using avrdude it is giving me error. Please any one can help me ...

help requires in winavr

i am trying to send ---.hex file to my siemens C55 throught serial port but while doing do i am getting an error "make.exe" program avrdude -p atmega8 -P com2 -c stk200 -U flash:w:gsm_remote.hex avrdude: port name "com2" is neither lpt1/2/3 nor valid number avrdude: can't open device "com2" avrdude: failed to open paral...

error: cast from 'const prog_uchar*' to 'byte' loses precision?

The error is at this line : dataArray[iLedMatrix][iRow] |= (byte)(bufferPattern[iRow]) & (1<<7); dataArray is : byte dataArray[NUMBER_LED_MATRIX][NUMBER_ROW_PER_MATRIX]; bufferPattern is : const patternp * bufferPattern; patternp is a typedef of the type : typedef prog_uchar patternp[NUM_ROWS]; I can see in the Reference that pro...

Pointer memory error

The problem I can't get the data from the Flash memory when using the function that return the address of the pattern desired in the Flash (simplified in the example below with only 1 constant : PATTERN_P). Some code before explication The type patternp is defined as typedef prog_uchar patternp[NUM_ROWS]; The global PATTERN_P vari...

How can I unit test Arduino code?

I'd like to be able to unit test my Arduino code. Ideally I would be able to run any tests without having to upload the code to the Arduino. Are there any tools or libraries out there which can help me with this? Update: There is an Arduino emulator in development which could be useful but it doesn't yet seem to be ready for use. Updat...

How I can fix this code to allow my AVR to talk over serial port?

Hi guys, I've been pulling my hair out lately trying to get an ATmega162 on my STK200 to talk to my computer over RS232. I checked and made sure that the STK200 contains a MAX202CPE chip. I've configured the chip to use its internal 8MHz clock and divided it by 8. I've tried to copy the code out of the data sheet (and made changes wher...

Building an AVR with HTTP server and SNMP agent?

I need to build a prototype for a simple data collection device using an AVR microcontroller. The device will basically collect sensor data and make this data available via SNMP and a HTTP response. What are my options when it comes to AVR software that would already have a HTTP server and SNMP agent built-in? ...

Must AVR programs always start with a relative jump instruction?

All example AVR programs I've ever seen start with code such as the following: .org $0000 rjmp Reset ; ... Reset: ; Start of program If I'm not making use of any interrupts can I do without the rjmp and start the program at $0000? ...

How can I visualise the memory (SRAM) usage of an AVR program?

I have encountered a problem in a C program running on an AVR microcontroller (ATMega328P). I believe it is due to a stack/heap collision but I'd like to be able to confirm this. Is there any way I can visualise SRAM usage by the stack and the heap? Note: the program is compiled with avr-gcc and uses avr-libc. Update: The actual prob...

How do I open an file in AVR Studio?

Hello, there: I have two ATMEGA88 (master and slave) working correctly by sending a test[] via I2C. Working enviroment: AVR Studio using C. What I need is to allow the master be able to send a indicated file such as mydoc.txt to the slave. Should I be using another application to build the UI? How can I connect a different IDE and m...

How can I prevent the need to copy strings passed to a avr-gcc C++ constructor?

In the ArduinoUnit unit testing library I have provided a mechanism for giving a TestSuite a name. A user of the library can write the following: TestSuite suite("my test suite"); // ... suite.run(); // Suite name is used here This is the expected usage - the name of the TestSuite is a string literal. However to prevent hard-to-find b...

Can I implement the Factory Method pattern in C++ without using new?

I'm working in an embedded environment (Arduino/AVR ATMega328) and want to implement the Factory Method pattern in C++. However, the compiler I'm using (avr-gcc) doesn't support the new keyword. Is there a way of implementing this pattern without using new? ...

Pros and Cons of ASNA Visual RPG (AVR)

Have you had any experience with ASNA Visual RPG for Visual Studio 2005/2008? I'm looking for some feedback on this product. I'm especially curious as to how it compares to other methods of accessing files and programs on the IBM’s System i (formerly known as iSeries, AS/400) server. Thanks! ...

Formatting characters on serial output!!!

Hi Guys, I'm interfacing an SD card to ATmega128 using EFSL. Card gets initialised, but I get an error saying "Unknown error 0xff(see sandisk docs p5-13)"... on serial port output. That's not all, I hv used 'sprintf' to form strings which I display on serial port. The puzzling thing is, I'm also getting the actual formatting characters...

Why is this code being generated by avr-gcc and how does it work?

This is a snippet of disassembled avr code from a C project I'm working on. I noticed this curious code being generated and I can't understand how it works. I'm assuming it's some sort of ridiculous optimization... Can anyone explain? 92: ticks++; +0000009F: 91900104 LDS R25,0x0104 Load direct from data space +0...