Go Down

Topic: Restrict user of certain pin/peripheral? (Read 825 times) previous topic - next topic

Baoshi

Hi,

I'm designing an Arduino compatible board with some extra devices (a Nixie tube to be exact). Within the circuit I have a H-bridge driving a transform. The H-bridge is controlled by OC1A/OC1B which produce complementary waveforms. I've written a library to configure Timer 1 for the need.

Now I'm worry if the board is given to a user, who did not use the library I provided but run some arbitrary code on it. There is a risk that both high-side and low-side MOSFET of the H-bridge are turned on simultaneously which causes a dead-short.

So I'm thinking if there is a way to restrict user of accessing these pins either as digital I/O or PWM. Maybe through pins_arduino.h or remake a core directory with reduced functions.

I know this may not be feasible, and is surely not fool-proof. But just want to explore if any possibility.

Thanks

Baoshi




Grumpy_Mike

You can do that but you will have to hack the header files and have your own IDE, not a good idea.
How about simply using an inverter or transistor to generate the complement of a pin for driving the h- bridge?

westfw

You could use your own pins_arduino.h file to mark the relevant digial pins as "NOT_A_PORT" in the digital_pin_to_port_PGM array.  This would only protect against a particular class of users, and it would cause programs to fail "silently" in mysterious manner if they tried to use the pins, but it might be better than nothing.

Go Up