Pages: [1]   Go Down
Author Topic: Restrict user of certain pin/peripheral?  (Read 795 times)
0 Members and 1 Guest are viewing this topic.
Offline Offline
Karma: 1
Posts: 2
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset


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.




Manchester (England England)
Offline Offline
Brattain Member
Karma: 631
Posts: 34510
Solder is electric glue
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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?

SF Bay Area (USA)
Offline Offline
Tesla Member
Karma: 135
Posts: 6782
Strongly opinionated, but not official!
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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.

Pages: [1]   Go Up
Jump to: