Show Posts
Pages: [1]
1  Forum 2005-2010 (read only) / Syntax & Programs / Re: what is the 2d array size limit for Arduino on: November 06, 2007, 09:52:12 am
Thanks for the answers. Now I realized that I was trying to solve the wrong problem  :'(.

I worked on some custom protocol to send data between Arduino and MSP430F2013. It only worked on and off. I spent most of the time tuning the timing, however without realizing that my 2D array exceeds the 1K RAM size limit of Arduino, which is the real problem.

Unfortunately its IDE doesn't warm me that my byte array used up of the RAM (like IAR IDE does).

Fortunately once the problem is identified, I can quickly googled out a solution by storing my byte array in the flash memory.

prog_uchar data[20][64] PROGMEM = ...

... ...
...  = (byte)pgm_read_byte(&data[j]);
... ...

(http://www.avrfreaks.net/index.php?name=PNphpBB2&file=viewtopic&t=38003&postdays=0&postorder=asc)
(http://www.arduino.cc/en/Reference/PROGMEM)
(http://www.nongnu.org/avr-libc/user-manual/group__avr__pgmspace.html#g39235a28487ae7790ce5f4c8178c8ed7)

After thought, the Arduino IDE's easiness to use totally makes me unconscious of my dealing with a MCU (where RAM size is a very limited resource). I worked very hard to fit my code into MSP430F2013's 128B RAM. And IAR IDE will warn me if things don't fit. It would be great if Arduino can have that function as well as step-by-step debugging. Am I being too greedy  smiley-razz
2  Forum 2005-2010 (read only) / Syntax & Programs / what is the 2d array size limit for Arduino on: November 05, 2007, 09:15:09 pm
I need to flush out some data that are stored in a constant 2d byte array. Wondering what, if there is a limitation on the size of array I can define in one sketch? How big X can be?

byte data[X][64]={{128, 0, 128, 16, 128, 32, 128, 56, 128, 72, 128, 88, 128, 104, 128,
  120, 136, 0, 136, 24, 136, 40, 136, 48, 136, 64, 136, 80, 136, 104,
  136, 120, 144, 0, 144, 16, 144, 32, 144, 48, 144, 64, 144, 80, 144,
  96, 144, 112, 152, 0, 152, 16, 152, 32, 152, 48, 152, 64, 152, 80,
  128, 0, 128, 0}, {128, 0, 128, 16, 128, 40, 128, 56, 128, 72, 128,
  88, 128, 104, 128, 120, 136, 0, 136, 24, 136, 32, 136, 48, 136, 64,
  136, 80, 136, 104, 136, 112, 144, 0, 144, 16, 144, 32, 144, 48, 144,
   64, 144, 80, 144, 96, 144, 112, 152, 0, 152, 16, 152, 32, 152, 48,
  152, 64, 152, 80, 128, 0, 128, 0}, {128, 0, 128, 16, 128, 40, 128,
  56, 128, 72, 128, 88, 128, 104, 128, 120, 136, 0, 136, 24, 136, 40,
  136, 48, 136, 64, 136, 80, 136, 104, 136, 112, 144, 0, 144, 16, 144,
   32, 144, 48, 144, 64, 144, 80, 144, 96, 144, 112, 152, 0, 152, 16,
  152, 32, 152, 48, 152, 64, 152, 80, 128, 0, 128, 0}, {128, 0, 128,
  16, 128, 40, 128, 56, 128, 64, 128, 88, 128, 104, 128, 120, 136, 0,
  136, 24, 136, 40, 136, 48, 136, 64, 136, 80, 136, 96, 136, 112, 144,
   0, 144, 16, 144, 32, 144, 48, 144, 64, 144, 80, 144, 96, 144, 112,
  152, 0, 152, 16, 152, 32, 152, 48, 152, 64, 152, 80, 128, 0, 128,
  0}};
3  Forum 2005-2010 (read only) / Interfacing / Re: ATMEGA168 CLKO on: November 06, 2008, 10:46:32 am
I realize I can simply use (high frequency) PWM, which is already addressed in earlier posts

http://www.arduino.cc/cgi-bin/yabb2/YaBB.pl?num=1214327529


4  Forum 2005-2010 (read only) / Interfacing / ATMEGA168 CLKO on: November 05, 2008, 10:31:56 am
Here is the question: I hope to use ATMEGA168's clock to drive external circuit. According to its manual, PB0/CLKO (which is Arduino digital smiley-cool can do that, probably with fuse-bit set.

How to do that with the Arduino IDE?
5  Forum 2005-2010 (read only) / Exhibition / plastic package for arduino board on: January 18, 2007, 09:53:43 am
I happened to find out that the official USB arduino board (which I bought from sparkfun.com) can fit into serpac A-21 box (with a 9V battery compartment).

http://www.serpac.com/products_a-21.htm

It's a very tight fit and the screw holes don't align. But with a front panel properly drilled, that little box can be a secure housing for the wonderful arduino board.

On the other hand, if I can suggest that the official version had its board resized to better fit in such plastic packages.
Pages: [1]