Here's what I'm trying to do. I have a dvd-rom, I found the signal that is logic 1 (on) when a disc is in the drive and a logic 0 (off) when there is no disc. The problem I am having is that when the eject button is pressed, the signal turns 1 (on), then back to 0 (off) when the drive is opened. When the eject button is pressed again, the drive closes and the signal turns 1 (on) then back to 0 (off), but if there is a disc in it jumps back to (on). I need a way to get a constant 1 (on) until it reads that a cd is in the drive, then it should be 0 (off). Basically: signal starts at a constant 1 press eject button signal goes to 0 signal goes back to 1 dvd-rom drive opens signal at constant 1 press eject button signal goes to 0 signal goes back to 1 dvd-rom drive closes IF: NO CD {signal stays at 1} IF: CD present {signal goes to and stays at 0} Hopefully I explained it enough to get help. Thank you.
Are you reading the head access timing do-dad that you can get of the monitoring thing? (i think i saw that done somewhere on piclist.com, but i am not sure) Anyways, if you can't find a nice solution there. Simplest way i can think of would be to use the signal from the eject switch. This would give you the simple logic idea (where e is eject switch satus, and i is the read indicator) on falling edge of E, wait until i reaches 0 code, once it returns to one, then output is i. How do u want to make it, MCU(YEH!) or logic gates (BOO HISS).
is there any type of chip that, when given a logic 1 for a time of more than 2 or 3 seconds it gives back a 1, and vise versa for a logic 0? That way those jumps would be ignored.
you're essentially talking about switch debouncing - dealing with the fact that when a C&N* push button is pushed or released, it tends to fluctuate wildly for a short amount of time before settling into the correct state. This is usually done by catching the falling or rising edge of the signal and ignoring everything else for a short while - the only difference here is that you need to ignore everything for a slightly longer while. There are many many ways of doing this, which range from the complicated to the very simple, essentially ranging between the highly effective and the not-so-effective - you choose the method that fits your needs. You should be able to produce a good solution that fits your needs with some NAND gates and a capacitor, where the value of the capacitor determines the period that gets ignored (bigger cap = longer period). If nobody beats me to it, I'll try post a schematic tomorrow (tonight is Work Late Night (tm))... * Cheap 'n Nasty Edited to add that you could also quite easily do this with a 555, should you so desire, and there are (were?) all-in-one switch debouncers on a chip, but that would be complete overkill.
Is it simple bounce? I thought most cd-trays used de-bounced switches and he was reading the head access info.
on reflection, perhaps 'somewhat similar to switch debounce' might be better. I was talking about applying debounce to the status line hanclansolo was monitoring, not the eject button. Essentially, as I understand this, you want to ignore the signal until it has settled in one state or the other, i.e. if it changes for less than a certain amount of time, you ignore the change. This is very similar to switch debounce. A simple RC filter is probably all you need, although you probably want to add some form of (inverting?) buffer, so that you don't end up with a nasty fluctuating signal. I don't think you'd need to go as far as single chip solutions, or shift registers for something this simple. A rather nice page I found while trying not to have to draw diagrams in Paint is this one - it deals with debouncing mercury tilt switches, and explains RC filters and shift registers quite nicely. I guess you'd want to ignore the software bit
could a relay be used as a timer delay? That way when the relay is given a signal for a long enough time it is switched on.
what about people like me who like to repeatedly press the eject button as rapidly as possible to alieviate bordom and stress?
hanclansolo: not really, unless the transitions are REALLY fast - relay's don't take long to switch. Wolfe: you get assigned to the Muppet Bucket (tm) and ignored?
I have found in nearly every drive I have opened (normal or laptop) that there is a SPDT switch that determines tray in/out Tray In/Out should be active low (zero when activated) The middle pin on the switch is ground, and the two other contacts are In and Out. Switch: Pin1---|-|.........TrayOut Pin2---|-|===....Ground Pin3---|-|.........TrayIn My guide here is for Pioneer Slot DVD's but should work on really any drive. http://forums.bit-tech.net/showthread.php?t=48541 This is an image of the Tray IN and Out switches on a Pioneer 106S There are two switches, but pinout to only three pins in the end. http://www.zapwizard.com/MediaPC/DVD/Testing.JPG This is the switch on a CD-RW I modded. (Three pins) http://www.zapwizard.com/mediapc/cdrw/Switch-Off.jpg http://www.zapwizard.com/mediapc/cdrw/Switch-ON.jpg And on a Laptop DVD drive: http://www.zapwizard.com/lanpc/CDRom/Routed-2.jpg (two small black numbs at the very bottom left of the drive)