Thursday, January 28, 2010

Weekly meeting agenda

Today's plans (here's the last meeting agenda):
  1. Task list - does everyone have access?
  2. Review and update group policies.
  3. Research update
    1. Dr. Jones
      1. Tutorial on the data transfer protocol.
      2. Our group's videos are featured on the IEEE RAM YouTube channel. I've entered some photos in a contest for the front cover of the IEEE Robotics and Automation magazine.
      3. Python now runs on the PIC24. Still work to do for the Summer Bridge program.
      4. Prepare a quad chart, two slide summary, three slide summary of the group's research.
      5.  Continuum review paper accepted; need to review another paper.
    2. Others

Python on a PIC

After some long hours, I got Python compiled and working on a PIC24HJ64GP502. It barely fits, but it does all work! Things to do:
  1. Clean up the make process. In particular, I'd like to be able to use make to build just the C code from the Python sources. I do have everything else building from both MPLAB and a Makefile (ugh).
  2. SVN commit this to the project.
  3. Write code to interface with the hardware. Idea: write a read/writeBit(s)/Word function, then use Python to build nice classes around all the peripherals. However, I'm not sure if there's enough RAM or if the Python will run too slowly to be practical.
  4. Put together a nice GUI so I can edit code, save it in a file, or send it to the PIC\
Some notes: to run ipm, "/cygdrive/c/Python26/python ipm.py --serial=com14 --baud=57600".

Thursday, January 21, 2010

Building a bridge

I'm planning on helping with the MSU BCoE Summer Bridge program. I'm planning on a 10-day portion, having the students build a WareBot: a robot which follows line to deliver packages, avoiding obstacles along the way. There are two portions: the mechanical platform and the microcontroller. I'd like to develop a simple tracked mechanical platform to use DC motors, a servo and an IR distance sensor, and line sensors. I hope to have a student complete that for me this semester; the question of how difficult it is to build these remains. The microcontroller question is more complex. I could use a PIC24, but C programming for it would be painful. A second option is the BASIC Stamp; a third option would be some sort of Python-powered uC (perhaps an ARM).

Investigating the BASIC Stamp, I'd think that a BASIC Stamp II would be fine. It needs a serial connection to the PC at RS232 levels per the schematic (sigh), so just an FTDI cable doesn't work (here's an example of using an FTDI chip plus interfacing transistors). The USB Board of Education provides a nice setup, but the prototyping area is too small, plus it's somewhat expensive. I'd need to add an additional breadboard to this for the sensors/motors I've chosen. PBASIC is OK, but I'm not that excited about it. Their IDE is nice, and integrated with a bootloader, which is very good. However, it doesn't have any analog inputs, which is bad; an alternative is to use an RC delay to read an analog voltage.

The alternative would be Python running on a uC, supplemented by I/O libraries. That's a lot of work, especially if I'm not planning on using it elsewhere. However, it looks like I could buy one and follow the tutorial; the library looks reasonable.  However, I don't fully understand how to send it code / bootload it. I've downloaded the code and now need to update my Cygwin install to build it. Looks like more work, but also looks promising...

Update: UNIX builds are always painful. PyChip built fine, after I found the docs/src/BuildSystem.txt to help me. I needed docutils to built the html files, which was easy to install after finding it. make check fails with a compiler error on ut_dict.c, which wasn't encouraging. Reading the docs/src/InteractivePython.txt, it seems like the interactive mode does what I'd hoped: transforms source code to bytecode, sends it to the target, then prints the results of executing that code on the target. Given that the PIC24HJ64GP502 has 6K of RAM (plus 2K of DMA space), perhaps I could run on it; docs/src/FrequentlyAskedQuestions.txt recommends 8K of RAM, with 4K as an absolute minimum. Of course, I'd then need to wrap many of the C functions in Python, which would be a pain.

Hardware update: PyChip has some support for the a very nice STM32 board which costs just $25! However, it uses an RS-232 connection, which is a pain. I'm not sure if the TX and RX pins are accessible at TTL levels.

Interesting articles

Reading in the IEEE Spectrum, I ran across two interesting articles. First, an interesting perspective from a University of Alabama professor on the climate, contrasting strongly with claims that climate data is unquestionable. (Note that the second article gives a series of opinions from the pro-change perspective, rather than factual claims, though it sounds factual.) Second, an interesting article on the China's Great Firewall gives a graphics below of what's censored as the image below:



In addition, a friend of mine with MS pointed me to some very exciting news: narrowed veins  (note the PDF is freely available) which do not carry enough blood away from the brain may be the root cause! There's a TV news story and web info on it as well.

Wednesday, January 20, 2010

Micro updates

I spent some time today working on an updated slide for Micro based on what I taught; I think it does a better job of capturing the MOV instruction's abilities.

I've also been thinking about re-doing the course using video supplemented with in-class exercises. I feel like I know what I'd like to do in these videos and how to do so reasonably efficiently. Now, what should I cover in the classroom without overwhelming myself?

Based on today's lecture, I need to have two levels of exercises: simple problems which verify what was taught, versus more difficult problems that require a bit of reasoning. For example, I task students with swapping data between two registers or memory locations as in-class exercises. I was surprised at how many questions and how much confusion this could generate. For the video portion, I'd go with something simpler: what happens after a sequence of MOV instructions? For the in-class exercises, I can ask them to perform a task (swapping) using these instructions.

The second in-class question is how to use in-class quizzes or something like that to reinforce the lecture. My guess is that I'd start with exercises, develop a good set of them, then move up to creating quizzes after the exercises are done.

Now on to my annual review, which I've been avoiding all day...

Tuesday, January 19, 2010

Tutorial created

Pondering a bit more on better ways to teach, I think my last few problems are resolved. In particular, my plan is to create a short (~7 minute) lesson which ends with an example, then an exercise based on that example. The exercises can and should be PC-based, such as writing and simulating some assembly code. I'm planning on recording in Camtasia from PowerPoint slides, supplemented by bringing in demos on MPLab, Quartus, etc. and showing data sheet, web sites, etc.

As a first pass of doing this, I've created a dataXfer tutorial video and accompanying docs. It took longer than I'd planned and I see several things to improve on in the future. However, I think the idea is sound and fairly do-able.


PC tools:
  • ZoomIt is a nice way to draw things while recording a video.
  • The latest version of Doxygen (1.6.2) doesn't work with my #ifndefs. After much playing, downgrading to 1.6.1 solved the problem. It now includes a nice search feature build into the docs!
But these things have eaten so much of my day and there's lots I haven't done yet...

    Sunday, January 17, 2010

    Improving micro

    Three of my group's videos are now featured on the IEEE RAM YouTube channel. That's marketing progress! I tried uploading the 2007 SECON video on Friday, so I can replace the audio with something legal. The upload failed, however, so I'll try again Tuesday.

    One my my Micro students sings in a barbershop quarter. How neat! Here's the podcast:

    Note: this slick player came from here.

    One thing I've been thinking about is how to improve Micro. One suggestion by Mark Taylor involves placing all the lecture content in videos which students watch, then using class time to build problem solving skills. I like the idea, but there are several problems I need to work through to get there. My thoughts:

    • I typically include a lot of group work / discussion as I give the lecture. This gives me a chance to correct wrong impressions, etc. How can I incorporate this into a video lecture?
      • Just giving the correct answer after an exercise encourages not doing the problems: I know that I'd just watch the thing rather than work the exercises.
      • Not giving the correct answer might leave students confused when I tried to build on that concept later in the lecture.
    • How do I make the lecture interesting? I know that I'd be bored by lecturing to my PC for an hour.
      • Throw in video clips of me? If so, when and why?
      • Break the lecture up into 10 minute pieces, ending with an exercise due in class?
      • Throw in some background music? See it more like a radio program?
      • Perhaps use screencast advantages: show MPLAB doing something, pull up and highlight data sheets, refer to book pages.
    • Techincally, what's the best way to do this?
      • The simplest approach, probably a good place to start, is to narrate my PowerPoint slides.
      • It would be nice to splice in a screencast, etc. Perhaps make that a movie then embed in PowerPoint?
      • Adding some video (here's a motherboard, etc.) would definitely add some interest.
      • However, editing this might become a lot more painful.
      • I'd no longer have a simple set of slides to distribute, but a whole production. I'm not sure whether book adopters would like the multi-media version or not.
    • Tommy pointed out that this would be a great tool for a week when I was gone: record my lectures!
    • In the end, I'd like to just try it: record one lecture and see how it goes.