Dismiss Notice
Join Physics Forums Today!
The friendliest, high quality science and math community on the planet! Everyone who loves science is here!

Pthread.h on ATmega32 micrcontroller

  1. Feb 20, 2012 #1
    Ok This might be really stupid but I have been finding conflicting answers and getting very confused.

    I am trying to program an Atmel ATmega32 using embedded C. This is my first time and I wanted to know if I can use threads in the programming.

  2. jcsd
  3. Feb 21, 2012 #2


    User Avatar
    Gold Member

    IIRC, most microcontrollers don't do threading. You can simulate it using interrupts, I believe.

    Quick test of avr-gcc:
    Code (Text):

    me@linuxbox:~$ avr-gcc test.c
    test.c:1:21: error: pthread.h: No such file or directory

  4. Feb 21, 2012 #3


    User Avatar
    Homework Helper

    Looking at atmel's documentation, it's a single cpu. If you want to do multi-threading you'll need to write or obtain a multi-threading operating system for the atmega328. The only operating system for the atmega328 I see in this wiki article is BRTOS, which is apparently free (MIT license).


    link to brtos from wiki article:


    It's also possible that your atmega328 came with software that included a multi-threading operating system.
    Last edited: Feb 21, 2012
Share this great discussion with others via Reddit, Google+, Twitter, or Facebook