Continue to Site

Welcome to our site!

Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

  • Welcome to our site! Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

Hard wire a bit to a pin?

Status
Not open for further replies.

woodrufj

New Member
Using a MicroChip (16F1829), is there a code (C) way to make an output pin directly follow a readable bit?

Specifically I'm looking for a pin to follow TMR0IF. This would be nice so I don't have to constantly check the flag while doing other important things.

I was thinking the #define tag, but doesn't look like it'll work that way.

Jay W
 
No, executable code has to read the state of TMR0IF, and then set a port pin high or low...
 
If you use an interrupt then as soon as TMR0F gets set, an interrupt fires, so that you can set your pin. This way you don't need to check constantly.
 
Status
Not open for further replies.

Latest threads

New Articles From Microcontroller Tips

Back
Top