Post by senatorpenguin on Oct 24, 2010 17:07:03 GMT -5
[EDIT: I've gotten motors, the screen, and some other stuff working using GCC, look at ti-evalbot.proboards.com/index.cgi?board=programming&action=display&thread=26 for a better guide]
I'm by no means an expert in anything ARM or Stellaris related, but I've gotten past the first few hurdles beyond simply running the preloaded uC/OS programs.
The IDE I've had the most success with is IAR Embedded Workbench for ARM (Kickstart edition, has a 32kb code limitation). supp.iar.com/Download/SW/?item=EWARM-KS32
The next things you'll need are drivers for the ICDI interface to program the board, which are found in the IAR installation folder at C:\Program Files\IAR Systems\Embedded Workbench 5.4 Kickstart\arm\drivers\LuminaryFTDI
There are two sets of example code that are useful in starting to program the evalbot. The first and easiest is the uC/OS III code examples that came with the book that costs more than triple the discounted bot. Fortunately, you can download them from Micrium with a bugmenot.com login: micrium.com/page/downloads/os-iii_files
To save you a bit of searching, once you've extracted their examples, the IAR workspace file is in Micrium\Software\EvalBoards\TI\LM3S9B92-EVALBOT\IAR
One folder level up from that is a collection of datasheets for parts on board the Evalbot.
Without any configuration, the 4 example programs can be compiled and downloaded to the board from IAR.
The code is quite confusing, mainly because uC/OS is an entire operating system, and each example is a full application written for uCOS. You can however, learn a bit about how to interface with some of the peripherals by reading through some of the more helpful functions. "app.c" contains the main method, along with most of the initialization procedures. The files in the BSP folder have most of the peripheral code.
The second set of invaluable examples are shipped with the IAR Workbench, helpfully located in C:\Program Files\IAR Systems\Embedded Workbench 5.4 Kickstart\arm\examples\TexasInstruments\Stellaris\boards\ek-lm3s9b92
These are examples for a very similar development board, however most of the IO pins are wired differently. To adapt these examples, you have to cross reference the code with the schematic here: focus.ti.com/lit/ml/spmr001/spmr001.pdf
For example, in the "blinky" example, which just blinks an LED on and off repeatedly, the main method contains:
However, checking the schematic PDF shows that PD0 is connected to a motor driver, not an LED. A little searching shows that LED1 is connected to PF4. by replacing all references to GPIO port D with port F, and writing to the registers in bit 4 rather than bit 0, this is rewritten as
You have to do this a couple more times in the rest of the code, but that is the general procedure.
Most of the examples use the UART0 (which is connected to the ICDI interface) to communicate with the computer. These are on pins A0/1 on the Evalbot and in the examples, so the code needs no alterations. Just use PuTTY to open up the ICDI COM port at 115200 baud, and watch the Hello World!s fly by.
As for the other peripherals, here are a few notes and observations of mine that might help:
1. If you are trying to get either the USB host or device to work, make sure you enable the 5V power supply (PA6 is high) EVEN IF YOU ARE USING THE EVALBOT AS A USB DEVICE. There is a glitch in the B1 revision of the LM3S9B92, which needs to read 5V on the USB0VBUS pin regardless of whether it makes sense to do so. Also, make sure you set PB0 (the switch on the USB multiplexer) high for device mode, low for host mode.
2. I don't know if you can implement the ethernet libraries without going over the 32kB limit. Maybe.
3. TI made a mistake, the screen controller isn't a SSD1300 (No I2C interface, and its way obsolete). It might be a SSD0300, and the following datasheet seems to more accurately describe the OLED controller. bsp_display.c from the micrium examples helps the most in implementing this.
www.eecs.umich.edu/~prabal/teaching/eecs373-f10/readings/SSD0300-Revision%201.4.pdf
4. If you are trying to run the example where the evalbot appears as a usb-serial device, you will need the "Stellaris Embedded USB Drivers" from www.luminarymicro.com/products/software_updates.html
I'm by no means an expert in anything ARM or Stellaris related, but I've gotten past the first few hurdles beyond simply running the preloaded uC/OS programs.
The IDE I've had the most success with is IAR Embedded Workbench for ARM (Kickstart edition, has a 32kb code limitation). supp.iar.com/Download/SW/?item=EWARM-KS32
The next things you'll need are drivers for the ICDI interface to program the board, which are found in the IAR installation folder at C:\Program Files\IAR Systems\Embedded Workbench 5.4 Kickstart\arm\drivers\LuminaryFTDI
There are two sets of example code that are useful in starting to program the evalbot. The first and easiest is the uC/OS III code examples that came with the book that costs more than triple the discounted bot. Fortunately, you can download them from Micrium with a bugmenot.com login: micrium.com/page/downloads/os-iii_files
To save you a bit of searching, once you've extracted their examples, the IAR workspace file is in Micrium\Software\EvalBoards\TI\LM3S9B92-EVALBOT\IAR
One folder level up from that is a collection of datasheets for parts on board the Evalbot.
Without any configuration, the 4 example programs can be compiled and downloaded to the board from IAR.
The code is quite confusing, mainly because uC/OS is an entire operating system, and each example is a full application written for uCOS. You can however, learn a bit about how to interface with some of the peripherals by reading through some of the more helpful functions. "app.c" contains the main method, along with most of the initialization procedures. The files in the BSP folder have most of the peripheral code.
The second set of invaluable examples are shipped with the IAR Workbench, helpfully located in C:\Program Files\IAR Systems\Embedded Workbench 5.4 Kickstart\arm\examples\TexasInstruments\Stellaris\boards\ek-lm3s9b92
These are examples for a very similar development board, however most of the IO pins are wired differently. To adapt these examples, you have to cross reference the code with the schematic here: focus.ti.com/lit/ml/spmr001/spmr001.pdf
For example, in the "blinky" example, which just blinks an LED on and off repeatedly, the main method contains:
//
// Enable the GPIO port that is used for the on-board LED.
//
SYSCTL_RCGC2_R = SYSCTL_RCGC2_GPIOD;
//
// Do a dummy read to insert a few cycles after enabling the peripheral.
//
ulLoop = SYSCTL_RCGC2_R;
//
// Enable the GPIO pin for the LED (PD0). Set the direction as output, and
// enable the GPIO pin for digital function.
//
GPIO_PORTD_DIR_R |= 1;
GPIO_PORTD_DEN_R |= 1;
However, checking the schematic PDF shows that PD0 is connected to a motor driver, not an LED. A little searching shows that LED1 is connected to PF4. by replacing all references to GPIO port D with port F, and writing to the registers in bit 4 rather than bit 0, this is rewritten as
//
// Enable the GPIO port that is used for the on-board LED.
//
SYSCTL_RCGC2_R = SYSCTL_RCGC2_GPIOF;
//
// Do a dummy read to insert a few cycles after enabling the peripheral.
//
ulLoop = SYSCTL_RCGC2_R;
//
// Enable the GPIO pin for the LED (PF4). Set the direction as output, and
// enable the GPIO pin for digital function.
//
GPIO_PORTF_DIR_R |= 1<<4;
GPIO_PORTF_DEN_R |= 1<<4;
You have to do this a couple more times in the rest of the code, but that is the general procedure.
Most of the examples use the UART0 (which is connected to the ICDI interface) to communicate with the computer. These are on pins A0/1 on the Evalbot and in the examples, so the code needs no alterations. Just use PuTTY to open up the ICDI COM port at 115200 baud, and watch the Hello World!s fly by.
As for the other peripherals, here are a few notes and observations of mine that might help:
1. If you are trying to get either the USB host or device to work, make sure you enable the 5V power supply (PA6 is high) EVEN IF YOU ARE USING THE EVALBOT AS A USB DEVICE. There is a glitch in the B1 revision of the LM3S9B92, which needs to read 5V on the USB0VBUS pin regardless of whether it makes sense to do so. Also, make sure you set PB0 (the switch on the USB multiplexer) high for device mode, low for host mode.
2. I don't know if you can implement the ethernet libraries without going over the 32kB limit. Maybe.
3. TI made a mistake, the screen controller isn't a SSD1300 (No I2C interface, and its way obsolete). It might be a SSD0300, and the following datasheet seems to more accurately describe the OLED controller. bsp_display.c from the micrium examples helps the most in implementing this.
www.eecs.umich.edu/~prabal/teaching/eecs373-f10/readings/SSD0300-Revision%201.4.pdf
4. If you are trying to run the example where the evalbot appears as a usb-serial device, you will need the "Stellaris Embedded USB Drivers" from www.luminarymicro.com/products/software_updates.html