It seemed pretty straight forward to connect my PSoC4 keyboard to a micro:bit since the PSoC4 could already scan the keyboard and display the characters and the micro:bit program could already control its LCD. However I ran into no end of grief trying to make it happen. After I set up the PSoC in SPI slave mode there was just no output. careful monitoring of the micro:bit SPI discovered a couple of minor issues with the micro:bit program, but even after it was cleaned up, the PSoC just wasn't responding as expected. It is very tough to troubleshoot the slave since there were no signals to analyze. Of course I had goofed in picking an output mode for the SPI transmit pin, but it took an lot of digging in many wrong directions before I discovered it.
Then I ran into severe memory shortages with my micro:bit program. I found it very difficult to figure out how much memory is available in the micro:bit and how much is used. After much research I found the reason why I only had enough memory to store font patterns for 16 characters out of the 60 key on my keyboard was due to RAM limitations. Eventually, after trying a bunch of techniques to conserve memory I figured out how to embed the fonts entirely in FLASH memory. The following video shows the result.
It seems like a simple step forward, but this has been the toughest part of the project so far. Thankfully it is sorted out, but there is still significant work left to shoehorn a BLE stack into the micro:bit.
I think I will switch to mechanical tomorrow and get some packaging designed.
The big idea behind adding a keyboard and LCD to a micro:bit is to provide a low cost way for micro:bits to send text to each other.
When this all works the device will be the equivalent of a walkie-talkie except it will send text instead of voice.
The big question is what to call it?
Should it be:
- micro:bit textr
Please feel free to suggest other potential names in the comments below.
There is less than a week left in the project, so it is going to be a mad scramble to see how many of the remaining objectives can be achieved.
- how Stirling engines work
- micro:bit BLE radio
- start connecting some sensors to the PSoC6
- designing the sensor interface PCB
Links to other blogs for this project: