The MBED firmware used on the Chipin sorter, developed over 12 weeks for a 3rd year university systems project. Chipin is a token sorter, it sorts tokens by colours and dispenses them to order through an online booking system and card reader. This program interfaces with an FPGA, PC and LCD screen to control the sorter. The sorter has an operation mode where it can process orders when a card is entered into the machine. There is also a maintenance mode where the device responds to maintenance instructions such as 'dispense all'. More information at http://www.ionsystems.uk/
Dependencies: MCP23017 TCS3472_I2C WattBob_TextLCD mbed-rtos mbed
FPGAcomms.h@9:8d78eb55ad5e, 2014-11-10 (annotated)
- Committer:
- IonSystems
- Date:
- Mon Nov 10 19:01:43 2014 +0000
- Revision:
- 9:8d78eb55ad5e
- Parent:
- 8:b7771391adc9
- Child:
- 10:8c0696b99692
red dispenser currently controlled by button 2 on MBED for testing
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
IonSystems | 6:e64796f1f384 | 1 | #include "mbed.h" |
IonSystems | 6:e64796f1f384 | 2 | |
IonSystems | 6:e64796f1f384 | 3 | //Setup pins to FPGA |
IonSystems | 6:e64796f1f384 | 4 | DigitalOut startSort(p5); //A positive edge tells the FPGA to start sorting. |
IonSystems | 6:e64796f1f384 | 5 | |
IonSystems | 6:e64796f1f384 | 6 | /* |
IonSystems | 6:e64796f1f384 | 7 | The command codes for the three sort select bits(ColourBit1 - ColourBit2) |
IonSystems | 6:e64796f1f384 | 8 | 000 Sort red chip |
IonSystems | 6:e64796f1f384 | 9 | 001 Sort green chip |
IonSystems | 6:e64796f1f384 | 10 | 010 Sort blue chip |
IonSystems | 6:e64796f1f384 | 11 | 011 Bin the chip |
IonSystems | 6:e64796f1f384 | 12 | 100 Recycle the chip |
IonSystems | 6:e64796f1f384 | 13 | 101 Nothing |
IonSystems | 6:e64796f1f384 | 14 | 110 Nothing |
IonSystems | 6:e64796f1f384 | 15 | 111 Nothing |
IonSystems | 6:e64796f1f384 | 16 | */ |
IonSystems | 6:e64796f1f384 | 17 | |
IonSystems | 6:e64796f1f384 | 18 | DigitalOut colourBit1(p6); //The 3 bits below are select bits for the sorter. |
IonSystems | 6:e64796f1f384 | 19 | DigitalOut colourBit2(p7); |
IonSystems | 6:e64796f1f384 | 20 | DigitalOut colourBit3(p8); |
IonSystems | 9:8d78eb55ad5e | 21 | DigitalOut startDispense(p18); //A positive edge tells the FPGA to start dispensing. p9 |
IonSystems | 6:e64796f1f384 | 22 | /* |
IonSystems | 6:e64796f1f384 | 23 | 00 Dispense red chip |
IonSystems | 6:e64796f1f384 | 24 | 01 Dispense green chip |
IonSystems | 6:e64796f1f384 | 25 | 10 Dispense blue chip |
IonSystems | 6:e64796f1f384 | 26 | 11 Nothing |
IonSystems | 6:e64796f1f384 | 27 | */ |
IonSystems | 6:e64796f1f384 | 28 | |
IonSystems | 9:8d78eb55ad5e | 29 | DigitalOut dispenseBit1(p19); //The 2 bits below are select bits for the dispenser.p10 |
IonSystems | 9:8d78eb55ad5e | 30 | DigitalOut dispenseBit2(p20); //p11 |
IonSystems | 8:b7771391adc9 | 31 | |
IonSystems | 8:b7771391adc9 | 32 | DigitalIn complete(p12); //FPGA sets to 1 once complete until another signal is recieved. |
IonSystems | 8:b7771391adc9 | 33 | DigitalOut select(p15); //0 for control, 1 for maintenance. |