Loading...
  Show Posts
Pages: 1 ... 13 14 [15] 16 17 ... 27
211  Using Arduino / Microcontrollers / Re: RAM RAM I need more RAM!! on: March 31, 2012, 06:05:05 am
Just as a starter here is something that I use to reduce RAM requirements:


void serialPrint_P(const prog_char* s){
  char* p = (char*)alloca(strlen_P(s) + 1);
  strcpy_P(p, s);
  Serial.print(p);
}

void lcdPrint_P(const prog_char* s){
  char* p = (char*)alloca(strlen_P(s) + 1);
  strcpy_P(p, s);
  lcd.print(p);
}


in sketch:

serialPrint_P(PSTR("This text is going to be going to the serial port.  If I used the normal Serial.print command it would go there via RAM wasting lots of space in the process.  The lcdPrint_P function does the same thing for LCDs.  Have a nice day."));
212  Using Arduino / Microcontrollers / Re: atmega1284 on: March 31, 2012, 06:00:55 am
"OUTPUT is not declared in this sketch" !

This relates to the processor not being recognised by the IDE and so it is not declaring the definitions etc for it.  Have you modified the relevant files?  Did you look at the thread I started about the 1284p that is linked to from maniacbugs's page?

The work he has done with v1.0 should give you a pointer.

I have the 1284p uploading and working under v1.0 now.  My only issue is that I would like an option of uploading more slowly as my test board kicks off quite a bit on longer sketches and I am too busy working on other projects to build a better one smiley

Check this thread re variant part : http://arduino.cc/forum/index.php/topic,99134.0.html
213  Using Arduino / Microcontrollers / Re: New optiboot; beta testers welcome... on: March 31, 2012, 05:49:20 am
I still cannot get the optiboot to work FOR UPLOADING VIA SERIAL on a Mega8A.

I have uploaded the optiboot bootloader using the AVR ISP MK2 and tried uploading a sketch but it doesn't upload either BUT it does upload and run using "Upload with programmer" (this is the basic blink sketch)

I have the 6 pin FTDI header connected just like I would for a 328 ie 1-GND, 3-VCC,4-TX,5-RX,6-100nF cap with other side going to reset pin.  It works on 328, 664 and 1284 so lead etc is known good.  Am I missing something?

Optiboot needs adding to version 1.1 of the IDE as a standard feature.  1.5K saved on the 328 with no disadvantages as far as I can see is too good to miss.  Hence my trying to get it to work on the Mega8.

ALSO

If I try and upload the bootloader via the IDE I get this:

Code:
avrdude: Sent: . [1d] . [04] . [04] . [00] . [a0] . [01] . [fd] . [00]
avrdude: Recv: . [1d] . [00] . [00] . [a0] . [01] . [ff] . [00]
avrdude: Sent: . [1d] . [04] . [04] . [00] . [a0] . [01] . [fe] . [00]
avrdude: Recv: . [1d] . [00] . [00] . [a0] . [01] . [ff] . [00]
avrdude: Sent: . [1d] . [04] . [04] . [00] . [a0] . [01] . [ff] . [00]
avrdude: Recv: . [1d] . [00] . [00] . [a0] . [01] . [ff] . [00]
avrdude: erasing chip
avrdude: Sent: . [12] . [0a] . [00] . [ac] . [9f] . [f0] . [ff]
avrdude: Recv: . [12] . [00]
avrdude: Sent: . [10] . [c8] d [64] . [19]   [20] . [00] S [53] . [03] . [ac] S [53] . [00] . [00]
avrdude: Recv: . [10] . [00]
avrdude: reading input file "/Users/darren/Applications/Arduino version 1.00/Arduino.app/Contents/Resources/Java/hardware/arduino/bootloaders/optiboot/optiboot_mega8.hex"
avrdude: can't open input file /Users/darren/Applications/Arduino version 1.00/Arduino.app/Contents/Resources/Java/hardware/arduino/bootloaders/optiboot/optiboot_mega8.hex: No such file or directory
avrdude: read from file '/Users/darren/Applications/Arduino version 1.00/Arduino.app/Contents/Resources/Java/hardware/arduino/bootloaders/optiboot/optiboot_mega8.hex' failed
avrdude: Sent: . [11] . [01] . [01]
avrdude: Recv: . [11] . [00]

avrdude done.  Thank you.

BUT

The file IS there, exactly where it is supposed to be !!!
214  Using Arduino / Microcontrollers / Re: New optiboot; beta testers welcome... on: March 24, 2012, 10:27:12 am
Ok added that line and removed the file added earlier....

I'm trying to upload blink

This is the error I now get:


Blink.cpp:8:21: error: Arduino.h: No such file or directory
Blink.cpp: In function 'void setup()':
Blink:10: error: 'OUTPUT' was not declared in this scope
Blink:10: error: 'pinMode' was not declared in this scope
Blink.cpp: In function 'void loop()':
Blink:14: error: 'HIGH' was not declared in this scope
Blink:14: error: 'digitalWrite' was not declared in this scope
Blink:15: error: 'delay' was not declared in this scope
Blink:16: error: 'LOW' was not declared in this scope


If I #include the Arduino.h file in the first line I still get the same error ie the Ardunio.h file is still missing.....

215  Using Arduino / Microcontrollers / Re: New optiboot; beta testers welcome... on: March 21, 2012, 08:08:41 pm
Actually, I managed to try it tonight.....

Added the entry as stated and then..

Compiled it and it says...

Code:
In file included from Blink.cpp:8:
/Applications/Arduino v1/Arduino.app/Contents/Resources/Java/hardware/arduino/cores/arduino/Arduino.h:212:26: error: pins_arduino.h: No such file or directory

So I copied the file called pins_arduino.h into the directory stated.....

and the error became:

Code:
In file included from /Applications/Arduino v1/Arduino.app/Contents/Resources/Java/hardware/arduino/cores/arduino/Arduino.h:212,
                 from /Applications/Arduino v1/Arduino.app/Contents/Resources/Java/hardware/arduino/cores/arduino/wiring_private.h:33,
                 from /Applications/Arduino v1/Arduino.app/Contents/Resources/Java/hardware/arduino/cores/arduino/wiring_digital.c:28:
/Applications/Arduino v1/Arduino.app/Contents/Resources/Java/hardware/arduino/cores/arduino/pins_arduino.h:90: error: 'DDRA' undeclared here (not in a function)
/Applications/Arduino v1/Arduino.app/Contents/Resources/Java/hardware/arduino/cores/arduino/pins_arduino.h:94: error: 'DDRE' undeclared here (not in a function)
/Applications/Arduino v1/Arduino.app/Contents/Resources/Java/hardware/arduino/cores/arduino/pins_arduino.h:95: error: 'DDRF' undeclared here (not in a function)
/Applications/Arduino v1/Arduino.app/Contents/Resources/Java/hardware/arduino/cores/arduino/pins_arduino.h:96: error: 'DDRG' undeclared here (not in a function)
/Applications/Arduino v1/Arduino.app/Contents/Resources/Java/hardware/arduino/cores/arduino/pins_arduino.h:97: error: 'DDRH' undeclared here (not in a function)
/Applications/Arduino v1/Arduino.app/Contents/Resources/Java/hardware/arduino/cores/arduino/pins_arduino.h:99: error: 'DDRJ' undeclared here (not in a function)
/Applications/Arduino v1/Arduino.app/Contents/Resources/Java/hardware/arduino/cores/arduino/pins_arduino.h:100: error: 'DDRK' undeclared here (not in a function)
/Applications/Arduino v1/Arduino.app/Contents/Resources/Java/hardware/arduino/cores/arduino/pins_arduino.h:101: error: 'DDRL' undeclared here (not in a function)
/Applications/Arduino v1/Arduino.app/Contents/Resources/Java/hardware/arduino/cores/arduino/pins_arduino.h:106: error: 'PORTA' undeclared here (not in a function)
/Applications/Arduino v1/Arduino.app/Contents/Resources/Java/hardware/arduino/cores/arduino/pins_arduino.h:106: error: initializer element is not constant
/Applications/Arduino v1/Arduino.app/Contents/Resources/Java/hardware/arduino/cores/arduino/pins_arduino.h:106: error: (near initialization for 'port_to_output_PGM[1]')
/Applications/Arduino v1/Arduino.app/Contents/Resources/Java/hardware/arduino/cores/arduino/pins_arduino.h:110: error: 'PORTE' undeclared here (not in a function)
/Applications/Arduino v1/Arduino.app/Contents/Resources/Java/hardware/arduino/cores/arduino/pins_arduino.h:110: error: initializer element is not constant
/Applications/Arduino v1/Arduino.app/Contents/Resources/Java/hardware/arduino/cores/arduino/pins_arduino.h:110: error: (near initialization for 'port_to_output_PGM[5]')
/Applications/Arduino v1/Arduino.app/Contents/Resources/Java/hardware/arduino/cores/arduino/pins_arduino.h:111: error: 'PORTF' undeclared here (not in a function)
/Applications/Arduino v1/Arduino.app/Contents/Resources/Java/hardware/arduino/cores/arduino/pins_arduino.h:111: error: initializer element is not constant
/Applications/Arduino v1/Arduino.app/Contents/Resources/Java/hardware/arduino/cores/arduino/pins_arduino.h:111: error: (near initialization for 'port_to_output_PGM[6]')
/Applications/Arduino v1/Arduino.app/Contents/Resources/Java/hardware/arduino/cores/arduino/pins_arduino.h:112: error: 'PORTG' undeclared here (not in a function)
/Applications/Arduino v1/Arduino.app/Contents/Resources/Java/hardware/arduino/cores/arduino/pins_arduino.h:112: error: initializer element is not constant
/Applications/Arduino v1/Arduino.app/Contents/Resources/Java/hardware/arduino/cores/arduino/pins_arduino.h:112: error: (near initialization for 'port_to_output_PGM[7]')
/Applications/Arduino v1/Arduino.app/Contents/Resources/Java/hardware/arduino/cores/arduino/pins_arduino.h:113: error: 'PORTH' undeclared here (not in a function)
/Applications/Arduino v1/Arduino.app/Contents/Resources/Java/hardware/arduino/cores/arduino/pins_arduino.h:113: error: initializer element is not constant
/Applications/Arduino v1/Arduino.app/Contents/Resources/Java/hardware/arduino/cores/arduino/pins_arduino.h:113: error: (near initialization for 'port_to_output_PGM[8]')
/Applications/Arduino v1/Arduino.app/Contents/Resources/Java/hardware/arduino/cores/arduino/pins_arduino.h:115: error: 'PORTJ' undeclared here (not in a function)
/Applications/Arduino v1/Arduino.app/Contents/Resources/Java/hardware/arduino/cores/arduino/pins_arduino.h:115: error: initializer element is not constant
/Applications/Arduino v1/Arduino.app/Contents/Resources/Java/hardware/arduino/cores/arduino/pins_arduino.h:115: error: (near initialization for 'port_to_output_PGM[10]')
/Applications/Arduino v1/Arduino.app/Contents/Resources/Java/hardware/arduino/cores/arduino/pins_arduino.h:116: error: 'PORTK' undeclared here (not in a function)
/Applications/Arduino v1/Arduino.app/Contents/Resources/Java/hardware/arduino/cores/arduino/pins_arduino.h:116: error: initializer element is not constant
/Applications/Arduino v1/Arduino.app/Contents/Resources/Java/hardware/arduino/cores/arduino/pins_arduino.h:116: error: (near initialization for 'port_to_output_PGM[11]')
/Applications/Arduino v1/Arduino.app/Contents/Resources/Java/hardware/arduino/cores/arduino/pins_arduino.h:117: error: 'PORTL' undeclared here (not in a function)
/Applications/Arduino v1/Arduino.app/Contents/Resources/Java/hardware/arduino/cores/arduino/pins_arduino.h:117: error: initializer element is not constant
/Applications/Arduino v1/Arduino.app/Contents/Resources/Java/hardware/arduino/cores/arduino/pins_arduino.h:117: error: (near initialization for 'port_to_output_PGM[12]')
/Applications/Arduino v1/Arduino.app/Contents/Resources/Java/hardware/arduino/cores/arduino/pins_arduino.h:122: error: 'PINA' undeclared here (not in a function)
/Applications/Arduino v1/Arduino.app/Contents/Resources/Java/hardware/arduino/cores/arduino/pins_arduino.h:122: error: initializer element is not constant
/Applications/Arduino v1/Arduino.app/Contents/Resources/Java/hardware/arduino/cores/arduino/pins_arduino.h:122: error: (near initialization for 'port_to_input_PGM[1]')
/Applications/Arduino v1/Arduino.app/Contents/Resources/Java/hardware/arduino/cores/arduino/pins_arduino.h:126: error: 'PINE' undeclared here (not in a function)
/Applications/Arduino v1/Arduino.app/Contents/Resources/Java/hardware/arduino/cores/arduino/pins_arduino.h:126: error: initializer element is not constant
/Applications/Arduino v1/Arduino.app/Contents/Resources/Java/hardware/arduino/cores/arduino/pins_arduino.h:126: error: (near initialization for 'port_to_input_PGM[5]')
/Applications/Arduino v1/Arduino.app/Contents/Resources/Java/hardware/arduino/cores/arduino/pins_arduino.h:127: error: 'PINF' undeclared here (not in a function)
/Applications/Arduino v1/Arduino.app/Contents/Resources/Java/hardware/arduino/cores/arduino/pins_arduino.h:127: error: initializer element is not constant
/Applications/Arduino v1/Arduino.app/Contents/Resources/Java/hardware/arduino/cores/arduino/pins_arduino.h:127: error: (near initialization for 'port_to_input_PGM[6]')
/Applications/Arduino v1/Arduino.app/Contents/Resources/Java/hardware/arduino/cores/arduino/pins_arduino.h:128: error: 'PING' undeclared here (not in a function)
/Applications/Arduino v1/Arduino.app/Contents/Resources/Java/hardware/arduino/cores/arduino/pins_arduino.h:128: error: initializer element is not constant
/Applications/Arduino v1/Arduino.app/Contents/Resources/Java/hardware/arduino/cores/arduino/pins_arduino.h:128: error: (near initialization for 'port_to_input_PGM[7]')
/Applications/Arduino v1/Arduino.app/Contents/Resources/Java/hardware/arduino/cores/arduino/pins_arduino.h:129: error: 'PINH' undeclared here (not in a function)
/Applications/Arduino v1/Arduino.app/Contents/Resources/Java/hardware/arduino/cores/arduino/pins_arduino.h:129: error: initializer element is not constant
/Applications/Arduino v1/Arduino.app/Contents/Resources/Java/hardware/arduino/cores/arduino/pins_arduino.h:129: error: (near initialization for 'port_to_input_PGM[8]')
/Applications/Arduino v1/Arduino.app/Contents/Resources/Java/hardware/arduino/cores/arduino/pins_arduino.h:131: error: 'PINJ' undeclared here (not in a function)
/Applications/Arduino v1/Arduino.app/Contents/Resources/Java/hardware/arduino/cores/arduino/pins_arduino.h:131: error: initializer element is not constant
/Applications/Arduino v1/Arduino.app/Contents/Resources/Java/hardware/arduino/cores/arduino/pins_arduino.h:131: error: (near initialization for 'port_to_input_PGM[10]')
/Applications/Arduino v1/Arduino.app/Contents/Resources/Java/hardware/arduino/cores/arduino/pins_arduino.h:132: error: 'PINK' undeclared here (not in a function)
.....and more.....
216  Using Arduino / Microcontrollers / Re: New optiboot; beta testers welcome... on: March 21, 2012, 07:36:07 pm
Thanks, I will give that a try in the morning, makes sense.
217  Using Arduino / Microcontrollers / Re: Backing up ATMEGA8 Program/Data? on: March 21, 2012, 06:19:08 pm
Which mega8 is it ? Some has on board USB so it could be one of those smiley
218  Using Arduino / Microcontrollers / Re: New optiboot; beta testers welcome... on: March 21, 2012, 05:45:42 pm
This optiboot is great.  I have a sketch on the 328 that only fits everything using it.

Thanks to everyone involved.....


Just received a bag of mega8u SMD chips and programmed optibook with the fuses as per makefile and all is well.....

Connected a FTDI lead as I would on a 328p ie 0-gnd, 2-VCC, 3-TX, 4-RX, 5 - RESET via 100nF cap

Trying to upload the LED flash sketch with LED connected to pin 17 SCK but upload fails as Arduino NG or older w/ ATmega 8..........

also tried UNO as that is what worked on 328p


Any ideas, at least I know the FTDI lead and IC work.
219  Using Arduino / Microcontrollers / Re: mega8 fuses etc on: March 21, 2012, 05:39:56 pm
arr, they are all in the makefile smiley

high = CC
low = BF

no ext
220  Using Arduino / Microcontrollers / mega8 fuses etc on: March 21, 2012, 10:17:25 am
What fuse bits do you set for a mega8 SMD ?  I am using optiboot.  I have the boot loader programmed
221  Using Arduino / Microcontrollers / Re: New optiboot; beta testers welcome... on: March 15, 2012, 11:31:11 am
Whoops.......

and then set board type to UNO smiley

It is working after all.
222  Using Arduino / Microcontrollers / Re: New optiboot; beta testers welcome... on: March 15, 2012, 11:14:03 am
I wanted to try this on some 328p ICs but the sketch doesn't run and I've tried programming the hex file onto the IC with my AVR ISP Mk2 but the IDE refuses to upload the sketch.

Questions

I tried programming the file "optiboot_atmega328.hex" from hardware/arduino/bootloaders/optiboot - Is this the right file?

What sketch space SHOULD be available if optiboot is working?

I'm assuming that maybe it isn't working because the fuses are wrong. - What do I set the fuses to under AVR Studio 5 and the AVR ISP Mk2, I've tried just changing the BOOTSZ to 512W_3E00 but it didn't have an affect and I don't know much about the fuses.

Thanks....

Searches find different answers, tried Ex = FF,  hi = DE & lo = D6 but still comes up with 30720 free and doesn't program
223  Using Arduino / Programming Questions / Re: Using local library on: March 15, 2012, 06:17:54 am
I've got some proper class based libraries up and working and I am #include ing some files which contain a stream of definitions eg text output so it's all in one place

The main program is 27K long and contains the main menu plus 6 large sections which each contain 2 functions.....

I would like to move each section into a single .h file and include it in the main program just to make navigation easier


BUT


I get errors with every call from said function to another function in the main .ino sketch.............

I have tried including the .ino sketch in the .h file but to no avail.


How can I go about this?


Thanks.
224  Using Arduino / Microcontrollers / Reprogramming 328PU using Mega8 & SD card on: March 11, 2012, 09:53:17 am
I've built a FTDI board to get from USB to the arduino and it works perfectly but I am looking at doing the same with a Mega8 instead.  If I do build the interface with a Mega8 instead is it possible to make the Mega8 reprogram the sketch on the 328?  I am thinking of sticking an SD card on the board with the Mega8 and IF an SD card is installed into the SD card slot with a program called say FIRMWARE.xxx it will pull the reset line low, release it and send the code from the file to the 328 to reprogram it.....

Sounds feasible to me when I came up with it.

Any ideas people?  Any issues?  I have my reasons smiley
225  Using Arduino / Microcontrollers / Re: Values of crystal capacitors on: March 11, 2012, 03:44:27 am
Bob, if the Mega32u4 is pin compatible how much is a bare board with UK postage.  I have a complete PCB manufacturing setup with bubble etching and everything but it's so much easier with a commercial board and I only want maybe 3 of them.

I've never heard of Digikey but will have a look.
Pages: 1 ... 13 14 [15] 16 17 ... 27