Author Topic: Microcontrollers for beginners  (Read 7115 times)

0 Members and 1 Guest are viewing this topic.

Offline emece67

  • Frequent Contributor
  • **
  • !
  • Posts: 614
  • Country: 00
Re: Microcontrollers for beginners
« Reply #50 on: April 17, 2021, 05:34:52 pm »
.
« Last Edit: August 19, 2022, 04:23:25 pm by emece67 »
 
The following users thanked this post: M.Zohaib Usman

Online Kleinstein

  • Super Contributor
  • ***
  • Posts: 14072
  • Country: de
Re: Microcontrollers for beginners
« Reply #51 on: April 17, 2021, 08:11:00 pm »
The STM nucleo boards are relatively cheap and they include the programmer / debug interface. So no other hardware needed. Most of them are not really breadboard ready (e.g. 2 row pin headers) - in this aspect the blue pill is easier, if one gets a known good version.

The main reasons to use ASM with a 8 bit µC is to get cycle accurate timing and a little more speed if really needed. With an ARM or similar high performance µC with extra buffers / chache even ASM programs are not that predictable anymore and the speed is most of the time higher than an AVR programmed in ASM. So less need to use ASM with an ARM. The initiallization is quite complicated, to even a simple program gets quite long  and thus less attractive to use ASM.
 

Offline emece67

  • Frequent Contributor
  • **
  • !
  • Posts: 614
  • Country: 00
Re: Microcontrollers for beginners
« Reply #52 on: April 17, 2021, 09:55:41 pm »
.
« Last Edit: August 19, 2022, 04:23:32 pm by emece67 »
 

Offline landperm

  • Newbie
  • Posts: 1
  • Country: au
Re: Microcontrollers for beginners
« Reply #53 on: April 19, 2021, 02:56:41 am »
Has anyone heard of BCX variants of STM32 devices?

For example, an STM32F1BCXVC would be the same as STMF103VC...
 

Offline DIYGUY Chris

  • Contributor
  • Posts: 41
  • Country: us
Re: Microcontrollers for beginners
« Reply #54 on: April 19, 2021, 10:18:54 pm »
I doubt that initialization is more easier than AVRs ! I've been playing with AVRs since long long time and the registers manipulation is far easy than ARM MCUs, also I do prefer RISC architecture MCUs  :)
The problem with the Nucleo is the lack of pre-set libraries and the setup of I/O ports depend on the package that you download for the CUBEMX (for sure if I'm not the only one who configure the I/O port by CUBEMX  :D )
 

Online brucehoult

  • Super Contributor
  • ***
  • Posts: 3996
  • Country: nz
Re: Microcontrollers for beginners
« Reply #55 on: April 19, 2021, 11:35:46 pm »
I doubt that initialization is more easier than AVRs ! I've been playing with AVRs since long long time and the registers manipulation is far easy than ARM MCUs,

I think that's the general opinion, justifiably so.

Quote
also I do prefer RISC architecture MCUs  :)

I don't get that part.

Compared to what? ARM, AVR, and PIC are all RISC.
 

Online westfw

  • Super Contributor
  • ***
  • Posts: 4196
  • Country: us
Re: Microcontrollers for beginners
« Reply #56 on: April 20, 2021, 10:01:10 am »
I don’t think that the 8bit PICs qualify as “RISC” in the modern usage of the term.  (Maybe not CISC, either.  Just “simple” ac/memory CPU’s.)
AVRs are closer, except for all those special IO instructions.


As for the original question...  by all means continue using your Arduino, only start paying more attention to its avr-ness.  Read the arduino source code and figure out what there is to criticize about it, and then write better versions, or other code.  Skip the arduino functions in favor of new code.  It’ll always be a comfort to have the arduino funtions to fall back on.


Then get an xplained mini so you can play with microchip studio and an actual debugger.


The get a dramatically different board (ti launchpad, espXX, maple mini, some samd5x board or risc-v), still supported by arduino, and figure out how they are different.  See what is means that arduino support for rPi Pico uses arm-mBed-os...  build software for each of the boards with the vendor’s ide/sdk instead of Arduino.  And then using only cli tools.


Then you’ll  be getting somewhere.



 
The following users thanked this post: Ian.M

Offline woofy

  • Frequent Contributor
  • **
  • Posts: 321
  • Country: gb
    • Woofys Place
Re: Microcontrollers for beginners
« Reply #57 on: April 20, 2021, 10:51:36 am »
The I7 is a CISC processor, or is it? It's actually a RISC processor interpreting the x86 instruction set. Is that really different to a Z80 running its instructions via microcode.
The terms RISC and CISC, with their loosely defined ever evolving blurred definitions, should be consigned to the annuls of history.

Online brucehoult

  • Super Contributor
  • ***
  • Posts: 3996
  • Country: nz
Re: Microcontrollers for beginners
« Reply #58 on: April 20, 2021, 02:23:10 pm »
I don’t think that the 8bit PICs qualify as “RISC” in the modern usage of the term.  (Maybe not CISC, either.  Just “simple” ac/memory CPU’s.)
AVRs are closer, except for all those special IO instructions.

Oh, I think PICs are certainly RISC. Not a very *good* RISC, but that's another issue. The instructions are all the same length and take the same amount of time to execute. Arithmetic is only between registers I believe -- they just have rather a lot of registers (32 or 128) and sometimes no RAM. And addressing the RAM is weird (similar to 8051 actually).
 

Online brucehoult

  • Super Contributor
  • ***
  • Posts: 3996
  • Country: nz
Re: Microcontrollers for beginners
« Reply #59 on: April 20, 2021, 02:26:22 pm »
The I7 is a CISC processor, or is it? It's actually a RISC processor interpreting the x86 instruction set. Is that really different to a Z80 running its instructions via microcode.
The terms RISC and CISC, with their loosely defined ever evolving blurred definitions, should be consigned to the annuls of history.

This is not correct.

RISC and CISC are characteristics of instruction sets, not of implementation.
 

Offline woofy

  • Frequent Contributor
  • **
  • Posts: 321
  • Country: gb
    • Woofys Place
Re: Microcontrollers for beginners
« Reply #60 on: April 20, 2021, 03:27:03 pm »
Oh, I think PICs are certainly RISC. Not a very *good* RISC, but that's another issue. The instructions are all the same length and take the same amount of time to execute. Arithmetic is only between registers I believe -- they just have rather a lot of registers (32 or 128) and sometimes no RAM. And addressing the RAM is weird (similar to 8051 actually).
Same length in the PIC16, but not the same execution time. They take 1 or 2 cycles (4/8 clks). In the PIC18 they are not even the same length, taking 1 or 2 words.

Online westfw

  • Super Contributor
  • ***
  • Posts: 4196
  • Country: us
Re: Microcontrollers for beginners
« Reply #61 on: April 21, 2021, 08:25:23 am »
Quote
I think PICs are certainly RISC. ...  Arithmetic is only between registers I believe -- they just have rather a lot of registers (32 or 128) and sometimes no RAM.
I think you've been mis-led by the somewhat weird (archaic) naming conventions used on the 8bit PICs.

A PIC has one general purpose register, an accumulator "W" ("Working Register")And it has a RAM space that includes general purpose memory, which they call "General Purpose Registers", as well as what they call "Special Function Registers" that do peripheral-like things.

"Real Math" (Add, subtract, OR, AND, XOR) occurs only between the W and one of the memory locations, and the result can be stored in either location.  Instructions are wide enough to address a substantial number of the memory locations (up to 512 at a time on PIC18) with the rest reachable via bank switching.  But I'd say that they're definitely more like memory than registers (for instance, there are no instructions that operate using two GPR locations.)

In addition, there are a large number of "simpler, single-operand, operations" that can be done on any memory location.  INC, DEC, (constant)Bit tests and clears, etc.  Things that are very handy for a microcontroller to be able to do, but not enough (IMO) to make them "registers."  And not very RISCy.
 

Online brucehoult

  • Super Contributor
  • ***
  • Posts: 3996
  • Country: nz
Re: Microcontrollers for beginners
« Reply #62 on: April 21, 2021, 11:55:17 am »
Quote
I think PICs are certainly RISC. ...  Arithmetic is only between registers I believe -- they just have rather a lot of registers (32 or 128) and sometimes no RAM.
I think you've been mis-led by the somewhat weird (archaic) naming conventions used on the 8bit PICs.

A PIC has one general purpose register, an accumulator "W" ("Working Register")And it has a RAM space that includes general purpose memory, which they call "General Purpose Registers", as well as what they call "Special Function Registers" that do peripheral-like things.

"Real Math" (Add, subtract, OR, AND, XOR) occurs only between the W and one of the memory locations, and the result can be stored in either location.  Instructions are wide enough to address a substantial number of the memory locations (up to 512 at a time on PIC18) with the rest reachable via bank switching.  But I'd say that they're definitely more like memory than registers (for instance, there are no instructions that operate using two GPR locations.)

In addition, there are a large number of "simpler, single-operand, operations" that can be done on any memory location.  INC, DEC, (constant)Bit tests and clears, etc.  Things that are very handy for a microcontroller to be able to do, but not enough (IMO) to make them "registers."  And not very RISCy.

I'm completely aware of the above.

The thing that makes something a "register" is not that it is fully general-purpose for arithmetic. There are many CPUs with registers that are usable only or mostly for special purposes. The 8080 and successors are prime examples. All arithmetic takes place only with A or in the case of the extremely limited 16 bit operations, HL. The same with 8051, except the registers are referred to by number not a name. And then there are instructions that work only with specific registers other than the accumulator, such as Z80 LDIR or 8086 MOVSB. They use very specific registers as source and destination pointers and loop counter and no others.

Certainly, I personally prefer instruction sets where you can use any register for anything. But that doesn't make the other kind "not registers".

The thing that makes something a "register" in terms of an instruction set is that there are relatively few of them and they can be addressed using just a few bits that are completely contained in the instruction opcode (or in the case of x86 in the modrm byte, or for 6809 the indexing byte).

As a matter of *implementation* registers are often implemented in a different technology and can be accessed more quickly than memory addresses, and they often form a distinct namespace. But not always. AVR makes the registers available as addresses 0..31 in the RAM address space. So do PIC and 8051. TMS9900 actually stores registers in normal RAM and has just one "true register" that points to the location of the program's registers.


The PIC ISA is completely correct to describe the things that can be named in the 5 bit or 7 bit field in fixed length 12 or 14 or 16 bit instructions (depending on model) "registers".
 

Offline Jan Audio

  • Frequent Contributor
  • **
  • Posts: 820
  • Country: nl
Re: Microcontrollers for beginners
« Reply #63 on: April 21, 2021, 04:05:00 pm »
I think you scared the beginner back to arduino.
 
The following users thanked this post: Bassman59

Offline SiliconWizard

  • Super Contributor
  • ***
  • Posts: 14297
  • Country: fr
Re: Microcontrollers for beginners
« Reply #64 on: April 21, 2021, 04:19:39 pm »
The I7 is a CISC processor, or is it? It's actually a RISC processor interpreting the x86 instruction set. Is that really different to a Z80 running its instructions via microcode.
The terms RISC and CISC, with their loosely defined ever evolving blurred definitions, should be consigned to the annuls of history.

This is not correct.

RISC and CISC are characteristics of instruction sets, not of implementation.

Indeed, RISC and CISC terms only relate to the instruction sets.
Now in "vintage" CPUs, they also tended to imply a certain microarchitecture, but the very example given by woofy shows that it's certainly no longer the case.
 


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf