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

Revision:
6:e64796f1f384
Child:
8:b7771391adc9
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/FPGAcomms.h	Fri Nov 07 20:16:23 2014 +0000
@@ -0,0 +1,30 @@
+#include "mbed.h"
+
+//Setup pins to FPGA
+DigitalOut startSort(p5);       //A positive edge tells the FPGA to start sorting.
+
+/*
+  The command codes for the three sort select bits(ColourBit1 - ColourBit2)
+    000     Sort red chip
+    001     Sort green chip
+    010     Sort blue chip
+    011     Bin the chip
+    100     Recycle the chip
+    101     Nothing
+    110     Nothing
+    111     Nothing
+*/
+
+DigitalOut colourBit1(p6);      //The 3 bits below are select bits for the sorter.
+DigitalOut colourBit2(p7);
+DigitalOut colourBit3(p8);
+DigitalOut startDispense(p9);   //A positive edge tells the FPGA to start dispensing.
+/*
+    00      Dispense red chip
+    01      Dispense green chip
+    10      Dispense blue chip
+    11      Nothing
+*/
+
+DigitalOut DispenseBit1(p10);  //The 2 bits below are select bits for the dispenser.
+DigitalOut DispenseBit2(p11);