Friday, March 1, 2013

The fifth lab day ( The test on the FPGA)

Today, we implement and test the design on the Altera DE1 board. The tests are successful.
Here is a example test.
First figure is the reset mode.

The reset mode
The second figure shows that the customer choose the product with the price of 70 penny. The SW3 is in logic 1.

Choose product of 70p

Then the customer press the pushbutton KEY3 to input 1 pound. The figure shows the result. The 7 segments display shows the change. The red LEDR3 is turned on to represent that the product has been dispensed successfully. And the green LEDG0 and LEDG3 represent one 10p and one 20p respectively.

After the input one pound

Wednesday, February 27, 2013

To assign the pin numbers

According to the reference manual for the cyclone II FPGA board, we now need to allocate the pin number to the inputs and outputs.

For the push button switches, we use them to represent the input coins.
Key3: 1 pound   key2: 50 penny   key1: 20 penny   key0: 10 penny

For the toggle switches, we use them to reset, cancel buy and choose product.
SW9: RESET  SW8: Cancel buy  SW7: product 150p  SW6: product 140p  SW5: product 120p
SW4: product 100p   SW3: product 70p  SW2: product 50p  SW1: product 40p SW0: product 30p

For the seven segment display, it is used to display the price of the chosen product for the customer. And it is also used to display the change that should be returned to the customer.

For the eight red LEDs (LEDR[7] to LEDR [0]), they are used to indicate that the product has been dispensed successfully.

For the eight green LEDs (LEDG[7] to LEDG[0]), they are used to indicate that the changes.

Monday, February 25, 2013

The whole connection of the internal circuit

After several days, we complete the codes for each components of the vending machine controller. Then, we try to combine each component into a single package.
The block diagram for the system is shown below.
The structure of the vending machine controller

Friday, February 22, 2013

The fourth lab day (Controller and Displayer)

Today is the fourth lab day. The task is to design the display component. Then we need to write the core of the system, which is the controller.

The fifth component is the displayer, which is used to display the price of the product and the change.
Here is the partial code for the displayer.


The partial code for displayer
 
 The controller is the cpu of the whole system, which send signals to display the information, dispense product or return the change.
Here is the partial code for the controller.

The partial code for controller

Wednesday, February 20, 2013

Product Selector and Product Dropper

The third component is the product selector, which is the part that allows the customer to choose the product.
Here is the partial VHDL code.


The partial code for the product selector
The  component is the product dropper, which is used to indicate that the product is dispensed.
Here is the partial VHDL code.
The partial code for the product dropper

Monday, February 18, 2013

Coin Receiver and Coin Changer

In this weekend, my partner and I decided to explore the different kinds of vending machine in the campus. And write the code for the

The first place is the central teaching building. The second place is the electronic and electrical building. After using these vending machines, we instantly found that we need to add the display part for the customor.

In this project, I really found that it is so interesting to apply what we know to the real life.

The first component is the coin receiver, which is the part that allows the customer to insert the coins.
Here is the partial VHDL code.


The partial code for the coin receiver
The second component is the coin changer, which is the part that cotrols the changes.
Here is the partial VHDL code.

The partial code for coin changer

Friday, February 15, 2013

The third lab day

Today, we offically begin to write the code for our vending machine.
1. The first decision we made is to write the code in VHDL. After doing the research, we found that VHDL is easier to write and more efficiency.

2. Then we try to design the top level structure of the vending machine. We think that there should be five components for the vending machine. Coin receiver, product selector, controller, product dropper and the coin changer. We decided to write separated codes for each part and then combine them into a single simple package.

3. In this project, we use the softeware Altera Quartus II and the DE1 development board.