Today we solved our Zigbee problem, it was really silly: we were not waiting enough time before and after entering the Zigbee’s command mode. We had a loop to do this waiting that worked fine, but since we programmed the System Boot with a clock twice as fast as before, the loop was not long enough anymore.
Since we had both motors and zigbee working well, Helen wrote a basic program to control the motors with the keyboard, sending directions through Zigbee.
Gabriel is working on driving our OLED screen. He wrote a program following the example in the datasheet but it did not work. It is difficult to debug because the bug can be either in software or in the pin assignment done in the Libero project (FPGA). We will re-check the pin assignment tomorrow. He also started working on a way to make it simpler to write the .dat file (the image to program the FPGA and the System Boot).
I wrote some code to use the encoders, and set the Libero project to set flags for the corresponding ADCs, so an interrupt would be generated when the measure in the ADC overcomes a certain threshold. For some reason I have not figured out yet, the interrupt routine is never called. For now I will leave the interrupt approach, and create a FreeRTOS task to monitor the ADC samples.
Possibly related posts: