Page 1 of 2 12 Last
  • Jump to page:
    #1
  1. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Feb 2014
    Posts
    6
    Rep Power
    0

    Embedded programming starting point


    Hello Everyone,

    I am looking for a embedded systems and a book to get started on embedded programming. The job I just recently got requires the use of exclusively C. I am a recent graduate and have some but not extensive experience in C.

    I have been looking at the beaglebone black, and rasberry pi's, both of which are a fair cost with decent enough GPIO.

    However when trying to find a book and tutorials online I am finding most are either Java, or python which dont meet my needs. The beaglebone black has shockingly little C programming info online.

    Can anyone suggest an embedded board, and a good book to learn not only basics about embedded programming, but also labs/examples in c?
  2. #2
  3. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Jan 2014
    Posts
    17
    Rep Power
    0
    If your new job uses the ARM processor, see if you can get a tool kit to use at home. If not, See what you can find in the way of free tool kits for the ARM processor, such as the armulator.

    If it's not an ARM process, see if you can get a tool kit for home use from the company or a freeware version, or stay after hours and study at work. Using an emulator with a source level debugger would be best.
  4. #3
  5. Contributing User
    Devshed Supreme Being (6500+ posts)

    Join Date
    Jan 2003
    Location
    USA
    Posts
    7,091
    Rep Power
    2222
    If your new job is in embedded programming, then study up on the platform and development system that they're using. Or better yet, learn it on-the-job.
  6. #4
  7. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Feb 2014
    Posts
    6
    Rep Power
    0
    Originally Posted by dwise1_aol
    If your new job is in embedded programming, then study up on the platform and development system that they're using. Or better yet, learn it on-the-job.
    It is in fact an ARM. I would just learn it on the job but we arent in development yet and it will be a few months until we do. I just want something at home to read and practice with until the time we write code comes
  8. #5
  9. Contributing User
    Devshed Supreme Being (6500+ posts)

    Join Date
    Jan 2003
    Location
    USA
    Posts
    7,091
    Rep Power
    2222
    If you go to the manufacturer's website, you should be able to find documentation for that processor. That documentation should be called "data books". The data book should describe the processor, its pin-out, its registers, use of the interrupt pins, use of the peripheral pins, its instruction set, etc. Similarly, if you go the website of the producer of the compiler and development software, you should be able to find documentation for it. The same for the operating system, if there is one.

    Among such documentation there used to be "application notes" describing some examples of the device being used. While that was mainly for hardware development, there should be something similar for software.

    At any rate, there should be somebody at work who is familiar with the tools you're going to be using and can provide training or offer suggestions. Or have you not reported yet?
  10. #6
  11. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Feb 2014
    Posts
    6
    Rep Power
    0
    Originally Posted by dwise1_aol
    If you go to the manufacturer's website, you should be able to find documentation for that processor. That documentation should be called "data books". The data book should describe the processor, its pin-out, its registers, use of the interrupt pins, use of the peripheral pins, its instruction set, etc. Similarly, if you go the website of the producer of the compiler and development software, you should be able to find documentation for it. The same for the operating system, if there is one.

    Among such documentation there used to be "application notes" describing some examples of the device being used. While that was mainly for hardware development, there should be something similar for software.

    At any rate, there should be somebody at work who is familiar with the tools you're going to be using and can provide training or offer suggestions. Or have you not reported yet?
    I have but still, im just looking for something to use at home, not just for work related learning but to have and to learn with and be able to do future projects on my own time with.
  12. #7
  13. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Feb 2014
    Posts
    6
    Rep Power
    0
    Originally Posted by VladDracule
    I have but still, im just looking for something to use at home, not just for work related learning but to have and to learn with and be able to do future projects on my own time with.
    Im not trying to discount your recommendations at all, they are perfectly 100% valid but just not what i am looking for at this time
  14. #8
  15. Contributing User

    Join Date
    Aug 2003
    Location
    UK
    Posts
    5,075
    Rep Power
    1802
    You are every unlikely to find information about using C on a particular board from anyone other than perhaps the board manufacturer. For boards using a microcontroller (a processor with on-chip peripherals), the chip manufacturer will also provide information.

    In either case, he information you are likely to find will be restricted to libraries, application notes and examples. The reason for this is that C is regarded as ubiquitous and not specific to any particular hardware. As an embedded developer you will use C and you will use the data sheets and reference manuals for the part of board you are programming; no one is going to lead you by the nose and teach you C for specific hardware.

    Unless the embedded systems you intend to develop are Linux based, I strongly suggest that you avoid the Raspberry Pi. It uses a proprietary Broadcom SoC for which the technical details are limited, and it have very limited I/O capability. Moreover it is ARM11 based (ARM Architecture v6) and that is largely superseded by ARM Cortex (ARM Arch. v7 and v8).

    Embedded systems covers a broad range from 8 bit microcontrollers with a few bytes of RAM running at 10MHz to 64bit devices with Gb of RAM running at GHz. It may run "bare-metal", use a simple RTOS scheduling kernel, or run full blown Linux or Windows Compact, or even Windows Embedded.

    You need to be clear about where on that spectrum you are aiming in order for anyone to give appropriate advice. I suggest that you aim at something similar to what you will be working on professionally.

    I would suggest that if the job requires that you use C, the target is probably toward the lower end of that spectrum, (and perhaps that they are dinosaurs that believe C++ is a step too far for embedded).

    So perhaps you should tell us a bit more about the work you will be doing and what the target is for that. You could learn a lot of inappropriate techniques if you get a platform that is very different from that. Also most embedded system books are targeted at specific architectures and those that aren't may be too broad or general to get you started.

    For ease of use, low cost and good community support it is hard to beat the mbed or Arduino platforms. Projects such as BeagleBoard and PandaBoard are at the higher end of complexity and performance, and while still cost effective may not teach you what you need to know. In particular they are geared toward running Linux.

    As an embedded developer of 25 years experience, I hate Linux as an embedded platform. It has its place, but for many applications I see it deployed they need 500MHz+ processors with Mb of RAM and Flash simply because they are running Linux and not because of the needs of the application. The main reason for deploying Linux on embedded systems is to leverage the work (open source) of others, and while that can get a product finished quickly when connectivity, file systems and device support needs are complex, if your aim is to learn about embedded systems, Linux will isolate you from much of what embedded systems developers are concerned with, such as board bring-up, boot-strapping,interrupt handling, etc. Also Linux is entirely unsuited to hard real-time applications, so cannot be used on a wide range of applications.
  16. #9
  17. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Feb 2014
    Posts
    6
    Rep Power
    0
    Originally Posted by clifford
    You are every unlikely to find information about using C on a particular board from anyone other than perhaps the board manufacturer. For boards using a microcontroller (a processor with on-chip peripherals), the chip manufacturer will also provide information.

    In either case, he information you are likely to find will be restricted to libraries, application notes and examples. The reason for this is that C is regarded as ubiquitous and not specific to any particular hardware. As an embedded developer you will use C and you will use the data sheets and reference manuals for the part of board you are programming; no one is going to lead you by the nose and teach you C for specific hardware.

    Unless the embedded systems you intend to develop are Linux based, I strongly suggest that you avoid the Raspberry Pi. It uses a proprietary Broadcom SoC for which the technical details are limited, and it have very limited I/O capability. Moreover it is ARM11 based (ARM Architecture v6) and that is largely superseded by ARM Cortex (ARM Arch. v7 and v8).

    Embedded systems covers a broad range from 8 bit microcontrollers with a few bytes of RAM running at 10MHz to 64bit devices with Gb of RAM running at GHz. It may run "bare-metal", use a simple RTOS scheduling kernel, or run full blown Linux or Windows Compact, or even Windows Embedded.

    You need to be clear about where on that spectrum you are aiming in order for anyone to give appropriate advice. I suggest that you aim at something similar to what you will be working on professionally.

    I would suggest that if the job requires that you use C, the target is probably toward the lower end of that spectrum, (and perhaps that they are dinosaurs that believe C++ is a step too far for embedded).

    So perhaps you should tell us a bit more about the work you will be doing and what the target is for that. You could learn a lot of inappropriate techniques if you get a platform that is very different from that. Also most embedded system books are targeted at specific architectures and those that aren't may be too broad or general to get you started.

    For ease of use, low cost and good community support it is hard to beat the platforms. Projects such as BeagleBoard and PandaBoard are at the higher end of complexity and performance, and while still cost effective may not teach you what you need to know. In particular they are geared toward running Linux.

    As an embedded developer of 25 years experience, I hate Linux as an embedded platform. It has its place, but for many applications I see it deployed they need 500MHz+ processors with Mb of RAM and Flash simply because they are running Linux and not because of the needs of the application. The main reason for deploying Linux on embedded systems is to leverage the work (open source) of others, and while that can get a product finished quickly when connectivity, file systems and device support needs are complex, if your aim is to learn about embedded systems, Linux will isolate you from much of what embedded systems developers are concerned with, such as board bring-up, boot-strapping,interrupt handling, etc. Also Linux is entirely unsuited to hard real-time applications, so cannot be used on a wide range of applications.
    One thing I am lacking is howto utilize hardware inputs such as GPIOS. I have experience in assembly so I understand how to do it down at the register level but ive never coded anything in that manner before.

    We will be using an RTOS, and will be using a cyclone V. I cant really give much more detail than that. Specific learning on this chip is one thing, but just having something for familiarity and being able to practice/brush up my programming ability is mostly what i want. Something to start out very simple and then work my way up as my programming ability overall increases. Board Bring up i would like to learn, but at the current moment its out of my position, we have a few other experts working in that area but i would love to learn.

    C is a requirement because we make FAA certified equipment, which really leaves C as the only option as the FAA is just recently allowing C++ but that is not our intent at the current time.
  18. #10
  19. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Feb 2014
    Location
    Southampton UK
    Posts
    15
    Rep Power
    0
    Haven't used the board myself, but a quick look around found this.

    GPIO Interface Programming Model
    Debounce capability for each of the inputsignals on portAcan be enabled or disabled undersoftware control
    by setting the corresponding bits in the gpio_debounce register accordingly. The debounce clock must
    be stable and operational before the debounce capability is enabled.
    Under software control, the direction of the external I/O pad is controlled by a write to the
    gpio_swportx_ddr register. When configured asinput mode,reading gpio_ext_portawould read
    the values on the signal of the external I/O pad. When configured as output mode, the data written to the
    gpio_swporta_dr register drives the output buffer of the I/O pad. The same pins are shared for both
    input and output modes, so they cannot be configured as input and output modes at the same time. †


    So I think it's as simple as

    Code:
    gpio_swportx_ddr = value;
  20. #11
  21. Contributing User

    Join Date
    Aug 2003
    Location
    UK
    Posts
    5,075
    Rep Power
    1802
    You should avoud re-quoting entire posts in your replies. If you are referring to something specific in a post, quote it for clarity - otherwise don't.

    Originally Posted by VladDracule
    One thing I am lacking is howto utilize hardware inputs such as GPIOS. I have experience in assembly so I understand how to do it down at the register level but ive never coded anything in that manner before.
    On most microcontrollers, GPIO registers are memory mapped so can be accessed via pointers in C. In most cases the chip or toolchain vendor will provide a header file with all the I/O registers defined.

    Originally Posted by VladDracule
    We will be using an RTOS, and will be using a cyclone V.
    A Cyclone V SoC presumably rather than Cyclone V FPGA? New to embedded and diving in with a Dual Core ARM Cortex-A9! Lucky you. I think your biggest learning curve will be the RTOS rather than C. C is a small language and easy to learn, using an RTOS effectively and safely is a different matter. There is little language support for concurrency and multi-tasking in C, so the OS library provides that.

    Fundamentally an RTOS provides at least a multi-tasking model (usually priority based preemptive scheduling of light-weight threads in a shared memory space), inter-process communication, synchronisation, resource locking, and timers. A higher end RTOS may provide MMU support so that tasks (threads or processes) run in independent protected memory spaces. Some RTOS's include "middleware" such as filesystems, device drivers and network stacks that you might expect to be part of the core OS in a desktop environment, in many cases these are optional or third-part components.

    Originally Posted by VladDracule
    just having something for familiarity and being able to practice/brush up my programming ability is mostly what i want.
    You got the job - presumably your employer knows what you need in terms of training and development and will facilitate that (unless you blagged the interview - in which case you will get caught out!).

    Originally Posted by VladDracule
    Something to start out very simple and then work my way up as my programming ability overall increases.
    Any C language reference that does not go into OS specifics (i.e. just the code language and standard libraries) will be appropriate for learning C for this target.

    As I said learning the specific RTOS, or about RTOSes in general may be more important.

    To be honest, I would suggest that it is you r new employer's responsibility to advise or train you.
  22. #12
  23. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Jan 2014
    Posts
    17
    Rep Power
    0
    Originally Posted by clifford
    As I said learning the specific RTOS, or about RTOSes in general may be more important.
    In the embedded applications I've worked with, a generic interface, mostly message based, was used for inter-thread communication / synchronization, and this interface was designed to be RTOS independent. Most of the team didn't need to know about the RTOS itself.

    As mentioned, try to find out what part of the project you will be working on. Has you're company acquired any tool kits that include compiler, linker, armulator, ..., and if so, can you get access to one of the took kits?
  24. #13
  25. Contributing User

    Join Date
    Aug 2003
    Location
    UK
    Posts
    5,075
    Rep Power
    1802
    Originally Posted by rcgldr
    Most of the team didn't need to know about the RTOS itself.
    An abstraction layer or façade providing RTOS independence is a common technique, but that does not mean that you do not need to understand the principles of scheduling, preemption, stack allocation, priority inversion, deadlocks, synchronisation, resource locking, IPC, shared memory access etc.

    An on-line lecture/presentation:
    Fundamentals of Real-Time Operating Systems
  26. #14
  27. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Jan 2014
    Posts
    17
    Rep Power
    0
    Originally Posted by clifford
    An abstraction layer or façade providing RTOS independence is a common technique, but that does not mean that you do not need to understand the principles of scheduling, preemption, stack allocation, priority inversion, deadlocks, synchronisation, resource locking, IPC, shared memory access etc.
    Many members of the team had no idea of how this stuff worked, other than they were not allowed to use globals for communication and had to use the abstracted messaging system for thread to thread or interrupt to thread communication and syncrhonization.
  28. #15
  29. Contributing User

    Join Date
    Aug 2003
    Location
    UK
    Posts
    5,075
    Rep Power
    1802
    Originally Posted by rcgldr
    they were not allowed to use globals for communication
    On that note: http://www.embedded.com/electronics-blogs/break-points/4025723/A-pox-on-globals is a useful read.


    Originally Posted by rcgldr
    they [..] had to use the abstracted messaging system for thread to thread or interrupt to thread communication and syncrhonization.
    I once worked with a guy who flatly refused to use the abstraction I proposed because by doing so he would not be able to put experience of the RTOS we were using on his résumé!

    An abstraction may serve different purposes, restricting and controlling safe use of the underlying OS is one. OS portability is another.
Page 1 of 2 12 Last
  • Jump to page:

IMN logo majestic logo threadwatch logo seochat tools logo