Notes on using the Robotics Connection I2C line following sensor with Arduino based boards

After many of wasted hours of trying to get the I2C line following sensor from Robotics Connection working with an Arduino based controller board I was finally able to get it to communicate and since there was no other information out there on this issue I decided to write this post. (more…)

Verilog: n-Bit Up Counter

This is a simple n-bit wrapping up counter. The n parameter can be changed to make this 4, 8, … bit counter were n = <number of bits> – 1. The CLK signal can be any signal you want and will increment the value of the counter on the positive edge of a pulse, RST is the negative edge reset signal which will reset the counter to 0 or any number of your choosing also be sure to change the initial value, which is the starting value when the module initialized. The output count is the current value of the counter. (more…)

Verilog: Dual Seven Segment Display Driver

This is an expansion upon my SevenSegmentDisplayDriver module which will allow you to drive a dual seven segment display, specifically the add-on for the Spartan 3E but it should be quite easy to modify for other FPGA’s. The basic premise of this module is you have a dual seven segment display which activates the left or right display depending on whether the enable signal is high or low. So using the code below, when the clock signal is low (right display is active) we send the lower four bits of our number to the display so they show on the right hand side display. When the clock is high (left display is active) we send the upper four bit to the left hand display. By doing this a few hundred times a second both numbers apear be on the display at once. To use this module you must slow down the clock to an appropriate rate and assign it to the enable pin for the display and the CLK input on this module. bIn in the 8-bit number you wish to display and ssOut is the array of segments for the seven segment display (See the SevenSegmentDisplayDriver post for more details) (more…)

Verilog: Seven Segment Display Decoder

This code will take a four bit number and decode it into the seven individual segments to drive a seven segment display. nIn is the four bit number to be decoded and ssOut is the array of segments for the display going from a, being the LSB, to g being the MSB. (more…)

Verilog: n-Bit Adder

This is code is for an simple asynchronous wrapping n-bit adder. By changing the value of n you can make it a 2, 4, … bit adder where n = <number of bits> – 1. f is the output register that will have the current value of the counter, cOut is the carry output. a & b are the number inputs and cIn is the carry input. Both the number outputs and inputs are set by the value of n so you can add two n-bit numbers and a carry bit then get an n-bit number plus carry bit out. (more…)

State Machine for the Spartan 3E Knob

The following code is a simple state machine that determines the direction that the knob on the Spartan 3E is turning and outputs a clock signal (Count) as it turns. A & B are the inputs from the encoders on the knob, RST & CLK are the reset and clock obviously. Count is the clock signal that goes two cycle for each click of the knob. Dir is the current direction of the knob, 0 for clockwise and 1 for counter-clockwise. Be sure to de-bounce the A & B inputs from the knob as they will have lots of noise and cause the state machine to be unstable. (more…)

Re-Mastering RiffTrax to DVD

After being a fan of MST3K for many years I was sad to see it go, but was able to entertain myself on DVDs of old episodes for awhile. So naturally I was thrilled I learned about RiffTrax and that most of the cast got back together and that they would finally be able to ‘riff’ new movies and shows. After thinking for awhile I figured the best way to show a RiffTrax to a group of friends was to re-master the with the RiffTrax on it, that way I could pause, fast forward, rewind, … without any trouble or syncing problems. Now after making a few of these I think I have been able to refine the process down to an art, so that I can crank one out within a hour or two, not including ripping, encoding, burning and so on. (more…)