Week 4

Nick designed and laid out a protoboard for the player module and then spent 10 hours soldering it together.  We decided that soldering more modules would not be an efficient use of our time, which leaves us with only two player modules. Nick also added negative number functionality to the player module. He also drew a schematic of the player module.

Brandon added functional start and reset buttons to the host module and removed extraneous information about the touch screen from its display. He also fixed several small outstanding bugs with the interface and brought negative number functionality to the host module.

The large majority of the remaining work was done by both Nick and Brandon working together to troubleshoot issues.

The new set of Bluetooth chips arrived this week.  We assembled them and were able to successfully connect and communicate over them.  The host module is controlled via HCI protocols, meaning the host module needed to send, receive, and interpret specific op-code commands over the UART.  Although we had the basis of a library for this, there was a significant amount of converting and additional code required before we could use it on the PIC.  A major hurdle we had to overcome was that some of the op-codes contained special and reserved characters, such as line feed (\n, 0x0A) and carriage return (\r, 0x0D), which prevented directly printing the op-codes.  We ended up bypassing pt_cornell_1_2.h and writing our own UART print using functions from uart.h.

Communication from the host module to the player module works well, but only when the target player module address was hard-coded into host module.  We had an absurd amount of difficulty in trying to read from the player modules to the host module.  The correct data was confirmed to be showing up on the RX pin into the PIC, but the onboard UART module failed us.  We spent over 40 hours over the past four days trying to get just this functionality working.  By jury-rigging an error check accounting for overrun errors to also poll a value from a specific location in PT_term_buffer, we were able to get it about 70% working 30% of the time.

After a some research we came to the conclusion that the combination of Protothreads and the PIC itself makes reading the particular piece of data we care about out of the notification messages from our central Bluetooth (Low Energy) chip is exceptionally difficult.  An overrun error is when the UART receives new data before the old data is completely read.  When the error occurs, it throws a flag that locks up the receiver and prevents any further data from being read in.  Receiving large amounts of data at any baud rate very quickly will throw an overrun error and this was thrown when receiving data from the BLE chip and also when receiving multi-character data from the PC terminal.  We tried several ways to fix this like manually clearing the error flag and trying to salvage what was in the buffer when it was thrown.  Another way was to write our own UART read function to make sure we weren’t jumping to random places in the middle of our read to hopefully avoid the overrun error, but we had still had similar problems with freezing up mid-receive.  Ultimately, time became a factor and we abandoned the attempt.

As such, we are implementing a Plan B, which while significantly less complex, should also be achievable by Tuesday morning.  This Plan B is to have the host (the person, not the module) pick which player buzzed in first by eye (based on when the buzzers light up) and select that player on the LCD touch screen, which well turn off the other players’ lights and set the target module address in the software.  Nick modified the player module code for Plan B.  Brandon modified the host module code.

Week 3

This week was Thanksgiving, so time to work was limited.  We demonstrated that each individual module was working.  Our central Bluetooth chip also arrived and we began working with integrating that into our design.  The central unit was able to connect to all of the peripheral chips, but we are currently limited by the fact the central and peripheral chips have different baud rates.  We have ordered another set of Bluetooth chips as a backup in case we are unable to change the baud rate on either of the current chips.  They should arrive by the end of the week.  We no longer plan to create our own seven-segment display due to time and budget concerns, but we are still planning to solder the parts to a PCB and put it in a case. There are also a number of small things that need to be polished, such as cleaning up the LCD display.

Week 2

We added addresses and sources to the UART protocol we’ve been using for both debugging purposes and looking forward to when we will have more than one player.  Also we encountered a problem regarding our Bluetooth implementation.  LE Bluetooth requires both central and peripheral modules to operate but we only have a chip for the peripheral half.  On Friday we ordered a chip so that the host can act as the central hub of the peripheral Bluetooth modules, but it has yet to arrive.

Nick Falco continued to work on the player module, refining and improving it.  It now is battery powered and has three working single digit seven segment displays that draw voltage and current from the battery pack as opposed to the PIC. Bluetooth has been added to the player module and has been tested via bluetooth terminal.  The visitor module also will take direct commands from the host module when hard wired together.

Brandon Smith continued working on the host module.  The touchscreen is fully functional and the module is now running off of a battery pack as well.  A C++ compiler was found and added to the development environment to potentially make use of C++ libraries for the Bluetooth chips and a C library for running Arduino-based code on a PIC device.  The UART portion of the module is working when used on its own.  It also appears to work over Bluetooth, using one of the peripheral chips we have to test it.

The Bluetooth situation has caused significant delay to our progress.  While we have the peripheral module working we do not yet have the central module.  Other than that though we did manage to catch up to our schedule otherwise.  We still have some extra time to play around with but if we can’t get the central chip to work out we will start to fall dangerously behind.

Week 1

We began programming the player and host modules.  Brandon worked on the host module, and currently has the touch screen and scoring mostly functioning, but the UART communication has a few bugs that need to be dealt with.

Nick worked on the player module using a borrowed micro stick.  The buzzer input-capture and LED’s are in full operation and are controlled and communicate via UART.  The players score can also be controlled via UART.  The only problem is with the seven segment displays.  When outputting the values on the oscilloscope they look perfectly fine, but the results from the actual board tend to differ.  I believe and also hope that this is a current restriction on the PIC that we will be avoiding in the final product by using the battery packs and a MOSFET arrangement.

We were not able to start running the modules off batteries because the battery packs have not yet arrived.  Our Bluetooth modules have arrived, but still need to have their pins soldered to them, be attached to the circuits and be configured.  That is our plan for next week.  We also need to finish programming the modules.  If the batteries and voltages regulators arrive, we will also try to start running the modules from them.