Show Posts
Pages: 1 ... 23 24 [25] 26 27 ... 30
361  Using Arduino / Project Guidance / Re: Strange fault. LCD corrupts and arduino crashes on: August 26, 2011, 06:51:08 am
Well definitely a big thanks, just attached to my PC in the workshop to add the extra 100nF cap and realised that I had actually missed BOTH of the 100nF caps !!!!  The 100nF cap on the board is on the RTS line between the FTDI lead and the 328p.  It only took me a few seconds to move a couple of components and add the 2 caps.  I will have to retro fit them to the existing boards but that shouldn't be an issue.

Once again help much appreciated.  I will post back as soon as I am able to retro fit them.  I'm off to work shortly and working all weekend so might even be Monday!
362  Using Arduino / Project Guidance / Re: Strange fault. LCD corrupts and arduino crashes on: August 26, 2011, 06:33:47 am
Quote
There is not much in the way of variables, .

Quote
The debug stuff is just basically lots of stuff like this:


    #ifdef DEBUG_INT
      Serial.println(""); Serial.println("-------------- Entering the inner loop --------------"); Serial.println("");

To me, those two statements are at odds with each other.

Code:
("-------------- Entering the inner loop --------------");
is a crazy amount of RAM to waste on such low information content.


The statements are enclosed in IFDEF statements  so it really isn't a waste of RAM when the debugging is switched off smiley  Since this happened I have split the IFDEF constant up and each function has it's own constant so I can turn on debugging during small parts of the program only.  With debugging on all the relevant variables and EEPROM locations are listed as are the results of all decision making sections of code.   If I was getting up to 29-30K and having this problem I would seriously reduce the amount of space used by the lines but it is happening at 10-15K hence the issue.

It works with the reference board and the only difference is the lack of a 100nF cap on one side of the 328p.  I will add this as it does seem likely that this is the problem.

All the other variable information is stored in EEPROM and read directly from and written directly too the chip so that it is not lost when power is removed.
363  Using Arduino / Project Guidance / Re: Strange fault. LCD corrupts and arduino crashes on: August 26, 2011, 04:34:02 am
I only have a 100nF cap on one side of the 328p so will add one to the other side and see if that fixes the problem.

Thanks for everyones help, if that doesn't sort it I will get back with more details.
364  Using Arduino / Project Guidance / Re: Strange fault. LCD corrupts and arduino crashes on: August 25, 2011, 06:08:55 am
Given that extra info, it sounds like a hardware problem. I would check you have adequate decoupling first. Do you have a 5v regulator in your design, and if not, where are you getting the +5v supply from?

Also I recommend using a magnifying glass to check for short circuits between adjacent pins or traces, especially if your pcb doesn't have solder resist. My first atmega328 stripboard design had a couple of these.

Yes, using a 7805 regulator from a 9v battery. When the FTDI lead is plugged in the board gets it's power from the USB port via the lead. I have built several generations of the main board updating each one to the latest spec then changing the design in eagle and crating a new board. With that in mind I have four electrically identical boards. This same fault happens on both of the boards I tried.

Power supply shouldn't be an issue as it does it from the FTDI lead but basically I have a couple of 10uF caps either side of the reg.

What decoupling on the 328p is the accepted ideal?
365  Using Arduino / Project Guidance / Re: Strange fault. LCD corrupts and arduino crashes on: August 24, 2011, 05:49:10 pm
You may be running out of RAM, overwriting variables, etc. Usually gets reported here when large arrays are used.
There are some memory utilization things you can use to see how much is being used.

Thanks,  I felt that it was likely to be something like that.  There is not much in the way of variables, certainly not even 1K's worth I would guess.

There are 5 arrays with 16 entries each, 3 are unsigned int and 2 are "char* NAME[]" with entries that are 8 characters long each.

There are several long ints, ints and boolean variables and a few local variables but thats it.

The sketch includes: WProgram.h, Button.h, TicksPerSecond.h, RotaryEncoderAcelleration.h, EEPROM.h & LiquidCrystal.h

The actual program is not that long or complicated.


IMPORTANT NEW INFO.....

I originally built the device as a shield which attached to a genuine Arduino 328p reference board.

Next I took the standard setup as per the bread board like here : http://www.arduino.cc/en/Main/Standalone  and added my shield making it all on one PCB.

It worked faultlessly until this happened !



If I upload the same sketch to an arduino reference 328p board with my original shield attached (so it should be effectively the same thing) then it works exactly the same BUT it continues to work even with the debug stuff.



The debug stuff is just basically lots of stuff like this:


    #ifdef DEBUG_INT
      Serial.println(""); Serial.println("-------------- Entering the inner loop --------------"); Serial.println("");
      Serial.print("Number if times left = "); Serial.println(count);
    #endif

So I can watch what is happening using the computer.
366  Using Arduino / Project Guidance / Strange fault. LCD corrupts and arduino crashes on: August 24, 2011, 03:41:38 pm
I have built a project using my own PCB and it works fine.  I included a programmer socket compatible with an FTDI lead and this has worked all the way through the build with modifications and updates.

All of a sudden after another update the device crashed with a corrupted LCD screen.  I thought this was a loose connection and so took everything apart but it wasn't. 

I picked up another build of the same device and then ran the same update....  This caused the same problem.

I have a programming switch using #ifdef and so turned off all the serial communications I was using as a debug and the device worked again perfectly......

I updated it again with the debug info and again the same apparently random LCD issues and crash so again I updated with the debug info off and again it worked......

The program is about 11K without debug info and about 15-16K with it.

It seems to be the program length that is causing an issue but the 328p that I am using should be 32K max shouldn't it!

Any ideas anyone?
367  Development / Other Software Development / Re: Next version of IDE and other ICs on: July 07, 2011, 07:03:21 pm
I am brand new to Arduino. I did not even know about 0021 until I read your reply.  Is going back a version fairly (considering) easy?

Sure, you can have multiple version avalible in your PC, see my folder below. I really need to start deleting some version some day.  smiley-grin

Quote
C:\Documents and Settings\Primary Windows User\My Documents\My Programs\Arduino

5 Folders:

arduino-0018
arduino-0019
arduino-0021
arduino-0022
arduino-1.0-beta1


0 Files:

Lefty

I am going to have to have a look for the beta version tomorrow then.  I'm off to sleep now!
368  Using Arduino / General Electronics / Re: 10K pot without stop on: July 03, 2011, 01:35:38 am
Quote
I did find a supplier of "servo pots" on ebay and bought one.  The value went haywire as it went through from high to low

"Haywire"?  That is exactly how a pot is designed to work.
Which is why a pot is not as good for continuous applications as several other solutions.

The pot was an easy answer.  It used one port and little programming so I thought that I wold give it a try.  The encoder works great though.
369  Using Arduino / General Electronics / Re: 10K pot without stop on: July 02, 2011, 06:08:48 pm
Thanks everyone for your responses.  I did find a supplier of "servo pots" on ebay and bought one.  The value went haywire as it went through from high to low and after some coding I fixed that but the rotary encoder method proved the best.

Bought a dozen from HK.
370  Using Arduino / Project Guidance / Re: Basic 664p/1284p board on: July 01, 2011, 05:24:23 pm
Anyhow I am working on it, I'll supply you both with a working bootloader soon.

Cheers you are a star.  Can you do 16 and 20MHz versions?  Is there a reason why the upload speed is 38400?  It's not a problem, just wondering.
371  Using Arduino / Project Guidance / Re: Basic 664p/1284p board on: July 01, 2011, 04:11:45 pm
Listen to Crossroads, he knows the hardware very well.


Yes. I realised that from seeing some of his other posts.

I was powering it from the 5v of the duemilanove board OR the FTDI cable.

I had decoupling caps and had tried with and without a couple of electrolitics.

I was using the same setup with a 328p which was working perfectly using the same caps and crystal!

The only changes I made when I went to the ceramic oscillator was to pull out the caps and crystal, install the ceramic osc just below the 1284p and use 3 jump wires to connect it. I then tan the IDE and it worked straight off. Like I said, very strange! The board was even tried with 3 different
Computers so it can't even be a bad USB power line on a particular machine. I'm at a loss as the what it is.
372  Using Arduino / Project Guidance / Re: Basic 664p/1284p board on: July 01, 2011, 07:58:55 am
crikey
you kind of assume that basic parts will work correctly!

glad you got it sorted
but I bet you are VERY glad!

Well yes!

The crystal and caps that were on the board had come off a working 328p breadboard!
I made a second board using point to point soldering and with it's own set of components.
I made a third board again with breadboard.

ALL three had the same issue!

The crystals came from 3 different suppliers. CPC, Farnell and Ebay
The crystals were 3 different brands
The caps came from 2 suppliers.

I am absolutely positive that it was wired correctly....

ie..  Crystal as close as possible to the chip on the XTAL lines then each XTAL line connected to GND via a 22pF capacitor.


So no idea why it wouldn't work

Anyway now that it is working I get to play with the PCB making kit that I bought last month and have still not used yet.

First job is trying to work out in Eagle how to print the two solder layers !! (If it all goes to plan I'll send you a board and a 1284p)
373  Using Arduino / Project Guidance / Re: Basic 664p/1284p board on: July 01, 2011, 07:17:00 am
What device are you using to upload the sketches on the FTDI port?

I am using the BUB board from Moderndevice and it already has the capacitor on the reset line so I removed the capacitor, C3 shown on your schematic and uploads smoothed out for me.

I am also uploading at 115200 too with no issues.

Mnmis

I was originally using a duemilanove board minus it's 328p chip then I bought a FTDI lead (it just looks like a normal USB lead but the USB plus is clear and the electronics for the FTDI are inside it - very nice).

I did try removing the cap C3 but it didn't work at all when I did.

The upload speed of 38400 is a product of Mr Skyjumpers core for the 1284p, it is fixed.

Thank you for your ideas.  As you can see from the above post it all appears to be down to the oscillator!!
374  Using Arduino / Project Guidance / Re: Basic 664p/1284p board on: July 01, 2011, 07:13:05 am
BLIMEY!!

I was a little unhappy with the naff looking trace when I looked at the output from the crystal oscillator so yesterday I ordered a pack of 5 16MHz ceramic oscillators off fleabay anyway.  I just pulled out the caps and crystal and stuck the oscillator in and hey presto.  The larger sketch just uploaded FIRST time with no issues whatsoever.......

I don't have enough time to do much more with it now but it would appear that it was the crystal oscillator part of the circuit causing the problems.  This is strange because I have tried SEVERAL oscillators and several pairs of caps including slightly smaller and slighter larger ones.

Just doubled the length of the sketch again so and hit upload - no problems whatsoever it uploaded and is still working.......

I am very happy now  smiley  smiley

And I really do appreciate everyones help !!
375  Using Arduino / Project Guidance / Re: Pins...how to consolidate? on: July 01, 2011, 06:10:20 am
Using a shift register is the best way for most purposes but as has been said knowing what you are using them for can be useful too.

Have a look at the 4000 and 74 series chips there are a number of useful devices there.

A shift register creates a little work between your chip and the input so MAY not be ideal when you have fast data coming in so multiplexing is another alternative.

A 74150 for example has 16 inputs and one output.  This can be controlled by 4 outputs from the arduino (for the address) plus the 1 input.  Not as good as the shift register BUT once the 4 address lines are setup the input requires no work and is full speed just like a normal input.

So now you have another possibility, you can even mix the two!  ie a pair of 74150s and a shift register would give you 2 inputs from 32 (or basically a pair of 1 from 16s) for 5 GPIO ports and at full speed with no extra work once the address lines are set.

I just bought 24 ex russian military new 74150s for £22 (about $27 ish)

If you want a set of functions for manipulating the 74150 let me know and I will upload them.

Have a play....
Pages: 1 ... 23 24 [25] 26 27 ... 30