Going from Arduino to ARM

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
okay in this video we're going to look at going from the arduino platform to the arm platform if you've been programming the Arduino Uno going to an arm microcontroller will be a big step now the arm I control is a very complex chip there's a very steep learning curve and the arm microcontroller is has very low power consumption high speed and lots of memory and that's why they use it in a lot of handheld devices so if you're serious about embedded programming you should have a look at the arm microcontroller now the arm I could controller I picked was made by STMicroelectronics and the part number is stm32f4 0-7 and it's on their discovery board what you see here now this arm is a 32-bit cortex m4 it has one megabyte of flash which you can write a large application has 100 192 K bytes of RAM and it has an ST link programmer which you see on the very top portion of the board here is a programmer that programs the microcontroller and the USB connector here actually powers the whole board and you could download your code through this connector into the chip into the microcontroller chip other things the attitude the board is a MEMS three axis accelerometer which you see here there's a MEMS digital microphone which is here there's a reset button the black button and there's a user push button the blue button and it's connected to the one of the GPIO s so you could download the data sheet for the stm32f4 zero seven from the website WWSD comm and you could check out all the other features now the biggest mistake I see people do when they learn a new microcontroller like this one here is to download the large IDE and all the software tools they could find then try to blink the onboard led well this micro is so complex that they get overwhelmed and they give up so the key is is to learn the inner workings of the microcontroller first the actual hardware inside the chip so next I'll show you the setup I use for learning the internal hardware of this microcontroller okay here's the setup that I use to exercise the features of the arm microcontroller on the disk reboard and if you look at the top of the board the USB connection that powers the board and the first thing I did I got a couple of 50 pin IDC headers like that connected together by ribbon cable and I connected them to both sides of the board so I could get access to all the pins so I could put my breadboard next to the IDC header and I could jumper any wires that I need for any projects that I want to do if you look on the right you can see a FTDI to serial adapter connected to some of the pins on the IDC header there that's connected into one of the you arts on the discovery board so you can see the TX and rx and ground line that's my backdoor into the discovery board so what I do I erased all the memory of discovery board and I load it in a fourth operating system onto the board it's called a fourth and it's written by CH ting and that's what I use to get access into the microcontroller itself so I could go into the microcontroller and I could walk around and I can look at the SPI poor it's like a look at the the I squared C ports I could play with the CRC generators the random generator random number generator so that's how I exercise the hardware on the board and you can see I have a little program running right now it's a toggle program and what it's doing every time I press the button its toggling the four LEDs the user LEDs so I have a little contact bounce software contact bounce program running to do that and I could actually run another program to show the the gyro okay in the last clip we saw the seller ometer map to the for user LEDs on a discovery board to give a gyro type display you look at the screen you can see the code there that ran that it was called gyro so basically what it did it read the x-axis value and the y axis value and depending on the value range it turned on the corresponding LEDs so right now I have teraterm running it's a serial terminal program running talking to the serial port of the arm which is the backdoor to the micro so right now I could actually send commands into the micro to do some tat to test code and what I could do I could actually read the x-axis of the seller ometer directly through a serial port so you see at the very bottom I have the x-axis question mark and then there's a dot and that means print to the screen and then many means to do it over and over again so if I if I activate that code you'll see that the x-axis value on the screen and I'll tilt I'll tilt the discovery board to change the values so the board right now is flat and I'll raise up one corner of the one edge of the board the x-axis up till it's vertical okay I'm vertical right now now I'll bring the board down to flat again so now we're flat now I'll bring the other other edge of the board up on SX x-axis and you can see the values change there so we're reading the Celeron right directly through the serial port now there's really no program involved I'm just manipulating the registers in the seller ometer so I'll bring it back down and now the board is flat again so next we'll have a look we'll go over to the CRC portion of the microcontroller and we'll play around with the CRC okay here's a bit of code that we could use to exercise their CRC generator on the discovery board I look up in the screen we can see the first two words CRC unable and CRC dot reset now those two words initialize your CRC generator so if we type the word in it they'll run those two words the next word is CRC and that takes whatever we type in the keyboard an inter sit into the CRC generator and question mark CRC will return the CRC check sum so we'll type the word in it to initialize the generator now we'll enter some data so we'll enter four bytes and I'll make it easy 1 2 3 4 5 6 7 8 so 1 2 is 1 byte 3 4 is the second byte in 5 6 7 8 then we type CRC they'll enter it into the CRC generator now if we type question mark CRC we'll get back to checksum so that there is our checksum for the 4 bytes 1 2 3 4 5 6 7 8 so if we send that code over say a radio that over a data radio and we send the checksum with it at the receiving end they can do the same calculation to see if the data is correct now one way to do that you could send the we could do that over again we go 1 2 3 4 5 6 7 8 CRC now we can actually put in the checksum CRC now we look at we put if we look at the checksum for that it should be 0 if it's correct and we get 0 so that means that that checked out ok so this is a technique that I use to learn their inner workings of the ARM processor
Info
Channel: 0033mer
Views: 94,577
Rating: undefined out of 5
Keywords: FORTH, ARM, Discovery, STM32F4, Arduino, ST.com, 32 bit, Microcontroller, CRC, MEMS, Gyro, Programming, Tera term, Serial Terminal, RS232, Ting, Uart, GPIO, eForth, UNO
Id: zhR_F5ANM_w
Channel Id: undefined
Length: 7min 59sec (479 seconds)
Published: Sat Dec 17 2016
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.