10 years, 11 months ago.

Are digital pins rtos safe?

So I'm working on writing a RTOS application that has GPS, Bluetooth, LEDs, etc. All of these things are on different pins, but am I going to have a problem with one thread turning one LED on(say PTE1) and another doing something with another pin on the same port(say PTE2)?

1 Answer

10 years, 11 months ago.

No, actions on one pin should not affect any other pin, regardless of the port they are on.

Accepted Answer

So yes, they are safe? Or no they are not?

posted by Eric Fossum 17 May 2013

They are safe, otherwise you couldn't do anything.

posted by Erik - 17 May 2013

Maybe there is a communication error, but I mean do I need a mutex in my rtos for each port?

posted by Eric Fossum 17 May 2013

Ah like that.

I haven't used RTOS myself, but if I understand it correctly you should not need a mutex for each port. Each pin of a port is controlled completely independent of other pins. Only if you would use a pin for several purposes you would need a mutex for it (that won't happen often, but there are some use cases for it).

But the tl;dr is that writing/read/setting mode of one pin should have no influence/dependence on other pins, so from what I understand then a mutex is not required.

posted by Erik - 17 May 2013

Thanks, that sounds like we're on the same page now :) and it sounds correct too.

posted by Eric Fossum 17 May 2013