Pthread.h on ATmega32 micrcontroller

  • Thread starter Thread starter Etude
  • Start date Start date
AI Thread Summary
Programming the Atmel ATmega32 using embedded C does not support traditional threading due to its single CPU architecture. Instead, developers can simulate threading through interrupts. The avr-gcc compiler does not include support for pthreads, which leads to errors when attempting to use them. For multi-threading capabilities, a real-time operating system (RTOS) like BRTOS can be utilized, which is available under the MIT license. It's also possible that the ATmega328 may come pre-installed with a multi-threading OS, but this would depend on the specific software provided with the microcontroller.
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!
 
Technology 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:
Thread 'Is this public key encryption?'
I've tried to intuit public key encryption but never quite managed. But this seems to wrap it up in a bow. This seems to be a very elegant way of transmitting a message publicly that only the sender and receiver can decipher. Is this how PKE works? No, it cant be. In the above case, the requester knows the target's "secret" key - because they have his ID, and therefore knows his birthdate.
I tried a web search "the loss of programming ", and found an article saying that all aspects of writing, developing, and testing software programs will one day all be handled through artificial intelligence. One must wonder then, who is responsible. WHO is responsible for any problems, bugs, deficiencies, or whatever malfunctions which the programs make their users endure? Things may work wrong however the "wrong" happens. AI needs to fix the problems for the users. Any way to...

Similar threads

Back
Top