ESSAY UNI FREIBURG

Page 1

force table lab conclusion essay 05 13

app to write evolution writers on ipad 05 03

BHARATHIAR UNIVERSITY MBA PROJECT MANAGEMENT QUESTION PAPERS 09 02

english essay short 05 10

samsung ue f6740 review of literature 05 09

definition grand jury report 05 14

essay scholarships in georgia 05 09

bal diwas essay in marathi on mla 05 14

INTRODUCTION TO CRIMINOLOGY YORK UNIVERSITY 09 02

usb report descriptor hidden 05 08

help no baking evolution writers 05 03

is evolution writers safe 05 04

UNIVERSITY OF ROCHESTER SOURCES OF STRENGTH 09 02

dedication of thesis to late fathers 08 20

ruttman mini bike history report 05 13

research evolution writers thesis help 05 04

ganti nama facebook 2018 annual report 05 14

argumentative research evolution writers child abuse 05 04

midair disintegration a possibility says report 05 12

dadang solihin slideshare presentations 05 14

pioneer dvr 219lbk review of literature 08 20

DISSERTATION SUR LAGRICULTURE AMERICAN AIRLINE 08 30

ACADEMIC HISTORY REPORT 08 24

cd4852b review of literature 08 21


ENGINEERING HUMANITIES QUESTION PAPER KERALA UNIVERSITY 09 03

writing a report graphic organizer 05 08

COLLEGE UNIVERSITY LOS ANGELES 09 03

ABSTRACT UNISI INFERMIERISTICA 09 01

iat test essay 05 09

evolution writers trail 5 walkthrough 05 04

afrikaans evolution writers 3 formats 05 05

evolution writers mario the thousand year door help center 05 04

essay kaziranga national park 05 02

HOW TO LAYOUT A UNIVERSITY ASSIGNMENT 09 02

the chronicles of narnia magicians nephew book report 05 11

HAWASSA UNIVERSITY ONLINE GRADE REPORT 09 03

paper trail part 3 help 05 03

EMBU UNIVERSITY COLLEGE APPLICATION FORM 09 02

writing a cover letter for magazine internship 05 14

ANALYSIS POSCHEL UNI STUTTGART 09 04

essay meaning in hindi 05 02

how to make the best paper airplane ever youtube 05 12

smcgs801 review of literature 05 10

cause and effect essay topics for college 05 02

is international law really essay plan 05 08

wijdbeens reporte 05 08

SHORT LOAN FINES UNIVERSITY OF NOTTINGHAM 09 02

UNIJOS ADMISSION LIST 2019 09 02


sample of cover letter for teachers 05 12

K L UNIVERSITY APPLICATION FORM 2019 09 02

Clinton Community College ​[Applause] in this video I'm going to talk about and give a demonstration of a project I've been working on now for quite a while it's an Arduino sketch that you can program into most 80 mega 328p based arduino z' which lets it function as a hardware to bugger that can talk to another target chip in the AVR series which can be another arduino or in this case i'm going to be showing a demonstration using an eighty tiny chip an eight pen eighty tiny 85 mostly because that's a fairly simple chip to demonstrate with runs at a low clock speed that's but easier on my code but in theory my code can can work with any of these micro processors listed here any of the AVR series this is based around a system called debug wire which is built into the AVR series chips recently by Atmel and now owned by microchip and there's very little documentation available about debug wire but it's two individuals that I ran into David CW brown and and write this w which are links to their sites here did some initial work on that I wrote some code to take advantage of it I've expanded on that quite a bit to make this work and I'm going to describe basically how it does work if you've looked at a datasheet for an AVR series device like the eighteen twenty eighty five you'll see this feature listed under special microcontroller features which is debug wire on chip debug system but the rest of the datasheet that in my experience really says very little more about that but it's essentially a protocol that works via the reset pin most AVR chips actually respond to several different protocols for talking to them during development there's the AVR in system protocol which is what you've probably used to do you ever uploaded code directly using a programmer like an AVR isp mark ii or if you've ever used their arduino sketch arduino isp sketch this uses the the SPI interface and is a way to upload code and you can change fuses and so forth there's a separate protocol that's hardly used for useful that is called the AVR high voltage programming protocol it's a totally different protocol but it mostly does the same thing as the in system programming protocol but it requires applying 12 volts to the reset pin to gain control and I'll talk about that a little bit later because it's an important way to recover from a mistake should you happen to set some of the fuses incorrectly on your AVR device it's easy to do what's called bricking yet if you turn off certain fuses that basically switch off the ability to use this first protocol the only recourse is to use a second protocol to recover from it but I've designed my code even though I'm going to implement a portion of the in system programming protocol to let you set it clearer in particular fuse that's needed to make debug wire work I've coded in a way that hopefully it won't disturb any of the other fuses but just I'm just putting that out there as a background I'm going to be using a simple circuit for the 80-85 which looks like this these four pins over here are used to implement the the in system programming protocol which I'm only going to use to setting clear fuses the debug wire protocol only only makes use of the reset line which is usually pin one of these devices it requires a quote greater than 10k resistor as a pull-up to VCC that's about as much as this as the as the datasheet swell I often say about the debug wire protocol apparently and I consider it to be proprietary it's built into their more expensive ice debugging systems and then to the product called the the AVR dragon but I don't I don't own those products as a test feature you'll see what this is for later on I've also added an LED on pin three and a switch to pin two using these particular IO bits and I'll be using those to demonstrate certain features my debugger I wired this all up on a breadboard that looks like this since this is what's called a proto shield I got I buy these from inexpensively from China but you can buy one from Adafruit that's a lot nicer you can see the switch and the led wired up here on the other pins just go over to the depends to implement the different options that I showed on the schematic above I tend to use 80/20 85 you could use a 25 or a 45 but there's very little price difference and you get like four times as much RAM and flash an EEPROM on the 85 as you do on the 25 so it's only about a dollar 16 versus 76 cents on the low end so why bother with those unless there was some reason you wanted a shoehorn on every penny the in system programming protocol I briefly talked about that here I'm gonna skip over that because you're just gonna be using the code to make that work and that's all that's all those details are handled for you for setting and clearing fuses one special detail about debug wire is it works across a single pin which means you're going to be communicating with a a serial interface but the transmit and receive lines are both operating on the same pin and this can be a bit tricky so the simplified I wrote a library for the Arduino called the one pin serial library which is you can download at the bottom of this page along with the sketch that you need to download to implement my debugger you'll have to install that library and put a link on here too if you don't know how about how to install the library on Arduino that shows you how to do that it's pretty simple in order to have something to debug and I'm gonna write a simple sketch for the 80 to 85 however to do this you'll also need to download a package created by David seam Ellis was active in the audrina community we do


that by following this link and if you follow the instructions there it will upgrade your arduino ide to allow it to program a variety of the 80 tiny chips you'll have to have a a programmer to do that or you'll have to use the aforementioned arduino is be sketch but he talks about Thanatos webpage so I'm not going to repeat all those details just that when you program the chip make sure you select the 80/20 85 or assuming that's the chip you you're debugging with and a clock made of a clock rate of one megahertz then the sketchy which you can also download at the bottom of this page is very very straightforward it's just some low-level code to set up the LED bits as an output and the and the switch is an input that goes through a loop where it toggles the LED on and off really fast which is essentially gonna talk about so quickly I'm just gonna look like kind of a half intents of the LED and it's checking the input pin periodically and if the switch is pressed it's going to execute this instruction right here I'll describe what that does later but essentially it's our it's a a breakpoint that you can activate yeah now with the point where we have loaded the eighty tiny 85 sketch this contains the loop turning the LEDs on and off and the test for the switch that would press is going to actually get the SPECIAL break instruction and we're ready to actually debug in this code so I'm going to close this out now we're going to go over to the debug our debugger sketch though we need to upload this now to the Arduino but before we can do that we have to remove the 10 micro farad capacitor from the from the Arduino and we also have to move the connection from the 8 to 20 tens pin 8 VCC and move it back to the D 9 connection because the Arduino needs to be able to power cycle the 8090 8500 to switch it into debug mode so I've made those connections over here on the on the breadboard and then we're going to start up into bugger we see the ready prop but at this point we have not enabled the DW enable fuse that that enables the ability of debug wire to run because you can't program the chip while that fuse is set so anytime you switch back then you need to reprogram the 80 90 85 we're gonna have to remember to switch that fuse off we can verify the fuses by typing F and I can now type the plus sign and that will enable DW enable fuse at this point again if you were to try to reprogram the chip it wouldn't work you'd have to press the minus button or command to switch it off so I'm gonna leave it set and I'm gonna type the B command and that's gonna power cycle it's gonna bring up a chip in debug mode now at this point we have complete control over the chip it's stopped and we can definitely ask you different commands like for example we can list out the code and see the beginning of the code is a big jump table up here these are called the reset vectors and the first one is what cuz executed when when there's a power on and the code began executing it jumps down here to 1e and this is the first executable line of code this is some setup code the Arduino internally uses so the actual code that we wrote is much further down so before we get into that though I'm gonna this just in general commands I can list out memory in addition to disassembling it I can type fw 0 0 0 and list out the contents of flash memory by word and you can see those same relative jump instructions here that begin with a c 0 in front of them or i can list the same memory say FB i can list it in bytes and listing in bytes it shows the same information but it also shows the ASCII equivalent over here this is useful if you're using the F macro and the program M commands which are kind of an advanced topic but this lets you put the contents of ASCII strings into the flash memory which is an important space-saving convention now I can also type reset and that will reset reset and that will reset the processor and initialize all the registers to unique values so I can type regs at this point and see that the registers have initialized 0 1 2 3 4 in ascending order I want to change your register I can say for example F 2 equals 55 and our 3 equals 66 our 4 equals 88 now if I type whoops one of our commands doesn't take i type too many sixes there so let's do that again our three equals 66 okay now we can tack reg s re GS and see the change that we made our two is 55 our three or 66 and our four is 88 or if I wanted to look at them directly let me clear output again I could simply say our zero and I can look at our zero I get hit return and I can now paste down and watch the individual registers go in a similar fashion I can go look at the SRAM I can say SR am zero zero six zero which is the lowest memory that's available on the 80 to 85 because if the address spaces is actually shared with the i/o registers and that's a more advanced topic I can't get into but for now the lowest address you can look at what the SRAM command this is sixty on this chip I can set the contents of this if I want to I can say s B equals 22 and that sets the first byte to 22 oops no X sorry s be zero zero six zero equals 22 now sets it 22 if I do another SR am there zero six zero we can see that the first bytes changed to 22 I can also set the contests by word I can say s W 0 0 6 0 equals 1 2 3 4 and now if I type Astra here I am 60 or you'll see it has been set to 3 4 1 2 that's because the byte order is such that the the high order byte is the it's the second byte in the two word sequence or I can look at it by words by simply saying s W 0 0 6 0 and that will show me the contents in word again many of the commands auto repeat so if I hit return I'm gonna get which is it will have to hit send up here I can now page dad look at the rest of memory there's also a special feature for working with the i/o commands of we'll talk about those in a second the time being let's get reset again go back up to the top and I'm gonna type run and now the code is running and you'll see over here that the red light is on on the Arduino and that's because it's talking on and off at about half intensity if I hit break it's gonna stop at mid code notice the LED is


now out and I'm sitting on an instruction called SBI and that stands for set bit and the IO space is 18 is the output register and bit for is the one that's gonna set so if I actually single step here you'll see the LED now turn on if I hit return again I'll repeat the single step so we can actually watch it go around to the loop turn the LED back off this is gonna test the switch to see if it's pressed the i/o port that corresponds to that it doesn't the switch isn't detected so it jumps back at the top and that's gonna set the LED again now it's good to clear the LED again and so forth but likewise since I know the address is 18 I could simply say IO 0 0 1 8.4 equals 1 oops sorry io 8 zero said IR 18.4 equals 1 and then I'll turn the LED on black because it's IO address 18 bit for I want it set to 1 or I can set the entire address by lemon a ting the dot for I could simply say io 1 8 equals and the fourth bit is going to be sending it to a 10 so I'll set it to 0 0 that'll turn the LED off or I can say IO 18.4 equals 1 and then I can say I o18 done 4 equals 0 and turn it back off again so in this way you can directly manipulate many of the i/o registers you can't change them all because some are are ones that you really shouldn't mess with like this but it's a quick way of verifying that some i/o operations some particular connection is set up is actually working a way to to check out your board even before you've written the code you can we can upload the debugger and even if there's no programming inside the chip it'll let you mess around with the registers and turn things on and off so I'm gonna hit resume when it run again and it's gonna start running again and then I've hit a breakpoint whoops reset again go back up the top and clear it and type run and now if I hit the switch you'll see a break command tap in there as well no I get hit step and likewise I can step around and around and around but I'm done I can hit run and I'll forego again we're running again over time break again and we can stop so this way you can start and stop code now I'm going to go up and I'm list the code at zero zero zero zero again I'll show you another feature I'm going to set the code to run from zero zero zero zero I'm gonna set a hardware breakpoint to stop at this instruction right here zero zero zero three zero you have one built-in hardware register which you can program from the debugger and that'll set a breakpoint so you'll see it jump down there and notice how we've now stopped at location I've heard of you the location 30 which is a relative jump to more at this point we can do a step and watch the code step 234 and so forth so this is another useful feature I'm gonna type list there 0 3 2 and this is where we are currently execution notice how it's going to bring run some code so I can also type run space 0 0 3 8 to begin running from where we are but again senator Hardware break point at this location 0 0 3 8 and again we've hit the breakpoint at 0 0 3 down there so using this feature you can actually jump around put through your code and jump from section to section and and debug things so that's a quick introduction I don't think I've shown all the features this thing has but you can read more about them in the article that I've written it and and try out the code yourself as time progresses I'm going to making improvements to this so consider this sort of an alpha slash beta version it's functional but I can't guarantee everything's been thoroughly checked out but I think you may find it at least educational thanks for watching State University of New York Polytechnic Institute, Marcy.

https://Dissertation.space


Turn static files into dynamic content formats.

Create a flipbook
Issuu converts static files into: digital portfolios, online yearbooks, online catalogs, digital photo albums and more. Sign up and create your flipbook.