Gastric Bypass

September 30, 2008 – 11:07 am
Here's a post I drafted in October of last year.  I had considered it too personal to share here, but considering the outcome I thought it best to get some more information out there.  October 3, 2007 - Wednesday Gastric Bypass -- The Beginning Well, Monday was my first meeting for the required 6-month lifestyle class for the bariatric surgery candidates.  This month was a nutrition class and we discussed various nutrition aspects (fats, starches, proteins, etc.).  Frankly, this stuff had always confused the heck out of me before.   Heh, I guess that's how I ended up in this situation -- not understanding what I was eating. OK, let me start from the beginning.  About a month ago, I was diagnosed as a Type II diabetic.  I'm not quite to the stage where I need to take insulin (yet) and can hopefully get it under control with diet.  I had been ...

AT91SAM9 Linux Watchdog

June 14, 2008 – 12:32 pm
A driver for the AT91SAM9 watchdog timer was introduced in Linux v2.6.23.  Unfortunately, there are some "issues" with this driver that prevent it from working in all cases. Specifically, in my case, the AT91SAM9260 would not boot from the Dataflash when the watchdog faulted and caused a CPU reset.The issues and my proposed solutions follow. 1) The default at91bootstrap code disables the watchdog functionality. In at91bootstrap, in at91sam9260ek.c, in the hw_init function, remove the line that disables the watchdog and replace it with a line that pats the dog as follows: /* Disable watchdog */ /*writel(AT91C_WDTC_WDDIS, AT91C_BASE_WDTC + WDTC_WDMR);*/ writel(AT91C_WDTC_WDRSTT|AT91C_WDTC_KEY, AT91C_BASE_WDTC + WDTC_WDCR);  /* pat the dog early */ Recompile at91bootstrap and load it using SAM-BA or whatever tool you use to flash this to your board.  2) The Linux driver didn't set the watchdog up to reset the peripherals.  This means that when the watchdog faulted and reset the CPU, the peripherals (DataFlash in this case) ...

NYC BACnet Meetings

January 28, 2008 – 8:54 pm
As part of the winter AHR Expo, the BACnet committee and the working groups met in New York City from January 18th though January 21st. A good time was had by all in NYC! David and I stayed at Novotel on 52nd. It was a great place, and I highly recommend it. It's close to everything, especially Times Square and only a few blocks from the MoMA. While we didn't have a lot of free time, we were able to get to the MoMA store and I got to walk around Times Square for an afternoon. I was able to get a authentic NYC pizza at John's Pizzeria on 44th (remember: no slices at John's) and an incredible prime rib at Gallagher's on 52nd. Gallagher's was right next to our hotel, so it had the huge benefit of being easy ...

Byte Array to String in C#

January 28, 2008 – 7:49 pm
I found myself working with C# and reading data frames from the serial port. Specifically, I'm attempting to read BACnet MS/TP data frames from a USB to RS-485 converter. I determined that my task list was as follows: Enumerate the available COM ports. Open the desired COM port at the desired baud rate. Read the available data. Format the frame in a human readable format. Steps 1 through 3 were relatively simple, and I got through those in a matter of minutes. However, what I thought would be the simplest task, #4 turned out to be the most frustrating. In the receiving data event handler, I read the data from the port into a byte array as follows: byte[] buf = new byte[serialPort.ReadBufferSize]; int read = serialPort.Read(buf,0,serialPort.ReadBufferSize); Now, what I needed was a way to take each byte in the array and format as a string. In C, I would have done something like: int i=0; char b[2]; char y[1024]; for(i=0;i<buf.len;i++) {     sprintf(b,"%02X",buf[i]);     strcat(y,b); } That ...

Creating Panoramic Photos

October 31, 2007 – 8:34 pm
In July of this year, we took a family vacation to Ocean City, MD. We stayed at the Seagate Condominiums on 30th St. On the last day, I took several photos from our balcony using my Canon digital camera. I took them from right to left, moving the camera as close to one "slide" at a time as I could. Since July, I've been thinking about how to stitch the photos together to make one big panoramic photo. Some poking around on Google led me to Autostitch. Here's a capture of the images from Explorer in thumbnail view: All I did was start Autostitch and select this group of images from the File à Open menu. I'm a member of the prestigious 3 monitor club, so I set the output options to 4800x1200 and the JPEG quality to 100. Here's the output using Autostitch's default settings: I used Paint.NET to crop the image to remove ...

Invasive Adobe Updates

October 24, 2007 – 8:12 am
I'm a fan of the latest Adobe Readers, starting with version 7. They aren't nearly as slow at startup as their predecessors, and I hadn't seen a need to switch to an alternative like Foxit Reader. Well, until today that is. I was working on some code in VS and out of nowhere a blank Adobe Reader window displayed and a notification area tooltip was displayed saying "Adobe Reader updates complete." Saywhunow? I hadn't opened Adobe Reader, IT JUST DID ALL BY ITSELF. Is this some type of vulnerability attack? Is someone trying to take over my machine via Adobe Reader? Is the sky falling? Shame on you Adobe, for making me automatically think the worst. After doing some research, it turns out this was an upgrade from 8.1 to 8.1.1, which is a "recommended" fix to a critical vulnerability. Sigh. I don't let Windows control me like this. I choose when I download ...

Nut/OS UART_ERRORS

October 9, 2007 – 8:22 pm
I recently had the opportunity to do some work in Nut/OS on the Atmel AT91SAM7X256. I used the Eclipse Platform as the IDE and the YAGARTO toolchain under Windows to cross compile Nut/OS and the application. It was quite interesting comparing Nut/OS and Linux. They're really quite different, but if you're used to working in the Linux kernel you'll find Nut/OS strangely familiar. Nut/OS has a UART API which uses _ioctl to get and set the UART status. For example, you could use UART_GETSTATUS to determine if there is any data available in the UART buffer. After reading the API documentation, I decided I would use the UART_ERRORS flag to determine if the device had seen any errors (framing, parity or overrun). The UART_ERRORS flag is convenient, because it's really (UART_FRAMINGERROR | UART_PARITYERROR | UART_OVERRUN), so unless you want to handle one of those errors specifically you only need to ...

About me

October 7, 2007 – 6:31 pm
I'm Coleman Brumley. And I'm a software developer. I live in Greensburg, PA with my wife, 2 kids, and 2 dogs and so many gadgets that the Wife Acceptance Factor (WAF) is nearly zero for every gadget I want these days. I started using computers when I was in the sixth grade when my teacher Mr. Schushler introduced me to the Commodore Vic-20. That year, my parents bought me one for Christmas. I was instantly hooked! From there I upgraded to a used Apple IIe and then graduated to the big time when I got my Apple IIgs. My introduction to programming was the BASIC programs in magazines like Compute! I spent hours typing very large BASIC (and later MLX) programs only to have them go away when I turned off the VIC-20. At least until I got my first "datasette". ...