chipKIT® Development Platform

Inspired by Arduino™

Using an MAX32 as an AVR ISP (In-System Programmer)

Created Sat, 26 Jan 2013 21:52:06 +0000 by Emopandas


Emopandas

Sat, 26 Jan 2013 21:52:06 +0000

I recently got a hand full of ATTiny's and there is a some projects I would like to build but this requires burning the software onto the chip(s). When I try to load the AurduinoISP There is many errors, expected since the Max32 is in fact not an Arduino. Anybody else have this issue? Solutions?

The chips I am looking to use are the ATTiny4313 ATTiny84A ATTiny85

Here is the list of errors

In file included from /pins_arduino.h:28:0,
                 from ArduinoISP.cpp:27:
m:\mpide-0023-windows-20120903\hardware\pic32\compiler\pic32-tools\bin\../lib/gcc/pic32mx/4.5.1/../../../../pic32mx/include/avr/pgmspace.h:4:2: error: #error ******** This sketch or library uses AVR-specific code that may not work with the chipKIT platform. See this forum for more information on porting code to chipKIT [www.chipkit.org/forum/viewforum.php?f=7] ********
In file included from ArduinoISP.cpp:27:0:
/pins_arduino.h:58:14: error: 'uint8_t' does not name a type
/pins_arduino.h:59:14: error: 'uint8_t' does not name a type
/pins_arduino.h:60:14: error: 'uint8_t' does not name a type
/pins_arduino.h:61:14: error: 'uint8_t' does not name a type
/pins_arduino.h:66:14: error: 'uint16_t' does not name a type
/pins_arduino.h:67:14: error: 'uint16_t' does not name a type
/pins_arduino.h:68:14: error: 'uint16_t' does not name a type
/pins_arduino.h:70:14: error: 'uint8_t' does not name a type
/pins_arduino.h:72:14: error: 'uint8_t' does not name a type
/pins_arduino.h:73:14: error: 'uint8_t' does not name a type
ArduinoISP.cpp: In function 'void setup()':
ArduinoISP.cpp:79:3: error: 'Serial' was not declared in this scope
ArduinoISP.cpp: In function 'void loop()':
ArduinoISP.cpp:136:7: error: 'Serial' was not declared in this scope
ArduinoISP.cpp: In function 'uint8_t getch()':
ArduinoISP.cpp:142:10: error: 'Serial' was not declared in this scope
ArduinoISP.cpp:143:10: error: 'Serial' was not declared in this scope
ArduinoISP.cpp: In function 'void readbytes(int)':
ArduinoISP.cpp:147:15: error: 'Serial' was not declared in this scope
ArduinoISP.cpp: In function 'void spi_init()':
ArduinoISP.cpp:164:3: error: 'SPCR' was not declared in this scope
ArduinoISP.cpp:165:5: error: 'SPSR' was not declared in this scope
ArduinoISP.cpp:166:5: error: 'SPDR' was not declared in this scope
ArduinoISP.cpp: In function 'void spi_wait()':
ArduinoISP.cpp:172:12: error: 'SPSR' was not declared in this scope
ArduinoISP.cpp:172:25: error: 'SPIF' was not declared in this scope
ArduinoISP.cpp: In function 'uint8_t spi_send(uint8_t)':
ArduinoISP.cpp:177:3: error: 'SPDR' was not declared in this scope
ArduinoISP.cpp: In function 'void empty_reply()':
ArduinoISP.cpp:194:5: error: 'Serial' was not declared in this scope
ArduinoISP.cpp:198:5: error: 'Serial' was not declared in this scope
ArduinoISP.cpp: In function 'void breply(uint8_t)':
ArduinoISP.cpp:204:5: error: 'Serial' was not declared in this scope
ArduinoISP.cpp:209:5: error: 'Serial' was not declared in this scope
ArduinoISP.cpp: In function 'void start_pmode()':
ArduinoISP.cpp:263:11: error: 'SS' was not declared in this scope
ArduinoISP.cpp:265:11: error: 'SCK' was not declared in this scope
ArduinoISP.cpp:270:11: error: 'MISO' was not declared in this scope
ArduinoISP.cpp:271:11: error: 'MOSI' was not declared in this scope
ArduinoISP.cpp: In function 'void end_pmode()':
ArduinoISP.cpp:277:11: error: 'MISO' was not declared in this scope
ArduinoISP.cpp:278:11: error: 'MOSI' was not declared in this scope
ArduinoISP.cpp:279:11: error: 'SCK' was not declared in this scope
ArduinoISP.cpp:280:11: error: 'SS' was not declared in this scope
ArduinoISP.cpp: In function 'void program_page()':
ArduinoISP.cpp:348:7: error: 'Serial' was not declared in this scope
ArduinoISP.cpp:356:5: error: 'Serial' was not declared in this scope
ArduinoISP.cpp:362:5: error: 'Serial' was not declared in this scope
ArduinoISP.cpp: In function 'char flash_read_page(int)':
ArduinoISP.cpp:375:5: error: 'Serial' was not declared in this scope
ArduinoISP.cpp: In function 'char eeprom_read_page(int)':
ArduinoISP.cpp:387:5: error: 'Serial' was not declared in this scope
ArduinoISP.cpp: In function 'void read_page()':
ArduinoISP.cpp:397:5: error: 'Serial' was not declared in this scope
ArduinoISP.cpp:400:3: error: 'Serial' was not declared in this scope
ArduinoISP.cpp: In function 'void read_signature()':
ArduinoISP.cpp:409:5: error: 'Serial' was not declared in this scope
ArduinoISP.cpp:412:3: error: 'Serial' was not declared in this scope
ArduinoISP.cpp: In function 'int avrisp()':
ArduinoISP.cpp:436:7: error: 'Serial' was not declared in this scope
ArduinoISP.cpp:497:5: error: 'Serial' was not declared in this scope

Jacob Christ

Sat, 26 Jan 2013 22:00:42 +0000

Yes, among other things this code appears to be accessing Atmel SPI registers. This needs to be ported to use PIC32 SPI registers. Unfortunately due to legacy issues, Arduino libraries cannot be used within Arduino libraries so this type of code, rather than using the abstracted SPI lib talks directly to chip registers.

I done a similar port in the past. It can be a daunting task depending on your experience.

This is an issue that is being wrestled with in both the Arduino and chipKIT development communities.

Jacob


Jacob Christ

Sun, 13 Jul 2014 00:47:59 +0000

I'm trying to convert an Arduino project to chipKIT right now and another issue this your program has is that Serial.readBytes does not appear to be implemented on chipKIT.

Jacob