1284P - Compiling error

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 :

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

void loop ()

{
}

'INPUT_PULLUP' was not declared in this scope

Am I missing something here ??

Macro INPUT_PULLUP is defined in original Arduino.h. Maybe you did some mistake with files installation. Check the files, paths...

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.

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

Not sure what that means ...

#define INPUT_PULLUP 2

Can also do it discreetly:

  pinMode (8, INPUT);
digitalWrite (8, HIGH); // enable internal pullup

Thanks for your help.

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

Serial1.begin(9600,SERIAL_8E1);

giving error :

'SERIAL_8E1' was not declared in this scope

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.

Here 's the output:

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

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?

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?

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. :smiley:

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:

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

if you're using the 1284P on a breadboard, I'll strongly recommend using the standard pinout (where PB0 = D0).

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.

What kind of core are you using the the 1284P? If you're ready to jump up to the IDE v1.6 you may want to try MightyCore. I haven't tested it with the NRF24L01 libraries, but the other you mentioned works fine. You also got som additional options, like clock frequency, Brown out detection and a variant option (if you have a 1284 instead of the 'P' version). My perception is that it require very little work making libraries compatible with the 1284P (and the rest of the family).

Thanks hansibull, but I am still using 1.0.6 for now ..

somedude:
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.

I don't see any pins_arduino.h in the optiboot repository. boards.txt and boards-1.6.txt have optiboot1284.build.variant=arduino:standard
which doesn't make sense to me because that's the variant used for Uno, etc.

Watcher:
Thanks hansibull, but I am still using 1.0.6 for now ..

Try GitHub - JChristensen/mighty-1284p: Mighty 1284P Platform for Arduino

Try GitHub - JChristensen/mighty-1284p: Mighty 1284P Platform for Arduino

Wow... Thanks pert! That eventually worked. Everything now compiles!

Thanks very much!

Which board option do you use for 16MHz. The "maniacbug" 1284p using optiboot 16 MHz ?

I also need to decide on the pinout (pin mapping) before I get the PCB done... I ll be using the SMD version of the chip.

Watcher:
Which board option do you use for 16MHz. The "maniacbug" 1284p using optiboot 16 MHz ?

I also need to decide on the pinout (pin mapping) before I get the PCB done... I ll be using the SMD version of the chip.

You can use avr-developers.com pinouts 16MHz using Optiboot, Bobuino and Skinny Bob, Mighty Mini 1284p @ 16MHz, Optiboot @ 1Mbps or "maniacbug" Mighty 1284p 16MHz using Optiboot. They are all 16MHz except for Mighty Mini 1284p @ 8MHz. I'm not sure what the best pinout is, there are so many of them. I recently put together a list(let me know if anyone wants it) of 12 different Arduino pinouts used with ATmega1284P. It's a shame that Arduino never made an official ATmega1284P based board just so that we would have a standardized pinout.