Mike Collins
Mike Collins
  • 19
  • 274 610
Strobe tutorial 2
Tutorial 2 for the design and build of a stroboscope capable of flashing from 2 flashes per second (fps) up to 200 fps. This can make a disk, rotating from 120 RPM to 12,000 RPM, appear to stop.
There are two videos - Strobe tutorial 1 (9:13) and Strobe tutorial 2 ( 13:15)
Please see the design document (stroboscope_1.doc)
and assembly code source file (strobe_code.asm) on Google Drive
drive.google.com/drive/folders/1_jlyxPEHAJKLUYk3AN3dzkq6PfucOVTB
I hope you find it interesting.
Переглядів: 138

Відео

Strobe tutorial 1
Переглядів 1293 роки тому
Tutorial 2 for the design and build of a stroboscope capable of flashing from 2 flashes per second (fps) up to 200 fps. This can make a disk, rotating from 120 RPM to 12,000 RPM, appear to stop. There are two videos - Strobe tutorial 1 (9:13) and Strobe tutorial 2 ( 13:15) Please see the design document (stroboscope_1.doc) and assembly code source file (strobe_code.asm) on Google Drive drive.go...
A useful Utility for debugging AVR issues after compilation. See description.
Переглядів 1393 роки тому
A useful utility for when a compiled program does not run. When the programmed chip is connected in circuit, it sits there and the desired result does not happen. This utility allows you to find out the contents of registers. Code for this utility can be found at drive.google.com/file/d/1bgcvwbUoNsYoSXUANi0t130rJJZmmkNF/view?usp=sharing Display the file "main.asm" as text, copy it and paste it ...
Unexplained optical effect
Переглядів 1103 роки тому
There is an effect in the interaction between my camera frame rate and a stroboscope flash rate that I can't explain. Can you? Please? Pretty please!
AT85 Assembler Tutorial Part 4 Vectors, Interrupts and more
Переглядів 2,1 тис.6 років тому
Please see playlist of all 7 videos in this course ua-cam.com/video/9HDLc40Gmac/v-deo.html&list=PLuCmHWky5GN4iyRNNchJ4GMcVCSOgdOvc&index=1 Part 4 Vectors, Interrupts and more. Vector Table template drive.google.com/open?id=1eCXTeFqTcNCgLYarcr98S0GHBRIAhQLd Tut 4 Example 1 drive.google.com/open?id=15ObHaoAYlL7MZCygYVMObJGOqdy7cYpY Tut 4 Example 2 drive.google.com/open?id=1QRS08wIGM-Eo4YWNjAvkuvI...
ATtiny Assembler Programming Part 6 The Timer
Переглядів 2,2 тис.6 років тому
Please see playlist of all 7 videos in this course ua-cam.com/video/9HDLc40Gmac/v-deo.html&list=PLuCmHWky5GN4iyRNNchJ4GMcVCSOgdOvc&index=1 Part 6 - description of the One-button Timer. Description of a timer based on the ATtiny85, which controls a relay that can switch the mains electricity on and off. The timer is programmed and controlled with a single button, and its timing period can be set...
ATtiny Assembler Tutorial Part 5 - Getting more from the timer
Переглядів 1,1 тис.6 років тому
Please see playlist of all 7 videos in this course ua-cam.com/video/9HDLc40Gmac/v-deo.html&list=PLuCmHWky5GN4iyRNNchJ4GMcVCSOgdOvc&index=1 Part 5. Programming examples Example 5a drive.google.com/open?id=1QvNAiExxrAOirtdwg1eiqO7ddDlScwqD Example 5b drive.google.com/open?id=17X7T4YBTl02TGNjlIi7tIGuKi-_qNQKj Example 5c drive.google.com/open?id=13OvA-xUIJ_aMOcQVNW6daIyXRshctzXs Example 5d drive.go...
ATtiny Assembler Tutorial Part 3 - time delays
Переглядів 4,4 тис.6 років тому
Please see playlist of all 7 videos in this course ua-cam.com/video/9HDLc40Gmac/v-deo.html&list=PLuCmHWky5GN4iyRNNchJ4GMcVCSOgdOvc&index=1 Part 3 Reasons for using delays in a real project : 2:20 Generating a delay that you might use in-line in a program, where you don't want to use the internal timers to do it (eg if they are already in use) 6:30 Using the internal Timer-0 : 14:13 6 LEDs schem...
Atmel Studio 7 Walk through
Переглядів 7 тис.6 років тому
Please see playlist of all 7 videos in this course ua-cam.com/video/9HDLc40Gmac/v-deo.html&list=PLuCmHWky5GN4iyRNNchJ4GMcVCSOgdOvc&index=1 This part of the course should go between Part 2 and Part 3. It is a walk-through of the features of the Atmel Studio 7 IDE Handy shortcut keys ... F11 : Single step (Steps all instructions, including into subroutines) F10 : Single step (Same as F11, but ste...
ATtiny Assembler Tutorial Part 2 - Resources and Studio-7 walk through
Переглядів 8 тис.6 років тому
Please see playlist of all 7 videos in this course ua-cam.com/video/9HDLc40Gmac/v-deo.html&list=PLuCmHWky5GN4iyRNNchJ4GMcVCSOgdOvc&index=1 Part 2 - Collecting and installing the requirements for doing meaningful things with Atmel AVR micro-controllers, with focus on the ATtiny85... 1. Download and install the Arduino IDE www.arduino.cc/en/Main/OldSoftwareReleases Note: AVRDude is part of this d...
ATtiny Assembler Tutorial Part 1 - Introduction
Переглядів 11 тис.6 років тому
Please see playlist of all 7 videos in this course ua-cam.com/video/9HDLc40Gmac/v-deo.html&list=PLuCmHWky5GN4iyRNNchJ4GMcVCSOgdOvc&index=1 Part 1 - 10-minute introduction to my Microchip/Atmel AVR ATtiny Assembler Programming course. The micro-controllers in the Atmel AVR range come in different sizes, but they all use a common architecture and instruction set, so this course on the ATtiny85 wi...
Citroen Xsara Picasso 1.6 HDi - Changing Maxi fuses
Переглядів 232 тис.7 років тому
Changing maxi-fuse on a Citroen Xsara Picasso 1.6 HDi.
FT Explorer - Second day
Переглядів 1708 років тому
Blue skies, clear day. Sunshine! Nice!
FT Explorer Maiden Flight
Переглядів 3 тис.8 років тому
This is my second Explorer, but I'm a novice pilot, and the first one didn't last very long. I wonder how many I'll get through before I can finally fly reliably ...
Carving Part 2b Making the prototype
Переглядів 14610 років тому
Making the prototype to be copied on the copy carver. Leaves, stems, bunches of grapes and a bit of wildlife, were made from Fimo and hardened in the oven, then glued onto a piece of plywood, to form a prototype that could be copied onto oak using a copy carver.
Carving Part 2a Preparing the prototype
Переглядів 24910 років тому
Carving Part 2a Preparing the prototype
Carving Part 1 intro
Переглядів 24910 років тому
Carving Part 1 intro
Carving Part 3 - copy carving
Переглядів 1,2 тис.10 років тому
Carving Part 3 - copy carving
Mia Carlotta.MOV
Переглядів 1,4 тис.12 років тому
Mia Carlotta.MOV

КОМЕНТАРІ

  • @TTrunKK
    @TTrunKK 3 місяці тому

    why did you stop uploading!!

    • @DownhillAllTheWay
      @DownhillAllTheWay 3 місяці тому

      UA-cam says this video was from 2 years ago - but it was actually from about 8 years ago, and it has 3 comments. You can see that the things that interest me are minority interests. I guess I just felt that it wasn't worth the time I spent on it. But I'm glad you liked it. Thanks for the comment! If you look for it, I did a multi-part course on programming the ATTiny85. Some people showed some interest - but not many.

  • @シlenouシ
    @シlenouシ 8 місяців тому

    Slt ta PA 1 numéro de téléphone mike

  • @MS-yz7sr
    @MS-yz7sr 11 місяців тому

    That doesn't even make sense to me, but am curious why the surfaces aren't lighting up around where that light is. It would be better if your camera was on a tripod and not being moved. Same with the strobescope... Which you're already not moving... I'd love to see what it looks like shot in a higher frame rate... Like, do you have an iphone? Try making a slowmo video. Although, whenever I make a slowmo video on iphone and there are LED's in the shot, they flash on and off. So it picks it up and I think that is 60f/s but I'm not 100% sure about that. Could it be interference from other LEDs, lights or flashes? Also, does this happen when it's completely dark? In the space you're filming in?

    • @DownhillAllTheWay
      @DownhillAllTheWay 11 місяців тому

      Firstly, thanks for taking an interest. In fact, this video is about 4 years old now, even though UA-cam says it is less, so i should probably delete it. The strobe was trashed a while back in a clear-up operation. The reason why the surfaces re not lighting up is easy to explain. When the strobe flashes, it lights up the surfaces around it, but if the camera shutter is not open at that instant, it will not capture it. I don't have a smartphone or any other means to take a slo-mo video, but i know that if the camera's frame rate was high enough, the strobe would appear to be bright all the time, as it did when i was viewing it. The effect is not due to interference of any sort - because the LEDs in the strobe have a 3 x 3 matrix, which is clearly visible in the ghost image shown. It's definitly an image of the strobe that is seen - i just don't know why it drifts down the screen like that, and can still be seen when the actual LEDs are out of frame! I think it's due to burning an impression into the camera retina chip, which takes a moment to fade - but I have never fully explaind the phenomenon to myself.

  • @Player-pj9kt
    @Player-pj9kt 11 місяців тому

    I think a better example are yoyr feet when waling and car tires (or anything that rolls)

    • @DownhillAllTheWay
      @DownhillAllTheWay 11 місяців тому

      Hmmm... Strobing your feet when walking means a *_very_* slow flash rate, which would mean long periods of dark. Sorry to differ, but I think it would make a really poor example - at least, to demonstrate on UA-cam.

    • @Player-pj9kt
      @Player-pj9kt 11 місяців тому

      @@DownhillAllTheWay Apologies I replied to the wrong video. However I watched your video and I thought it was informative. I saw another guy making a 3d stroboscope - he made a bunch of 3d models of frogs jumping over each other and glued them to a spinning platform. Perhaps you could try the same thing with your method?

  • @jesusjimenez7378
    @jesusjimenez7378 Рік тому

    Nose lo ke pone masi fuse ke es eso

    • @DownhillAllTheWay
      @DownhillAllTheWay Рік тому

      I discovered the Maxi fuses when my car died almost completely. The headlights still worked, so I knew the battery was OK, but the engine wpouold not turn. I was told by people online that it seemed like a Maxi-fuse problem, so I started making enquiries about where they are. There are two sets of fuses - one in the dashboard, and one where I show in the video. In my case, my advisers were correct - it was a Maxi-fuse. I replaced it, and I have never had any trouble since then. The car is 17 years old, and still giving me good service.

  • @autisticdrone.
    @autisticdrone. Рік тому

    Very good video. I will keep this in mind if needed for my picasso.👍

  • @wormwood6424
    @wormwood6424 Рік тому

    It looks like it helped about 200k people 😅

    • @DownhillAllTheWay
      @DownhillAllTheWay Рік тому

      Well I haven't had replies from that many (thankfully!), but as you see from the comments, it seems to have helped some. I made thwe vid because I also had a struggle to find the maxi-fuses. They seem to have been deliberately hidden away. Right now, I'm trying to find the timer that decides whether the push on the window winder button was a short one (less than half a second) or a long one. I have a case opened with the French Car Forum, and I'll update that if I ever find it. ATM, it takes 15 pushes to get the window all the way down or all the way up.

    • @wormwood6424
      @wormwood6424 Рік тому

      @@DownhillAllTheWay I think I need to join them too. There are different variations of picasso and hardly any are the same as this one. I'm looking now for possible coolant leak. It's a brilliant car and if I get another it will be the same car lol.

  • @wormwood6424
    @wormwood6424 Рік тому

    Hallelujah lol...finally found the right vid!...thanks xx

  • @online-xg3xn
    @online-xg3xn Рік тому

    Mike . Again thanks a lot for the assembler code video .. They helped me so much !! Going forward in the process of coding I am looking to assembly code a watchdog timer with interrupt to save energy. I do manage to set the : Vector table Timer prescale in register (WDTCR) 32ms Enable the time out interrupt in register (WDTCR) Watchdog Reset Flag in register (MCUSR) Sleep mode in register (MCUCR) Set global interrupt and put in sleep mode .. But after, I am not able to get it out of the sleep mode ( in fact yes but after 2 098,94 ms ) I have spend a lot of hours read the AVR doc without being able to find the issue by myself. I think i do miss one link between the interrupt and the SREG but I am here looking for help. so if you have some time to spend please don't hesitate to respond to me. :)

    • @DownhillAllTheWay
      @DownhillAllTheWay Рік тому

      Oh wow! I'm pretty rusty on the AT85 now, as I have hardly looked at it since writing the course. I was thinking of writing a bit of simple code to drive a stepper motor (my 8-year-old grandson is fascinated by them), but that's relatively trivial. If you are busy writing code on it and thinking about it now, then you are probably far more expert on it than I am *_at the moment._* How big is your program? Is it small enough to post it in a comment? I could make a local copy of it, after which you could delete it if you wanted to. But even if I get it, I can't make any promises other than that I'll give a go. Maybe in discussing it between us, something will occur to one of us. Is there only one sleep mode on the chip? Could it be that it can't come to life again because it's unable to process anything because it's sound asleep? It's a distant memory of a feature that I never used, but I have a recollection of a sleep mode where it could count the time asleep in order to wake up, and a total energy saving sleep more where it couldn't do that. I'll do a bit of rooting around.

    • @DownhillAllTheWay
      @DownhillAllTheWay Рік тому

      Read section 7 in the coding manual - attiny25.pdf (also covers AT45, AT85) See table 7-1. Did you note the comment below it? - "Note: 1. For INT0, only level interrupt" Do you have any bits set in the Power Reduction Register, PRR? Are you waking it up with a digital or an analog signal? (Note above Table 7-2 - Note that if a level triggered interrupt is used for wake-up from Power-down mode, the changed level must be held for some time to wake up the MCU. Refer to “External Interrupts” on page 58 for details . Not exhaustive, but some things to check, anyway.

  • @myhobbies5965
    @myhobbies5965 Рік тому

    Excellent explanation.

  • @myhobbies5965
    @myhobbies5965 Рік тому

    Excellent course, and excellent hobby.

    • @DownhillAllTheWay
      @DownhillAllTheWay Рік тому

      Thanks for the compliment. It's quite some time since I did this course, and then, it was the only one on UA-cam. However, I have just been looking on UA-cam, and I see there is another 8-part course on the ATtiny85, which I have just noticed, so I haven't looked through it - but I get the impression that it is probably better than mine. He uses C and Assembler, whereas my course uses only Assembler. C is much more intuitive. It's a big language with a lot to learn, but like learning a human language like French, you start with a few words, and you learn more as you use it. Worked for me (with both C and French!), so don't be daunted - have a look at his course. ua-cam.com/video/rPS3gRg6dT4/v-deo.html&ab_channel=AnasKuzechie

  • @Kocaczech
    @Kocaczech Рік тому

    thank you !

  • @xaviergonzalez5828
    @xaviergonzalez5828 2 роки тому

    This video is Gold! Thank you Sir! English is not my native language and I get you very well! Greetings from South America!

    • @DownhillAllTheWay
      @DownhillAllTheWay 2 роки тому

      Many thanks for the compliment, Xavier. I feel good that I'm helping somebody.

  • @luisvera2005
    @luisvera2005 2 роки тому

    Hola buenos tardes que pasa cuando sale en el tablero problema electrónico

    • @DownhillAllTheWay
      @DownhillAllTheWay 2 роки тому

      Sorry, you did not describe the symptoms of your electronic problem. Please note that I am not a Citroen technician. I had a problem, and when I asked about it on "French Car Forum", they said it was a Maxi-fuse. Maxi fuses are difficult to find, so when I discovered where they are, I made this video. But I'm not an expert. Give all possible information about your problem on the French Car Forum. Describe it as exactly as possible. frenchcarforum.co.uk/forum/viewforum.php?f=3 People there are very helpful.

  • @laurhus978
    @laurhus978 2 роки тому

    best teacher ever :)

  • @LAYLA2354
    @LAYLA2354 2 роки тому

    ??????

  • @markburt4173
    @markburt4173 2 роки тому

    Thank you for this your a STAR

  • @boriszivkovic9933
    @boriszivkovic9933 2 роки тому

    very useful information,thank you

  • @tuopeeks
    @tuopeeks 2 роки тому

    Interesting, might be that you have a drifting beat frequency between the camera capture and strobe. It looks like you are capturing an internal reflection of low intensity showing the LED array. You also seem to capture dark lines which I think might be the point the camera is over saturated. The camera software may also relate to the behaviour of the image capture. Interestingly, it doesn’t capture any yellow persistence from the fluorescent coating on the LEDs.

    • @DownhillAllTheWay
      @DownhillAllTheWay 2 роки тому

      Thanks for looking. Yes, I think you're right. I partly solved this quite a long time ago, but I didn't update because it seemed to have garnered no interest at all - and because my "explanation" was half-baked. When I say "partly solved", I mean I have a vague notion, though I can't fully explain it - but if I take a picture (a still image) of something very bright against a darkish background with this camera, the bright object has a strong vertical flash above and below it. You see it for moments in the video, while the camera shutter is open at the same time the LEDs are lit - the flash appears as green lines. The video above is, of course, a series of still pictures, and each one will have the vertical flash, but because of the interaction of the frame rate of the camera and the flash rate of the strobe, only a small part of that vertical flash is captured, and appears as the dots I was asking about - which move down. If the strobe rate is changed, I can make the dots move upward. There are 9 LEDs in the LED block. It's funny that when we see the moving dots, the camera shutter wasn't open at the same time the LEDs were lit (because they appear to be off), so I guess the CCD has been affected by the light. However, I also know that electronic cameras don't use a mechanical shutter, so the CCD sees the LEDs even though it's not storing the photo at that time. Or maybe it is part-way through its storage cycle. Like I said - I have a vague notion - but that's about the size of it!

  • @ENLIGHTENMENTscience
    @ENLIGHTENMENTscience 2 роки тому

    👍

  • @nutier
    @nutier 2 роки тому

    Awesome video ! I enjoy it so much . Thank you for sharing .

  • @michaelwaters1072
    @michaelwaters1072 2 роки тому

    Brilliant - thank you - all my dash instruments are out, and I am going to tackle this, starting in the fuse box under the front dash - will let you know the result krgds Michaek

    • @DownhillAllTheWay
      @DownhillAllTheWay 2 роки тому

      It's mind-bending how they came up with that "feature" in the design of this car! They obviously didn't want anybody to find out where the maxi-fuses were! It sounds like you may have blown the same fuse as I did. My whole dashboard was out, though the headlights still worked - but the starter did not. The car was bafflingly *_dead._* Mine was a 30A fuse, in series with another 30A fuse inside the car, so because the Maxi-fuses are so hard to get at, I replaced that one with a 40A fuse, so if it should blow again, the one inside the car would go first. I still have no idea what caused my fuse to blow. I had a satnav and a dash-cam plugged into a double-USB adapter in the cigarett-lighter socket, so I guess it was something to do with that - but it must have been a short circuit in the wires. Neither of those things draws anything like the 30A that it took to blow the fuse.

  • @lorenalagos7975
    @lorenalagos7975 2 роки тому

    Ese fusibles de que es que función cumple en el motor yo tengo una picazzo 2.0 lo tiene

    • @DownhillAllTheWay
      @DownhillAllTheWay 2 роки тому

      I don't know what all the maxi-fuses do. On my car, I plugged something into the cigrarette lighter, and after that, the car was DEAD! No starter, no ignition. Fortunately, it happened at my house, not somewhere far from home. I made enquiries and some people told me it seemed like a maxi-fuse, and it took me some time to figure out where they are, so when I did, I made a video about it. There are 8 maxi-fuses in my car, but I don't know their individual functions. I hope I will never need to find out! I don't know how they work, but here's what I *_think_* - I think they probably control circuits which contain other fuses. So, for example, you might get a maxi-fuse in a circuit that controls several devices, like this... 12V---- maxi-fuse ----+---- subordinate fuse----- device 1 +---- subordinate fuse----- device 2 +---- subordinate fuse----- device 3 If one of the devices draws too much current, its fuse will blow, but the maxi-fuse is put there as an added security. I just wish they would put them in some more obvious place! Also, in my case, I had a 30A maxi fuse driving a circuit with another 30A fuse in it, so the maxi fuse would be as likely to blow as the subordinate fuse. I changed the maxi fuse to 40A

  • @edgarhernandopradamantilla7650
    @edgarhernandopradamantilla7650 3 роки тому

    Gracias, me sirvió mucho,

  • @nickjenkins3592
    @nickjenkins3592 3 роки тому

    You are a gem, sir! Your tutorials provide a truly valuable service.

    • @DownhillAllTheWay
      @DownhillAllTheWay 3 роки тому

      Oh, don't say that - I'll never get my head through the door! I haven't used the AT85 for a few years, but I came back to it recently to make a stroboscope, and I'm thinking of doing another tutorial on that, as it used both timers in the chip and also the A-D converter. It works quite well, though its adjustment at high flash rates (>200 fps) becomes quite coarse, so it should really be re-designed with a range switch in it. Well, I'm not sure that I'm that keen, or that I want a stroboscope that badly, but keep an eye on the channel.

  • @lacielouchannel4424
    @lacielouchannel4424 3 роки тому

    I maybe wrong but I think it maybe atmosphere particles refracted moving around or like scattered dust particles through light .the light seems to cling to the moving particles dust .or even water particle droplets giving it a secondary light that will travel .in your case a optical effect .

    • @DownhillAllTheWay
      @DownhillAllTheWay 3 роки тому

      Thanks for the suggestion, but I don't think it's that. I can control whether the dots move upwards or downwards by altering the flash rate - slightly lower, or slightly higher than 30 fps - which I suspect is the frame rate of the camera. I've just checked the camera to see if I could experiment with a different frame rate (some cameras are settable for 60 fps), but it doesn't seem to do that. I suspect it's something to do with the way the CCD is scanned, but I don't really have much clue.

    • @lacielouchannel4424
      @lacielouchannel4424 3 роки тому

      @@DownhillAllTheWay sorry I was thinking king of the led light transfer beam .have a look at this . Below www.atik-cameras.com/news/rules-1-2-arc-second-per-pixel-and-when-to-break-them/

  • @chrystina5604
    @chrystina5604 3 роки тому

    As you are removing a live cable, should you not have mentioned to disconnect the negative from the battery first !!

    • @DownhillAllTheWay
      @DownhillAllTheWay 3 роки тому

      The battery in the Picasso is under the passenger's seat (in the RHD version), and as you have to remove the seat to get at it, I didn't bother. However, if you want to do so, then do it.

    • @chrystina5604
      @chrystina5604 3 роки тому

      In mine, all you do is tilt the seat, You don't have to remove it, The trouble with having a live cable is, it touching ground, but as you say, It's down to choice

  • @sprobertson
    @sprobertson 3 роки тому

    If anyone else is befuddled by interrupts not working in the (now Microchip Studio) simulator, there's an option on by default: Tools -> Options -> Tools -> Tool settings -> 'Mask interrupts while stepping' Turn that off from the start and save yourself hours of frustration!

    • @DownhillAllTheWay
      @DownhillAllTheWay 3 роки тому

      Thanks Sean. I'm still using an old copy of Atmel Studio 7, but I guess I'll have to upgrade at some point (probably when I change my computer at some point in the not-too-fr future), and this is very useful info.

  • @peterjordaan8352
    @peterjordaan8352 3 роки тому

    Great tutorials Mike! Thank you for all the time you've spent making this available, it has helped me a great deal at my ripe old age and also convinced me to learn assembler.

    • @DownhillAllTheWay
      @DownhillAllTheWay 3 роки тому

      From one old man to another, thanks for the comment, Peter. I made the course a few years ago, and I haven't touched the AT85 since, but I have come back to it in the last few weeks, and I'm working on a stroboscope (and struggling!), which will read a potentiometer with the A-D converter, and feed the result to Timer_0 to generate the light-pulse repetition rate, and the length of the pulse will be controlled with with Timer_1. There may be another tutorial in due course. I'm writing the application in Assembler, but to be honest, I'm starting to wonder if it's a good idea. You have to accept that all computers run machine language, and it's different for each series of chips. It is the job of the compiler to turn your written code into machine language - a language in which each machine instruction (in the case of the AVR chips) is a 2-byte string of 1's and 0's. Assembler is a language in which you can write words like ADD, SUB(tract), MOV(e), etc, which have more meaning in English than does a string of binary digits, but I have seen several queries about whether C or ASM is more efficient, because people have written small applications in both languages and found the C to perform faster, or with fewer machine instructions. Of course, you can de-compile a C-program to find out what Assembler-based code it has produced, so you can find out why it was better than your own ASM code. When you read C-code that has been written for the AVR chips, you see immediately that it is kept very close to the hardware, referring to registers by name etc, it produces pretty tight machine language - and frankly, C is far more intuitive.

    • @peterjordaan8352
      @peterjordaan8352 3 роки тому

      @@DownhillAllTheWay I used to program in basic (bascom) but prefer assembler as most of my projects are quite simple and for own usage.C-code will allways be Greek to me! Waiting for the next tut good luck and thanks again.

  • @bertstrijker3424
    @bertstrijker3424 3 роки тому

    Mike thanks for your beautiful videos with explanations. I have a question, If I run your program in simulation mode, the interrupt does not work. I have checked the program a few times but the instructions are the same as you show in the video. Could it be that there is an incorrect setting in studio, causing studio 7 to ignore the interupts?

    • @DownhillAllTheWay
      @DownhillAllTheWay 3 роки тому

      I don't think there's anything in AS7 (Atmel Studio 7) that would prevent interrupts from being shown. Where abouts in the video are you looking, and what is not working for you? Interrupts have to be set up. You have to give the parameters for them, enable them individually, the SEI (Set Enable Interrupts) is a general enabler to enable them all. Did you copy the code from my Google Drive, or did you write it manually? If so, finger-tangle is an ever-present problem. Unfortunately, UA-cam doesn't lend itself to being a forum, so this isn't the place to send lots of code for debugging, but give me a time-stamp on the video, and describe what you're doing as well as possible, and I'll try to help.

    • @bertstrijker3424
      @bertstrijker3424 3 роки тому

      Hi Mike Thank you for helping me Here you have a link with the video. ua-cam.com/video/sGuO27iJVHg/v-deo.html Also click on show more, there is some text explained Thanks in advance.

    • @DownhillAllTheWay
      @DownhillAllTheWay 3 роки тому

      @@bertstrijker3424 Hi Bert, I put a number of replies on your video, (five, I think), but each time I look to see if you have replied to them, I see that they are no longer there. Please take a look and let me know if you see them. If not, I'll stick to communicating here.

    • @bertstrijker3424
      @bertstrijker3424 3 роки тому

      @@DownhillAllTheWay Hi Mike. Thank you for your response. I have emailed the source code to you

  • @pepsodentpasta
    @pepsodentpasta 3 роки тому

    Hi, as a beginner may i ask you. What free software do you use for compile the assembly language into hex file ? Thanks.

    • @DownhillAllTheWay
      @DownhillAllTheWay 3 роки тому

      Atmel Studio-7. It's an editor / compiler / simulator. It is covered in module 3 of this course.

    • @pepsodentpasta
      @pepsodentpasta 3 роки тому

      @@DownhillAllTheWay thank you for your information.

  • @mbanc443
    @mbanc443 3 роки тому

    Hello Mike! Thank you for your time teaching here! Your lessons are really valuable and fully understandable the way you do it. Really appreciate it!

  • @mbanc443
    @mbanc443 3 роки тому

    Great job Mike! Your videos really help to get into Atmel Assm. While not there yet and still trying hard to understand how some things are done. Have a general question on the bootloader. is it suppose to be loaded before you load the program, so after you upload your hex to chip so program will run. I mean bootloader part a must of been loaded previosly, right? As empty brand new chip will not start your program without the bootloader, correct? I missed that part when you loaded the bootloader, unless it's been done automatically by AS7 or chips purchased possibly with bootloader presintalled? Please clarify.

    • @DownhillAllTheWay
      @DownhillAllTheWay 3 роки тому

      To Mike B from Mike C! The applications I have written on the AVR chips have not used a boot loader. I used an Arduino Nano as a programmer, and wrote code to the ATTiny85 that would run when the chip was switched on. You have to think about where your program is. If it is somewhere off the chip, then you will need a bootloader to pull it into memory so that it can be run. For example, the bootloader on a PC pulls program data from the hard disk). The ATtiny85 has various sections of memory - the SRAM for its working memory (this is volatile - does not retain data when the chip is switched off), it also has EEPROM (which I have not used - though it is available for program and/or data storage), and it has "Flash" memory for program storage. This is not volatile (maintains data through a power cycle), but when a program runs, its instructions are executed in Flash memory. The program can also write to flash memory, and in the timer that I present in the last module of the course, when the desired time period has been set, the number of seconds is copied to flash so that it will not be lost on power-down. The operation is not straight-forward, however. The method presented in this course writes program data to Flash using the Nano as a programmer, and when the chip is switched on, the application begins to run immediately. (other programmers are available - but probably not as cheaply!

  • @colingaywood1961
    @colingaywood1961 3 роки тому

    Thanks Mike for a great set of videos. These really helped me with my home projects using AVRs.

  • @avalueduser3234
    @avalueduser3234 3 роки тому

    Thank you for doing these videos Mr Collins. One question. I see how the registers show as starting at 0x20 yet the page for register Summary shows half of them below this address. Is (for example) PORTB on the Tiny85 at 0x18 or would it be offset by 0x20 and at 0x38? Sorry for this silly question but I'm having trouble and don't know if its this or something else.

    • @DownhillAllTheWay
      @DownhillAllTheWay 3 роки тому

      There are no silly questions. I don't know why they did it this way, but the I/O registers listed in section 23 of the datasheet - "Register Summary" have a column called "Address", which makes you think it's a memory address - but it's not! It should really say "IO Register number". Their memory addresses are that number plus 0x20. It's because the actual memory addresses 0x00 ... 0x1F are the working registers, and the I/O registers start after that. fig 4-2 in the datasheet shows the working regs. Fig 5-2 shows the data memory map, with the working registers first, then the I/O registers, followed by the user data area. You can prove this to yourself if you have got far enough through the course to have loaded a program. Make a display like at 8:26 in the video above, with a "Memory" column with "data REGISTERS" selected in the selection box at the top of the column, and a "Processor Status" column (which also shows all the data registers, 0 to 31). Note the value of SREG (Status Register). Lots of instructions change it. Now simply press F11 (single step) until the Status Register changes. Bits in it will be indicated in red (meaning they have changed on this instruction), and in the "data REGISTERS" memory display, the byte at address 0x5F will also be red. Verify that the values of address 0x5F and the SREG are the same (they are - they're the same register) So the Status reg (SREG) is at address 0x5F, but the register summary in the datasheet says it is at 0x3F. I didn't write the datasheet. Don't shoot the messenger!

    • @avalueduser3234
      @avalueduser3234 3 роки тому

      @@DownhillAllTheWay Sir I would only like to thank you for the series you produced and helping me understand this. I think some of the tech writers should be put to work digging ditches. I know I really should have sat down and read the whole application note before doing anything but I had some success with writing assembler on the Arduino UNO and thought this would be the same but different addresses. It honestly never occured to me that Register Summary would require me reading one blerb about adding 20hex and or paying close attention to the memory map drawing.

  • @Rendon276
    @Rendon276 3 роки тому

    0:27 not all programmes take a minute to load.

  • @jeanpierredaviau7478
    @jeanpierredaviau7478 4 роки тому

    How does the rjmp junk ' knows ' that the count TCNT0 is equal to 125 ?

    • @DownhillAllTheWay
      @DownhillAllTheWay 4 роки тому

      When the video is running, it has a timestamp at the bottom of the screen - for example, 32:25 / 38:45 The 38:45 is the total length of the video, and the 32:25 is the point in the video that you are looking at. Try clicking on the 32:25 now to see how it takes you to exactly that point in the video. If you did that for me, then I would know what you were asking about, but the way you did it, I have to go all the way through the video looking for "rjmp junk". I'm very willing to help you, but please help me to do so.

    • @DownhillAllTheWay
      @DownhillAllTheWay 4 роки тому

      Ah! I just found it at 35:45. The rjmp is just jumping to the label junk: The rjmp doesn't 'know' anything about 125, but because it is jumping back and re-executing the rjmp over and over again, that means the processor is running, so it is using clock cycles and all the other bits of the chip are running too - including TCNT0, which is counting up. I put a message on the screen about that at 35:52. The 125 is set into register OCR0A - the Output Compare register, which is constantly being compared with the counter. When it counts up to 125, there is a count compare, which causes a few things to happen. The counter is reset to zero (because we're in CTC mode) and an interrupt is sent, which causes the program to jump to the instruction on line 25. The jump is not explained at this point, because we don't have an interrupt vector table yet, which directs the program where to go when it gets an interrupt. The Vector table is presented in the next module. Hang in there, you're doing great. All will become clearer in the next 15 minutes.

    • @jeanpierredaviau7478
      @jeanpierredaviau7478 4 роки тому

      @@DownhillAllTheWay I am sorry about that.

  • @jeanpierredaviau7478
    @jeanpierredaviau7478 4 роки тому

    Is there a code formatter (kind of Astyle) for assembly in atmel studio?

    • @DownhillAllTheWay
      @DownhillAllTheWay 4 роки тому

      Sorry Jean Pierre, I've never heard of Astyle, and to be honest, I don't really understand what you're looking for.

    • @jeanpierredaviau7478
      @jeanpierredaviau7478 4 роки тому

      @@DownhillAllTheWay A code beautifier like stahlworks.com/dev/pic/dview-astyle.jpg

    • @DownhillAllTheWay
      @DownhillAllTheWay 4 роки тому

      @@jeanpierredaviau7478 - When I was writing programs of 25,000 lines of C, I wrote a beautifier to keep it all in line - but on the AT85, it's really not worth it. Just write it beautiful in the first place. I recommend writing self-documenting code, so instead of writing ldi R16, 0xF3 ; (comment explaining the bit weightings) out WDTCR, R16 write ... ldi R16, (1<<WDIF)|(1<<WDIE)|(1<<WDP3)|(1<<WDCE)|(1<<WDP1)|(1<<WDP0) out WDTCR,R16 Other than that, I can't really think of any suggestions for appearance of your programs.

  • @jeanpierredaviau7478
    @jeanpierredaviau7478 4 роки тому

    Ok. I got it to work. Now, reading the datasheet, what is the thing that is doing the watching and comparing of OCR0A and TCNT0 : "The 8-bit comparator continuously compares TCNT0 with the Output Compare Registers (OCR0A and OCR0B)." ? The CTC clear timer on compare. By moving the WMG bit to the left and make it a two, 2, ....

    • @DownhillAllTheWay
      @DownhillAllTheWay 4 роки тому

      Look at the diagram in paragraph Figure 11-1. It covers the design of counters 0 and 1, so that "TCNTn" can be interpreted as TCNT0. The same for the other terms - OCRnA, OCRnB - just replace the 'n' with '0'. At the top left is the counter TCNTn, which is being clocked by clk(Tn), which is a derivative of the I/O clock. Thus, it counts at a rate that is previously set up in the program as clk/8, clk/256, etc. Its count is continuously compared with OCRnA and OCRnB by the comparator circuits marked "=", which generate OCnA and OCnB (Output Compare A & B), which get sent to the Interrupt circuit to generate the interrupt.

  • @jesusfajardomolina5849
    @jesusfajardomolina5849 4 роки тому

    Porfabor algun consejo mi citroen picasso 1.800 de gasolina sea quedado sin corriente no enciende ni las luces del cuadro algun consejo o algo q puede ser

    • @DownhillAllTheWay
      @DownhillAllTheWay 4 роки тому

      Mine is a Citroen Xsara Picasso 1.6 HDi , so they may be different - it started with a problem in the cigarette lighter 12V socket. The symptom was : No engine, even the starter did not turn - no dashboard lights - but the battery was OK because the headlights still worked. I went to the Citroen forums www.citroenpicasso.org.uk/picasso/ ...and... www.frenchcarforum.co.uk/forum ... and described my problem. I was told that it was probably a "Maxi-fuse". The location of the maxi-fuses is not obvious - why would any manufacturer hide fuses in such an inaccessible place? It took me a long time to find them. There was no video on UA-cam about them, so I made this one. Have you checked your maxi-fuses? In my case, the maxi-fuse was a 30A fuse - and it was in series with another 30A fuse inside the car, so current to the 12V socket passes through both fuses. I replaced the maxi-fuse with a 40A one, so that if it blew again, the one inside the car would blow first, and it is much easier to change.

    • @pedro3954
      @pedro3954 Рік тому

      Buenas donde está la caja de fusibles del motor alado hay 3 enchufes es de hay nueve los enchufes y verás que vuelve ala vida

  • @jeanpierredaviau7478
    @jeanpierredaviau7478 4 роки тому

    I tripled check and Atmel7 does not come out of the loop in my example 1 which is exactly like the one on the video for winmerge. gist.github.com/J4e8a16n/76348023c1dbfac21b0947abe43be87d

    • @DownhillAllTheWay
      @DownhillAllTheWay 4 роки тому

      I copied your code from GitHub and single-stepped it in the simulator, and it works for me. The operation is described at 35:45 for the next couple of minutes, and when I populate TCNT0 with 0x7C, it steps up to 0x7D, then jumps back to reload TIMSK (the "ldi R16,(1<<OCIE0A)" line), exactly as shown in the video at 37:36. You have probably already solved your problem by now, but if not, please describe exactly what you are seeing, and at what point it your results differ from the video.

    • @jeanpierredaviau7478
      @jeanpierredaviau7478 4 роки тому

      @@DownhillAllTheWay Jesus, it is the worst think I was expecting. :/)

    • @jeanpierredaviau7478
      @jeanpierredaviau7478 4 роки тому

      @@DownhillAllTheWay I will go to example 2. I even typed your values in the timer, scrutinized everything , followed cycle by cycle ... no way. screenshot: www.dropbox.com/s/5sy43i672rgyxwk/seven%20dogs.png?dl=0

  • @jeanpierredaviau7478
    @jeanpierredaviau7478 4 роки тому

    line 25 at 32:25 , ldi R16,(1<<OCIE0A) ; 1 will be shifted 4 places? How does assembly get the real number 4? In the tn85def.inc file I found. Take a 1 and shif it by 4

    • @DownhillAllTheWay
      @DownhillAllTheWay 4 роки тому

      Hi Jean Pierre, I can't remember without looking it up - but you can do that. You can either search the datasheet using the search facility of your PDF reader, for OCIE0A, or search the definitions file under Studio-7.

    • @jeanpierredaviau7478
      @jeanpierredaviau7478 4 роки тому

      @@DownhillAllTheWay In the tn85def.inc OCIE0A = 4

    • @DownhillAllTheWay
      @DownhillAllTheWay 4 роки тому

      @@jeanpierredaviau7478 In the datasheet also. section 11.9.7.

    • @jeanpierredaviau7478
      @jeanpierredaviau7478 4 роки тому

      @@DownhillAllTheWay Yes it is the 4 th bit. If you move 1 by 4 you get it set see the image TIMSK = 0x10

  • @jeanpierredaviau7478
    @jeanpierredaviau7478 4 роки тому

    Where is TCNT0 in the code main.asm? (the one that we raise to 7D)

    • @DownhillAllTheWay
      @DownhillAllTheWay 4 роки тому

      In tn85def.inc, there is a line ... .equ TCNT0 = 0x32 The tn85def file should be available in Studio-7 via Solution Explorer (the right-hand pane in the video). Clicj Dependencies. Please bear in mind that it's more than 2 years since I did this course, so I can't remember it all in detail. It helps if you say where you saw this (a time stamp would do - for example, In the video at 21:32).

    • @DownhillAllTheWay
      @DownhillAllTheWay 4 роки тому

      Did you look in the datasheet?

    • @jeanpierredaviau7478
      @jeanpierredaviau7478 4 роки тому

      @@DownhillAllTheWay yes but the datasheet will seems a bit crypted for me for a while ;o)

  • @jeanpierredaviau7478
    @jeanpierredaviau7478 4 роки тому

    Where cna I find the 10 first lines? line 11 ; load stack register sbi DDRB. PB0 pulse_setup: ldi R16,0x03 ;pulse length[ sbi PORTB,PB0 ;pulse high | pulse: ;| dec R16 ;|10 uS pulse brne pulse ;| cbi PORTB,PB0 ;pulse low ;| rcall delay rjmp pulse_setup ;delay 990 ;<----- ldi R20, 30 ; loop1: ; ldi R21,110 ; 10 mS delay find value experimentally loop2: ; inner loop dec R21 ; brne loop2 ; <---- inner loop dec R20 brne loop1 ret line 37 Regards

    • @DownhillAllTheWay
      @DownhillAllTheWay 4 роки тому

      Hmmm... That little bit of code was never intended as a program, but as an example of how *NOT* to make a delay. Note the comment on-screen at 6:22 - "I have not given source code for this program because it is not something you would want to keep". Just follow the explanation on the screen. If you want to single-step this code, just copy it into Studio as it is and single-step it - however, I stress that this is not the way to make a delay. It was my first attempt, before I had learned anything about the on-chip timers. It is cumbersome and very difficult to make accurate.

    • @jeanpierredaviau7478
      @jeanpierredaviau7478 4 роки тому

      @@DownhillAllTheWay Thanks for the answer. This comment should figure at the top of the list.

    • @jeanpierredaviau7478
      @jeanpierredaviau7478 4 роки тому

      Atmel says PB0:unknown instruction or macro | missing file delay_dont.obj

  • @jeanpierredaviau7478
    @jeanpierredaviau7478 4 роки тому

    I dont have this main.asm file (at7:10) in the video in the drive.google downloads.

    • @DownhillAllTheWay
      @DownhillAllTheWay 4 роки тому

      Under the video, click "SHOW MORE". You have to be logged in to Google, then you will find 3 files you can click. I have just checked them all, and they open as expected. There is no "main.asm" file. The Vector table template (see below), is just full of "reti" instructions - return from interrupt. That means that if any interrupt is called accidentally, there is a return from interrupt, and the program continues execution as if nothing had happened. The processor can be interrupted by any one of the things in the vector table, and when you switch the chip on, the first thing that happens is a Reset interrupt. In the program shown in the video, the reti for the Reset interrupt has been replaced with "rjmp main", which means "do a relative jump to the label "main". The program jumps to that location and starts executing instructions from that point. (If you raise a signal on pin-1, that also causes a reset interrupt, but that is never used in these examples). The video tells you when to download the example files 0:10 - load example 1 31:20 : load example 2 There is also a copy of a blank Vector table for you to download and keep. When I'm starting a program, that's the first thing I copy in. Change the reset vector to "rjmp main", make a label called "main:" (the semi-colon makes it into a label), and start writing your program. The first few instructions set the stack registers, and then set up the pins - whether input or output, etc.

  • @jeanpierredaviau7478
    @jeanpierredaviau7478 4 роки тому

    So the pulse cut the 240 volts current between 0 and 5 volts?

    • @DownhillAllTheWay
      @DownhillAllTheWay 4 роки тому

      Yes. I think it was about 2 volts, but it's the timing, not the voltage that was important. However, the mains-switching circuit is mentioned, but not described in these tutorials. They give you a grounding in the timers, which will give you a good feel for the use of the other peripherals, such as the A-D converter. My course does not cover that, but if you understand how an A-D converter works, by the time you have gone through this course, you will know how to read the datasheet, so you will set the ADC interrupt and write your code.

  • @jeanpierredaviau7478
    @jeanpierredaviau7478 4 роки тому

    AT85 == ATtiny85?

    • @DownhillAllTheWay
      @DownhillAllTheWay 4 роки тому

      Correct. My abbreviation. Not official. "==" You must be a C programmer. ;-)

  • @jeanpierredaviau7478
    @jeanpierredaviau7478 4 роки тому

    Live long and prosper

    • @DownhillAllTheWay
      @DownhillAllTheWay 4 роки тому

      Merci, Jean Pierre. How did it go - did you get right through the course? If so, you may be the first to have done so. Do you have a project in mind? I saw somebody on UA-cam had made a voice recorder with it by using the A-D and D-a converters. It wasn't that great - but I still thought it was a good project. I think it held about 5 seconds of speech. The AT85 is only a little chip - but the world is full of little applications. I'm busy learning (again, with a lot of difficulty) the STM32H7 chips (with the ARM core). I want to make a POV globe, which will be turned by a motor at 900 RPM, which is one revolution every 66667uS, but I don't want to complicate my work bench with the motor yet, so I used an AT85 to produce a 10uS pulse every 66667uS to simulate the index pulse from the motor. They're useful little chips.

    • @jeanpierredaviau7478
      @jeanpierredaviau7478 4 роки тому

      @@DownhillAllTheWay I could make a dimmer with your project. I started to learn assembly on windows 20 years ago and I gave up. It is a hobby, I went on java, then C , C++ . Then Arduino. Last year I tried Atmel studio (after a video from Joop Brokking) but I gave up because of the lack of informations for the beginners. Here I am banging my head on your code. I am progressing but my ability to memorise grows weaker with time. There is a lot to memorise ... You gave me an opportunity to make peace with assembly and Atmel. I would had like to have that software in the past. Regards JPD

    • @DownhillAllTheWay
      @DownhillAllTheWay 4 роки тому

      @@jeanpierredaviau7478 Courage, Jean Pierre. Tu y arrivera. If you need help, drop me a comment. If I can help, I will, or otherwise, the guys at AVRFreaks know what they're talking about. They spend all their time programming these chips, and helped me several times when I was struggling.

  • @jeanpierredaviau7478
    @jeanpierredaviau7478 4 роки тому

    Would this asm work on arduino pro?

    • @DownhillAllTheWay
      @DownhillAllTheWay 4 роки тому

      Yes, it would, though you would need to verify what pins connected to what peripherals etc. I used the ATtiny85 as a learning exercise, and I concentrated my efforts there - so I'm not an expert on the entire AVR range of processors, but as I understand it, they all have the same AVR core, with the same functionality - one instruction every clock cycle (for most, but not all instructions), but you may have noticed that in my course, a jump is always "rjmp" - relative jump, and rcall - relative subroutine call. The reason is that the ATtiny85 can't directly address a large memory space (only 8MB, if memory serves), so a relative jump is used - relative meaning jump forwards or backwards so many addresses, rather than, for example, jump to address 0xf87d32 (direct memory addressing). The bigger chips in the range, such as the Atmega 328 used on the Arduino, can use jmp and call instructions with direct memory addressing. Some of the chips can be run at a higher clock speed, and they have extra capabilities, like multiply and divide of 16-bit numbers (a 32-bit number can be divided by a 16-bit number) - so you will be able to use "mul" and "div" instructions, and ypou may find that the built-in peripherals are more advanced as well - but mostly, the same assembler will work, and the differences as noted, will be quite obvious. You just have to read the datasheet for whatever chip you use.

  • @jeanpierredaviau7478
    @jeanpierredaviau7478 4 роки тому

    hanks for you effort and God Bless you.