Show Posts
Pages: 1 ... 50 51 [52] 53 54 ... 116
766  Using Arduino / Programming Questions / Re: Project crashes Micro on: April 06, 2013, 01:00:20 pm
With PROGMEM, this wont work:

As it is accessing the data incorrectly.

You have to use special functions as mentioned in reply #9.

See here for details:

Although it has to be said, that page is far from helpful. So as a hint:


You also don't need the const keyword if you are using the PROGMEM keyword.
767  Using Arduino / Programming Questions / Re: Project crashes Micro on: April 06, 2013, 05:37:23 am
Could you attach your modified code.
768  Using Arduino / Programming Questions / Re: Project crashes Micro on: April 05, 2013, 06:10:31 pm
Errrm, an arduino Uno has 32kB of Flash and 2kB of RAM. The sketch size reported is how much Flash you are using, and gives no indication of how much Ram is being used.

I had a look at the sketch. You are using at least 1.2kB of Ram in your 'scrollingLetterKeys', 'scrollingFrame', 'blinkColumnStates' and 'blinkRowStates' arrays combined (plus the overhead from the arduino core).

However you have a very large amount of memory consumed by other arrays. Although these are declared 'const', the compiler will still store it in the Ram when in use which means you will be far exceeding the available RAM - by more than 4kB.

You could try using the PROGMEM keyword for the constant arrays.

Also you are using 'int' types to store the numbers 0 and 1. Consider using 'byte' instead as it will use half the memory.
769  Using Arduino / Displays / Re: How Do I Control This Display on: April 05, 2013, 06:01:46 pm
The answer is, you don't. An arduino is nowhere near fast enough to control such a display as the display has no controller built in - you have to generate the pixel clock, HSync, VSync, Data Enable, and data pins.
I tried such a thing before (different screen, but same principal) using an arduino and even with near perfect optimisation of code I could only get to 1/10th the required pixel clock frequency which is so far out of spec that the screen won't accept it.

Interestingly actually this is an Analog display not a digital one (FG020510A). But still, the clock rate required is far beyond the capability of an arduino.
770  Using Arduino / LEDs and Multiplexing / Re: Streaming Pixel Data to Arduino on: April 04, 2013, 06:36:17 pm

37mS/1536 bytes = 24uS/byte which is a data rate of 41,513 bytes per second if I have the math going right.
So sending bursts of data over at 115,200, loading it into an array as you go, and then sending the array out to the WS2801s would seem a feasible approach.

41513 BYTES/s is larger than 115200 BITS/s. You would need a minimum of 416kBaud - say 500kBaud to transmit that data rate using an 8N1 Serial link.
771  Using Arduino / Programming Questions / Re: Why is this program not preforming as it should? on: March 17, 2013, 10:31:45 am
As it is homework, you can do the work, but here are some tips to get you started:

First things first, have a look at the last 3 lines of the setBacklight() function and tell me (and yourself) what is wrong with them smiley

Second, if nothing is printing on the display, try uploading a simple sketch, such as on of the LiquidCrystal examples and see if that works. If it doesn't you likely have a hardware issue.
If it does, go through the lcd.___() calls in your main sketch and see if you are doing anything differently.

[Also: Have a quick look in setup, do you really expect to be able to see text if it is cleared after 7 milliseconds]
772  Using Arduino / Microcontrollers / Re: atMega1284P-AU @ 20Mhz on: March 17, 2013, 09:51:32 am
The chip still worked fine at 4V, but that is outside the guaranteed working region.
The atmega1284p operating voltage range is 1.8-5.5V..
But not at 20MHz.

– 0 - 4 MHz @ 1.8 - 5.5V
– 0 - 10 MHz @ 2.7 - 5.5V
– 0 - 20 MHz @ 4.5 - 5.5V
773  Using Arduino / Microcontrollers / Re: atMega1284P-AU @ 20Mhz on: March 17, 2013, 06:09:40 am
The full swing would be better for noisy environments, but it also consumes more power. I found that the low power crystal oscillator worked fine in my project, though I didn't try it on breadboard, the circuit was built directly onto a PCB. I imagine with a breadboard there will be much more noise and so the full swing setting could be useful.

The brownout probably should be 4.3V, or not on at all, however the powersupply I was using at the time was rather crappy and kept triggering the brownout - the circuit drew large currents at times and the supply couldn't hold its voltage, dropping on occasion to around 4v. The chip still worked fine at 4V, but that is outside the guaranteed working region.
774  Using Arduino / Project Guidance / Re: ABC - Arduino Basic Connections on: March 16, 2013, 09:13:09 am
For the 'Pushbutton to 12V', you have a note under it that says that for 24v you should increase R to 2200 Ohms. You don't however mention which resistor to increase as there are two. While to the more experienced it is obviuos which you mean, for those who are new to electronics, it is asking for trouble, as increasing the bottom one would result in 16.5V across the arduino.

The other thing is that you may want to check your 'Encoder' circuit. As it is there is nothing in the circuit to generate a logic 1, unless you are using 0v logic smiley-wink.

Other than that, looking good.
775  Using Arduino / Programming Questions / Re: LED navigation lights can someone help me modify this code on: March 11, 2013, 03:36:18 pm
One thing is this:
 if (ledState == LOW)
    ledState = HIGH;
    ledState = LOW;

First of all, never use if statments without {}. Yes it is valid for a single line, but it makes code difficult to follow and allows mistakes to creep in.

Secondly, that snippet of code can be replaced with just:

ledState = !ledState;
776  Using Arduino / Programming Questions / Re: Faking SPI with Attiny85 on: March 06, 2013, 08:07:50 am
The lines of code for USI aren't buying time so much as they are performing a function. To do SPI with the USI module you have to generate the clock cycles manually by writing to the config register - not only that but you have to manually do every edge, so for an 8bit transfer you have to perform 16 writes to the config register.
If you just put 16 instructions in a line, you can get a clock rate of Fcpu/2, if you use a loop, that drops to Fcpu/6.
You will have to edit USI.h to provide the correct Arduino pin numbers corresponding to the USI pin locations. There are three #defines at the top of the .h file which set this.

[USI library attached]

For the software library, you can use any of the 4 SPI modes, and have a choice over data order. Due to the way it is generated, the fastest speed I could get was 1/16th of the clock frequency.
With the software library you have to specify which pins to use for SPI in the begin call:
begin(byte SCK_, byte MOSI_, byte MISO_, byte SS_)
There is also a function which allows you to set the state of the SS pin:
void writeSS(boolean state);

[TinySoftwareSPI attached]
777  Using Arduino / Programming Questions / Re: Faking SPI with Attiny85 on: March 05, 2013, 06:27:27 pm
I have written a drop in replacement library for SPI. I have both a USI Master version and a bitbanged software Master version. If you would like I can upload them.
778  Using Arduino / Programming Questions / Re: how to increase the size of an array? on: March 03, 2013, 07:34:16 pm
I was under the impression that the limit for avr-gcc was 32kB arrays (or 32k elements, whichever is smaller).

I just tried and had no problem compiling a program with an array of 8193 elements. I did try declaring the array as 8192 bytes and adding an extra and got the error message you reported. It looks like you have given too many initialisers as the error suggests (you specified more elements than fit in the array length you specified).
779  Using Arduino / Programming Questions / Re: error: invalid conversion from 'char' to 'const char*' on: March 03, 2013, 07:09:48 pm
(1) @PaulS and @Grumpy_Mike... why not declare temperature as a char? Last time I checked, the temperature around here is unlikely to get above 127 degrees C or less than -128 degrees C. What on earth is the point in using an int when you don't need two bytes to store the value, you are just wasting a byte of precious RAM. Remeber folks, just because a char is called a char doesn't mean it has to be used to store a character! (Oh, and the temperature could be 'H', that would be room temperature if it were in fahrenheit: 72 degrees F is approx. 22 degrees C)

(2) The issue lies in this line:
ether.browseUrl(PSTR("/data_request?id=variableset&DeviceNum=49&serviceId=urn:upnp-org:serviceId:TemperatureSensor1&Variable=CurrentTemperature&Value="), temperature, website, my_callback);

You first need to convert the temperature to a string of characters before passing it to that function. For example:

char temp[5];
ether.browseUrl(PSTR("/data_request?id=variableset&DeviceNum=49&serviceId=urn:upnp-org:serviceId:TemperatureSensor1&Variable=CurrentTemperature&Value="), temp, website, my_callback);
780  Using Arduino / Microcontrollers / Re: More than 256K of memory? on: February 16, 2013, 02:49:32 pm
Do you know it is going to be larger than 256K, or are you just making a wild guess? Just as an example, it is possible to make an entire MP3 player in 90k of Flash, and that was over 15000 lines of code...
Pages: 1 ... 50 51 [52] 53 54 ... 116