Previous in Forum: Which is best combination   Next in Forum: why a transformer feeder is not provided with line isolator
Close
Close
Close
Rate Comments: Nested
Associate

Join Date: Jul 2007
Posts: 26

help on pic micro

03/03/2008 11:18 AM

hi guys

i have a pic micro and connected to it is a card reader

now when a card is inserted,the pic goes to a particular address of the card for authentication say addr 0x0000.

the problem is ,if a wrong card is inserted or anything at all is inserted,since the pic cannot read address 0x0000,it gets stucked.

i want to put a time limit on the code that reads from the card at address 0x0000,so that if that time elapses ,the micro will skip that instruction and move on to the next, but i dont know how to do that?

any suggestions? or if u have a better idea....u are welcome

Register to Reply
Interested in this topic? By joining CR4 you can "subscribe" to
this discussion and receive notification when new comments are added.
Guru

Join Date: Jan 2008
Posts: 1753
Good Answers: 59
#1

Re: help on pic micro

03/03/2008 6:20 PM

You asked a specific monitoring question, but there is a general programming technique that solves all such problems for your design at once.

You set up a single monitoring timer, as loose as you are able to live with, and as close and detailed in the logging of the cause of its triggering as you desire. Then you keep programming all your segments with that in mind, that from time to time your routine should reset the monitor, so that it won't trigger. When the program is tardy or stuck anywhere, you have all the data to track the problem, or program a very specific response and log for your benefit. Additionally, knowing that the monitor will hammer sloppy programming does wonder to crisp and modular programming (effect on the programmer's mind mainly).

Register to Reply
Register to Reply

Previous in Forum: Which is best combination   Next in Forum: why a transformer feeder is not provided with line isolator

Advertisement