About Me

I am an Aerospace Engineer with specialties in flutter, fluid structure interactions, and the use of CFD in a production environment. My dissertation shows how to improve the state-of-the-art unsteady CFD performance by 2 orders of magnitude. I am an engineer, a pilot, a marksman, a husband, and a dad.
Showing posts with label c. Show all posts
Showing posts with label c. Show all posts

Monday, April 16, 2012

Fortran Array Reordering Utility (Freo)


Fortran and C order their arrays differently. Fortran is column major; C is row major. There are performance implications to using the wrong order.

What do you do when you inherit a 10k+ line Fortran code written in C order? Regular expressions are not reliable. By-hand conversion takes too long and is fraught with human errors. So, I wrote the freo program in Scheme to flip the indicies of a specified function. Freo transposes Fortran indicies. It correctly converted the entire 12k line code in 54 files without human help in a few seconds.

Freo Converting Fortran Arrays in 4 files

Download exe file at: freo.exe and .scm code at: freo.scm. The code is not pretty and not optimal, but it does exist and does work. The code is compiled to a windows exe with Chicken Scheme.

Sunday, April 8, 2012

Project: C Functions and Programs on the PIC 16F876


C Functions and Programs on the PIC 16F876
Charles O'Neill
September 2004

This project’s purpose is to become familiar with C programming on the PIC 16F876 micro-controller. Each of the four programs demonstrates a particular aspect of micro-controller C programming: mathematical operations, functions, simple data input, and pointers.

The micro-controller is a 28 pin DIP PIC16F876 manufactured by Microchip. The PIC voltage input is +5 volts DC via a µA7805 dc/dc voltage regulator. The compiler is the CCS C compiler (v. 3.207) for 14 bit PIC chips. C compilation occurs on a x86 based PC. Data transfer between the PIC and the PC is through a 9 pin serial cable.

The full project is available here.

Tuesday, March 27, 2012

Project: Stepping Motor Control


Stepping Motor Control
Charles O’Neill
19 November 2004


This project’s objective is to describe and control a DC stepping motor. Qualitative stepper motor theory is presented. An example driver with schematic using the PIC16F876 programmed in C is included.



The mini-project is available here.