Tips and Examples

Your Ad Here

This page contains some examples of the code used in the tutorial. Some of the code have detailed explanations, while others do not. If there is a project without documentation and I get a lot of requests for instructions, I might spend some time writing out the specs if I have time. Requests of interesting projects are welcome, I might have already written something similar in the past anyway. Not all projects are PIC24 based, as I use PIC18′s for USB projects as well.

Basic IO: Button Debounce
A lot of weird things can happen when mechanical devices are introduced to an electrical circuit. Switches and buttons are the most basic of mechanical devices, but they can cause a ton of headaches. In this article, I look at some of the ways to “debounce” mechanical switches in order to use them as clean and reliable inputs to a microcontroller.

Finite State Machine Based LCD Controller
If you ever wanted to display text on an LCD, this article will show you how to effectively make an finite state machine for an LCD controller. Though I don’t go into detail into how the actual driver works, I do explain the concept with a simple demonstration. LCD’s are an effective way to display and output with one output pin!

Your Ad Here

Non-Blocking Code
For everyone who’s just starting to code, this article is a must read. Learn simple ways to write your program while still maintaining responsiveness in your system.

UART based I2C Controller
I frequently have to fool around with new IC’s. However, since a large number of modern day IC’s use the I2C bus, it would be inconvenient to build a controller on each and every circuit I prototype for component evaluation. Instead, I built a tool that translates RS232 UART commands into I2C commands. Then, using a program in Java to control my RS232 port from a computer, I can have full access to all the IC’s in one simple bus.

Object Oriented Programming For Embedded C
Objects are great. They let you code faster and makes the code easier to understand. They are also a snap to reuse. But how can we do this in C? In the article I revamp the SPI EEPROM driver OOP style.

2 Responses to Tips and Examples

  1. mazen says:

    I want C codes to set the disable or enable the interrupt when using UART in PIC24F family Thank you

  2. jliu83 says:

    @mazen. Dude, I’m not a consulting service. I don’t write code for other people pro bono. If you are having trouble and have questions, then please post your code and I can take a look at it. Otherwise, read the tutorials or we can sign a consulting contract. Geez.

    -J

Leave a Reply

Your email address will not be published. Required fields are marked *

*

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>