??? 04/02/08 18:18 Read: times |
#152898 - here's one way ... use it at your own risk ... Responding to: ???'s previous message |
Mohammad Okasha said:
it's my graduation project and im running out of time...
the thing is that i need to put a self diagnostic routine that starts with the device and checks all input ports(P1 & p2). i have only 3 unused pins on p3 and my idea needs at least 8 pins. I read about using shift registers here on the site but i don't really get how i can use it or if it is going to solve my problem, ... so I'd really appreciate any ideas or explanation. Thnx What is it, exactly that you intend to diagnose? How thoroughly do you intend to diagnose it, i.e. do you intend to check all possible values and combinations, or do you intend only to check for "stuck" bits, etc? Here's one way in which you could accomplish this task, namely checking for proper function of your INPUT port functionality and OUTPUT port functionality on P1 and P2. If you use an external bidirectional tristate shift register, e.g. 74HC299/74HC323, etc... one tied to each port, P1 and P2, you can control these with three pins, and test both input and output functions. One of your three available pins drives the clock. One drives the S0 pin and one drives the S1 pin. G0 and G1 are tied to GND, since the output enable can be controlled via S0 and S1, i.e. when they are both '1' the output is disabled. The remaining available MCU pin will drive the S0 pin, and you will not worry about the SR and SL pins, as they are redundant. You can simply tie them Vcc or GND and use S0 and S1 to control the device. To load the shift register from the port, assuming you know how to write to the port, you set S0 and S1 to '11' and then drive the clock low and then high. To shift left, which is what you will do, you set S0 low and set S1 high, after which you then drive the clock low and then high. The nCLEAR need not be actively driven because you don't care about initial conditions, hence, it can be tied to '1'. This gives you the ability to load the shift register with any desired value, shift it however many times you wish, and then read its content. If, for example, you wish to check each bit alone, you can write a "00000001b" to the port in question, follow the load sequence, and then write a "11111111b" to the port. Then you can follow the shift-left sequence, enable the outputs, and read the port. You should then see a "00000010b" on that port. You do that an additional six times, and you'll know whether or not all the port bits can be read. If you consult the 74xx299/323 datasheet, which can be somewhat confusing because of the redundant inputs and functions, intended for maximal flexibility, you'll see that there are numerous things you can do. Once you set the S0 and S1 pins appropriately, all you have to do is control the port and control the clock, for each funciton. If you want to be able to recirculate the register content, thoug I don't know why you'd want to do that, you can connect Qh' to SL. This device (74xx299/323) is useable for parallel-in/parallel-out, parallel-in/serial-out, serial-in/parallel-out, and serial-in/serial-out operations. I've assumed that, since this is your final project, you are intimately familiar with the details of the 805x operation and instruction set, the basics of digital logic, and the importance of carefully studying all datasheets relevant to your application. If that isn't the case, then you're in serious trouble! RE |
Topic | Author | Date |
only 3 empty pins while i need at least 8 o/p pins | 01/01/70 00:00 | |
What is it checking for Highs lows? | 01/01/70 00:00 | |
data aquisition system of a satellite | 01/01/70 00:00 | |
Is it really necessary? | 01/01/70 00:00 | |
unfortunatelly it is necessary | 01/01/70 00:00 | |
here's one way ... use it at your own risk ... | 01/01/70 00:00 | |
the self diagnosis | 01/01/70 00:00 | |
Correction | 01/01/70 00:00 | |
What you should ask him is ... | 01/01/70 00:00 | |
RE:What you should ask him is... | 01/01/70 00:00 | |
It's not pointless, but it is costly. | 01/01/70 00:00 | |
RE:Type of test | 01/01/70 00:00 | |
Simple tests use loopbacks | 01/01/70 00:00 | |
receiving inspection | 01/01/70 00:00 | |
RE:receiving inspection | 01/01/70 00:00 | |
You should probably do what your instructor says | 01/01/70 00:00 | |
RE:you should probably do what the instructor says | 01/01/70 00:00 | |
Instead the input buffers.. | 01/01/70 00:00 | |
aside from internal memory test and port checks | 01/01/70 00:00 | |
Thank you.....![]() | 01/01/70 00:00 |