This page deals with my final year MScEE project: a self tracking webcam. This work was done for Staffordshire University (UK).
The aim of this project is to build an endembed system pluged on a computer with only two wires ( two USB cables) able to make a camera self turn to always look at a selected object. This will be done without extra suply since each USB cable can provide 500mA. For now, the project only works under Linux. Some port is possible for MS Windows or other UNIXs but are not planed by the author.
This project deals with many problems: endembed systems, serial monitoring, USB development, realtime image recognition ... and many other really interesting topics.
The logbook might help in sorting troubles, and understanding the underneeth of everything.
All steps to build the project are detailed in the second appendix of the formal report. If you can not read the PDF files, download the sources of the reports, and read the Latex files.
THE READER IS REMINDED THAT THE PROJECT CAN ONLY RUN UNDER GNU/LINUX.
In this documentation, I only explain how to build and use the board; I assume that you know how to modify files if required, and have the source tree of your kernel so that it is possible to compile a driver.
I dont say it is easy; I just explain how I did it to make it work FOR ME.
To learn more about everything, I encourage you to read the Formal Report, at least the abstract and the introduction. You can also find pictas in other sections.
I have a segfault when launching the monitor
- I know, you forgot to give the -c option. I will correct that soon.
When sending the key, the monitor "Did not receive expected char".
- Hmmm ... let me think 1s ... PLUG THE PLUGS !!! Both of them: the serial plus the power plug of your board ( which is the USB for me).
Echos are not expected values.
- If you use a serial LIRC receiver, that will interfere. First shutdown the lirc daemon, and then restaure the serial port settings. The documentation I readed said to 'setserial /dev/ttyS0 uart none' before launching lircd; to revert from that, you shall enter: 'setserial /dev/ttyS0 uart 8250'
ASL can not compile the code: usb08.asm(24) : error : address overflow
- This is because you use the stable version of asl: 'asl-1.41r8', which is known to have bad support of the 68hc08 series. I reported the bug, offered a patch, but the maintainer does not want to release a new stable version. He told me that latest unstable version should be corrected, but I did not find where to grab it.
- The solution if you use 1.41r8 is to patch it yourself: edit code6805.c (in asl source tree), find line 776 which contains 'SegLimits[SegCode] = 0x1fff;', and write instead: 'SegLimits[SegCode] = 0xffff;'. Then recompile, and reinstall. Thats all. This is an ASl bug, and have been corrected in recent versions; actually, 1.41r54 is ok.
ASL compiles fine, but p2hex returns a 0 byte file
- This is my fault; I had not properly readed the documentations
- You should edit the Makefile of the STWP project, and change the line "$(P2HEX) usb08.p" into "$(P2HEX) -r 0x-0x usb08.p". This bug may not occur with old verions of ASL; it should starting from 1.42.
Where can I buy some 68HC908JB8 ?
- if your local distributor does not have 68hc908jb8 in stock, you may try to ask Freescale to send you some free samples.
Why cant I find any MC68HC908JB8JP any more ?
- Because this product is deprecated.
- But, did this product's life time already burned out ? no :)
- Then, what'ze mess ?
- MC68HC908JB8JP is the name of a product concept; after it's first release long time ago (around 1998), new laws came,
asking Motorola and now Freescale to stop producing components containing lead (Pb). For some obvious reasons, Freescale
kept on producing the concept of MC68HC908JB8JP, but for some obscure reason the lead-less equivalent was given a different name:
MC68HC908JB8JPE . All other friends of the 68HC908JB8 have been given similar names: just get an 'E' added in the end.
- To refresh your mind, 68HC908JB8 is the familly of the 8b uC that is USB capable, all compatible with this project.
JB8JPE vs JB8ADWE vs JB8JDWE vs JB8FBE is a fight about packaging (pin number, and pin spacing).
- All ...E chips seem to me pin and package compatible with old references, but are lead-less.
If you cant find your good old ref on re-seller web site, try adding an 'E' at the end of it.
While uploading the firmware, if something goes wrong, the first thing to do is to edit the Makefile and remove '-e' in 'MON_OPT'.
To make sure the chip is blank, use
AND POWER CYCLE THE CHIP BY UNPLUGING THE POWER FOR AT LEAST 2 to 10s ( depending on the capacitor you have used on the board)
Remember that when you change the security key, or want to enter or exit monitor mode, you must always power cycle the board. It sometimes happens that the LEDs come off but there is still enough current in the capacitors to keep memory state in the chip if you use big capas. So if you encour any problem, wait at least 2 to 10s before replugging the board.
If you need to contact me, you can find my email in my CV. See head page. I am open to any suggestions, even bad criticises.