Arduino Zero Pro: Review and Debugging
This is the Arduino 0 Pro released by Arduino, srl or Arduino org, and its a 32 bit compatible Arduino compatible microcontroller and its got the same sort of footprint as the Arduino Uno. Now, before we get really into it, there is a bit of controversy surrounding this board, because Arduino SRL split from Arduino LLC, which is arguing, oh Yahtzee, see and theres still got some stuff going around with the trademarks. So at the moment I consider this to be a clone board until any of those things are resolved and thats. How I see it so I dont mind buying this or getting hold of it. In fact, I got it from these guys cool components, theyre a lovely little company with a great team behind them and they have good support and they sent this to me to review so were gon na. Have a look at it. If you want to take a look at the core components, website theres a link in the description somewhere down there and you can have a look at their product page. So this is the Box. The 0 Pro comes in its just a little tiny thing: theres not much in here. Apart from the board and a couple of little bits of documentation, it doesnt come in any kind of anti static, shielding so Ill be careful, but I think Ive just grounded myself. So Id be ok, so this is what we get we get. Thank you for supporting our do.
We know again controversial so well. Get rid of that and a couple of stickers so well get rid of that too. So the zero power is a 3.3 volt 32 bit evolution of the uno former and its powered by a soundy 21. I think its GE 18 a actually ARM Cortex Intel chip and it runs it 48 megahertz its got 14. I Oh digital io running along the board there and its got 6 12 bit analog pins and one of those is actually an analog out. So its a deck capable of 10 bit precision. So I think its its analog 0 is the 10 bit DAC that that can be used. All of the pins will operate it 3.3 volts, but with a maximum of set mili amps out, which is likely to mean that youre going to need to use some external circuitry to drive something like a white LED through a transistor or something like that, because 7 Milliamps isnt an awful lot and that that is the limit. Unfortunately, in comparison with the uno that would have kicked out 40 milliamps per IO pin at maximum, you wouldnt usually run it like that, but certainly LED capable. It supports all of your normal communication type. So spi ITC its got cereal on board. It also has a virtual serial port. Well talk more about that in a minute, but it also supports Twi, J tank and SW D as well. Now, looking around this board, it seems very similar to maybe an Arduino or a Leonardo, but there are a couple of big things: youll notice on this board, first off youve got this blue sticker, which says limited edition now under that resides a chip, and that is The embedded, debugger and youll also notice.
There are two USB ports there. One of them says programming and one says native USB. Now the think of it up there with the limited edition sticker is the Atmel embedded debugger chip. Now this gives you a full hardware. Debugging interface and the native USB there is a its capable of being a USB host. It also power the board or it can be used to emulate a mouse or keyboard just like USB HID stuff or like on the Leonardo theres a theres, a different kind of power regulation going on as well. So you wont see a massive sort of linear regulator. Youll see that theyve got a switching regulator. Just there thats the LM two, seven three four seven switching step down chip and it means that it it steps down the voltage you put in either through the DC jack or through any of the USB s2 3.3 volts. Now the board itself has 256 kilobytes of flash memory available and 32 kilobytes of SRAM available. You also get 16 kilobytes of EEPROM, but apparently adapts by emulation Im, not sure what that means, whether that means some of the flash is is pushed towards this virtual EEPROM. Im not sure now, if we look at these two boards side by side, you wont notice much of a difference here. Some of the component placements is a little different. I think theyve used some different passive components, but essentially the whole board is the same.
So this is the Arduino dot C C or the Arduino LLC version, and this is the Arduino srl or Arduino dot. Org version the Arduino dot CC version hasnt been released, yet it says its coming soon still, but the srl version has been released. Now you can use their IDE, which is essentially the same as the Arduino dot C C IDE to program this board that works perfectly, but there hasnt yet been an official release on the Arduino CC website that covers their Arduino 0. Incidentally, the difference between the zero and the pro is its probably only really the fact this one says Pro and this one doesnt. There are no debugging options yet in the official IDE, but we can do that now using the Atmel studio and something called the visual micro, which is a plug in for Atmel studio. So lets take a look at it. Ok, once youve installed the arduino ide from arduino org, because thats the one that supports this board at the moment. Im using one point, five point: eight point: three: you can find that in the previous versions bit and you also install the Atmel studio with the visual micro plugin, you can get started so Ive written a little bit of code here. All it does is has a counter. It uses blinking without without delay, and it also has a couple of LEDs on there that are set via some boolean z here so Im going to upload that to the board itll take a few seconds.
This ones a little bit slow its uploading via the program port programming port. So it means that the board will completely erase the chip when its uploaded okay. So its started now were getting a little bit of extra information coming out on the output here and its saying its up via swd and its running at 500 kilohertz, I think thats, the the safe area for the chip to to run out so weve just got Our flashing LED going on here, thats coming from this interval here of 1 second or 1000 milliseconds. So we dont now need that all we need to do is copy all of that code and then we can get started. So what we want to do in at Mels studio is create a new project, so we click new project and then we need to create an Arduino sketch 32 bit do or 0 now. The beta version of visual micro supports the 0 at the moment, so were just going to create a sketch. We dont need to name it anything, but in particular so well go for the sketch one. So if you click OK now you cant upload using a pal studio just at the moment Im sure in the future, once the both of the boards from Arduino CC and how do we know all are released, then the the software will get updated. But for now we cant so once weve got our sketch loaded in the solution Explorer, we can open up.
The sketch were going to paste in everything weve written now. If youve got some libraries and stuff that youre using the visual micros software will pull that in. As well but Im not using any libraries Im just using the standard Arduino code and it pulls in all those dependencies as well, so we dont need to worry once weve done that Im just going to change the chip up here at the moment is defaulted to The do chip, which is the 80 Sam 3 X 80, were going to change that to the one thats used on the 0 Pro, which is an 80 Sam D, 21 g 18. A once it loads up will change the chip and then well well build our project Im, not sure if you need to change it to build a project, but I think its probably a good idea so well select Sam D, all parts scroll to near the bottom And there it is so we click, OK and you can see there. The supported tools include the EDB G, you better debugger, so well, just click Save well go back to our sketch and then we want to build build solution and youll see down here its gon na start building and there we go its finished and binary sketch size Is 10 kilobytes so once weve done that we can close the solution and wont click Save on this? So click, yes and then were going to open the solution for debugging, so open object file for debugging now weve already got the code on the device.
We did that with the IDE, so we dont need to worry about uploading through ml studio were going to select the file that we want so sketch 1 debug and its an elf file, which I think its very cute. But I dont know what Els stands for. So we just click open next and then its going to ask us to select the right chip that were using so device. Family is Sam D and we know its around the bottom there. It is and then we click finish and it will load that in and youll see, weve got our CPP file here, and this is our code. This is the same code that weve got on the device, so we now need to select our debug tool up here. You can see a bit where it says no tool, but we know theres an embedded debugger on the device, and it also knows that, because it knows about this chip and what it supports so on the Virtual comport and weve got this embedded debugger and thats. What we need to do – just click, Save, go back to our CT CPP file and then we can start debugging theres a little button here that says start debugging, but before we do that we want to add a trace or an interval trace on the interval or On the counter on anything really so what we can do is well go down to something that happens so weve got a counter adding here.
So if I right click, I can add a breakpoint insert a trace point and then I can get it to output that counter to our display. So all I need to write is the value is and then add our I put the wrong brackets in. You can add our variable and then close that and we can select whether we want it to break on that point or whether we want it to continue and we want it to continue just so. We can monitor that value. Then we can start debugging. So just click to start debugging and it will show the output once all of this starts. So weve got these sections here and we can see what the breakpoints are. We can see what the call stack command window, but we wont see the output, so you can see here its kicking out. This is without any serial print lines or anything like that, so its kicking out what the value is, if I just pause this now so I can click break all and that will pause the program. It jumps to the line that its just written and just been doing in the processor, so we can go back to our sketch. We can actually see whats in the memory here, so we can see the base flash and the user page. So these are pages the the stuff that weve written to the board and the flash is its current memory points. But if we go back here to counter, we can actually change the value of counter to 122, so currently its its so so currently it is sitting at 11.
But now, if I continue, we can click continue. It should show that the value is 122 unless its gone past that and were going to go on to 1 2. 3. So well, just click continue and they were going. Weve got 122 in the output, so weve changed a value thats currently in the program via the debugger. We can also do that with other things. So in my sketch here, Ive got an if statement. So if the value is a thousand, then its going to turn those LEDs on so lets pause again. So this is the point at where its broken in the program so lets change that value now to 997. So the counter now sits at 997 once it gets to a thousand its going to turn. Those LEDs on – and all I need to do now is click continue and just wait a couple of seconds and it will turn those LEDs on so a 998 999 1000 and then both of our LEDs are on. We can also turn those LEDs off now individually. Theyre being lit up based on a boolean, so if I go down here to LED one boolean, I can change that to a zero and then I need to also change the counter back to a value thats, not going to restart that. If statement there so Ive changed it back to 1. Now, if I can continue, the first LEDs can turn off or the second LED.
I think Ive done the wrong value, but so you can see that you can change these various points in here. You can also mess around with the code by running to a certain point, so we could right. Click here and say: run to cursor. So well only run the program up until that point, so its like setting a temporary break, but you just run that part of the program. So there we are and just run the program up until the previous movie. So now we can also run it to here, or we can just continue by stepping to the next statement each time so thats debugging on the arduino 0 pro using the Atmel studio and a great visual micro plugin, and i really advise that you pick it up Its a really nice way to learn how to do this so lets. Look at the pros and cons well start with the cons, because you know we should so the cons, ignoring the embedded, debugger and perhaps USB host the teens e 3.1 probably comes close to beating this in terms of features and its got a lot more software out There that support it and its also, there are many more examples out there of people using it in projects so its worthwhile having a look, but this, I really think, will be a nice board, especially when Arduino CC comes out with their or LLC comes out with Theirs there the community is going to take off massively, but the hardware is exactly the same.
If you rely on five volt electronics, which I sort of do most of the time, then youre gon na have a hard time dealing with 3.3 volt boards. Youre gon na have to do a lot of level. Shifting and youre gon na have to worry about providing two different types of power. Most of the time I dont know what the 5 volt pin on this board will kick out, but it may not be enough to drive some of the things that you want to drive, so you might have to look at powering some of your circuits separately, which Is some of something people where the Nuno might not be used to the software support isnt quite there? But it will be Im very sure that theyre going to come out with a new idea which supports this board, fit Arduino CC, but Arduino org also have those out now, but I think theyre gon na add Hardware debugging to the IDE Im, pretty sure of it. But in the meantime you can use visual micro and you can use things like Atmel studio or Visual Studio from Microsoft and theyre, both free products that you can pick up as a Community Edition that you can use. I was a little bit skeptical about how useful the embedded debugger would be, but Ive been completely turned around. I think its great to be able to see inside see what the chips doing. We have to pause it in your program and just say: stop there.
I want to check my values or change them or just completely stop the program. If you want to, I think it its a brilliant addition and its something Ill be looking into exploring further some of you out. There will have used embedded debuggers before, but its new to me, perhaps old hat to you, but Im very excited about it. Well, its got that extra memory so were looking at quite a hefty amount of space, really in comparison to a new. No many many of the Arduino development boards around at the moment it has a 48 megahertz processor.