For the final project of ECEN 2400 Applications of Embedded Systems, Nayef, Luke, and I wanted to create a retro game controller that utlized wireless communication since most retro controllers use wires due to hardware limitations of old systems.
With this in mind, we would have to use the controller on a emulator on PC that way we could communicate through bluetooth. This controller was created using the Sparkfun nRF52840 mini breakbout board. It has 5 face buttons including 2 side triggers on the rear side. It communicates with a slave over BLE and UART. ADC for the thumbstick is still in Progress To communicate with the PC, we would have to program an arduino based board (ESP32, Arduino Micro w/BLE module, etc) to connect with our nRF over BLE and decipher the characteristics being sent from the nRF. By doing this through arduino, we would be able to utilize libraries that already work with the PC to give it controller inputs
Functional Block DiagramFor the PCB, we designed a full schematic and layout using EAGLE from Autodesk. We wanted it to act as a shield for the nRF and have it protrude out the rear so that we could access the micro-USB and battery connectors while housed inside the enclosure. We had a pretty simple design, so creating the PCB wasn't too difficult. We had to include mounts for 7 buttons, an analog stick, and then the headers for the nRF.
To debug some of the project, we had to figure out how to properly connect into an ARM chip since the nRF we're using doesn't have built in capabilities for debugging. This lead us to the J-Link EDU Mini programmer. With the inclusion of several VS Code extensions, we were finally able to debug it similar to how we debugged on Code Composer Studio with the MSP432.
One part that we debugged completely was the UART. To figure out if we were properly writing a UART string to the TX pin, Nayef created several test cases for each button and directional inputs that we properly translated into our button interrupt handler later. We also verified these findings using several Nordic apps such as nRF Connect and nRF Toolbox. In nRF Connect, we were able to harvest our respective boards address which would be needed for connecting directly to the arduino boards to be used for PC integration. We had to use the android version to obtain this, since it seems that the iOS version does not have permissions to access this data. We also were able to use these apps to verify proper data transmission of each button press.
To further create a fully functioning system, we have to figure out how to connect our nRF to an arduino board over BLE and possibly using physical UART connections. There are existing arduino libraries that allow for data from the arduino to be processed as controller inputs with Window's built in USB Controller features. Also, we must fully figure out our ADC in order to break down our analog input into four directional inputs. Once we have all of this complete, we believe that with a bit more debugging and ironing out some issues, this should be a controller that can play retro games on a PC emulator.
Comments