TekBots Days 30-48

September 6, 2007 by tekbots07akerlunj

Thursday September 6, 2007

Once again, I have to make another post for a large sum of days. I have been making a lot of progress lately which is one of the reasons I haven’t been posting. Days 30 through 35 I managed to finally write successfully to the flash. Until the end of the week I didn’t actually have evidence that I was writing because the verify portion wasn’t working fully. Part of this problem was I grabbed the code for reading from my writing code, failing to realize that the operations are so different that it was better to just write the code for reading from scratch. By writing the code based off of other code there was a lot of errors in it present that it took me a while to remove. The second part of the problem was regarding the inability to perform a continuous array read.

The second week I wrote code on the PC to work around the limitation of only being able to read a page at a time. I plan on writing code within PSoC itself to do this, as it will speed up read times, but for now the current setup is fine. I also began testing my code under various inputs and conditions, including differing file size, differing beginning write address, and other various tests. One of the tests I performed was writing a 8MB file to the data flash, which is a really slow process. To figure out where my time was being consumed at I spent some time writing a timer into my code in PSoC and timing how long each process took. The results of my timings indicated the biggest consumer of time in reading and writing was communication between the PC and the board. After talking with Chris I began work on trying to find a new way to get information to the board in a faster way. Searching the internet I found a most helpful site that became the hub of my research into USB endpoints and communication in general: (http://www.beyondlogic.org/usbnutshell/usb4.htm)
Hardware limitations prevented us from using high speed communications, so we are limited to full speed. Using this information and the site above, I found that the current endpoint type we were using (Interrupt) has limited a limited packet size of 64 bytes. The only way it seemed we could increase this was to start using the Isochronous endpoint type.

The rest of my week was then spent researching isochronous transfers. I learned that it was a very fast means of transmitting information, typically used to streaming video and audio. This sounded perfect for what we wanted, so I began searching for example code. During my search for example code I came across a blog for someone who had similar problems as myself, and they indicated that Isochronous transfers are fast, but they have a drawback. Isochronous transfers don’t have error checking, making them vulnerable to more errors than other transfers. This flaw makes isochronous transfers more desirable for streaming of audio and video but in the software we are using being one or two bits off can ruin the whole program. Using Isochronous transfers also ended up being a lot or work for what we were planning on doing with it, so in the end it we decided to scratch using isochronous endpoints.

Last week I have been optimizing my code and commenting it so as to make it more readable. With some of Chris’s help I managed to cut the write time by 25% and the verify time by 50%. I also fixed the problem with the continuous read.

The beginning of this week I began testing my code to make sure it works, and fixing errors, and yesterday I began work on the FPGA board quick start guide. I have the outline of the guide started, I am currently in the process of testing my steps, and getting ready to make screen shots and begin writing.

TekBots Days 19-29

August 11, 2007 by tekbots07akerlunj

Friday August 10, 2007

Its been a long while since I have written in my blog, and it still doesn’t seem like I have really accomplished too much either, but here is the update. The issue we were having with the computer freezing is indeed because the PC was automatically configuring the DSP board. We got tech support in and told the computer to stop automatically configuring the DSP board, which gave control back to me the programmer. After that I began communications with the DSP board, I was fairly quickly able to send information, but I had trouble getting information back. This was because in USB communication the address of an endpoint output is different then the address for an endpoint input, for the same endpoint!!! (An endpoint is a data line if my vocabulary is confusing). As soon as I was informed of this fact communication was easily passed between the PC and the DSP board.

Communication with the DSP board indicated a large transition in the project, our goal now was to program just to get the board working at startup. Allen and myself met with Chris Edmonds and received our project goals and immediately divvied up tasks. We basically seperated the tasks into two parts, the PC side of things and the Cypress side of things. I took the Cypress side and Allen took the PC side. We first started on the JTAG interface, but since the Cypress side was almost completely written already I began working on programming the data flash. This brings us to where I am now.

I have completed what I believed to have been working code, but I am encountering communication problems, I’m in the process of using LED’s to see what I can get out of the chip. The progress I’m making with that isn’t too great so far, Chris has a theory that I’m messing with memory somehow, which is backed up by some of the strange outputs I seem to be getting but I can’t seem to figure out where this is occurring. I did make the discovery that some of my #defines in my include files were incorrect according to the data flash data sheet, but that didn’t seem to help matters any. We will see what happens in the next couple of days as I continue to clean up the code and get a better understanding for exactly what is happening.

TekBots Days 16, 17, and 18

July 27, 2007 by tekbots07akerlunj

Thursday July 26, 2007

I have been lately getting really into my project and totally forgetting to write in the blog lately, but I have finally hit a dead end, and have something meaningful to write about. What I have been doing the last three days has mostly consisted of finishing the  porting of all the code from C++ to C, which took nearly an entire day to complete. After I had finished porting the code over it was completely riddled with errors that took me around a day and a half to go through and fix, which took me to the middle of today, in which I finally compiled the code completely and attempted to run it for the first time. The code itself on the PC side ran decently smoothly, there weren’t any errors dealing with anything other than print statements, which I found amazing. However there were several problems with my program in PSoC. We made a fairly last minute decision to make the DSP board a HID device, which basically means it doesn’t require driver installations, you just plug it in a go. The process of converting everything on the chip to make it a HID device however was more than what I or Chris thought, so I ended up spending nearly the rest of the day trying to figure out exactly everything I needed to do to convert the DSP board into an HID device. I was eventually successful, but I am now faced with another problem for which I have already spent an hour on. The issue at hand is when I try to send configuration information to the DSP board, the PC stops responding, and for some reason the DSP board seems to automatically get configuration informations prematurely straight from the PC itself (I discovered this by programming the chip to light up a different LED as soon as configuration is complete). I don’t know what is going on at all, but I plan on attacking Chris and extracting answers from him as soon as I get here tomorrow morning. I feel like I’m really close here, and I’m really getting jazzed about this project now.

TekBots Day 14 and 15

July 24, 2007 by tekbots07akerlunj

Monday July 23, 2007

Hopefully it won’t become a habit, but I have been combining days here recently. Last Friday wasn’t all too eventful, however I did aid in a START session for the very first time. This basically consisted of showing START students how to solder, and make sure they were being safe while they solder. We also showed them how to make a normal “Burglar Alarm” into a very annoying one via shorting a cap. After lunch for the very last time we went to Out of the Box and said our goodbyes, which took up the rest of the day.

Today I finally gave up on trying to create my own original code and start from scratch, there is something going on in the program that I just don’t have the time to go through and figure out. I have now begun work on programming the CPLD through the USB, this requires sifting through old code and retrieving exactly what I need, and ignoring the rest. I am working on both chip-side and PC side programming. This is the first real time I have programmed in C in quite some time so I feel like I’m taking a crash course in C programming, but I’m picking it up quite quickly. I also have to translate C++ into C without any experience with C++. I have noticed that the code I have been giving was rather incomplete, so once I have finished porting the code I will have my work cut out for me finishing the code.

TekBots Day 12 and 13

July 20, 2007 by tekbots07akerlunj

Thursday July 19, 2007

Yesterday I began work immediately on PSoC, and spent roughly 2 hrs trying to figure out why I couldn’t program the DSP board. In the end it turned out that Chris never logged out of his computer and the PSoC program remained running in the background preventing new programming from being possible. It was quite annoying and we even went as far as to take screen shots of what was happening and begin to e-mail Tech Support before I discovered another occurrence of the program being open, and closed it by mistake. This was all brought about as a result of a bunch of changes I made to the program, and I was almost positive it would work, to my dismay it still doesn’t work, and I have nearly completely copied the sample working code, and am running out of alternatives. For summer Stretch Don and myself finished out epic battle of chess. This game was going back and forth for most of it, but I eventually came out victorious and sent the big Don back to his office crying…  After lunch Ellen and her Out of the Box requested my presence, so I went over there and helped the students program. The visual programmer they are required to use is beginning to really get on my nerves, there are so many problems with it, that it pretty much can’t be reliably used.  That night I helped out with fixing the TekPets, there was a slight problem I found in which the buttons were improperly soldered, which required some fixing, but other than that it appeared to go somewhat smoothly, I can’t wait for this week to be over and to be able to sleep again.

This morning, I was set to work trying to finish the remaining TekPet programming, it however didn’t go as smoothly as it did yesterday, and I was quite dismayed. Once again I went over to Out of the Box and verified that the programs we wrote yesterday were what the students wanted and worked properly, sadly however they seem to have had something done to them as very few of them worked again. I can feel this project is most definitely starting to test me and I’m beginning to feel more and more reluctant to do anything relating to the project. I write this getting ready to go back to Dearborn and work for several more hours tirelessly on the students TekPets and praying that they will start working. This is one of the few projects I think I will be very happy to finish and never touch again

TekBots Day 11

July 18, 2007 by tekbots07akerlunj

Tuesday July 17, 2007

 Last night a large number of TekBots workers volunteered their valuable time to helping Ellen Porter finish and repair 36 TekPets. I was among these students that worked until 3AM, I however was on a separate project, which was to create a TekBot kit counter for those workers creating kits for the coming up year. I was unable to finish the counter last night, and so decided to finish it today. Fairly shortly after arriving at TekBots today I finished preliminary software coding to get a base to build off of. After finishing the preliminary code I began once again on the hardware side of things, finishing up the soldering placing a startup switch and reset button. I next moved on to the hardest part of the project, which was calibrating the potentiometers to the most desirable resistance. This was something I was only able to guess at, and after finishing the programming I discovered I was terribly wrong with my settings. Via trial and error I recalibrated the settings and managed to get a working “prototype” which will be used tomorrow during the building of kits. Overall the project was a very fun and quick project and I’m glad I received the opportunity to work on it. I have made plans to further enhance the design and remove a few problems it has, but as of yet I need to go home and rest… cheers!

TekBots Day 10

July 17, 2007 by tekbots07akerlunj

Monday July 16, 2007

Today I talked with Chris about PSoC, and I was informed that the schematic I was basing everything off of is not the layout of the board.  I fixed everything making it appear to work, but once again I was approached by failure.  I have working code as my ally so I think by tomorrow I will have it figured out. Out of the box was a good session today, I was a bit exausted but the students were able to pull up the slack and give me a break which is incredible. The TekPets are coming along nicely too. I’m really excited for the days to come.

TekBots Day 8 and 9

July 14, 2007 by tekbots07akerlunj

Friday July 13, 2007

Yesterday I spent the entire time before lunch finishing up the soldering of the USB programmer, and creating JTAG cables for them. After lunch it was then time to do outreach again in which we made paper mache tops for the TekPets. The first session was alright, the students weren’t too hard to manage. The second session however was a little bit worse, and we had fewer people to try to control them as well making it more difficult to manage them. I think it would have been easier to have a more authoritive figure for the second session. Today I went back to learning how to program in PSoC. I was met with very little success in that the LEDs still haven’t lit up. I sent an e-mail to Chris to get his code and see what could possibly be wrong with mine, but he has yet to get back to me. The outreach program today was a lot better than it was the day before, but I found that the students were to some degree kinda lazy. As a result of the laziness of the students we fell a bit behind in the TekPet project, but I anticipate that all will turn out alright on Monday.

TekBots Day 7

July 12, 2007 by tekbots07akerlunj

Wednesday July 11, 2007

Today, I discovered why I was not able to comunicate with the Cypress chip on the DSP board. There appears to be a problem in which when power is supplied to the board, it prevents communication between the Cypress chip and the PSoC Programmer. I also finished programming the USB programmers today, and began soldering resistors to fix the programmers to allow them to use JTAG. Once again I helped Ellen with the outreach program, in which we soldered together the Tiny26 board.  Overal, today has been the most relaxing day I have had, which I think will help me acheive my goals in the upcoming days.

TekBots Day 6

July 11, 2007 by tekbots07akerlunj

Tuesday July 10, 2007

Today I discovered just how close yesterday I was actually to programming the USB chip on the DSP board, but then also how far away I was. I managed to get the program to fully compile without bugs eventually, I was just not clicking on a certain button that creates necessary files for the programming. The issue I am running into now is my inability to talk to the chip on the DSP board. I will look at it with fresher eyes tomorrow. Don set me next to programming the USB programmers, there are 100 of them, so we shall see what happens. Once again after lunch I worked with Ellen and the group with the outreach program. Today we finished soldering and started plans for what the students will actually be working on. I have been assigned to work with at least one student, possibly a second one, on individual difficult programs that they will be attempting to create for their TekPet. I anticipate this will be a fun project and await their ideas. I am really starting to get excited about working for TekBots, and have already had plenty of fun.