Pthread.h on ATmega32 micrcontroller

  • Thread starter Thread starter Etude
  • Start date Start date
Join the discussion
Ask a follow-up here, or get your own question answered by working scientists, mathematicians and engineers — people, not an autocomplete.
Real named experts · corrections over time · the nuance an AI answer skips
2 replies · 5K views
Etude
Messages
28
Reaction score
0
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.

Thanx!
 
Physics news on Phys.org
IIRC, most microcontrollers don't do threading. You can simulate it using interrupts, I believe.

Quick test of avr-gcc:
Code:
me@linuxbox:~$ avr-gcc test.c
test.c:1:21: error: pthread.h: No such file or directory
 
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).

http://en.wikipedia.org/wiki/List_of_real-time_operating_systems

link to brtos from wiki article:

http://code.google.com/p/brtos/

It's also possible that your atmega328 came with software that included a multi-threading operating system.
 
Last edited: