04 Bit-banging in Cortex-M Assembly

Поділитися
Вставка
  • Опубліковано 19 жов 2024

КОМЕНТАРІ • 24

  • @fernandopinheiroguimaraes2664
    @fernandopinheiroguimaraes2664 9 років тому +3

    Thank you so much for this clear and concise tutorial. Very useful
    Fernando.

  • @WholeNewLevel2018
    @WholeNewLevel2018 7 років тому +1

    Thanks it was very clear tutorial please keep up the good work ....
    now we could all bang those bits....

  • @researchitechindia
    @researchitechindia 6 років тому +1

    Thanks for clearing the bitbanging concept .

  • @saiprashanth165
    @saiprashanth165 5 років тому +4

    Please give us more videos like this Sir.

  • @ahmadzaklouta
    @ahmadzaklouta 6 років тому

    Thank you very much. Will you post more videos? more advanced concepts in C or assembly.

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

    What I was hoping for was to see you explain the binary encodings for these instructions.

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

    Hi Mr. Joe in munute 3:30 in register R4 is value 0x0000ABDD, it should not be value 0x0000ACDD? Thank you for this video.

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

      No. If we perform the bitwise OR of 0x1 (from R0) and 0xB (from R3) the result will be 0xB.

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

      @@joetheprofessor6260 thank you for you answer, but if we perform the bitwise OR of 0x1(R0) and 0xC (R3) the result is 0xD and from what you have wrote earlier I thnik that should be 0xC. Thank you for answers for understanding this.

    • @joetheprofessor6260
      @joetheprofessor6260  3 роки тому +1

      @@Antyelektronika 0x1 is 0b0001 and 0xC is 0b1100. If we OR them together we get 0b1101 which is 0xD

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

    Thanks professor. I thought this is called bit manipulations in 8-bit architecture.

  • @김경민-n7r5f
    @김경민-n7r5f 3 роки тому

    Thank you for your video, it is very helpul

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

    why we use bit banging operator instead of assigning a value to a register to change register value? what is the purpose of this?

    • @joetheprofessor6260
      @joetheprofessor6260  4 роки тому +2

      You use bit-banging when you only want to modify some, not all, of the bits in a register. For example, one function might use bits 0-3 and another might use 4-7. Each function must be careful to only modify those bits it is allowed to access, and not make any assumptions about the values of bits that it is not allowed to access.

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

      @@joetheprofessor6260 for example ı have to make 00000011 to 00000010 in a register. I am assigning relevant register to "2" (in decimal form ). You say 7-6-5-4-3-2-1 bits are busy in the register while assigning another function try to use those pins, is that right?

    • @joetheprofessor6260
      @joetheprofessor6260  4 роки тому +1

      @@coderhex1675 By simply assigning the value 2 to the register you are forcing bits 4-7 to be zero. But if those bits are controlled by some other function, some other part of your overall program, they may not be zero when you are ready to clear bit 0. That's why bit banging is used.

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

      Understood... very thank you. By the way would you like to find me on facebook: osman.cicek.9216 I want to meet with you. Please PM me. Sorry for my bad english.

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

    at 3:28, why didn't the B change by one in R3?

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

      Because the OR of 0xB and 0x1 is 0xB....that's why we have the B in R4. R3 doesn't change because it is not a destination register for any of the instructions.

  • @zinedine874
    @zinedine874 5 років тому +1

    I am watching your videos and I live them. However, using the term bit-banging is not correct. you mean bit-banding which is a feature in arm processors. bit-banging is a software technique to send serial communication over gpio.

    • @joetheprofessor6260
      @joetheprofessor6260  4 роки тому +2

      I understand what bit banding is, and that's not what I'm talking about. I'm using the term to refer to the underlying bit manipulations that you must do to the I/O registers in order to accomplish the serial communication you are referring to. I'll concede that it might be better to call this bit manipulation or bit bashing.

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

    I've heard and used the term "bit-banging" many many times. Nothing new to me. What I haven't heard of is the vertical bar '|' (or just "bar") being called a "pipe". Never heard of that before.

    • @joetheprofessor6260
      @joetheprofessor6260  4 роки тому +1

      In a unix shell the vertical bar is used to take the output from one command and "pipe" it to the input of another command.

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

      @@joetheprofessor6260 I am very familiar with pipes in command language interpreters. Within the narrow context you describe, the "pipe operator" is represented by the ASCII unbroken vertical bar character (there is a broken vertical bar' ¦' character and that one is not in ASCII). But the character is not a "pipe character" just as an asterisk is not a "multiply character". In fact, Unicode clarifies that '*' is an asterisk and is intended to be used for a footnote indicator which was its traditional purpose before programmers hijacked it for other uses. Unicode defines the '×' to be the multiply character (or more strictly its Code Point). In the C language, the asterisk is used as the "multiply operator" but it is wrong to call it the "multiply character". The character is still called an asterisk. As in the C language, the unbroken vertical bar is the inclusive OR operator. Applying jargon that comes from unspecified and/or unrelated contexts should be avoided. It only causes confusion.