Giotto is a programming model for embedded control systems that is applicable to hard realtime specifications that are periodic and feature multi-modal behavior. Examples of such systems include fly-by-wire or brake-by-wire systems where sensor readings must be periodic and there are multiple modes of operation.Ptolemy II is a university based open source modeling and simulation framework that supports model-based design, and facilitates actor oriented and objected oriented programming. It serves as a laboratory for the modeling and simulation necessary in the design of a real-time embedded system. Ptolemy also has a C code generation framework that generates code for different targets.Ptolemy II has an implementation of the Giotto programming model, that allows the simulation of Giotto models in Ptolemy II. In this report we discuss our ability to implement Giotto semantics using code generation and a real-time operating system. We illustrate these techniques with Ptolemy II and the FreeRTOS embedded operating system. To illustrate these techniques we extend the code generation framework within Ptolemy II to generate C code for the Giotto programming model. We have implemented a C code generation adapter in Ptolemy II for the Giotto model of computation targeted to systems capable of running the FreeRTOS operating system. We present an elevator controller as an example that uses the code generation framework.2