An intro to the CANPico board

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
hi my name is dr ken tindall and i am the cto of canis labs i'm here today to give an overview of the can pico board that connects a raspberry pi pico to canvas so here is the board and i'll just give a quick overview of the functions of the board this here is the can controller and the can transceiver and then we have a couple of jumper pins here this one is to disable uh transmitter so when this is not closed the this board cannot uh transmit on the can bus which is uh useful in case we don't want to screw up a can bus that we're trying to monitor by some software that's gone crazy this is a jumper to add in a termination resistor the 120 ohm termination resistor that's standard on can bus in case we're working on a bus that we haven't got termination for this is the screw terminal that connects up to the can bus uh the can high can low and there's an extra signal in the middle for uh grounding to the target ground and then down here we have the instrument header so ground a trigger pin that we can use in software on the raspberry pi pico to drive a pulse on that to trigger instruments when something interesting happened we have the two digital lines rx and tx from the can transceiver and we have the analog can high and can low lines so here we would put an oscilloscope and on these we would put a logic analyzer right i'm going to now show you how to actually install a raspberry pi pico on the pico board so this is a jig made from some breadboard and some header and it's quite simple the header pins here and red i've removed all the header pins that are connected to uh the can pico board so all the other pins are there just to hold the uh the raspberry pi pico in place and i put some markers here in yellow so we know where to solder so if we drop the canned pico down on top of the jig then the raspberry pi picot goes down here so then we just run solder into the half moon pins on the raspberry pi pico and then we've soldered it down so here's a couple of boards i've put together soldered down the raspberry pi picos and assembled it and here is a little tiny maybe not the world's shortest but a very short piece of twisted pair can bus that connects them up i haven't connected up the grounds here because the usb power for both of these comes out of the same hub so they have a common ground reference already and you can see the jumpers are in place so this terminates the bus at either end and both boards are allowed to transmit so we have the transmit interlock pin jumper enabled here so let's have a look at the software side of things both of these boards have had firmware um put onto them which is a micropython firmware that's available from our github repository and that provides a a can interface to these uh to the can picker board and one of the easiest ways to drive micropython is from the uh tony ide there's just a few things when installing tony you have to to be aware of firstly uh it needs to begin to have the the back end drivers for the pico installed but if we also open the options out here another one of these is uh by default uh depending on the version installed uh it may only have a single tiny instance and here we want uh two one board and the other board so we need to allow that to have more than one instance and then uh the second thing to bear in mind we obviously select the raspberry pi pico as the back end but in the board here we actually have two uh usb ports so our custom micro python firmware has two serial ports enabled one is running on the uh the command line rifle which is what tony uses and the second one is a generic serial port that we can use for communicating from the pico back to the host i'll talk about that another time we have built into the firmware a reliable transport protocol over usb serial that we can use then to control these these boards from a host pc so if i leave that there so if i just reset this instance we can see here this is telling us this is the can pico build firmware and it's the 1.15 version of micropython that it's uh it's built from now if we use mark the tony ide we can actually open files and store them on the raspberry pi pico so here is a file that uh again this file comes from our github repository and you can drop it in using tony and it just has some very simple uh example code that just sets the stuff up to produce typing um when you're playing so for example there's a an identify uh function we can call up here that flashes the leds so if you've got multiple boards uh running you can see which board is which it's quite easy to get get them all mixed up and there are some other functions in here one of them that's very very useful is a function called mon which just spins in a loop receiving can frames through the api and then just print them out so it's the simplest can bus monitor in the world so let's have a look at the can api okay so let us bring in the example file above that brings in a bunch of definitions for us and saves us all our typing and we create an instance of account controller and then we just create an instance of our library and we say to use the game controller and we'll do the same on the other side like so now we are ready to create some cam frames and send them on the can bus so let's create a can frame that's can frame that's five bytes long and has a hex um ascii hex equivalent of the payload hello and in fact this we can see it's back into ascii text right let's create another one okay so now we are ready to send a couple of frames on the can bus so one of the easiest ways to do this is to use the is to use the pythonic form of asking for two variables so we're ready to pick those up so if we send the frames now they've gone on the canvas now they're sitting here in the receive buffer so if we pick them up there is hello and there is world and that is how we send frames on the can bus with can pico so uh let's have a look at uh the logic analyzer uh feature of the can picker board and let's install the logic analyzer protocol decoder and we tell it that the line coming in for the can rx is the canon x line there's a few things we need to get right for example setting up a pre-trigger capture a buffer otherwise the decoder doesn't know where to start the cam frame received from and we only want half a millisecond of sample time so if we um the logic analyzer and send the hello frame here's the cam frame signal on the can transceiver and if we go in and show it to ascii there is our hello world frame okay that's the end of our intro tour to the can pico um there's lots and lots of other features we're going to look at in the future but for now thanks for watching
Info
Channel: kentindell
Views: 1,932
Rating: undefined out of 5
Keywords:
Id: MmRj8UEvXXM
Channel Id: undefined
Length: 10min 52sec (652 seconds)
Published: Mon May 24 2021
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.