ChipKIT Max32
From ChipKit Wiki
Contents |
[edit] Max32 Documentation
Hardware Reference Manual: http://www.digilentinc.com/Data/Products/CHIPKIT-MAX32/chipKIT%20Max32_rm.pdf
Board Schematic: http://www.digilentinc.com/Data/Products/CHIPKIT-MAX32/chipKIT%20Max32_bysa_sch.pdf
Jumper Settings: http://www.digilentinc.com/Data/Products/CHIPKIT-MAX32/chipKIT-Max32-Jumpers.pdf
Open Source Eagle Project: http://www.digilentinc.com/Data/Products/CHIPKIT-MAX32/chipKIT_Max32_bysa.zip
Digilent Product Page: http://www.digilentinc.com/Products/Detail.cfm?NavPath=2,892,894&Prod=CHIPKIT-MAX32
[edit] Max32 Boot Loader
This link is to the image of the boot loader installed on the board at the factory. This can be used to restore the board to the factory configuration if the boot loader has become erased. This may not be the same as the boot loader stored in the repository on github, as Digilent doesn't necessarily track every change made to the boot loader on github. The version loaded at the factory will be updated when significant changes have occurred that fix bugs or add new capabilities.
http://www.digilentinc.com/Data/Products/CHIPKIT-MAX32/arduino-booloader.X.Max32.hex
[edit] Info about PIC32MX795F512L
| Parameter Name | Value |
|---|---|
| Family | PIC32MX7xx |
| Max Speed MHz | 80 |
| Program Memory Size (KB) | 512 |
| RAM (KB) | 128 |
| DMA Channels | 8 |
| SPITM | 4 |
| I2CTM Compatible | 5 |
| A/D channels | 16 |
| Max A/D Sample Rate | 1000 |
| Input Capture | 5 |
| Output Compare/Std. PWM | 5 |
| 16-bit Digital Timers | 5 |
| Parallel Port | PMP16 |
| Comparators | 2 |
| Internal Oscillator | 8 MHz, 32 kHz |
| RTCC | Yes |
| I/O Pins | 85 |
| Pin Count | 100 |
[edit] chipKIT MAX32 vs Arduino Mega
| Feature | chipKIT MAX32 | Arduino Mega |
| Speed | 80 MHz | 16 MHz |
| Flash memory | 512 Kb | 256 Kb |
| SRAM memory | 128 Kb | 8 Kb |
| Digital I/O | 83 / 5 PWM | 54 / 14 PWM |
| Analog I/O | 16 | 16 |
| Com I/O | 8 | 10 |
| RTCC | Yes | No |
| Ethernet | Yes (with addon PHY) | No |
| USB | USB 2.0 FS, Device/Host, OTG | No |
| CAN controllers | 2 | 0 |
| Timers | 16/32-bit | 8/16-bit |
| Comparators | 2 | 1 |
| I2C | 5 | 1 |
| SPI | 2 | 1 |
| UART | 6 with IrDA | 4 |
On Arduino, setting a pin to INPUT then setting its value HIGH enables an internal pull-up resistor, ie:
pinMode (myPin,INPUT);
digitalWrite (myPin,HIGH);
On the Max32, not all pins have pull-up resistors available. The pinMode/digitalWrite combination doesn't affect pull-ups in Max32. You need to use the PIC32 RxPU registers to control internal pull-ups. If you need pull-up resistors on input pins you'll need to add them externally.
[edit] Interrupt vector dump
A dump of the interrupt vectors from the Max32.
[edit] Using simulated EEPROM
The PIC32 parts don't have any internal EEPROM memory. In both the Uno32 and the Max32, the last 4K of the program flash is reserved for use to simulate EEPROM. However, due to wearout limits of the flash (it's only rated for 1000 erase cycles) the flash can't be direct mapped to EEPROM. The library treats the 4K as content addressable memory and stores both the EEPROM address and the value in a 32 bit word. The result is 1Kbyte of simulated EEPROM and a page erase doesn't have to occur until 1K writes have occurred.
You can read from the EEPROM any number of times. The number of times you can write depends on the usage pattern of the writes, but the limit is ~1,000,000 byte writes. If you only use one EEPROM location, you can write that one byte about a million times. If you use 1K EEPROM locations and rewrite all of them each time, then you're limited to being able to rewrite them all ~1000 times.
Also keep in mind that this is a minimum, not a maximum. According to the data sheet Microchip guarantees that you can erase and rewrite a page a minimum of 1000 times. The actual number will vary from chip to chip and will almost certainly be larger (possibly much larger) than 1000.
One area of Mega compatibility that currently isn't being preserved by the Max32 is the amount of simulated EEPROM. Right now, only 1K of simulated EEPROM is supported. The ATmega2560 on the Mega has 4K of EEPROM. The amount of simulated eeprom supported by the system can be modified by small changes to the EEPROM library, boot loader, and linker script. A knowledgeable user could adjust the amount of simulated EEPROM up to any amount desired (although going in blocks of the PIC32 flash page size would be a good idea).
[edit] Using SPI
The SPI interface on AVR microcontrollers uses four signals labeled SS (slave select), MISO (master in/slave out), MOSI (master out/slave in) and SCK (serial clock). On AVR microcontrollers, MISO and MOSI switch direction depending on whether the SPI controller is enabled in master mode or slave mode.
The SPI signals on a PIC32 microcontroller are labeled SS, SDO (serial data out) SDI (serial data in) and SCK. The SDO and SDI pins don't change direction depending on how the SPI controller is enabled.
Jumpers JP3/JP4 are on the board to allow switching the direction of these two pins at the connector. Both jumpers should be switched together. The jumpers should be in the MASTER position for SPI master operation and in the SLAVE position for SPI slave operation. They are normally in the MASTER position.
The SPI signals are on connector J8 and are digital pins 50 (MISO), 51 (MOSI), 52 (SCK) and 53 (SS). The PIC32MX795 microcontroller shares the SDO pin with one of the signals used for the ethernet RMII interface (ECRSDV). The SDO signal also appears on digital pin 43 (pin 11 on connector J8).