These last days have been difficult! I think this week we have worked on our project more than we have ever done since the beginning of ROSE! Yesterday night was one of the most exciting ones in my life (I’m not exaggertaing :p!) We managed to test our LED stripes, drill a piece of our railraod and put the stripe underneath… the result is a three times more beautiful railroad!! I’m so happy the stripes fit perfectly in the space below the railroad, although we’re still wondering how to manage the curves on the circuit….
On my part, I have started to think about our Software Architecture. I have therefore read about BlueZ, hcitool, gatttool and so on, to find out how to program the application that will be run on the Central Station. Then after discussing with Alexis on Tuesday, I temporarily switched to a more important question, namely how to manage the nrf51822 chips on the train and on the railroad switches (from a software viewpoint), above all the question whether or not we need an OS on our chip? Given that the SoftDevice BLE stack generates interrruptions on its own, it most probabaly wouldn’t be compatible with an OS running on the chip. If we absolutely need an OS then we should consider adding another microcontroller at the output of the nrf…. So I started to see what software mecanisms we need to implement on the train, and in fact apart from the PWM (for the motor and the lights on the train) there is nothing more (of course apart from the BLE app that will be managed by the SoftDevce). Good news : there aren’t PWM channels on the nrf!! Soooooo, last night Sam put me on the right track talking about the PPI, and the Task&Event mecanism. Therefore, I read a whole lot about all this, as well as GPIOTE modules and how to use them to “simulate” a PWM, by using a Timer peripheral in Compare mode and a GPIOTE controlling the GPIO that we want to PWM-control. I also found (once again after being put on the right track by Sam 😉 !) an example implemantation of a three channel PWM on the nrf on this very helpful website and dived into the code to understand what it does. Today, I will try to use it on our Evaluation Kit just to better understand how it works and then determine precisely whether or not we can be sure to be able to manage the train and the railraod switches in bare metal.
I wanted to talk about the motor as well because there has been a rather big change in our conception of the system -> we will no longer be using a “hand-made” H-bridge but rather a standalone H-bridge. After disussung with Alexis, we found out that with the previous model we had suggested, chances were high that there might be a shirtcircuit! So last night, Gleison and I found a model of an H-bridge (previsously suggested by Alexis to another group)… but it’s a bit more complicated than what we thought, to use it.. I didn’t have the time to have a closer look at it last night since I was busy datasheet-reading for the nrf, but hopefully today I will try and study that part a bit more.. we also need to determine what RC filter and what Zener diod we will be putting before the ADC input.
it’s the Iranian new year I will go further in discovering how to use the nrf in bare metal mode for our application.. and if time there is (I have a porject to do for my ATHENS week in parallel :\ !!) to determine how to control the H-bridge and the components for our RC filter and Zener diod.
We’ll keep you posted 🙂 !