What Actually is Embedded C/C++? Is it different from C/C++?

What Actually is Embedded C/C++? Is it different from C/C++?

Jacob Sorber

3 года назад

156,581 Просмотров

Ссылки и html тэги не поддерживаются


Комментарии:

@samgarg5228
@samgarg5228 - 26.07.2022 23:10

Useful for filling up sheets in exams (experienced).

Ответить
@jorgeferreira6727
@jorgeferreira6727 - 02.08.2022 18:16

Last time I used "Borland Turbo C" was on top of WinNT 4.0, for cross development for an MS-DOS based platform.
In case you are curious the MS-DOS based platform(s) were Norand/Intermec portable devices, the grand parents of modern tablets.
By that time, 1999, my goto programming tool for desktop development was C++ Builder 3, and some Visual Basic 5 when forced by my co-workers.

Ответить
@jorgeferreira6727
@jorgeferreira6727 - 02.08.2022 18:20

Clearly who wrote that sh*t has a hard time understanding the hardware of a micro-controller. Namely, memory mapped I/O, pin direction/digital/analog plus the peculiarities of the peripherals, like SPI, I2C EUSART, PWM, ADC,...

Ответить
@jorgeferreira6727
@jorgeferreira6727 - 02.08.2022 18:28

Microchip compilers for the PIC32 family of micro.controllers are GCC based.

Ответить
@jorgeferreira6727
@jorgeferreira6727 - 02.08.2022 18:33

Not writing to registers in a desktop micro processor ?!?!?!?
Did those guys never heard of "intrinsics" ?

Ответить
@burningglory2373
@burningglory2373 - 12.08.2022 00:47

Funny that GCC was only under the "Normal C" while microchip basically only uses forks of GCC for their pic compilers.

Ответить
@AS-wi6hr
@AS-wi6hr - 13.08.2022 23:44

if they talk about Borland Turbo C++, my guess is that these guys are from Indian subcontinent.

Ответить
@prathamesh3299
@prathamesh3299 - 22.08.2022 14:35

as cs student from India colleges teach us in turbo c if these guys have windows in the lab if it's Linux then they use text editor to teach us c dammm why they do this I don't know but yeah

Ответить
@keatonhatch6213
@keatonhatch6213 - 26.08.2022 06:36

Haha right of the bat they say C is used for OS development and “embedded C” is for micro-controllers. Lol what do they think OS code talks to?

Ответить
@danielrhouck
@danielrhouck - 23.10.2022 05:27

As I mentioned in a different one of your videos, I would love to hear more about linker scripts. If I canʼt do the link by passing a bunch of arguments to gcc or clang, I donʼt know how to do it. I can probably figure it out if that is enough even if some of those arguments are `-Wl,-whatever`, but not if I have to actually invoke ld or gold directly.

Ответить
@dimdimich
@dimdimich - 27.10.2022 13:54

It is hilarious for me when people write programs for IoT with gigabytes of RAM and gigahertz multicore CPU under Linux, and call it "Embedded Programming" :)

Ответить
@DevlogBill
@DevlogBill - 15.11.2022 08:47

Excellent video, I love your content they are always educational. I am learning easier stuff than this, JavaScript. But I had a question. RUST is extremely popular now and I hear it can be used for embedded systems as well? Have you used Rust before? In your personal experience do you think Rust is as perfomanent as C or C++?what is your opinion? ThNk you for the excellent content.

Ответить
@brokenicry
@brokenicry - 05.12.2022 18:10

DEFINITELLY a YES on debugging and testing... Do you perhaps have such a video already??

Ответить
@andyonions7864
@andyonions7864 - 21.12.2022 16:51

C is the world's greatest macro assembler. Embedded C is almost identical.

Ответить
@gdotone1
@gdotone1 - 28.12.2022 22:32

more on linker scripts please. a lot more on embedded programming, a project start to finish. walk throughs of were to find and use information for the parts and project. that would be very valuable. and, of course, more than 5 such projects.

Ответить
@djpenton779
@djpenton779 - 02.01.2023 09:19

Nice video. I suspect the misconceptions sometimes arise due to lack of experience with, say device drivers, or "larger" computers that have memory-mapped registers. C (not some separate language) is used for that stuff, and for most OS code. Most programmers probably don't run into cross-compilation either.

I have just recently started with hobby microprocessor programming, but have lots of experience with low level stuff on general purpose computers. Systems like the arduino IDE hide a huge amount of detail, which leads to misunderstandings of how the too lchain (including the language) actually works.

Ответить
@berekethaddis239
@berekethaddis239 - 10.01.2023 21:09

Thank u .

Ответить
@brucelytle1144
@brucelytle1144 - 30.01.2023 22:32

Funny, just yesterday I was thinking about Borland. I liked their software. Learned C with TurboC.

Ответить
@blogger.powerpoint_expert
@blogger.powerpoint_expert - 12.03.2023 14:00

Embedded C is the same C language applied to the Embedded Systems 🙂

Ответить
@htainlindwa80
@htainlindwa80 - 24.03.2023 19:55

Hello sir, I am extremely new with learning C programming, but I want to learn from you because I like your attitude. I am not sure though, that i would be able to learn from you because I am a slow learner. Do you think your class could be for me or do you thank I need some prerequisites to start learning C? Let me know thanks!

Ответить
@classicryda120908
@classicryda120908 - 26.03.2023 18:27

as a beginner, im confused to this type of programming style, can it be replaced as a more user friendly code that doesnt involve bit shifting/register? or is it a totally different thing? for example im accustomed to digitalWrite(pin, HIGH) instead of toggling some bit on the register, is it equivalent?

Ответить
@szilagyimiklos4757
@szilagyimiklos4757 - 09.04.2023 00:02

Did you know that the first embedded system, the Apollo Guidance Computer, was developed for NASA's Apollo program in the 1960s? It used a custom-built assembly language, but modern embedded systems have come a long way since then! Today, we use Embedded C/C++ to program microcontrollers, enabling devices like IoT gadgets, drones, and even smart appliances. The key difference between regular C/C++ and Embedded C/C++ lies in the system constraints, like memory and processing power, that embedded systems have to work with. This makes writing efficient and optimized code a top priority for Embedded C/C++ developers!

Ответить
@markcuello5
@markcuello5 - 23.04.2023 15:51

HELP

Ответить
@tomsparks3259
@tomsparks3259 - 13.05.2023 02:21

This article sounds like it came from ChatGPT.

There is no difference. If you can do some of the simple stuff you generally never do with C, like setting and clearing bits, you can do this. Trust me, it's not too tough.

The registers for configuring and controlling the device's native peripherals are most often mapped into memory locations. And the programming software the manufacturers supply for free often provide for addressing a register as you would a simple variable using native features of the C language.

So, you essentially operate on bytes and bits in memory with language features that have probably been there forever in plain old C.

What may be tougher is understanding the hardware you choose to use. But even that gets easier. I practically slept with the MCU's reference manual until things made sense.

Ответить
@ShaunRoselt
@ShaunRoselt - 06.07.2023 14:39

Borland Turbo C evolved into Embarcadero C++ Builder and it's absolutely amazing.

Ответить
@jamesmcdermott9275
@jamesmcdermott9275 - 16.08.2023 18:23

Mate, I could never listen to you all day!

Ответить
@ronalerquinigoagurto555
@ronalerquinigoagurto555 - 17.08.2023 03:57

Gcc has different versiones like none-eabi, so I think in the end the compilers avoid using syscall instructions as it knows beforhand that there is no kernel/os

Ответить
@ivanronda9583
@ivanronda9583 - 25.09.2023 02:55

I was learning to code in C for the last 2 years and i was stunned when i saw that embed code.

Ответить
@minhajsixbyte
@minhajsixbyte - 03.10.2023 17:45

i have come across many geeksforgeeks articles that are very weird and shows poor quality control

Ответить
@bobfarker4001
@bobfarker4001 - 06.10.2023 18:45

"borland turbo C for archeological sake" -People who LOVE this stuff care about the HISTORY.

Ответить
@Stabby666
@Stabby666 - 13.10.2023 18:00

From my perspective the major differences are:

MCUs are generally harvard architecture - so code and constant are stored in flash, and standard RAM is used for variables. Since MCUs tend to be memory constrained you really need to keep constants in the flash memory. Sometimes this involves using macros for constants, and accessing that data using special functions. For example with ATMEL parts, if you use const uint8_t x=0; that will actually be put into dynamic RAM, wasting precious memory.

Since MCUs have little memory, you often cannot dynamically allocate arrays on the stack. They need to be global, or created on the heap using malloc(). This can cause strange intermittent crashes for new programmers.

For any non-trivial code, you'll be using interrupt-driven functions a LOT. You need to write code that can handle this seamlessly and efficiently. This even changes the way you plan out your code - it's inefficient to read from an ADC and wait in a loop for the result. Your code should start the ADC conversion, then carry on doing something else and an interrupt can fire after the ADC has completed so you can read the value immediately.

There are big performance hits on MCUs if you exceed the size of their registers. So using 16bit regs on an 8bit MCU, or 32bit regs on a 16bit etc. So just throwing "int x..." around is generally a bad idea - it's better to specify the type of int you're using.

Due to memory constraints it's also common to use a lot of bitwise flags and registers - 1 8bit value can hold 8 booleans, essentially.

Working out the amount of computing resources you have to maybe reduce power by reducing the clock speed. For instance I recently made some business cards that play tetris, they use an array of LEDs for the 10x20 grid, buttons, and small CR2016 coincells mounted through the card. The coin cell can only put out a few milliamps of current, so the design only ever lights 5 LEDs at a time, but scans through them so fast that the eye doesn't notice any flickering - this display update takes over 90% of the MCU's time, as it is limited to 1mhz, so it doesn't exceed the battery current capacity!

Ответить
@rohityadav-ss8wx
@rohityadav-ss8wx - 14.11.2023 17:01

If possible would you please explain linker scripts in details

Ответить
@salsamancer
@salsamancer - 17.11.2023 16:06

The syntax of C doesn't change, but rather you need to rethink how you design your code. You're not building an app to execute on an OS, you're creating the firmware to run the entire machine.

Ответить
@sunlin894
@sunlin894 - 28.11.2023 20:03

I have Turbo C & Borland c++ builder for old school apps - i even have an old Zeos tower 386 that still works - multiple pentium Packard Bell & A few Dells - all win95 or 98 or xp etc.. all work
but here's my problem
- I understood what you were saying and have seen it - such as Macro & function , extern etc...
I used to use Extern function declarations in Quick Basic 4.5 for small microsoft Quick C & MASM microsoft assembler functions i assmbled (object .obj code) and then linked that where used in main module of my programs that made executeables file .exe before everything went
.DLL etc... (which i stopped there in my programming career because of it's complication &the advent of oop and container classes???, etc...)
Long story short i had to eat, support family, i play with all my old toys - but really needed someone like you to guide, direct and inform me -
Thank you for this information.
I'm an industrial electrician - big stuff, motors, MCC, vfd, inumerous field devices - with a good old school foundation in C - i would love for someone to assist me through the door of embedded C - and i'm not talking arduino - something more practical - say Allen Bradley or other -
I'll trade you, my turbo c/c++ disks (original) and Borland stuff for this guidance and teaching - maybe even app design guidance - like what software & where can i get it to write & publish apps??
That sort of thing.....what do you think? Send me an email i'll send u pics of my old software disks & boxes & books -
Wishful thinking right ! Signed - old school boy programmer - love playing with those old c, qb, assembler - wife always asking me - why do you have all these old computers - she just doesnt get it - lol

Ответить
@minaessam1
@minaessam1 - 11.12.2023 13:59

I need to see more videos about Linker script

Ответить
@MohammedU3
@MohammedU3 - 13.12.2023 12:38

I am not sure what linker files are but as the looks of it, it looks like he is using a typedef enum which is inside a struct that is named "MEMORY" and he is using bitfields(since they can't be used with enums that's why it might be added inside a struct) to intialize how many bits that certain enum variable takes.
If that's the case, that would mean I have finally found a purpose of enums.

Ответить
@LaeeqKhan01
@LaeeqKhan01 - 21.01.2024 04:11

One question: how can we access a "non memory mapped" register in C?
Nice video though.

Ответить
@nezbrun872
@nezbrun872 - 01.02.2024 19:48

Oh dear! That website is an great example of the blind leading the blind.

Ответить
@manuelcapel5889
@manuelcapel5889 - 02.02.2024 15:36

It's like asking "what is the difference between English/French and legal English/French". Both are the same languages, use the same vocabulary and grammar set, just that in a legal setting, you focus more on certain vocabulary and syntax that are not very common in everyday speech.

Ответить
@skeleton_craftGaming
@skeleton_craftGaming - 11.02.2024 07:54

you can't cross compile Java, that's on of its features [or rather that you don't have to]...

Ответить
@chrishaddad8067
@chrishaddad8067 - 24.03.2024 18:13

you suck

Ответить
@chillbro2275
@chillbro2275 - 26.06.2024 13:52

I have been wondering what a linker is for years. I would like a to watch a little more information on linkers.

Ответить
@aiyamenkhueljerry260
@aiyamenkhueljerry260 - 14.07.2024 21:30

Embedded C is same as C, the difference is just understanding microprocessor tool chain, data sheet and understanding hardware architectures and a knowledge of electronics. Embedded C is simply the application of C on embedded product development.

Ответить
@COMPTROL
@COMPTROL - 12.08.2024 18:35

wow a garbage video half of which consists of refuting a made up, chatgpt generated article?

Ответить
@intptointp
@intptointp - 25.08.2024 05:37

Isn’t embedded C just writing code (C) to some external processor like a microcontroller?

That’s all.

Ответить
@elalemanpaisa
@elalemanpaisa - 15.09.2024 22:27

Everything above Assembly is far away from the Hardware and high level. :) But I give you that.
There is also nothing wrong with high level programming languages, so I don't get the bashing some people do (yea same with those I use arch btw dudes) use the right language to get the job done. If you have a massive 1MB Ram C is just fine.
If you are more constraint and lets say we are talking about 64KB or even less - then you might want to consider something else.

Ответить
@netanelkomm5636
@netanelkomm5636 - 02.10.2024 11:51

GeeksForGeeks are the masters of clickbait + stupidity.

Ответить
@itoaa
@itoaa - 26.11.2024 22:35

Very good explenation. c and c++ can look very different, if you do low level programming, and when you do programing in an operating system. Still the same language.

Ответить