PSAS/ capstone2009/ blogs/ MikeEngstrom

Mike Engstrom Capstone 2009 Blog

Return to capstone2009 main page


ECE413 / Michael Engstrom / WPR Week of 2009/5/31

Last Week

Next Week

Issues


ECE413 / Michael Engstrom / WPR Week of 2009/5/24

Last Week

Next Week

Issues


ECE413 / Michael Engstrom / WPR Week of 2009/5/17

Last Week

Next Week

Issues


Notes for APS State Machine

Pseudocode for rough draft of APS state machine

enum aps_state //easier to use real names when referring to states

variable rocket_mode = sleep //could init into other state if desired

task apssm_task


Software Team Notes 2009/5/17


ECE413 / Michael Engstrom / WPR Week of 2009/5/10

Last Week

Next Week

Issues


ECE413 / Michael Engstrom / WPR Week of 2009/5/3

Last Week

Next Week

Issues


PSAS Meeting Notes 2009/5/5


Capstone Meeting Notes 2009/5/1


ECE413 / Michael Engstrom / WPR Week of 2009/4/26

Last Week

Next Week

Issues


Diagram Notes for Errorhandling 2009/4/28

error handling enums and arrays

methods


ECE413 / Michael Engstrom / WPR Week of 2009/4/19

Last Week

Next Week

Issues


Capstone Meeting 2009/4/17


ECE413 / Michael Engstrom / WPR Week of 2009/4/12

Last Week

Next Week

Issues


PSAS Meeting Notes 2009/4/7


Capstone Meeting 2009/4/3


ECE413 WPR Week of 2009/3/29

Last Week

Next Week

Issues


Notes 2009/4/2


Capstone Meeting 2009/3/27


Software Team Meeting 2009/3/26


ECE 412 / WPR - Week of 2009/3/22

Last Week

Next Week

Issues


Capstone Meeting Notes 2009/3/20


Pressure Sensor Test 2009/3/13


Capstone Meeting Notes 2009/3/13


WPR - Week of 2009/3/8 - Michael Engstrom

Last Week

Next Week

Issues


PSAS Meeting Notes 2009/3/10

We have a hard deadline Friday to perform our pressure sensor tests; Daniel H. needs the data for his report due Monday. Spent most of the meeting configuring our sensor setups. Jeremy and Dave worked hard at getting the ADC to send data over the UART. Many obstacles were overcome, not the least of which was a messed up GTK. K and I made progress with the SPI configuration. Mainly I realized that I am not very familiar with setting up devices to talk over data protocols.

The assistance from K was a huge help, We wrote up configuration files to get the SCP1000 configured at 'High Speed' mode, 17 bits of accuracy. The SPI protocol is a little convoluted, dummy writes are needed just to be able to grab data from the device. In fact, for every read there must be at least two writes (I think), as well as the DRDY pin being set and a status register check to clear a value.

I am starting to understand the process, and K assures me that it will be easier once I get some practice setting up devices. We stayed 'til after 11pm working on things, and we might be coming in Thursday to finish up. It must be ready by Friday. Dan F said he would email Andrew his SPI code, so that may make things easier.


Software Notes 2009/3/8

Working on getting SPI configured. Without an SPI device (Andrew has the SCP1000 to get it soldered to the test board for next Friday), so back to trying to get SPI0 talking with SPI1. Tried to get some organization as far as file setup goes.

Making copies of the freeRTOS files becomes complicated when trying to remember what was done, and when. Need to be proactive in getting hooked up to a repository, make life simple and be able to better coordinate with Jeremy.


Capstone Meeting Notes 2009/3/6


WPR - Week of 2009/2/23 - Michael Engstrom

Last Week

Next Week

Issues


Software Team Meeting Notes 2009/3/1

Today was a meeting day for Jeremy and I to get the sensors working on the Olimex boards. My board had an issue with programming, namely that it could not be programmed via the jtag connector. I had been trying some of the jcwren code, and while it compiled fine I am not sure if the board was having trouble running the .hex file.

As an check to see if other, older code still would work poke.hex was attempted to be flashed to the board. Nothing. I looked for the directions to flash the Olimex board using the serial cable. All I ended up doing was moving switch 1 to "on" and running the myocd and ocdflash commands like normal with the serial cable hooked up.

The output showed some complaining about not finding the jtag connector, but the program was flashed to the board fine over the serial port. Subsequent flash attempts using the jtag connector now worked fine, so this looks to be a troubleshooting method to be used in the future.

We discussed the direction we wanted to go as far as the jcwren code. As far as we can tell the jcwren code makes our boards unresponsive to the point that the serial port rescue method needed to be used to return to normal. It may be that we are not proficient enough to get the flash working correctly and K or someone could help us get things corrected, but for now we will only use the jcwren code as a reference and import the things we like about it into the existing PSAS freeRTOS code.

The changes I have made to main.c and other files could have broken the flow of the program. I probably just need to use git to pull the files down from the PSAS repository and have a fresh slate. This highlights our need for our own capstone repository. Second only to getting the sensors working, that needs to be a priority.

The ADC is working, but we need to have better control over what pins it uses, how many channels are implemented, bit rates, etc. Jeremy plans to write some code for the I2C and place some stubs for the SPI code I am working on. We may need some technical advice and help in getting things moving. Hopefully we can have something to test with by Tuesday's PSAS meeting.


Capstone Meeting Notes 2009/2/27


WPR - Week of 2009/2/23 - Michael Engstrom

Last Week

Next Week

Issues


Capstone Meeting Notes - 2009/2/20


PIC Overview Notes – 2009/2/20

SEE FULL PIC NOTES POSTED ON MAIN CAPSTONE PAGE


Eagle CAD Tutorial notes - 2009/2/17


WPR - Week of 2009/2/16

Last Week

Next Week

Issues


Notes 2009/2/16


Capstone Meeting Notes 2009/2/13


WPR - Week of 2009/2/9

Last Week

Next Week

ARs


Notes 2009/2/8


WPR - Week of 2009/2/1

Last Week

Next Week

ARs

Issues


Notes from PSAS Meeting 2009/2/3

Andrew cannot make the meeting, but Tim was there and Jeremy and Ken attended as well. K helped debug a problem Jeremy was having with editing main.c of freeRTOS. We swapped my board with his and things seem to work, so maybe his board has a hardware problem.

Regarding the main.c, Jeremy tried to edit the flash rate of the LED and it did not seem to change, so we investigated whether or not the file was compiling and we were grabbing the correct .hex file.

I continued to chip away at getting the register files set up to loop SPI0 and SPI1.


Notes 2009/2/2

Since the LPC2148 supports it, I had an idea of setting up the SPI0 and SPI1 as a Master/Slave connection and sending data back and forth. It is looking like SPI is a choice for at least one of our sensors. I researced the manual and found the information in Chapters 12 (SPI0) and 13 (SPI1) regarding register values

Using the example code K sent Jeremy and me:

/*
* enable_spi0
* Configure pins for SPI
* p0.4-01 9:8 of PINSEL0 SCK03
* p0.5-01 11:10 of PINSEL0 MISO0
* p0.6-01 13:12 of PINSEL0 MOSI0
* p0.7-01 15:14 of PINSEL0 SSEL0
* 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
*  0  1  0  1  0  1 0 1 1 1 1 1 1 1 1 1
*         5         5         f    f
*/
inline void enable_spi0(void) {
  PINSEL0 &= 0xFFFF55FF;      // SPI0 Configuration P0.[4,5,6,7]
}

and from the spi.c function:

void initSPI0() {

//  SPI Clock Counter Register
// How Many PCLKs per SPI SCLK?
// Must be > 8
S0SPCCR = 0xC;

// write the control register S0SPCR
// bits
// 01                          0
// 2                 BitEnable 1          // (11:8 controls # of bits)
// 3                 CPHA      0          // clock phase control
// 4                 CPOL      1          // active low (falling edge?)
// 5                 MSTR      1          // master mode
// 6                 LSBF      0          // MSB First
// 7                 SPIE      0          // no interrupts
// 11:8              BITS      0000       // 16 bits per transfer
// 15 14 13 12 | 11 10 9 8 | 7 6 5 4  3 2 | 1 0
// 0  0  0  0     0  0 0 0   0 0 1 1  0 1   0 0
// 0x0034
S0SPCR = 0x0034 & S0SPCR_MASK;
DBG("End of SPI0 initialization.\n\r");

I worked out the data values necessary for the registers to set up both SPI0 and SPI1. Tomorrow at the PSAS meeting I hope to have something ready to try out. Bye.


FW Meeting Notes 2009/1/30

My board was set up with freeRTOS and makes the "annoying beep" it is supposed to when pressing the button. Since I need to get communications on the SPI bus and the Olimex board has two SPIs my idea is to make one the master and the other the slave and let them talk to each other. Looking at the schematic, SPI1 shares IO with other devices but SPI0 has dedicated pins, so I will make SPI0 the master.

I need to look at the manual, see what bits need to be set for the SPI registers, and write a function that performs those tasks. Then when I have the master and slave configured I will send data from one to the other and run each one to a separate serial output to confirm the data transfer. The SPI function can be included in the main.c of freeRTOS to initialize when the OS starts up, and the OS can deal with the interrupts and priorities.

K explained how the git repository works, but he wants to wait until Tuesday to get the repo Jeremy and I will be using uploaded to the PSAS server. The changes I make will live on my laptop until then.


Capstone Meeting 2009/1/30

Attendees: All team members, sponsors, advisor


WPR - Week of 2009/1/26

Last Week

Next Week

ARs

Issues


Notes from PSAS Meeting 2009/1/27

The wall adapter I picked up at Goodwill works great. K and Dave helped download and set up freeRTOS on my dev board and explained a bit about the structure of the program. Things are at the point that I can modify programs to run on my dev board and I need to begin to interface with data devices. This will be a critical skill for when the different sensors are chosen and Jeremy and I must figure out how to talk to them. The idea is to use freeRTOS to provide a framework for our functions and speed up our development time.

I left relatively early to go and pick up an extra serial cable my Step-Father had. They are surprisingly hard to find, and since my laptop has serial out I can avoid headaches that come from using USB-Serial adapters by having a regular cable.


Notes 2009/1/24

I spent most of the late morning and early afternoon trying to configure my Airlink 150N cardbus to connect to my wireless router. I used some tutorials to find that the chipset was ra2860sta, so I went to their site hoping for a Linux driver.

The RALink site had drivers so I was in luck, and I downloaded the files and used the readme to configure and compile the driver and attach it to the kernel. This took me about 3 hours, and the rest of my time has been taken up in trying to get it to talk to the network. Pinging the loopback works OK, pinging the address of the card works OK, but I still can not get on the network.

Maybe it is related to how I have my router set up, or some configuration file setting that is incorrect, or the error between the chair and the terminal, but it will have to wait until later. My cat5 cable works for now, and maybe I can get some advice at the PSAS meeting or ask K next Friday.

There are some good sources of information out there for the Serial Peripheral Interface (SPI) bus, and I have been researching how to talk on such a network. Some of the FW stuff I have been banging my head against at work deals with SPI, so I should be a SPI expert by the time my internship and capstone are done. I also have been researching the freeRTOS documentation; Jeremy and I need to come up to speed fast. The learning curve is painful, but as they say, pain is weakness leaving the body (or mind in this case).

On my way home from class Friday night I stopped at Goodwill and found a nice compact wall adapter that is perfect for my LPC2148 dev board. I am finding it difficult to find a serial cable, new or used, so it may be an excuse to head to Frys tomorrow. At least I do not have to worry about finding a different wireless cardbus adapter, since mine is close to working.


Notes from FW Meeting 2009/1/24

Jeremy and I left the capstone meeting early to work with K, and again he was greatly of help. Jeremy was able to compile a program, send it to the LPC2148 dev board, and run commands that beeped and flashed and sent text out the serial cable to the minicom terminal on his laptop. Again, we are trying to overcome our Linux rustiness in addition to getting the tools to work.

Just as a reminder, there are typically at least four terminal windows running when we are working with the dev boards:

Note that the make, myocd, and ocdflash commands should be run in the folder that the program to be compiled resides in. The alias psas should be run before the myocd command to point to the correct path.

Of course we need to have already used the make command to generate the .hex file to send to the board. K showed us where the libraries were for the functions, and we need to get familiar with the initialization routines used in pretty much every .c file. We also need to become comfortable with modifying the functions.

Andrew will be expecting us to be able to talk to sensors sooner than later, so our next goal needs to be talking to specific pins on the dev board. Ai Ling should have an accelerometer for us soon, so we need to be ready. We need to know the specs of the LPC2148 by heart, research SPI, and also research freeRTOS. This will wait for tomorrow, though. I am tired now.


Capstone Meeting 2009/1/23

Attendees: All team members, sponsors, advisor


WPR - Week of 2009/1/19

Last Week

Next Week

ARs

Issues


Notes 2009/1/20

Attended PSAS meeting at the CS Lounge. We took a picture with the airframe that might be in a magazine.

Dave helped me get the Eagle cad viewer setup on the Linux side of my laptop. I brought my Olimex board and the connector, so K had me set it up and make sure we could run a program.

K and I were able to run the same program as Friday using my board and cables; in fact it seemed to work better. I do need to pick up a serial cable, and possibly look around in my junk at home for a 9v wall adapter. Note to self: look at schematic to make sure the polarity is correct for the adapter.

I need to run through the steps on opening up the different programs on the terminal windows. I know I need terminal windows open with this:

So with these windows open I can edit programs, compile them with make, and send them to the LPC2148.

The USB cable is hooked to the JTAG device, which is connected to the JTAG port on the LPC2148, and a power whip comes out of the JTAG to power the board (see note above about finding a wall adapter instead), the compiled hex files are sent over the JTAG to the board, and the output is viewed on the serial cable hooked up to the 2148.

If everything works correctly, commands are sent in the terminal window that had the myocd alias, they are implemented on the board, and the minicom window outputs the text.

To get to the alias files I ran the command

editor .bash_aliases

and uncommented the specific program line I wanted to run, in this case poke. When I was in the poke directory and ran make the first time it didn't do anything because there was nothing to make. K had me type

make -f clean

and then run make again. I think the -f flag was there, I need to look at the man page again.

More later.


Notes 2009/1/16

K. has been very helpful in setting up the tools necessary for cross-compiling from my laptop to an ARM platform (hex files, etc). He had previously worked his way through the tedious process of installing all the development packages, configuring the various files, setting up the necessary folders and sub-folders, and working up some example C programs that would compile and run on the Olimex board. Many of these steps are included in a very long script file that he ran on my system.

After working through some issues with the configuration on my system, installing some necessary programs and files, and changing some configuration values we were able to compile and run an example program on the Olimex board that flashed some lights when buttons were pushed and showed output over a serial cable. Success!

My laptop is circa 2003, which is good in a way because it has a serial connection in back. K. says that the USB-Serial adapter cables can introduce some weird delays that I now do not need to worry about. I just connect the board to Serial 1.


Capstone Meeting 2009/1/16

Meeting notes:


WPR - Week of 2009/1/12

Last Week

Next Week

ARs

Issues


Notes 2009/1/13

I attended the PSAS meeting and talked to Dave about the issues I was having installing the cross-toolchain, and he suggested that a partition sounded like it was full. The partitions were installed as the default, and I saw that root only had about 500 MB allotted. I reinstalled Debian with at least 10 GB for each partition, and the files seemed to install fine so far. Here's hoping... time for bed.


Notes 2009/1/11

I have successfully installed Debian on my Dell Latitude D400 laptop bought for this capstone. My Linux skills are somewhat rusty. The main goal at this point (other than re-familiarizing myself with Linux) is to go through the steps found at http://psas.pdx.edu/CapstoneLV2bProjectReport/#index9h2 that the 2006 Capstone team had in their report for setting up the development software.

There have been some problems with setting up the cross-toolchain compiler. The cross-compiler howto at http://psas.pdx.edu/DebianCrossCompilerHowto/ lists the terminal commands to download and install the necessary packages, and errors come up saying there is no room to unpack the files. The disk is required for many of the commands, and I think I need to point the OS to a network location or something.

...OK, I have found how to remove the CD from the install tree. I am not sure if I should just move it below the ftp and http lines. I used the command

editor /etc/apt/sources.list

and commented out the cdrom line. Now to try again....

Well it did't seem to work. I ran the command

sudo apt-get build-dep binutils gcc-4.0

and the error message is

Unpacking libc6-amd64 (from .../libc6-amd64_2.3.6.ds1-13etch8_i386.deb) ...
dpkg: error processing /var/cache/apt/archives/libc6-amd64_2.3.6.ds1-13etch8_i386.deb (--unpack):
 failed in buffer_write(fd) (9, ret=-1): backend dpkg-deb during `./lib64/libc-2.3.6.so': No space left on device
dpkg-deb: subprocess paste killed by signal (Broken pipe)
Errors were encountered while processing:
 /var/cache/apt/archives/libc6-amd64_2.3.6.ds1-13etch8_i386.deb
E: Sub-process /usr/bin/dpkg returned an error code (1)
E: Failed to process build dependencies

I will have to try it later. Maybe I can talk to the SW guys at the next PSAS meeting.


Team Meeting 2009/1/9

Attendees: all students, advisor, industry sponsors.

Andrew is working through the agenda.

Meeting Notes

Here is diagram Andrew drew of the baseline FW knowledge requirements for Jeremy and myself:

Baseline FW Knowlege

Here is the diagram on the board in the meeting showing the general layout of our project and which team member is responsible for what:

Meeting Diagram 2009/1/09

General Team Member Responsibilities:

For next week: WPRs that include what we have read, questions about our assigned tasks and research. Feel free to use the PSAS avionics mailing list for questions.