Artou has an ATmega32 processor board with ISP and JTAG programming ports. The AT32 has a PORTA that uno does not. On PORTA are 4 user programmable LEDs connected to pins 4, 5, 6 and 7.
ATmega32 is not on ArduinoCorp products and requires an added MightyCore board support package to compile code for the processor. We will upload from the Arduino IDE using a USBtiny external ISP programmer.
External ProgrammerI expected the USB port to support programming. It powers the board and can be made into a serial port with a sketch but we need an external programming device. I am using a USBtiny programmer.
You have to connect the programmer and the board with a cable. The connector ends are polarized and keyed. Do not force and remove power if there is an unpleasant odour.
The Artou ATmega32 board also has a JTAG programming port that uses the same keyed 10pin box connector. JTAG is an incompatible programming format, requires a different programming device.
Do not plug an AVR ISP/ICSP programming device into the JTAG port, do not plug a JTAG programmer into the ISP port. Remove immediately.
The AVR programmer does supply enough current to power the board.
Arduino IDEOpen a new Arduino sketch and save.
// binary count on ports A to D
// Artou ATmega32 board has LEDs on PORTA-5 to 7
void setup()
{ DDRA=0xFF;DDRB=0xFF;DDRC=0xFF;DDRD=0xFF;} // all 8 pins output
void loop()
{ PORTA++;PORTB++;PORTC++;PORTD++; delay(50); }
PreferencesMenu File->Preferences. Select a comfortable font size and tick box for Show verbose output during: upload.
Go to Additional Boards Manager URLs: add
https://mcudude.github.io/MightyCore/package_MCUdude_MightyCore_index.json
Click OK to save changes.
Tools->Boards ManagerMenu Tools -> Boards Manager. It may take a moment to update from the interweb.
Search and install MightyCore. The package adds only a few additional files. Stuff like files that map out features of the AT32 such as PORTA.
Check added development boards.
Select MightyCore->ATmega32. Check bottom of screen and added Tools menu items. Default settings are good. Menu Tools->Programmer select USBtinyISP.
Menu Sketch->Upload Using Programmer or Ctrl+Shift+U on keyboard. Orange text is from verbose upload.
Watch an upload sequence
While the asterisk progress bars crossed the computer screen the USBtiny programmer goes through a programming cycle. A blue LED comes on and SPI leads to the ATmega32 PORTB are used in ISP/ICSP programming..
Export BinaryArduino IDE can export a compiled binary that you can upload using avrdude software. Menu Sketch->Export compiled Binary and look in the sketch folder. Either of these hex files will work.
Go menu Tools->Board->Boards Manager and select MightyCore->ATmega32. At the bottom of the screen you will see the selected board. Menu Tools shows setup parameters.
Arduino Uno boards contain ATmega328p MCUs. This screencapture shows our code generates compilation errors when compiling for the Uno because ATmega328p are not built with a PORTA circuit.
Some further projects to explore:
Comments