the dude of dudes
New Member
I'm pretty green when it comes to electronics, but I still really enjoy plugging away with it and learning by building circuits and such. So please be gentle!
I've been working on building a circuit to interface a PS/2 mouse as a game paddle with my old Commodore64 using a PIC 1688. Basically, I'm fooling the computers A/D convertor by pulling the POT line high for a specific period of time. It all works well, however the key to getting the timing right is sensing the start of a 512us read cycle which starts when the computer pulls the line lo for 256us. The line goes from tri-state to lo, which RB0 on the PIC is unable to detect, so I'm using a saturated BJT as a switch as recommended on another thread on this site.
My problem is there seems to be a latency with the switching of the transistor. I'm using an NTE123AP (since it's what I have). It's rated for 6V on the base, and a max Ic of 600ma, so I think it's big enough. hfe is 200, and ft is 300mhz min (I assume this is switching speed, which would be plenty). Changing the values of resistors to the base and collector seem to have quite an effect on how much latency there is. I start timing the cycle when the transistor switches off, and my POT value on the computer is determined by the amount of time that passed before I pull the lines high. Changing the base and collector resistors change this number. So I can only assume that the transistor is not properly switching off. How do I calculate the proper reisistor values for this, and determine if I am using the right transistor for the job?
I've been working on building a circuit to interface a PS/2 mouse as a game paddle with my old Commodore64 using a PIC 1688. Basically, I'm fooling the computers A/D convertor by pulling the POT line high for a specific period of time. It all works well, however the key to getting the timing right is sensing the start of a 512us read cycle which starts when the computer pulls the line lo for 256us. The line goes from tri-state to lo, which RB0 on the PIC is unable to detect, so I'm using a saturated BJT as a switch as recommended on another thread on this site.
My problem is there seems to be a latency with the switching of the transistor. I'm using an NTE123AP (since it's what I have). It's rated for 6V on the base, and a max Ic of 600ma, so I think it's big enough. hfe is 200, and ft is 300mhz min (I assume this is switching speed, which would be plenty). Changing the values of resistors to the base and collector seem to have quite an effect on how much latency there is. I start timing the cycle when the transistor switches off, and my POT value on the computer is determined by the amount of time that passed before I pull the lines high. Changing the base and collector resistors change this number. So I can only assume that the transistor is not properly switching off. How do I calculate the proper reisistor values for this, and determine if I am using the right transistor for the job?