Hardware Reference
In-Depth Information
Another thing in common with the Arduino Due is power issues. There are many pins on the ChipKit Max32 that
are 5v tolerant, but not all are. Here are some caveats when powering pins:
The PIC32 MCUs on these boards have an operational voltage of 3.3V. The ChipKit MAX32,
UNO32, and u32 boards are 5V tolerant, meaning you can input 5V to get a digital or analog
reading without burning out the chip. However, these chips only output a maximum of 3.3V.
Some 5V components may not recognize 3.3V.
The readings will be made by default in the range of 0-3.3V instead of 0-5V. So, you will have
to change the values in your own code or libraries in order to obtain the correct range. This
may include using a logic level converter for a 5V device. However, many components are
already 3.3V compatible, so, for example, you will not need a logic level converter for chipKIT
or Arduino Due boards. The Arduino revision 3 shield specification includes an IOREF pin. If
your code checks this pin value, you can enable the appropriate level converter for your board.
For I2C, there needs to be external pull-up resistors. The PIC32 does not have internal
pull-up resistors for every digital pin, so it is best to not use them. You can also design shields
or breadboard projects by including the needed pull-up resistors, typically 2-2.7kW. This helps
make a shield or project compatible with the Arduino Leonardo, which also does not have
pull-up resistors on the I2C pins.
the editor is a derivation of the arduino ide, and it acts and performs the same as the arduino 1.0 editor.
however, at the time of writing, it supports the arduino 0023 core.
Note
Digilent Incorporated has created additional libraries to take advantage of the unique hardware. In addition
to the standard Arduino SPI, there is Digilent Serial Peripheral Interface (DSPI) for hardware based SPI support.
Additionally, there is an official Software SPI (SoftSPI) is a software implementation of SPI that allows any pin to be
used for SPI communication. It is common when using shield to have a conflict with a pin that is already using SPI.
Being able to use software create a new SPI pin gets around that conflict.
Software Pulse Width Modulation Servo (SoftPWMServo) ensures that every pin can be used. The SoftPWMServo
library allows for any pin on a ChipKit board to support servos.
It also has improved timer support with the Core Timer Service, and a Task Management service. The Core Timer
Service will let you work on timing issues with micro second resolution. Whereas the Task Management Service will
let you work at millisecond resolution. We will use the Task Management Service to do object detection with in timed
intervals that will not interfere with your code in the main loop. Also, it will not require polling the sensors in your
loop code.
Example: Object Detection using the Task Manager service
In this example, you will use one chipKIT Uno32, two IR LEDs, and one IR sensor. The example uses the ChipKit
Task Manager to register two tasks that blink the IR LEDs at specified intervals. Figure 9-2 shows the project
breadboard layout. The sensors are connected to pins 5, and 6. The IR sensor is connected to pin 2 which is an
interrupt pin. This will allow the IR sensor to immediately trigger upon the detection of IR.
 
 
Search WWH ::




Custom Search