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.

Thursday, February 14, 2013

The basic flow chart for the operation of this machine

After having a short conversation with our supervisor, he suggested us to draw a flow chart for the machine. The graph can help us to write the code for the machine.

The flow chart is shown below.
The flow chart for the machine