Show Posts
Pages: 1 2 [3] 4 5 ... 10
31  Using Arduino / Programming Questions / Re: IR break beam sketch language issues on: October 23, 2011, 01:49:44 am
Bit-banging a 38khz signal is completely un-necessary when you have an onboard timer that can generate that for you. See Ken Shirriff's IRemote library for the code.

I assume that you're using a pulsed and modulated signal to drive the IR LED? It looks like that LED can be pulsed at up to 1A if you get the pulse timing right. If you're just driving it with a constant supply your range will be very limited. I've had more than 15 meters reliable outdoor range by pulsing at 600mA  smiley-eek
32  Using Arduino / Programming Questions / Re: PROGMEM problem on: October 22, 2011, 11:18:13 am
I notice a long sequence of 0xff in your constant data. It looks like you might be suffering from this problem:

Does it upload if you (temporarily) replace the long runs of 0xff with different values?
33  Using Arduino / Programming Questions / Re: PROGMEM problem on: October 22, 2011, 06:18:28 am
All the _P progmem convenience functions require the data to have been located in the lower 64Kb by the linker because they use the LPM instruction to access memory. You can still get access to your data if the linker has put it above the lower 64Kb by using the 'far' functions that use the ELPM instruction for access.

Read progmem.h for details, and inspect your linker map file for evidence of where your data ends up.
34  Using Arduino / Programming Questions / Re: digital i/o library? on: September 26, 2011, 02:34:58 pm
Would it be useful to make a library for digital output ? It would be specific to the processor ofcourse and use direct port manipulation,
I heard that direct access is 30-40 times faster than digital write , but would, making it into a library slow it down to where its not useful?

I think it's already been done very well: digitalWriteFast.h is about as optimal as you can get while still maintaining the abstraction that is the Arduino pin numbering.
35  Using Arduino / Programming Questions / Re: lib_malloc on: September 22, 2011, 02:48:34 pm
I have seen a JTAG interface permits a gdb directly on the board, I am under linux. Is someone tested that ? I have a JTAG with my mini2440 board, can I adapt it with arduino atmega 328 ?

JTAG is supported by the atmega1280 and 2560 but not the smaller Arduino's such as your 328. The JTAG pins are 4,5,6,7 on the Arduino Mega. If your JTAG debugger is supported by OpenOCD then you should be able to hook it up but you're on your own there.
36  Using Arduino / Programming Questions / Re: lib_malloc on: September 21, 2011, 02:32:57 pm
Debug versions of the heap functions usually pad a small region before and after the allocated block with a known pattern and then check that the pattern is intact when the block is free'd. You really haven't the SRAM to do this on the Arduino. You could develop the key parts of your app on a PC with all your debug libraries and some stubs and mocks where the hardware goes then when it's bug free, port it down to the Arduino.
37  Using Arduino / Programming Questions / Re: Using expanded SRAM on: September 06, 2011, 01:57:47 pm
I made my own implementation of the extended memory interface except I used a much larger 512Kb SRAM chip that also runs with zero wait states. I wrote some articles on it:


To clear up some of the points in this thread.

Yes you can move the heap into the extended memory and this is my recommended way of using it. I provide some free software that manages heap state between bank switches so you get 8 independent 56Kb heaps to play with.

Yes you can move the stack into extended memory. It would be as simple as writing to the AVR_STACK_POINTER_REG register in a function that you must never return from (e.g. main) and doing it while interrupts are disabled. However in a bank-switched environment moving the stack pointer into extended memory would be a catastrophic fail.

It is also technically feasible to move the .data section (globals and statics) out into extended memory but this would have to be an advanced option because you'd need to modify the gcc linker script to set up the XMCRA and XMCRB registers before .data is moved from the flash image to SRAM.
38  Using Arduino / Programming Questions / Re: Accessing serial and other functions in Eclipse on: September 04, 2011, 03:35:17 pm
You need the arduino library. Don't worry, it's small. Probably the easiest way to get it into a prototype eclipse project is to create a new project folder called something like "arduino" then copy the arduino library source code into that folder. You can find the library source code here:


You probably don't want main.cpp but do take a look at it so you know what has to be called in your own main().
39  Using Arduino / Programming Questions / Re: Arduino + eclipse on: September 04, 2011, 04:43:39 am
Do you have any idea why this function always returns 0 ?

Make sure you call init(). This sets up the timer that the counter runs off. e.g. to imitate the Arduino IDE:

#include <wiring.h>   // from the Arduino library

int main(int argc,char **argv) {

  return 0; // not reached

I tried to replicate your problem. I found something interesting. If you sometimes use a dual monitor setup, and put the Serial Monitor on the second monitor, there is no way to move it if you do not have that second monitor attached. I use two monitors at work, but only one at home. The last time I opened the Serial Monitor, I moved it to the other monitor. Now, I can not move it back, or see it.

Assuming you're on Windows...

  • Select the serial monitor in the task bar. It will come to the foreground on the invisible monitor.
  • Press Alt-Space to drop down the system menu.
  • Press M to start moving it.
  • Use the cursor arrows to move it back to the primary monitor. Actually after you've pressed any cursor at least once you can then use the mouse to swing it back into view.

NB. If you have it maximised on the invisible monitor you'll need to do Alt-Space, R to restore it before moving it.
40  Using Arduino / Programming Questions / Re: Err: multiple types in one declaration on: September 02, 2011, 09:41:33 am
I suspect a name clash with something defined in another header file that you're including because those names defined at global scope in defines.h are very frequently used words that could easily clash with a #define or something else that you can't see.

Try renaming your structures and global variable instances of those structures one by one to see if it goes away.
41  Using Arduino / Displays / Re: 16bit data bus color LCD interfacing? on: August 30, 2011, 11:31:00 am
Yes it's possible. The driver is the SPFD54126B. Google will find you the datasheet. You'll need to implement the control signals for the 8080 (lots of pins, fast) or SPI (few pins, slow) interface. When you've done that you'll need to implement the commands that control the display and transfer data.

Alternatively, the interface is likely to be very close to one of the better known drivers, e.g. ILI9320/9325 etc. You could find some code for one of those and use that as your starting point. Either way, you are going to become very familiar with the datasheet if you take this on smiley
42  Using Arduino / General Electronics / Re: TQFP Soldering on: August 28, 2011, 01:10:32 pm
I use the pre-tinning method then I weight down the IC slightly then reflow the solder with a hot air gun - an Aoyue 852A+ in my case. Afterwards I inspect and touch up with my finest tip iron working under a 20x binocular microscope. 100% success rate so far.
43  Using Arduino / Displays / Re: LCD TFT Display on: July 10, 2011, 07:34:59 am
Also use command SLPIN (10h). It's documented in the ST7735 datasheet.
44  Using Arduino / Programming Questions / Re: Callback functions / function pointers on: June 27, 2011, 04:01:47 pm
While there's nothing wrong with your example it is a curious blend of C (the function pointer) and C++ (the class). If you're going C++ then a more pure approach would be to define an abstract base class (analogous to a C# interface) and pass a derivation of that to the worker class that would make calls through the base class methods. That should be all recognisable stuff to you as a C# guy.

Alternatively if you want to stick to the function call analogy then the pure c++ way is to use a function object, or functor.
45  Using Arduino / Displays / Re: LCD tft at least 7'' on: June 21, 2011, 04:09:48 pm
Yes you could drive an SSD1963 with an Arduino. Download the datasheet and look into the serial (slow, few pins) and 8080 parallel (much faster, many pins) interfaces. There may even be sample source around somewhere if you search hard - the SSD1963 is quite a popular driver.
Pages: 1 2 [3] 4 5 ... 10