Mathew King's Lab Notebook

Week 01

January 12, 2006 (2 hours):
Meet as a group for the first time to discuss project ideas. Came up with four ideas and completed homework #1

WEEK 01 SUMMARY
Accomplishments: Completed homework #1.
Weekly Work Total: 2 hours
Project Work Total: 2 hours

Week 02

January 19, 2006 (.25 hours):
We meet briefly after class to decide on a project. Jeremy had some new insights on how we could do the "iReader" project. We set up a meeting for 7:00 on Sunday and we were all going to do some research before the meeting.

January 20, 2006 (1 hour):
I did some research on the USB interface and the FAT file-system so that we could use a "Thumbdrive" in our project. I found some code that implements the FAT file-system on a microcontroller here. We may be able to use this code as a guide on our project.

January 21, 2006 (1 hour):
I did some more internet research on how the USB protocol works. I found that in order to interface with our USB drive we will need a USB host controller. I found a company called Cypress who seems to specialize in microcontrollers that work as an USB host.

January 22, 2006 (2 hours):
The team meet as a group in MSEE 189. We discussed our findings so far. I showed the team the cypress website and I told them about the FAT32 driver I had found. We also talked about the different LCD's that we may want to use. I did not have much input on the subject because I had spent my time working on the USB interface. We completed the project proposal which included assigning homeworks. I will be doing the design constraints homework and the circuit design homework.

In order to get the Cypress microcontroller to work I believe we will need the development kit. This would be beyond the budget of the project, but Cypress has a higher education program and the course may be able to get the kit for reduced or no cost. I am planning on discussing this with prof. Meyer on Tuesday.

WEEK 02 SUMMARY
Accomplishments: The group was able to decide on a project. We finished up the project proposal and divided up the labor.
Weekly Work Total: 4.25 hours
Project Work Total: 6.25 hours

Week 03

January 23, 2006 (3 hours):
I put in some extensive time learning the FAT32 filesystem. Using this wikipedia entry as a reference I was able to modify the code I had found last week, and successfully view directories from my thumbdrive. I ran across a few problems. First my drive was formatted for FAT16 and the code was designed to work only with FAT32, so I had to reformat my drive using FAT32. When I first viewed the root of the drive all of my files were shown correctly, but it also displayed non existing directories with garbage as for names. I found that the code did not correctly identify the last cluster in a chain in some instances. I was not able to read from a file correctly, but I hope to have that working soon

January 24, 2006 (1.25 hour):
I set up CVS on the project account in hopes that the roup may use it. The repository path is CVSROOT=:extssh:477grp3@shay.ecn.purdue.edu:/home/shay/ a/477grp3/ CVSROOT. I imported 2 modules. First the FAT32 code that I found; I called it "fat_fs". I also imported a "mat" moduled for myself. This will contain all of my personal work such as this lab note book. I set up cron so it gets updated nightly.

I talked to Professor Meyer about the cyress microcontroller, and he said that it would be OK to use and that he would look into getting a development board for us. He also said that it would be alright to use the FAT32 code that I found online as long as I give credit to the original source.

January 25, 2006 (1 hour):
I requested a sample of the CY7C67300 EZ-Host. While I was looking through some of the reference designs for the microcontroller I found a product called USB Memory Key Bridge. It provides a very easy interface to a USB thumbdrive, but it would most likely do too much of our project for us. None the less I sent an email inquiring about the product.

WEEK 03 SUMMARY
Accomplishments: The group finalized most of the project details, and we set up our team account.
Weekly Work Total: 5.25 hours
Project Work Total: 11.5 hours

Week 04

January 30, 2006 (2 hours):
I spent some time reviewing our choice of microcontroller for the EIU, the cypress CY7C67300 EZ-Host. I found other product that act as an embedded USB host, but none of them were stand alone microcontrollers like the EZ-Host.

I looked over some last semesters' Design Constraints homeworks to get an idea what I need to do for the next two weeks. I started writing the introdution, but I didn't get very far.

February 1, 2006 (3.5 hours):
Our group met for 2 hours in MSEE 189 to discuss the homeworks that are comming up next Friday. On the EIU side we talked about our micocontroller options. The problem with the Cypress chip is that it has no onboard EEPROM or flash, and not a huge amount of sram (16 K). The microcontroller will boot off of an external EEPROM using I2C. We can fit up to 64 K of program code on an external chip, which would be plenty. We would also need to get some external sram. The micro can address up to 512 K using "Page Mode" addressing. We estimated that we will need between 64 and 128 K of external ram. Our other option would be to use a standalone USB host controller, and a seperate microcontroller with enougth ROM to hold all of our code, and enough RAM to store data while the product is running.

I spent some more time on homework 3. I have some basic ideas on what needs to be in the report now. I need to hear back from the rest of the team to finish the report.

February 4, 2006 (2 hours):
I spent a good deal of time reading the documentaion for the EZ-Host. I figured out that it can only address up to 40K of external memory. There is 0x4000-0xBFFF which is 32K and 0xC100-0xDFFF which is 8K. I figured we could use one 32K x 8 rom and map it to the 32K block. I found a 32k x 8 sram with the 12 ns speed needed if the microcontroller is running at 48 MHz. The CY7C1399B (Digi-key part 428-1711-ND) costs only $1.94 per unit. We will also need an external EEPROM to store program code. I estimate that we will need no more than 32KB for the code. I found 2 4AA256-I/ST on Digi-key for $2.75 per unit. It seems to match the requirements of the microcontroller.

Febuary 5, 2006 (1.5 hours):
The team met for a while to further discuss component selection. We were able to nail down all of the parts we would be using

WEEK 04 SUMMARY
Accomplishments: The group finalized most of the parts we would be using, and I started working on homework 3.
Weekly Work Total: 9 hours
Project Work Total: 20.5 hours

Week 05

February 6, 2006 (5 hours):
I worked very hard on homework 3. I am not done yet but I am well on the way. It should only take a few more hours to complete. I need to go to office hours sometime soon to ask about the format. Here is a link to what I have so far

February 8, 2006 (4 hours):
I finished up homework 3 and sent it to my team to take a look at.

February 9, 2006 (1 hour):
Made all of the changes from the feed back I recieved.

February 12, 2006 (7.5 hours):
Thomas and I met in the 477 lab for several hours designing our circuit and working on our schematic. It took us a while but we were able to download parts from the internet database and create our own parts. I worked mostly on the DU circuit while Thomas did the power supply.

WEEK 05 SUMMARY
Accomplishments: I Finished up homework 3 and submited it, and I started designing the circuit
Weekly Work Total: 17.5 hours
Project Work Total: 38 hours

Week 06

February 13, 2006 (3.5 hours):
I worked in the lab on the circuit design. I finished up many of the major components to both the DU and EIU.

February 14, 2006 (3 hours):
I continued my work on the circuit and I talked to Brian about programming the EEPROM. He said that I would need to email Chuck to find out if the programmers that the lab has will work. I was able to download the USB drive design documents from Cypress, but I was not able to install them because the C drive is not writeable. I am going back in tomorrow to find out how to get administrator access on the lab computer.

February 15, 2006 (5 hours):
I installed the Cypress design notes onto the lab computer and I spent some time reviewing the included documents. There was an example schematic that gave some insight into the USB circuit, and included some parts that we didn't know we would need. There was also some very detailed programming guides and a lot of sample c code.

Thomas and I worked on finishing up the schematic. We tryed importing into Layout, but there were still a lot parts that are not finalized. We added some footprints even though they were not correct just to get a feel for Layout.

February 16, 2006 (1 hour):
I worked on cleaning up the schematic

February 18, 2006 (2 hours):
I started the theory of operation writeup, but I did not get very far

February 19, 2006 (12 hours):
I spent most of the day in lab. I started out by writing a good portion of the theory of operation. Durring the writeup, I found some minor errors in the circit and I fixed them. Then I noticed that Thomas had changed the USB power from 5V to 3.3V, when he simplifed the power supply. I talked it over with him and we found a way to provide the needed 5V with only minor changes to the circuit. We then went through the BOM and selected and ordered all of the needed components. Finally we started picking out the footprints that we will use on the PCB.

WEEK 06 SUMMARY
Accomplishments: I finished designing the circuit and started the theroy of operation. We also started the PCB Layout.
Weekly Work Total: 26.5 hours
Project Work Total: 64.5 hours

Week 07

Febuary 20, 2006 (7 hours):
We had a small emergency when we found out some of the capacitors we were using would not work. We spent a good deal of time locating all of the caps on mouser. I then went through the our BOM and made sure all of the footprints on the PCB were correct. The PCB is now at the stage were we can start routing

Febuary 21-22, 2006 (15 hours):
Thomas and I worked on learning how layout works. We were having some trouble at first getting traces to connect, but after a few hours of trial and error we were able to get the hang of it. I started routing the DU and made it a goal to get it done before I went home. After Many hours of work it became clear that I could not route the 28 signals between the HC08 and the LCD controller. I took a look at the LCD data sheet and decided to use the indirect addressing mode which only requires 13 lines. After making some changes to the circuit I tryed routing again with much better results. By 7:00 I had the entre DU routed.

Febuary 22, 2006 (4 hours):
I worked on homework 5 for a few hours and I'm very lose to being done

Febuary 23, 2006 (9 hours):
I finished up homework 5 and the cirucit and got them summited. I then worked for a while on routing the EIU. I started routing it and it seemed very cramped in the space we had. We talked to Jeremy and we found that we could make one of the sides an inch longer. We also found out that the phycical location of the parts needed to be rearanged. I took a look at the pin layout for the memory chip and I found that pin numbering was off. I modified the numbers and it looked a lot easyer to route. I then spent several hours routing the EIU logic side and left it in a state where Thomas only had to finish the power supply.

WEEK 07 SUMMARY
Accomplishments: I finished homework 5, and spent a lot of time working on the PCB layout.
Weekly Work Total: 35 hours
Project Work Total: 99.5 hours

Week 08

Febuary 28, 2006 (8 hours):
The team met in the lab to work on our design review presentation. I worked for a while cleaning up the DU PCB. We spent many hours putting together the slides and rehearsing for the review

March 1, 2006 (1 hour):
We ordered the last of our parts, including many caps and the battery.

WEEK 08 SUMMARY
Accomplishments: Made some changes to the PCB and did the design review
Weekly Work Total: 9 hours
Project Work Total: 108.5 hours

Week 09

March 6, 2006 (3 hours):
We had to change the footprint of the FPC connector for the LCD because the pins were in reverse order of what we expected. This required some re-routing. I also took some time and made sure we addressed all the issues brought up at the design review.

March 7, 2006 (7 hours):
I changed the trace spacing from 7 to 8 and got rid of all the errors except for on 1 IC the pads are too close together. I talked to Brian and he said that it would be ok as long as those were the only design rule errors. I did a lot of checking for right and acute angles.

We did our parts demo with Brian and got them all checked off. There were a few footprints that neeeded som minor changes. We made all the recomended changes and we think that the PCB is ready to be submited.

WEEK 09 SUMMARY
Accomplishments: Got the PCB ready to be submitted and did our parts demo
Weekly Work Total: 10 hours
Project Work Total: 118.5 hours

Week 10

WEEK 10 SUMMARY
Accomplishments: Spring Break
Weekly Work Total: 0 hours
Project Work Total: 118.5 hours

Week 11

March 21, 2006 (2.5 hours):
I went to the lab to practace soldering. I couldn't find an unused practace board so I had to find one that had already been used. I had a hard time removing the IC that was already on it, I ended up ripping off 4 or 5 pads in the process. After the board was clean I got a new IC and did my best to solder it on. It took me some time but I got the hang of it. After the I soldered the IC, I soldered a 1206 capactior without much trouble.

I noticed that I had not installed the all Cypress software so I did that. Hopefully we will be able to get the code working on the EZ-Host.

March 22, 2006 (1.5 hours):
The PCB arrived today. I spent a while visually inspecing the board at our station and under the microscope. I then used the multimeter to check the connentivity of most of the main traces including ground and all the powers. The unused practice soldering boards were out so I went ahead an did another one. The process was a lot smoother this time. I used the microscope to inspect my work; I found that most of the pins looked good, but there were some that didn't appear to be soldered at all. I also saw that a few pins were slightly off the pads. I don't think it would have been enough to cause problems, but I will make sure to watch out for it when I solder the real board.

March 23, 2006 (4 hours):
I came into lab to work on the PCB, but when I got there Jeremy had some concerns about progamming the 24AA256 EEPROM. We didn't know if we were going to program the EEPROM in circuit. Furthermore, the only 24AA256 we currently have are in TSSOP packages so we really had no way to test them. I looked at the Dataman programmer and I found that the 24AA256 is supported, but we would need a DIP to test. We decied that we would try to solder wires to all pins on the TSSOP. Very carefully I under the microscope I was able to connect wires to all the pins, and I then connected a 4 pin header for each side of the EEPROM. I was then able to plug the headers into the Dataman and program the EEPROM, wich was a huge accomplishment. I then put the EEPROM into a bread board and hooked it up as it would be in the circuit, and I was still able to program it. This made me very confident that we will be able to program the EEPROM in circuit. I then constructed a connector to go between the 4 pin programming header on our board and the Dataman.

The 24AA256 only holds up to 32 KB of data. The Cypress can boot off a EEPROM up to 64 KB. From our estimates a 32 KB Rom may not be enough and we may need an 24AA512 which holds up to 64 KB. The only problem is that the Dataman-48, which is in the lab, does not support the 24AA512. According to the Dataman website newer versions of the Dataman hardware will support the 24AA512. Tomorrow we are going to see if the lab has any newer Dataman hardare.

I took some pictures of the work I did and I will upload them when Danny emails them to be

March 24, 2006 (.5 hours):
I went to lab to see how much was done on the PCB. While I was there I asked Chuck if there was any other Dataman hardware and he sait that there was not. I did some searching for other 64KB EEPROMS and I found that the Atmel AT24C512-10TI-2.7 can be programmed by the Dataman that we have. I did not yet order the part, but it is in stock on Arrow Electronics.

March 26, 2006:
Here are the pictures from March 23.
In circuit programming 1
In circuit programming 2
In circuit programming 3
In circuit programming 4
In circuit programming 5
In circuit connector 1
In circuit connector 2
In circuit connector 3

March 26, 2006 (9 hours):
The group met in the lab to try to get things working. I started out by soldering the DU mirco and all of the other components to get the micro running on the DU board. I gave it to Danny to test and we were able to program it and write a very simple program for it. I then helped Jeremy and Thomas on the power circuit. I had to scrape off a trace and flywire to 2 pins. I then helped Danny verifiy that all the pins between the DU micro and LCD controller were connected. We found that one of the was not properly solered and I fixed it. Lastly I soldered on the LCD controller and the rest of its circuit. The controller itself was tricky because I could not seem to line up the pins correctly. I had to use the microscope to get it soldered. I was going to solder the EZ-Host circuit but Jeremy said he was not going to test it until Tuesday so I will do it tomorrow.

WEEK 11 SUMMARY
Accomplishments: Got most of the DU soldered and figured out how to program the EIU
Weekly Work Total: 17.5 hours
Project Work Total: 136 hours

Week 12

March 27, 2006 (7 hours):
I solderd the EEPROM onto the EIU and verified that It ould be programmed in circuit. I then soldered the EZ-Host on and tried to get it up and running. First I found that the program that I put onto the EEPROM was not correct so I attempted to reprogram it. It seemed that after the EZ-Host was on the board, the in circuit programming did not work any more. I removed the EEPROM from the board and programmed the EEPROM that I brought to headers. Using the cable that I made for in circuit programming, I pluged in the EEPROM that I had just programmed. I still did not get any output from the EZ-Host. I spent the rest of the night trying to figure out why the EZ-Host would not boot. It seems that the SCL and SDA lines for the EEPROM sould be correct according to the datasheet, but the signals that I see make it seem like the SCL and SDA lines are reversed.

March 28, 2006 (8 hours):
I called Cypress tech support to try to figure out why the I2C clock and data lines seemed reversed. I did have the lines hooked up for the size of EEPROM that I have, so I figured that there was some pin to tell the EZ-Host to reverse the lines. I could not find anything of that sort. After some digging through the EZ-Host's datasheets I found that durring boot up it tries both configurations of SDA and SCL. I hooked it all up to an oscilliscope and I did find where the lines do get swaped. I figured out how I2C works and it seemed line the EEPROM was responding to the EZ-Host. I decoded what was sent from the EEPROM and there were a few bits that were off. I shorted the wires to the EEPROM and after that I was able to boot the EZ-Host from the EEPROM and run a heart beat program.

March 29, 2006 (2.5 hours):
I went in and worked on the PCB to make sure it was ready to be sent in. I ran the check with the PCB manufacturer and there were no show stoping errors. I will go in tomorrow to talk with Brian before I submit it. I didn't add the RS232 level translator becaue another team had a DIP one that they were not using so they gave it to us. I figured we could put it onto a breadboard for debugging. I ordered the parts that from the list that Thomas made last night.

March 30, 2006 (1 hour):
I talked with Brian about resubmitting the PCB. I decided to go ahead and submit it. I made one last change before I did. I added a jumper between the power rail and power of the EEPROM so that we could completly isolate it when programming.

April 2, 2006 (3.5 hours):
I found out what was wrong with the EEPROM. There was not a good conection to ground causing errors in programming. Jeremy then showed me the code he had so far. When I left we had gotten SPI working on the Cypress.

WEEK 12 SUMMARY
Accomplishments: Got the Cypress EZ-Host up and running and ordered a new PCB
Weekly Work Total: 22 hours
Project Work Total: 148 hours

Week 13

April 4, 2006 (1 hour):
I helped Jeremy continue to debug the Cypress EZ-Host

April 9, 2006 (2 hours):
I assisted Jeremy while he was working on the EZ-Host code

WEEK 13 SUMMARY
Accomplishments: I helped Jeremy debug his code. I did not do much else this week because I had tests and I'm waiting on the new PCB
Weekly Work Total: 3 hours
Project Work Total: 151 hours

Week 14

April 10, 2006 (7 hours):
The new PCB came in today. I did a visual inspection and everything looked good. I then started populating the power supply. I found quite a few parts that were not re-ordered so I had to take them off the original circuit. The new LTC1980's were not in the lab so I had to go to Thomas' appartment to pick them up. After I finished populating the 1980 circuit Jeremy showed me how to test it. The circuit put out the correct voltage and seemed to charge the battery. I went ahead and ordered the new EEPROM and a cap that we were missing from digi-key

April 11, 2006 (8 hours):
I finished populating the rest of the power supply. I got the other 2 voltages out that I expected. I then started to test the power supply with some larger loads to make sure it could take it. It seemed to work just fine until I put a 10 ohm resistor as the load. All the parts should have been able work at 300 mA but something stopped working. I debuged the circuit and I found that there was a short in the system. I suspected that the short was in the LTC1980 regulator, so I replaced it. That still did not fix the problem, so I gave up for the night.

April 12, 2006 (7 hours):
I started debugging the circuit some more and I determined that the short was in the switching transistor. After I replaced it the power supply sill did not work. I checked all the connections and everything seemed OK. After a while I decied to try another LTC1980 which caused the circuit to work again. I continued to test the circuit and most things seemed alright, but there were some timeing signals that were not correct. I found that if I set the circut for one battery, the signals were correct. I also noticed that the power supply seemed to flicker at some voltages

April 13, 2006 (8 hours):
I asked Brian about the problems we were having and he gave me some suggestions. I mentioned to him that we were still missing a capicitor that we thought would not affect the circuit, but Brian said that it would.

The capicitor came in and I put it in the circut. I was still having some minor problems, but for the most part everything was OK. I decied to try another large load. When I did it worked for about half an hour and then stopped working. I noticed that there was a transistor that was getting very warm and I susppected that it had gone out.

April 14, 2006 (10 hours):
We only had one more of the MOSFET that I suspected was bad, so I bought a larger one to test with. The new one worked OK, but the output was not as smooth. After doing some reading on the LTC1980 we found that the MOSFET was only really used when the circuit is plugged into the wall, and when only a battery is connected a regulated output is produecd without the MOSFET. Thomas and I went out and bought a one cell lithium ion battery. With our new setup things worked OK at first, but we found that the battery would not charge for more than a few minutes.

WEEK 14 SUMMARY
Accomplishments: I got the power supply sort of working. I had a lot of problems with the battery charging circuit
Weekly Work Total: 40 hours
Project Work Total: 191 hours

Week 15

April 17, 2006 (2 hours):
I continued to debug the power supply. Thomas had gotten ahold of Linear and they told him to send a email showing the waveforms of some of the signals on the 1980. I assised Thomas in capturing these waveforms on the oscilloscope.

April 18, 2006 (4 hours):
We wanted to be able to dispaly an image onto the LCD display. I started writing a simple script in python to convert a bitmap into a form we could insert into the DU code. Danny then told me that he could produce an image that was in a raw format with no header or anythig so I changed my script to just loop through this file and output it as a C integer array. We tested it on a few different images and found that it worked just fine. Here is a link to the script img2c.py.

April 19, 2006 (1.5 hours):
I was in Indy today so I went to some stores to look for a new battery. I found a battery that seemed like it should work at Fry's. I was also able to find a USB connector that would be much better than what we currently had.

April 20, 2006 (3 hours):
I tested the new USB connector that I had bought and it worked great. Thomas had not heard back from Linear yet so we continued to debug the circuit. Many of the outputs of the 1980 were not correct and we sill could not figure out why.

April 21, 2006 (2 hours):
Last night Thomas and Danny had discovered that the current sense resistor was connected backwards, which could have led to all our problems. We cut some traces and did some flywiring so that the circuit was correct. We did some simple testing of the circut and found that many of the problems we had been having were now fixed. We then got the video camera and filmed the four PSSCs that we had accomplished.

April 23, 2006 (8.5 hours):
I added some pullup resistors that were needed to get the battery gage to work. I then worked with Thomas to make sure all the outputs were correct. I then populated the rest of the EIU. We powered up the EIU by itself and everything seemed to be working with the new power supply. I then connected the DU and attempted to run it off the battery. It did not work at first but after spending some time looking at the internal signals we discovered that there was just a loose connection in the system. We were able to get full functionality running off the battery by the time we left.

WEEK 15 SUMMARY
Accomplishments: I wrote a script to put an image on the lcd. The group finally got the power supply working and we were able to power the entire circuit off of the battery
Weekly Work Total: 21 hours
Project Work Total: 212 hours

Week 16

April 24, 2006 (8 hours):
I tested the in circuit charging of the battery. We found that if the power supply voltage was too high, one of the transistors would get too hot. We have had problems with this transistor in the past and we knew it could be damaged by heat. We found a supply voltage that did not overheat the transistor, but it did make our transformer rather hot. The circuit was still ok after about 45 minuites of charging. Jeremy finished writing the code for the battery gage, so we video taped all of our PSSCs for tomorrow's class.

April 25, 2006 (6 hours):
Nick check off our last PSSC. Thomas made some changes to the circuit to try and allow for the in circuit charging to work with a wall adapter. We were not able to make these changes, and when we tried to put the ciruit back together, we were seeing very strange output from the 1980 We had one 1980 left so I replaced it, and we were still seeing strange behavior. We strugled with this for a while when I discovered that the mulimeter was low on battery and reading voltages too high. Once I got a new multimeter we found that the circuit was working correctly the whole time.

April 26, 2006 (3 hours):
I worked with Jeremy to get the packaging put together. I made a housing for the new USB connector that I had bought, and attached it to the package. We needed a hole for the reset button and the connector between the EIU and the DU so I used the dremel to cut them out. Finally I helped while Jeremy put everything together. All that is left to be done is the hinges

April 27, 2006 (2 hours):
I tested the circuit just to make sure it still worked. It is very inconsistant on boot up, but when it starts running it seems stable. I worked with Thomas and Danny to attach the hinges.

April 28, 2006 (1 hour):
I got the iReader up and running for our 270 presentation. The presentation went ok, but there were some technical problems so we were not able to demo the product.

April 29, 2006 (4 hours):
The group meet in the lab to figure out what needed to be done for the final reports. We made our poster and printed it, but the print quality was poor so we may have to print it again. We cleaned up our station, and took some more video for the final presentaion. When I left I put together my old homeworks and edited them and sent them off to Danny.

April 30, 2006 (2 hours):
I finished the rest of the items I needed for the report and sent it to Danny

WEEK 16 SUMMARY
Accomplishments: Finished up the ciruit, the packaging, and the documentation
Weekly Work Total: 26 hours
Project Work Total: 238 hours