Closed v-sadovsky closed 3 years ago
Hi!
If you want to use "Arduino functions" such as digitalWrite
, you can't use PD0, PE0, and so on. These only represent what bit on a port to manipulate.
This means that this is defined in the avr-libc source files:
#define PD0 0
//...
#define PD7 7
#define PE0 0
//...
#define PE7 7
What you should do instead is to use PIN macros. This will always work with pinMode/digitalRead/digitalWriteWrite
digitalWrite(PIN_PD0, HIGH);
digitalWrite(PIN_PE0, HIGH);
Thanks! With these macros all works fine!
Hi
Thanks for the provided minicore!
I have a custom board based on the atmega328PB chip. ArduinoIDE version is 1.8.15, Arduino AVR Boards version 1.8.3 is installed, MiniCore by MCUdude version 2.1.2 is installed, my OS is Windows 10.
The following steps were done:
Next, I tried to test my board with a simple "blinking" sketch:
After uploading the code I connect to the defined pin a LED probe and all works fine - the LED is blinking. But when I try to use, for instance, PCn or PEn pin for the same purpose it works strange - the defined pin does not work, but PDn is working instead.
I tried to use Microchip studio for programming this board and all works fine. Am I doing something wrong with the ArduinoIDE?
Regards