Micromouse book
Categories
Recent Comments
Meta
Popular Posts
- Simple ADC use on the STM32 (4,106)
- STM32 Arm-Cortex bootloader (2,803)
- STM32 USART basics (2,703)
- All Japan Micromouse 2011 – finals (2,011)
- STM32F4 – the first taste of speed (1,690)
- Micromouse Book (1,587)
- Nokia 3410 LCD on the STM32 (1,337)
- CodeSourcery GNU Toolchain for the ARM on a Mac (1,145)
- Bit Banding in the STM32 (1,045)
- ARM STM32 JTAG (973)
Blogroll
-
Upcoming Events
Tag Archives: MPLAB
Microchip MPLAB moving to NetBeans
It seems that the next big thing for MPLAB, Microchip’s IDE, is going to be a move to NetBeans. MPLAB is, mostly, a pretty good place to develop embedded software for the Microchip PIC processors. All the variants from the venerable 16F84 up to the latest 32-bitdevices are catered for. Editing, programming and debugging can all be done from one handy-dandy application. Of course, it has its limitations…
Chief among these, for me, is that it will only run on Windows and I mostly use a mac at home. In fact, almost the only thing I need a windows PC for at home is working on my micromoice that use the dsPIC processor. Although I shall soon switch all new development to the STM32, there will remain a need to code for the dsPIC on the older mice.
Microchip have recognised that there is more to the world than Windows and so they are going to be releasing the next MPLAB generation using the NetBeans IDE. NetBeans is a Java based IDE capable of many tasks. Think of it as like clipse but much, much nicer – and smaller.
Don’t let the Java thing put you off either. Gone are the days when Java applications were automatically big and slow with wierd user interfaces. NetBeans will run on windows, OSX and Linux and runs pretty well identically on all platforms. I already use it as the platform of choice when I have code to edit. In fact, at home, I have the mouse code set up to be edited on the desktop Mac using NetBeans and only switch over to the windows laptop to compile and download to the target.
For my part, I can’t wait for the NetBeans version of MPLAB to become available.
Read more here:
http://netbeans.dzone.com/nb-microchip
A little bit of test code
Once the main board is assembled, it can be tested without waiting for the sensor or motor driver boards to be ready. In time honoured fashion, we start with a little program to flash the LEDs.With any new microcontroller project, it is a good idea to start with some simple code that will allow you to test your ability to create a project in the chosen development environment, compile the program, transfer it to the microcontroller and run it. While you are at it, you get to test the simplest part of the system hardware.Development for Primus used the MPLAB IDE from Microchip and the free Microchip C30 port of the GCC C compiler. Between them, these are powerful tools if a little fussy in places. To get started, you will need to install both these packages to their default locations on your PC.The complete project for MPLAB/C30 is contained an a ZIP file that you can download here: primus1.zipCreate a folder in a convenient place on your hard drive and use MPLAB to open the primus.mcp file which defines the project. this project, like all those that follow, contains a number of folders, each with a specific purpose.
| src | holds all the C source code files. These all have the extension .c | |
| include | holds all the C header files. These all have the extension .h | |
| tmp | used by the compiler during compilation and linking. Let the compiler handle these. You don’t normally have to worry about them. | |
| output | where the compiler creates the actual rom image that gets sent to the processor. Again, you don’t need to worry about them unless you are using an external programmer and need to find the hex file to download | |
| config | not normally used here but can hold configuration options for building the code using a command line compiler. |
The file include/primus.h is where all the hardware is defined for the mouse as well as som common definitions for things like directions and such. this file is included by most other source files in the project. Ensure that you have configured MPLAB to allow you to set the configuration bits in the code, then the macros in primus.c will set things up for you. Primus uses an 8MHz crystal with a x8 PLL multiplier. This gives an effective processor clock of 64MHz which in turn runs the processor at 16MIPs.This short piece of code not only test that the LEDs and speaker are wired correctly but, if you can measure the frequency of the signal driving LEDA, it will be 500hz if you have the oscillator correctly set up. This will be essential when we come to drive the sensors and motors so get it right now, before doing anything else. Continue reading
Add to Google