Show Posts
Pages: [1]
1  Products / Arduino Due / Re: Are 32-bit controllers like Due the future? on: January 20, 2013, 01:42:19 pm
I personally don't have a need for that much processing power, nor the time to write enough software to take advantage of it.
I guess that you never programmed something like a small TFT Display (320x240 pixel). Such a simple element like a progressbar brings any ATMega MPU on the border of usage. Atmel's xMega's can help to solve those problems because they clocked 30Mhz but the progressbar is not the only thing that the mpu should doing. To use bigger Fonts need do define them as a hugh uint8_t array an this consumes storage space in the Flash memory. An access to that memory from a running program, consumes many cpu time. This is reasoned by the modified harvard-architecture design of the ATMega's, that the compiler not supports. GNU-CC is designed for used with a von-Neumann architecture. To get access to the flash memory, the compiler designer had created some macros that will solve it.
I am very surprised about the speed of a simple Cortex-M3 that is internaly clocked with 78Mhz. The size of flush memory is 256kbyte  (STM32V103C) and the SRAM size is 48Kbyte. This chip price is cheaper than an ATMega 2560 and the tools are cheaper too.  The backside of the medal is, that the architecture  is more complex.  I guess, that the ARM Cortex M3 / M4F (with DSP - every floating point application will love it)
will be very successful like ATMega and PIC's.
I have a couple of applications that the power of the ARM is required. I will be with you, i also know a couple of applications that does'nt need a "big gun" like an ARM. ATMega's MPU's are are very versatile in usage and is available as a DIP variant's. This are very important for test and evaluation purposes. I don't will miss them and will use them in the future too.

2  Using Arduino / Programming Questions / Re: ATMEGA644 Serial1 can't work on: December 29, 2012, 08:36:25 am
Take a look to the mapping if the ISR for the serial Port you wanna use. I have did some fixes in Arduino103 environment for m644,644p , 1284p to use the the serial port. The #defines of the
supportet ATMega variants are not complete in all purposes. Just extend them and add your MPU model to the right register definition.
Take a look to the compilers mapping file and compare the IRQ Vectors he mapped with the datasheet of the MPU you use.

Hi All,
I am using atmega644 with  sanguino 1.01 , we met a problem when testing serial1. atmega644  would halt  after calling  "Serial1.println" several times  and  there also did't have anything output on USART1.  anyone can help us?


// the setup routine runs once when you press reset:
void setup() {                
  Serial1.println("Serial1 Starting...");

void loop() {


3  Using Arduino / Programming Questions / Re: Using Flash space error on: December 29, 2012, 08:28:58 am
In general, the PROGMEM in older AVR-Toolchains contains a macro in avr/pgmspace.h that contains the following definition:


typedef char prog_char PROGMEM;

This is since a couple of Versions of the Toolchain, this "type" declaration marked as "Depricated". The reason is, that the  GNU-C/C++ Compiler does'nt supports memory attribute  on a type definitions. The recommended usage is, to use the attribute on the variable instead of the type definition. The explain and further programming of attribute are found here: .

if you define a uint8_t array of values, you need to declare them as const instead static.

const uint8_t arr[] = PROGMEM  {"this is just a test that shoud stored into the Programm memory space\n"};
uint8_t char_from_progmem;

uint8_t readstring_P (const uint8_t *str)
    retbyte = pgm_read_byte (str)  ;
 return (retbyte);

// ############# call that function ######################
char_from_progmem = readstring_P(arr);

The compiler does'nt need to know what memory segment the pointer of str points, just the address is needed.  The access to the program memory do the
pgm_read_byte (str) function for us. This need just the address and assume, that the memory is the program space instead data segment.
The document from Dean Camera describe further details about the progmem handling.

bye the way, the depricated SIGNAL() function for ISR callbacks are also describted by Dean Camera and i would recomment his "actual" Documentation of all the hints about the newer toolchain and recommended programming.

I am leading with a strange error using the PROGMEM space that I can't understand. Here is the temp code that I have been using to figure out the problem:
Pages: [1]