Gas station without pumps

2015 August 31

Eighth weight progress report (and colonoscopy)

Filed under: Uncategorized — gasstationwithoutpumps @ 19:48
Tags: , , ,

This post continues the series of weight progress reports from the previous one.

My weight went up a little in August:

Weight went up a little, but stayed in my target range (barely).

Weight went up a little, but stayed in my target range (barely).

My exercise was down a bit for the month (only averaging 2.25 miles/day of bicycling, down from 3.48 in July and from my normal year-round average of just over 4 miles/day).  Non-Californians may find this strange, but I bicycle much more in winter (daily commute to campus) than in summer. It hasn’t helped that we had a heat wave at the end of August—I’m no longer used to afternoons with temperatures over 95°F (35°C), and I just stayed in my nice cool bedroom/office all day.

I had really expected to lose some weight this month (despite the less-than-adequate exercise), because  I had a colonoscopy in the first week of August.  With 3.5 days of clear liquids only (about 400 Calories a day) and massive doses of laxatives, I expected my weight to plummet, needing some effort to bring back up.  Look closely at that weight plot—do you see a drop at the beginning of August? Neither did I. Confounding my expectations, I put on weight during the colonoscopy prep—more liquid went in than came out.  My experience should make it very clear that counting on laxatives for weight loss is a really bad idea.

And despite the rather draconian prep protocol I followed, the gastroenterologist pronounced the prep merely adequate, which is still better than the last two times, when a more standard protocol resulted in inadequate prep.

I have a very slow transit time (3–4 days, rather than the usual 1–2 days), so I need to customize the colonoscopy prep protocol. I customized the protocol this time, rather than following the standard one that the gastroenterology office wanted me to follow.  Their protocols had failed twice already, because the protocols were based on an average individual, not customized for me.

The protocol I followed this time was

Day –7:
Discontinued nuts, whole grains, popcorn, fish oil, aspirin.
Continued multivitamins, atorvastatin, and calcium carbonate.
Day –3:
00:00 Discontinued solid food.
11:30 two Bisacodyl tablets (2× 5mg)
17:30 one dose Purelax (17g PEG 3350) in 300ml apple juice
Day –2:
00:00 Stop all alcohol, red, blue, or purple fluids.
10:30 One bottle magnesium citrate solution (17.45g magnesium citrate)
15:45 One bottle magnesium citrate solution (17.45g magnesium citrate)
Day –1:
08:05-09:30 2L PEG-3350 solution in 8 250ml doses, 10 minutes apart (210g PEG 3350, 2.86g sodium bicarbonate, 5.6g sodium chloride, 0.74g potassium chloride)
Day 0:
07:00 2L of PEG-3350 solution (in 8 250ml doses, 10 minutes apart)
10:40 stop all fluid intake
13:40 colonoscopy

The Bisacodyl and Purelax had little effect, but the magnesium citrate was very effective. The PEG-3350 was rather slow-acting—very little of the 2L that I took early in the morning of Day 0 had come out six hours later. Drinking 2L in 75 minutes was very hard on my stomach—the first 1L was easy, but my stomach was painfully distended by the end of 2L.  (I had deliberately selected a 4L protocol, rather than the 2L Moviprep protocol that I used last time, because I thought that the flushing action of more water would increase effectiveness.)

In five years, when I’m scheduled for the next colonoscopy, I’ll modify the protocol further, discontinuing solid food 12 hours earlier, replacing the Bisacodyl and Purelax with an earlier bottle of magnesium citrate (1 on day –3, 2 on day –2),  and doing 3L of the PEG-3350 on Day –1 in 3 1L sessions (8:00, 12:00, 16:00), with only 1L early in the morning of the day of the procedure.

2015 August 30

Ask better questions

Filed under: Uncategorized — gasstationwithoutpumps @ 15:29
Tags: ,

There is a new blog, intended for K–12 math teachers, that is dedicated to “trying to get a little bit better at questioning”:

I read a number of math-teacher blogs, even though I’ve not taught a math course since Spring 2003 (Honors Applied Discrete Math), because a lot of the teaching discussion is relevant to what I do teach. I also read some physics teacher blogs, for the same reason.

It would be nice if there were blogs discussing precisely the same courses and teaching challenges that I face, but I don’t know if there is anyone else in the world who teaches the same eclectic mix of courses that I do. Last year I taught a first-year grad course on bioinformatics, a how-to-be-a-grad-student course, a freshman design seminar for bioengineers, a senior thesis writing course, a grad course on assembling the banana-slug genome (co-taught with another faculty member), and a lecture/lab course on applied electronics.  Over the decades I’ve been a professor, I’ve created and taught courses on an even wider range than that, including bicycle transportation engineering, desktop publishing, VLSI design, technical writing, digital synthesis of music, and most of the core computer engineering courses. At the moment, I don’t see myself creating any more new courses before I retire, unless I can hand off some of the existing courses to younger faculty.

The “better at questioning” theme of is an interesting one for a teacher blog, as it focuses on one rather narrow aspect of teaching, but is open to a diversity of different subjects, different age ranges for the students, and different teaching styles.  I’ve considered joining that blog as a contributor (it is open to any teacher, I believe), but I’m not sure how much I have to say about asking questions that is relevant to the math teachers who are the main audience.

I have much less time with students than K–12 teachers do (35 hours for a standard course, 95 for my intense Applied Electronics lecture+lab course), so I don’t have the luxury of slowly developing a classroom culture—I fully expect some students to still be uncomfortable with the way I teach even at the end of the course, though I attempt to get them to buy into the main purposes of the course within the first few hours of class time.

My goal in lecture classes is not to ask questions, but to get students to ask me questions—I’d rather that they figured out what they needed to know, rather than me trying to guess what holes they have based on what they get wrong on questions. I’m also not very interested in what students can do in 30 seconds—I want to know what they can do if they have adequate time to think and to look things up, so in-class questions don’t tell me much about what students need.  I rely on week-long homework and papers to do that.

I mainly use in-class questions to keep students engaged in the class—asking for the next step in a derivation, for example—rather than to test their knowledge or understanding. Since engagement is my goal, I don’t generally ask students who raise their hands, but do cold calling—selecting students randomly after asking the question.

Questions in the lab are a different matter. There I’m either trying to understand what the student is attempting (“What is the corner frequency you were trying to get?”) or prompting them to learn to do debugging (“Where is your circuit schematic?” “Have you compared your wiring to your schematic?” “What voltage did you expect to see there?”).


2015 August 28

New Stem Cell Assistant Professor position

Filed under: Uncategorized — gasstationwithoutpumps @ 22:07
Tags: , ,

UCSC has just announced a new Assistant Professor position in Stem Cell Genomics in the Biomolecular Engineering Department.  The job description and application is at, and the key line is probably

The successful candidate will be expected to establish a wet lab operation focused on stem cell genomics research, to develop a vigorous, externally funded research program, contribute significantly to undergraduate and graduate education, and perform university and professional service.

We are defining stem-cell genomics fairly broadly, particularly the “genomics” part—the stem-cell part is an absolute requirement, as the available lab space is dedicated to stem-cell research.  The “genomics” is there because that is where the department has critical mass—it will be easier to integrate a genomics person into the department than someone who is further afield.  That said, we always look for the best available candidate using a broad definition of what the position calls for.

Personally, I am hoping that we get someone in stem-cell engineering, as we are an engineering department, not an extension of the Molecular, Cell, and Developmental Biology department.  I’m not on the search committee, though, and I don’t know whether they share my view of the importance of strengthening the engineering and design components of our curriculum and teaching—they may not even distinguish between science and engineering.

I’m not in stem cells myself, so I’m not up-to-date on what is going on in the labs.  As I understand it, current research is mainly with mice (particularly hematopoietic stem cells), but there are a number of new induced pluripotent stem cell lines being established for various primates.  (A couple of the senior theses that I read several times as part of senior thesis writing courses dealt with establishing iPSC lines from orangutan fibroblasts.)

This faculty slot is the last wet-lab person the department will be able to hire for some time (until the campus rationalizes their currently dysfunctional way of allocating space—we are desperately short of wet-lab space while other departments are trying to figure out what to do with all their unused wet-lab space), so we want to get someone good who’ll stay with us for a long time.

It is an assistant-professor-only slot (tenure-track, but arriving with tenure)—the department has wasted way too much time on failed senior recruitments (generally forced on us by higher administrators—the School of Engineering has done much better growing our own faculty from promising assistant professor candidates).


Book draft 2015 Aug 28

Filed under: Circuits course — gasstationwithoutpumps @ 21:09
Tags: , , ,

I released an updated version of the Applied Electronics for Bioengineers text today.  This draft involved several changes:

  • I moved the electrode chapter and electrode lab to just before the EKG lab. This makes more sense in terms of the flow of the course, and means that the electrode lab can be done during the shortened Memorial Day week. The microphone, loudspeaker, and first audio-amp lab are now closer together, making a more coherent cluster (the hysteresis lab is still between the loudspeaker lab and the audio-amp lab). Unfortunately, the change also means that the introduction to op amps gets squeezed a bit, as the first audio-amp lab is a week earlier.  I’ll see how well that works this spring, and whether some other adjustment to the schedule is needed.
  • The hysteresis and relaxation oscillator chapter and lab were rewritten to take advantage of the frequency-measurement channels added to PteroDAQ. I replaced the old frequency recording with one done using PteroDAQ, and I added discussion of how to do the lab without bench equipment. I think that these chapters are essentially done,
  • The protoboards for using op amps came this week, so I took photos and put them in the audio-amp lab:
    Front and back of op-amp protoboard. This board replaces the instrumentation-amp protoboard used in previous years. Students will solder two boards: a microphone preamp and an EKG.

    Front and back of op-amp protoboard. This board replaces the instrumentation-amp protoboard used in previous years. Students will solder two boards: a microphone preamp and an EKG.

    I think that the new protoboards will be easier for students to use than the old ones—the grouping of wires is more obvious, there are more dedicated resistor slots, and each resistor can now connect to two wires at each end.

  • I also added a picture to the power-amp chapter of a bread board that I had melted by getting an nFET too hot:

    Too much current through a nFET can make it hotter than a breadboard can handle.

    Too much current through a nFET can make it hotter than a bread board can handle.

  • Throughout the book I changed references to the KL25Z board to references to the FRDM-KL25Z, as that seems to be the official part number for the development board.

At this point, I’ve rewritten and updated through Chapter 17, and I still have Chapters 18 through 28 to go.  It looks like I won’t get a full pass over the book done this summer

Work on the book and PteroDAQ will slow down somewhat for the next few weeks as I take care of other pressing deadlines: my teaching/research/service statement and biobib for a merit review—it’s been 4 years since the last time I did them; an external review for tenure of an assistant professor; final approval of PhD thesis that I read earlier this summer; finalizing the H. pylori genome assemblies I’ve been working on; setting up my web sites for fall quarter; planning the schedules for both my fall quarter classes; ophthalmologist appointment; training session for undergrad peer advisers; School of Engineering “all-hands” meeting; … .

I’ve spent about 4–5 hours on the external review so far, and have only read the CV, research statement, and two of the papers—there are five more papers to read, so I figure it will take me about 10 more hours to read the remaining papers and synthesis a coherent 1–2-page letter supporting (or not) the tenure case.

The thesis is a less difficult task, as I’ve already read the whole thing and marked it up—all I have to do is check that the corrections and clarifications I requested have been made.  I expect that to take 4–8 hours.

One problem is that both the tenure review and the thesis checking are tedious, so I can’t do them for very long at a time—but both are due next Wednesday. Writing the teaching/research/service statement will take some effort, as I have never been good at the bragging that seems to be expected—I tend to write honest statements of what I’ve been doing, which then get misinterpreted as my having been much less successful than what a straight reading of the material says.

DMA counter for event counting on Freescale Kinetis processors

Filed under: Circuits course,Data acquisition — gasstationwithoutpumps @ 18:25
Tags: , , , , , ,

The application note mentioned in PteroDAQ frequency channels is Freescale’s AN5083Using DMA for pulse counting on Kinetis, which I finally got around to looking up and reading today, after implementing frequency channels on the KL26, KL25, and K20 processors (Teensy LC, FRDM-KL25Z, and Teensy 3.1 boards, respectively).  The reason I looked it up finally was to look for a workaround for the biggest problem—namely that the CITER counter on the K20 has a maximum of 32767.  If I’m counting at the highest frequency (supposedly 8MHz or 6.26MHz, depending which documentation I believe, but I’ve not been able to get measurements much above 4MHz), that requires sampling at 125–245Hz or faster. But I often want to sample at factors of 60Hz, to alias out any frequency modulation from line interference.  The cruder DMA systems of the KL25 and KL26 use a 20-bit counter, and should be able to count to 4-5MHz (though they are likely to top out at 3MHz), so I could sample as slowly as once every 3.8s, even at the highest measurable input frequency.

I had no problem getting the counting to work with the 15-bit DMA_TCD_CITER counter. I can live with the 32767 count limit (at 60Hz sampling, that would be a 1.966MHz limit on the counting), but I wanted to see if I could use the optional interrupt that can be set up when the CITER counter ends to increment a software counter and reset the DMA counting.  That should give me an arbitrarily wide counter, at the cost of perhaps missing a count at the wraparound (an error of 30.5ppm, about the same as the clock error).

Unfortunately, AN5083 merely explains what I had already figured out for myself—without even the essential warning that you need a NOP after disabling the DMAMUX before looking at the counter to avoid a race condition on the KL25 and KL26:

    (&DMAMUX0_CHCFG0)[0] &= ~(DMAMUX_ENABLE);       // turn off at DMAMUX
    __asm__ volatile( "nop" );
    uint32_t count = 0xfffff - (DMA_DSR_BCR0 & 0xfffff);

They only say

The major loop counter of the DMA register DMA_TCDn_CITER_ELINKNO is limited to 15 bits, in the case where the channel linking feature of the DMA is not in use (refer to DMA chapter in the Reference Manual). Therefore, there is a limitation of 32K major loops count. So, user must check CITER register and make sure it will not reach to zero. If, CITER reaches zero, BITER will reload the value from BITER register.

I tried for a good chunk of yesterday to get the code working with the interrupt.  I can get the interrupt to occur (detected by turning off an LED in the interrupt return), I can read the longer frequency counter (detected by turning off an LED if the count to return is >32767), and the count is returned to be pushed on the queue, but something gets wedged and that longer count is never output to the host.

The processor needs to be power-cycled, the same as if the processor had gone into an infinite loop (which is what the Teensyduino unimplemented_isr routine does). I did disable the DMA error interrupt routine (with DMA_CEEI), so that isn’t the problem.  I even confirmed this by enabling the error interrupt and providing a dma_error_isr routine that turns off the LED, but the LED did not turn off.  I also checked the DMA_ES register at the beginning and end of the dma_ch0_isr routine and in the routine that reads the counter, and DMA_ES was always 0.  So if there is an error, it is not being reported by the hardware.

I suppose that an SWD debugging interface (not available on the Teensy 3.1 board) might be useful here, as I could at least check my conjecture that the processor is looping in the fault_isr routine.  It may be wedged somewhere else.  And there is always the possibility that there is an undocumented hardware bug (like the race condition between DMAMUX disabling and reading DMA_DSR_BCR on the KL26) that requires some workaround that I haven’t thought of yet.

I’ve given up on the higher resolution counters for Teensy 3.1 for now and just pushed the 15-bit implementation (with the interrupt code mostly commented out) to the BitBucket PteroDAQ repository.  If anyone reading this blog is familiar with the DMA interrupts on the K20 processor, please look at the code in kinetis_frequency.c and tell me what I’m doing wrong!

Next Page »

%d bloggers like this: