8-Bit Microcontroller FIFO loopback Application

The goal of this exercise is to write a FIFO-based loopback application for an imaginary/generic 8-bit microcontroller. In this exercise, we don't specify the exact microcontroller and therefore can't actually execute or test this code, but we will evaluate the source code instead. Let's assume our imaginary microcontroller has a common address space for code and data, so you don't need the compiler extensions needed to distinguish between the memory spaces. In case you still feel you need some compiler extensions to express yourself, let's assume the compiler is based on GCC. The microcontroller has an SFR area which is used to control the device and its peripherals. It is mapped between addresses 0x00 to 0x7F in the common memory space. As our controller is 8-bit, this means it is possible to use up to 128 eight-bit registers to control the device and its peripherals. Let's assume the linker is already aware of the SFR area, so you don't need any compiler extensions to prevent other code or data from overlapping with the SFR area. There is only one SFR register you need to access during this exercise, however. Let's call this the "Serial I/O" register. Writing into this register will send a byte out via our physical serial I/O peripheral and by reading the same register we get a byte the serial I/O peripheral has just received. NOTE that we are allowed to read this register only in case the hardware indicates we have received a new byte and we can write to this register only in case the hardware indicates it has processed the previous byte and is ready to take the next one. These indications will be performed by interrupts. In this exercise, you should access the "Serial I/O" register only from the interrupt context. Let's assume the "Serial I/O" register is located at address 0x6B in the SFR area, but let's also assume you DON'T have the SFR space predefined. This means you need to wrap this register address yourself into some form, so you could read and write its value to receive and transmit the data. Let's stress out that reading and writing this register trigger different operations on hardware, so for example reading the SFR register 0x6B will NOT return the value you wrote there with previous operation. Your communication via the serial peripheral will be full duplex, so receiving and transmitting will be independent and may even take place with different speeds. In your exercise, please use separate FIFOs for receiving and transmitting the data. For the receiver side, the data flow should be like this: 1. Read "Serial I/O" SFR register if data is available and fill the receiver FIFO. This happens in the interrupt context. 2. Read receiver FIFO from normal application context and process this data. For the transmitter side, the data flow should be like this: 1. Fill the transmitter FIFO from the normal application context. 2. Read the transmitter FIFO from the interrupt context and send data out by writing to the "Serial I/O" SFR register. Note that as our target is a small 8-bit controller, efficiency of your code is important! */ // Below you will find some macro definitions you may use in your code if it // seems appropriate. As you will notice, the macros are actually empty. As we // are using a generic imaginary microcontroller, you don't need to define // bodies for these macros - they are just placeholders. #define ENABLE_SERIAL_OUT_REG_EMPTY_INTERRUPT() #define DISABLE_SERIAL_OUT_REG_EMPTY_INTERRUPT() #define ENABLE_SERIAL_IN_REG_FULL_INTERRUPT() #define DISABLE_SERIAL_IN_REG_FULL_INTERRUPT() #define ENABLE_GLOBAL_INTERRUPTS() #define DISABLE_GLOBAL_INTERRUPTS() #define DELAY_1_NOP() #define DELAY_10_NOPS() #define SERIAL_IO_INITIALIZE() #define SERIAL_IO_DEINITIALIZE() #define ENABLE_WATCHDOG() #define RESET_WATCHDOG() #define DISABLE_WATCHDOG() // This is the configuration part. FIFO sizes from 1 to 65535 bytes should // be supported in your code. #define OUTPUT_FIFO_SIZE 500 #define INPUT_FIFO_SIZE 500 // This interrupt service routine will be called whenever the corresponding // interrupt is enabled and the hardware of serial I/O peripheral is able to // accept a new byte written to the "Serial I/O" register. ISR_VECTOR_SERIAL_OUT_REG_EMPTY() { } // This interrupt service routine will be called whenever the corresponding // interrupt is enabled and the hardware of serial I/O peripheral has a new // byte received, which should then be read out from the "Serial I/O" register. ISR_VECTOR_SERIAL_IN_REG_FULL() { } // Here, in the application's main() function, please provide code that // periodically reads the serial input and sends back the INVERTED bytes via // serial output. int main(void) { }

Skills: C Programming, C++ Programming, Software Architecture

See more: create 8 bit music, convert songs to 8 bit, convert music to 8 bit sound, 8 bit unsigned integer, 8 bit technology, 8 bit style music, 8 bit style, 8 bit portrait, 8 bit graphics, hire 8 bit animation cartoons, bit microcontroller verilog, bit microcontroller pid, pid control bit microcontroller, pid bit microcontroller, top projects vlsi verilog bit microcontroller

About the Employer:
( 1 review ) Riyadh, Saudi Arabia

Project ID: #15672775

5 freelancers are bidding on average $29 for this job

$25 USD in 1 day
(15 Reviews)

Hi, Basically I'm an electronics engineer having 7 years of experience in embedded system designing and programming. I'm good with various microcontrollers such as AVR, ARM, PIC, STM, Arduino etc Relevant Skills and E More

$35 USD in 1 day
(3 Reviews)

I can supply you with a nice solution - including the necessary comments. Expect "reference quality". Relevant Skills and Experience See my profioe for the basics! This would not be the first time I implement some FIF More

$25 USD in 2 days
(3 Reviews)

I will make the code following your specifications. I will make a well comented code, using my professional expertise for this. Relevant Skills and Experience I'm electronic engineer specialized in high perfomance PCB More

$30 USD in 0 days
(0 Reviews)

Dear employer. We understand your need for a portable code that follows the standard ansi-c implementation as this is how we develop codes for our products so they can easily be adapted to whatever processor platform w More

$30 USD in 1 day
(0 Reviews)