Go Down

Topic: 1284P - Compiling error (Read 3400 times) previous topic - next topic

Watcher

Hi all,

After installing the necessary files to the IDE to support the atmega1284p, i tried to recompile some of my sketches choosing any of the atmega1284p boards from the board menu.

Surprisingly the following doesn't compile :


Code: [Select]

void setup(){
 
  pinMode (8, INPUT_PULLUP);
 
}

void loop ()

{
}



Quote
'INPUT_PULLUP' was not declared in this scope
Am I missing something  here ??







Budvar10

#1
Feb 02, 2016, 12:24 pm Last Edit: Feb 02, 2016, 12:24 pm by Budvar10
Macro INPUT_PULLUP is defined in original Arduino.h. Maybe you did some mistake with files installation. Check the files, paths...
Arduino clone with ATmega1284P   http://forum.arduino.cc/index.php?topic=277260.0

DBMcDonald

You may have an old version of the 1284P board files.  I'm using a version dated May, 2015 that has INPUT_PULLUP defined.

You could try defining INPUT_PULLUP with a value of 2 in your code.  It should then compile.

Watcher

Quote
You could try defining INPUT_PULLUP with a value of 2 in your code.  It should then compile.
Not sure what that means ...

DBMcDonald


CrossRoads

Can also do it discreetly:
Code: [Select]

  pinMode (8, INPUT);
digitalWrite (8, HIGH); // enable internal pullup
Designing & building electrical circuits for over 25 years.  Screw Shield for Mega/Due/Uno,  Bobuino with ATMega1284P, & other '328P & '1284P creations & offerings at  my website.

Watcher

Thanks for your help.

However, I must be doing something wrong since this doesn't compile either :

Code: [Select]
Serial1.begin(9600,SERIAL_8E1);

giving error :

'SERIAL_8E1' was not declared in this scope

Budvar10

#7
Feb 03, 2016, 01:53 pm Last Edit: Feb 03, 2016, 01:57 pm by Budvar10
Also, defined in HardwareSerial.h which in included via Arduino.h. You have to check core files, paths to the files, etc.

Provide detailed output.
Arduino clone with ATmega1284P   http://forum.arduino.cc/index.php?topic=277260.0

Watcher

Here 's the output:

Code: [Select]
Controller_Firmware_with_Curtain_control_V3.ino: At global scope:
Controller_Firmware_with_Curtain_control_V3.ino:137: warning: only initialized variables can be placed into program memory area
Controller_Firmware_with_Curtain_control_V3.ino: In function 'void setup()':
Controller_Firmware_with_Curtain_control_V3:178: error: 'INPUT_PULLUP' was not declared in this scope
Controller_Firmware_with_Curtain_control_V3:183: error: 'SERIAL_8E1' was not declared in this scope
Controller_Firmware_with_Curtain_control_V3.ino:227: warning: only initialized variables can be placed into program memory area
Controller_Firmware_with_Curtain_control_V3.ino:228: warning: only initialized variables can be placed into program memory area
Controller_Firmware_with_Curtain_control_V3.ino:229: warning: only initialized variables can be placed into program memory area
Controller_Firmware_with_Curtain_control_V3.ino:230: warning: only initialized variables can be placed into program memory area
Controller_Firmware_with_Curtain_control_V3.ino:231: warning: only initialized variables can be placed into program memory area
Controller_Firmware_with_Curtain_control_V3.ino:232: warning: only initialized variables can be placed into program memory area
Controller_Firmware_with_Curtain_control_V3.ino:233: warning: only initialized variables can be placed into program memory area

DrAzzy

It looks to me like your '1284p core is improperly installed or severely mangled. It's not picking up any of the defines; I would not be surprised if other stuff was also found to be missing if you got further in. I do not think that finding workarounds for individual issues is a worthwhile use of time.

Figure out what is wrong with installation of the core and fix it. Is it a version of the core incompatible with the version of the IDE you're using? Did you leave an extra layer of folders, or leave the -master on the end of the folder after downloading from github?
ATTinyCore for x4/x5/x61/x7/x8/x41/1634/828/x313 megaTinyCore for the megaavr ATtinies - Board Manager:
http://drazzy.com/package_drazzy.com_index.json
ATtiny breakouts, mosfets, awesome prototyping board in my store http://tindie.com/stores/DrAzzy

westfw

INPUT_PULLUP and the serial options are both relatively new features.  It sounds more and more like you do not have the most recent version of the 1284 support files - which one are you using, and where did it come from?

somedude

#11
Feb 03, 2016, 07:30 pm Last Edit: Feb 03, 2016, 07:54 pm by somedude
Watcher,


I use the 1284p in Arduino IDE 1.6.6 and all I had to do is create a variant in boards.txt and point it to the folder where I downloaded the pins_arduino.h for Bobuino (I chose it for better compatibility).

You might have downloaded the old core posted on GitHub my maniacbug, which doesn't actually have SERIAL_8E1 referenced in HardwareSerial.h indeed.

The new IDE supports it just fine once you get the pins_arduino.h.

WestFw published a new version of Optiboot that fully supports 1284p (tested by yours truly), which also provides pins_arduino.h with the pinout used by Bobuino. It seems that most have adopted the Bobuino pinout for their 1284p's, so I will stop saying 'Bobuino' now. :D

hansibull

If you're using the 1284P on a breadboard, I'll strongly recommend using the standard pinout (where PB0 = D0). The Bobuino pinout is great if you're planning to use shields, but the configuration is pretty messy (and it have to be). If you're using a non labeled chip on a breadboard, this is the cleanest configuration:
MightyCore -  ATmega1284, mega644, mega324, mega164, mega32, mega16, mega8535
Github.com/MCUdude/MightyCore

MiniCore - ATmega8, mega48, mega88, mega168, mega328
Github.com/MCUdude/MiniCore

somedude

One other advantage of the Bobuino pinout is better compatibility with libraries.

Watcher

#14
Feb 04, 2016, 06:56 am Last Edit: Feb 04, 2016, 07:01 am by Watcher
Quote
if you're using the 1284P on a breadboard, I'll strongly recommend using the standard pinout (where PB0 = D0).
Code: [Select]
One other advantage of the Bobuino pinout is better compatibility with libraries.

Thanks for the recommendations.

I am actually designing a stand alone PCB using the SMD version of the chip in replacement of the ATMEGA32U4 chip. I have installed the required support files (am using IDE 1.0.6) to try to re-compile existing code. I haven't yet ordered the PCBs so any recommendation on the best pin mapping approach is also greatly appreciated. As for libraries, I am using :

EEPROM.h , pgmspace.h , Wire.h, OneWire.h,DallasTemperature.h,SPI.h,nRF24L01.h,RF24.h
 
 
Still haven't figured out why it doesn't compile though. Is it a matter of the IDE version am using?
If I choose the Leonardo or micro board everything compiles just fine.




Go Up