My sketch ran perfectly on Arduino. The sketch uses 2 non-bundled libraries, namely -
DigitalWriteFast
ByteBuffer
Now while porting code to ATtiny85 using Arduino-Tiny, I've run into these compilation errors.
I am us using Arduino-001, with avr-gcc v4.5.3
rdi8_at85.cpp: In function ‘void setup()’:
rdi8_at85.cpp:81:3: error: ‘DDRD’ was not declared in this scope
rdi8_at85.cpp:81:3: error: ‘DDRC’ was not declared in this scope
rdi8_at85.cpp:82:3: error: ‘DDRD’ was not declared in this scope
rdi8_at85.cpp:82:3: error: ‘DDRC’ was not declared in this scope
rdi8_at85.cpp: In function ‘void loop()’:
rdi8_at85.cpp:181:13: error: ‘TCCR1A’ was not declared in this scope
rdi8_at85.cpp:181:13: error: ‘TCCR2A’ was not declared in this scope
rdi8_at85.cpp:181:13: error: ‘COM2A1’ was not declared in this scope
rdi8_at85.cpp:181:13: error: ‘COM2B1’ was not declared in this scope
rdi8_at85.cpp:181:13: error: ‘PORTD’ was not declared in this scope
rdi8_at85.cpp:181:13: error: ‘PORTC’ was not declared in this scope
runaway_pancake:
ATtiny85 doesn't have all of the 328's ports, etc.
Its limited I/O is on PortB.
Is "Arduino-Tiny" supposed to figure that out for you?
That is indeed a distinct possibility and I was hoping that Arduino-Tiny figures that out. One explanation is that DigitalWriteFast library bye-passes Arduino-Tiny completely, i.e. doesn't use Arduino pin-mapping logic, so I think that mright explain the error messages.
But aren't those constant defined in avr-libc headers ?
runaway_pancake:
ATtiny85 doesn't have all of the 328's ports, etc.
Its limited I/O is on PortB.
Is "Arduino-Tiny" supposed to figure that out for you?
That is indeed a distinct possibility and I was hoping that Arduino-Tiny figures that out. One explanation is that DigitalWriteFast library bye-passes Arduino-Tiny completely, i.e. doesn't use Arduino pin-mapping logic, so I think that mright explain the error messages.
But aren't those constant defined in avr-libc headers ?
They're only defined if the processor has the corresponding port. If you're not using the port, just comment out the code that uses it. That's probably the most trivial thing you can do while still calling it "porting"
I'm assuming you're saying "constant" because they refer to a constant memory address, because I really hope you don't think DDRD is a constant.
runaway_pancake:
ATtiny85 doesn't have all of the 328's ports, etc.
Its limited I/O is on PortB.
Is "Arduino-Tiny" supposed to figure that out for you?
That is indeed a distinct possibility and I was hoping that Arduino-Tiny figures that out. One explanation is that DigitalWriteFast library bye-passes Arduino-Tiny completely, i.e. doesn't use Arduino pin-mapping logic, so I think that mright explain the error messages.
But aren't those constant defined in avr-libc headers ?
They're only defined if the processor has the corresponding port. If you're not using the port, just comment out the code that uses it. That's probably the most trivial thing you can do while still calling it "porting"
I'm assuming you're saying "constant" because they refer to a constant memory address, because I really hope you don't think DDRD is a constant.
Thanks. I did mean "constant" as in constant memory address, or more so from a C #define standpoint. It is a SFR or special-function memory location, right ?
I am also getting this problem when I am trying to migrate my code from an Arduino uno to an Arduino due.
I am writing this post not intentionally trying to hijack falcon74's post rather I am new to this forum and don't know how to make my own post.
These are my error messages
Arduino: 1.8.12 (Windows 10), Board: "Arduino Due (Programming Port)"
Blink:97:3: error: 'DDRD' was not declared in this scope
Blink:101:3: error: 'PORTD' was not declared in this scope
Blink:102:3: error: 'EICRA' was not declared in this scope
Blink:103:3: error: 'EIMSK' was not declared in this scope
Blink:107:3: error: 'TCCR1A' was not declared in this scope
Blink:108:3: error: 'TCCR1B' was not declared in this scope
Blink:109:3: error: 'TIMSK1' was not declared in this scope
Blink:114:3: error: 'TCCR2A' was not declared in this scope
Blink:115:3: error: 'TCCR2B' was not declared in this scope
Blink:124:3: error: 'TCNT1' was not declared in this scope
Blink:127:5: error: 'OCR1A' was not declared in this scope
Blink:129:3: error: 'EIFR' was not declared in this scope
Blink:130:3: error: 'EIMSK' was not declared in this scope
Blink:132:3: error: 'TCCR1B' was not declared in this scope
Blink:133:7: error: 'sei' was not declared in this scope
Blink:151:5: error: 'PORTD' was not declared in this scope
Blink:153:5: error: 'PORTD' was not declared in this scope
Blink:154:5: error: 'OCR1A' was not declared in this scope
Blink:200:5: error: 'EIMSK' was not declared in this scope
Blink:201:5: error: 'TCCR1B' was not declared in this scope
Blink:206:7: error: 'cli' was not declared in this scope
Blink:220:7: error: 'sei' was not declared in this scope
I realized that the Due and the Uno have different processors but idk how to translate these ports, interrupts, and timers onto the Due.
Can someone please help my poor soul
Thanks in advance!