Posts by David
You are currently viewing a selection of posts from the Pololu Blog. You can also view all the posts.
To make this possible, we updated the Windows installers for the Pololu AVR C/C++ Library to support Atmel Studio 7.0. This means that when you install the library on Windows, it will automatically copy its files into the AVR GCC toolchain inside Atmel Studio 7.0 and install project templates for the supported devices. Adding support for Atmel Studio 7.0 required us to add some code to detect its location and fix two unexpected problems. You can see the changes that were made in the libpololu-avr commit history on GitHub.
|The second screen of the Pololu AVR C/C++ Library installer for Windows.|
Importing an Arduino sketch in Atmel Studio 7.0
Atmel Studio 7.0 is the latest version of Atmel Studio, an integrated development environment (IDE) for AVRs from Atmel. It has an interesting new feature that allows you to create a new project from an Arduino sketch. The idea is that you could import an Arduino sketch, compile it with Atmel Studio, and then load it onto an Arduino-compatible board using a debugger from Atmel. This would allow you to step through the program one line at a time as it runs on real hardware and see what the program does at each step. It would also allow you to use the advanced code editing features of Atmel Studio. When you import a sketch into Atmel Studio 7.0, the source code of your sketch, along with the Arduino core source code and the code for any libraries you are using, gets copied into the directory for the new project.
However, the new feature only supports a certain small set of boards from Arduino and Adafruit, which means that you would have to select a board similar to your Orangutan, 3pi robot, or A-Star and then adjust the project settings (such as the F_CPU clock speed macro) to make it work. Atmel Studio does not support Arduino bootloaders, so it will not be easy to program an A-Star without getting an external programmer. Our Pololu USB AVR Programmer does not support debugging, so if that is the only programmer you have, then there is relatively little value in using Atmel Studio to program your device instead of just using the Arduino IDE. The feature does not appear to be very polished and still has bugs, which I encountered when I tried to import a sketch that has multiple .h and .cpp files.
If you want to try out the new feature, just open Atmel Studio 7.0, select File > New > Project…, and then select “Create Project from Arduino sketch”, which is a template that can be found in the “C/C++” category.
We have released a new build of the software for our Wixel Programmable USB Wireless Module that works on ARM Linux systems like the Raspberry Pi. This means that you can now upload apps to a Wixel from a Raspberry Pi, without needing a typical desktop computer. You can find the software download in the Wixel User’s Guide.
We have seen people use Wixels to help monitor blood glucose levels, create wireless quiz buttons, or wirelessly control servos. For a complete list of all the Wixel apps we know about, see the Wixel Apps list on our forum. We hope that the expanded software support for the Wixel will help people create new applications in the future.
|Wixel programmable USB wireless module.|
Several people here made robots to compete in the recent LVBots line following competition. The goal of the competition is to make an autonomous robot that follows a line on the ground as fast as possible. I made a robot called LearnBot for the competition. LearnBot is able to learn the line course on the first lap and then use that information to its advantage on the second and third laps. Continued…
We have a new video showing several projects you can do with a stock Zumo 32U4 robot. The Zumo 32U4’s motors, encoders, line sensors, proximity sensors, accelerometer, gyroscope, LCD, LEDs, and buttons make it a versatile robot that can be used in a wide variety of projects. The ATmega32U4 microcontroller on the Zumo 32U4 robot can be programmed in C++ from the Arduino IDE.
All of the projects shown in the video use unmodified, stock Zumo 32U4 robots (except for the Zumo driving on the refrigerator, which had strong magnets taped to it). However, you can open up even more possibilities by adding your own electronics to the Zumo 32U4. The FuzzBot, Pixy Pet, and this smartphone-controlled tank are some example projects by our customers that involved adding hardware to our older Zumo Robot for Arduino.
The source code for many of the projects shown in the video is available as examples in Zumo32U4 library, and we are working on adding more of them. Check it out, and get some ideas for a cool Zumo 32U4 project!
We have updated our Programming Orangutans and the 3pi Robot from the Arduino Environment document to support version 1.6.0 of the Arduino IDE, which is the latest stable version. Thanks to improvements in the Arduino IDE, we were able to make the instructions for getting started much easier.
The Orangutan line of AVR-based robot controllers started ten years ago and has since expanded to include boards with a variety of AVR processors and on-board peripherals, from the minimal Baby Orangutan B-328 to the powerful Orangutan SVP-1284 and X2. Many of the Orangutans share handy features like a buzzer, LCD, and buttons, but the integrated dual motor drivers found on every Orangutan are what justify calling it a “robot controller”. Our 3pi robot is an extension of Orangutan concept to a complete robot, so we think of the 3pi as pretty much part of the Orangutan family.
(Don’t need integrated motor drivers? Check out our Arduino-compatible A-Star family of microcontroller boards.)
|Pololu 3pi robot.|
The Orangutan SV-328, Baby Orangutan B-328, and 3pi all use the same AVR ATmega328P processor as the Arduino Uno, so it is natural to want to program them from the Arduino environment. However, there are a couple of key differences to overcome. First, the boards have no pre-installed Arduino bootloader or built-in USB-to-serial adapter. This simplifies the design and frees up some resources for your application, but it means you have to program them with an external programmer like the Pololu USB AVR Programmer. Also, the clock on these boards runs at 20 MHz, while the official Arduinos are at 16 MHz, so time-sensitive code might not be compatible.
Adding support for the Orangutans and programmer to the Arduino IDE used to involve manually editing a few configuration files with a text editor. With this latest update, you can simply copy a folder into your Arduino sketchbook directory.
Another notable Arduino change is improved support for AVRs running at different speeds. Functions such as
pulseIn now adapt to the clock frequency specified by the
F_CPU macro and should work fine on an Orangutan running at 20 MHz.
To get started, see our guide.
RPicSim is an open source software library written in Ruby that provides an interface to the MPLAB X PIC simulator and allows you to write simulator-based automated tests of PIC firmware. While RPicSim has been available since early this year, we just released version 1.0.0 and are excited to share why we made it and to encourage people to start using it. Continued…
We just released the P-Star 25K50 Micro, a programmable breakout board for Microchip’s PIC18F25K50 microcontroller. Although we have been using PIC microcontrollers since our very first product, the P-Star 25K50 Micro (abbreviated P*) is our first product where the PIC microcontroller can be programmed by the user. The P-Star 25K50 Micro is the same size as our AVR-based A-Star 32U4 Micro, and we designed it with the hope that it would be small and cheap enough to go into (and stay in) almost any project.
The PIC18F25K50 has 32 KB of flash program memory, 2 KB of RAM, and built-in full-speed USB functionality. Applications can be developed using standard Microchip PIC compilers and development tools (such as MPLAB X and XC8).
The P-Star 25K50 Micro can be programmed via its proprietary USB bootloader using our open source software that is available for Windows, Linux, and Mac. The bootloader uses 8 KB of flash memory, leaving 24 KB for the user. Alternatively, an ICSP programmer can be used to erase the bootloader and access the full 32 KB of program memory. (Since the bootloader cannot be recovered, we recommend this option only for those who are comfortable programming exclusively with an external programmer.)
The P-Star 25K50 Micro features a precision 16 MHz crystal, a USB Micro-B connector, and three user-controllable LEDs. A voltage regulator and power selection circuit allow the board to be powered from either USB or an external 5.5 V to 15 V source, while a resettable PTC fuse on the USB VBUS supply and reverse protection on VIN help protect it from accidental damage.
|P-Star 25K50 Micro pinout diagram.|
Compared to the popular ATmega32U4 microcontroller, the PIC18F25K50 has nearly the same performance and memory capacity, but it also has some compelling features that are missing on the AVR. For example, the PIC18F25K50 uses the PIC18 architecture, which has two interrupt priority levels: interrupts can be assigned to either level, and a high-priority interrupt routine can run in the middle of a low-priority one. This powerful feature is what enables our Maestro servo controllers to generate precise servo signals while still using low-priority interrupts to assist with serial communication and other tasks. Unlike the ATmega32U4, the PIC18F25K50 can operate at full speed down to 2.7 V (though the brown-out reset on the P-Star is activated at 2.85 V by default).
The PIC18F25K50 also has a 5-bit digital-to-analog converter (DAC), which is a fun feature not available on many 8-bit microcontrollers.
|A 3 kHz triangle wave generated by the 5-bit digital-to-analog converter (DAC) on the P-Star 25K50 Micro.|
For more information, check out the P-Star 25K50 Micro page, and let us know what you think in the comments.
This week I released version 2.0.0 of minimu9-ahrs, an open-source demo program that runs on the Raspberry Pi, reads data from a MinIMU-9 via I²C, and uses the readings to calculate the orientation of the IMU. The new version adds support for the MinIMU-9 v3. The program now supports all past and present versions of the MinIMU-9.
The original version of minimu9-ahrs was released back in 2012, along with ahrs-visualizer, a program for displaying the orientation in 3D. For more background, you can see my blog post about minimu9-ahrs from 2012 or read the Raspberry Pi blog post about it from June 2014. The video below shows minimu9-ahrs and ahrs-visualizer working together:
Version 2.0.0 of minimu9-ahrs also includes some other changes:
In this new version, the raw accelerometer readings that you can get using the
--mode raw option have basically been multiplied by 16 from what they were before. We made this same change to our LSM303 Arduino library when we added support for the LSM303D. The reason for this change is that before the MinIMU-9 v3, all the MinIMU-9 accelerometers were 12-bit, with the lower 4 bits of the output registers being unused, so we always shifted the readings to the right by 4 bits to get rid of the unused bits. The LSM303D in the MinIMU-9 v3 has a 16-bit output, so shifting its readings to the right by 4 bits would be inappropriate. However, it is nice for the raw accelerometer readings to have the same scale regardless of which accelerometer you happen to be using, so we chose to stop shifting the output of any of the accelerometers. All the accelerometers are configured to have a full-scale range of ±8 g by minimu9-ahrs, so a reading of 4096 will always correspond to about 1 g. This change should not affect most users, but it is not backwards-compatible, so, following semantic versioning, I incremented the major version number from 1 to 2.
The Debian package that I made for minimu9-ahrs version 2.0.0 uses the armhf architecture instead of armel (which was used for previous versions), so you can easily install it on a Raspberry Pi running Raspbian. I also made a new version of ahrs-visualizer that has an armhf package. If you are not using a Debian-based distribution like Raspbian or you are not using the armhf architecture, you can still compile the programs from source.
With this new version of minimu9-ahrs and our recent big price reduction of Pololu IMUs (which made the MinIMU-9 less expensive than a Raspberry Pi), now is a great time to start experimenting with these state-of-the-art MEMS sensors.
Related past posts
- Big price reduction of Pololu MEMS sensor carriers and IMUs
- New product: AltIMU-10 v4 gyro, accelerometer, compass, and altimeter
|A chain of addressable RGB LEDs (#2535 and #2536) on a breadboard, controlled by an A-Star 32U4 Micro.|
At first glance, these new LEDs look like everyday through-hole RGB LEDs, but they are hiding something very special inside: a built-in WS2811 LED driver that lets you chain them together and individually control them all with a single digital output from a microcontroller. The communication protocol of these LEDs is very similar to that of our WS2812B-based LED strips and Adafruit’s NeoPixels (such as those on the Adafruit NeoPixel Shield, which we just started carrying last week), so there is a variety of sample code available for the Arduino, AVR, and mbed microcontroller platforms to help you make your project start blinking quickly.
|Two different sizes of addressable RGB LED. From left to right, their diameters are: 5 mm (#2535) and 8 mm (#2536).|