It may seem like this is just a natural continuation of my Week 10 post, but I'll reveal to you a little secret. I'm actually writing this one day before the final review lol.
Anyway, that is inconsequential. What does matter though is that I managed to get two boards to speak to each other. This week's assignment was a bit tough for me, I'm not gonna lie. First of all, my SAMD21E breakout board mothership had to be milled and stuffed twice. It then proceeded to refuse compliance on multiple occasions. I didn't actually get to the reason behind its refusal to work but I assume it was somehting to do with my incorrect way of using EDBG. I realised that as I was bootloading it I didn't change the samd11 part of edbg.exe -e -b -t samd11 -pv -f sam_ba_Generic_x21E_SAMD21E17A.bin to samd21. What is actually weird about this is that the board bootloaded successfully and, as I uploaded a simple blink sketch, everything was working as expected. It was only later that board began refusing to show up on my comm ports. Uploading new IDE sketches either gave weird errors about communication issues or simply saying that nothing is connected to that particular port I picked.
So I decided to give up on the 21E (which is a shame... I actually really want to graduate to using the 21E since I also learnt how to handle the solder paste a little more proficiently and was drawn to its higher Flashable memory). Well, I reverted back to my comfortable space and redid my mothership board with a SAMD11C. I also wanted to experiment with bootloading via Arduino IDE and create a node board that didn't have a USB connection. I spoke to Anthony about how does one do it and he pointed me to Neil's SAMD11C Free-DAP board hidden on the Embedded Programming week's website.
Ok, I'm a little lazy today... How about I dump all the images I have for this week and go through all that needs going through? Alright boo:
From biggest to smallest: 21E breakout mothership, USB-less solenoid control node, Free-DAP baby programmer.
21E Mothership
11C Mothership
Solenoid control node
Solenoid control node with USB
So I guess there it is. Oh, and one more thing... The .ino sketches:
Motherhsip sketch
Node sketch
Right. So now you see what's up. The Mothership opens up a USB connection with my laptop and a serial connection with the Node board. It is looking out for a String command in my serial monitor. If you say the right thing ie. "on" or "off" the light on both the Mothership and the Node will turn on or off. Pretty simple. I'm glad it ended up working. You'll also notice that I define a MOSFET pin on my Node board since I'm trying to streamline the way I trigger the solenoid on my device to from my laptop and not from a built-in button on the side of my project box. If this is jibberish, go to my Final Project page and hopefully I'll do a better job of explaining it.
Even though I managed to get the node board to light up when I typed "on" I wasn't able to get it to trigger the MOSFET. At this stage idk if this is because I was careless when designing my Node board (I don't think it's that since it's the same set up as my Input Devices board that actually controls the solenoid successfully) or whether something has broken on the circuit locally. I know one more thing to try to get it to work but I don't think I'll do it before tomorrow...
Oh, also, note to future self: remember to switch the RxTx pins on the Node's 2x02 pinheader. You want to be talking to the other boards "ear" instead of its "mouth".