thepenguin77 wrote:
They took some features out and made it less reliable. For one, they took out the logic analyzer. If you go to the my edaboard post and watch the second youtube video the guy posted, you'll see what I mean. Plus, 2 is cheaper. Smile
Ah, so I see. That's no fair, then. Sad I hope that the PICkit 2 does the trick for you, then. Smile
Microchip have been promising some of the standalone tools for the PICkit 2 to be updated for the PICkit 3, but they're taking a while to show them (there's a beta of the standalone programming software, at least, but no logic analyser). The PICkit 3 isn't that bad (from a hardware perspective it's quite a bit nicer than the PICkit 2) but has some software design quirks. For example, every time you switch PIC type, it needs to download a specific firmware into the PICkit 3. If you switch PIC types frequently you'll end up reflashing the PICkit 3 firmware frequently, and if one of these firmware swaps goes wrong you could brick the PICkit 3. (Unless you have another PIC programmer around to manually reprogram the PIC inside the PICkit 3).

For what it's worth, I've got a PICkit 3 and I'm happy enough with it, though keep meaning to buy a cheap PICkit 2 clone.
Ok, so my picKit2 finally came in the mail today. And it worked!!! Now I think I can finally finish this project
thepenguin77 wrote:
Ok, so my picKit2 finally came in the mail today. And it worked!!! Now I think I can finally finish this project
Congrats! I'm anxious for you to finish it quickly so we can see how well it works.
While describing how it works is ok, it would be much better to show a video.


I actually don't suck at aiming. The problem was that 1. this account has the sensitivity on 10 and 2. I was playing with a circuit board connected to a bread board, not a plastic controller.

In case you didn't realize, both of the guns I'm using are single shot.
That's a very descriptive video, Penguin; thanks for that. So does this mean that other than cramming everything back into the controller casing, that the project is all done?
Yes, it is very close to being done. I only have a few things left like: choosing the rapid speeds and finalizing the hardware side.

And on the hardware side I need a little help. First off, the extra button had to be tied to ground because it was floating around. I would turn the controller on and the button would appear to be pressed when I wasn't pressing it. The fix was to tie it to ground with a 22k resistor. I have no idea what this resistor should be, I just picked a big one because I don't want to short the controller when the button is pressed.

But the problem I am having now is that the controller notices the keypress before my chip does. This causes some little glitches like shots being fired when switching modes. When nothing is being pressed, the trigger is at 1.36 V and + is at 2.00 V. When I start pulling the trigger, the voltage slowly drops from 1.36 to about .12. I figured out that the controller notices the trigger pull at about 1.15 V.

So my question is, what can I do to get my chip to recognize a voltage drop before the controller.
Generally a 10K resistor is used; I think that trying smaller values might do the trick. It's worth a try, at any rate.
I second Kerm's recommendation for a 10K for a good size for a button pull-up. However, the PIC has internal weak pull-ups; it may be easier to use the button between the pin and ground and enable the weak pull-up rather than use an external resistor. (I'm not sure what your hardware limitations are).

To detect an analogue event try using the PIC's comparator module. I'm not familiar enough with this particular PIC to offer much more of a suggestion, sorry. Sad
Ok. So I'll use weak pull-ups for the button. That will be really easy. Those shouldn't affect the other pins right? I would assume that the weak pull-ups are just very moderate.

But that still doesn't fix my main problem of the sensitivity. The comparator won't work because that only deals with 1 pin. Even if I rigged it to to use both pins just on opposites. i.e. if one goes higher than the the other. I wouldn't be able to detect both at the same time. Plus, the code to do this would probably be more intensive than what I have now and I only have 32 bytes left.
So do you think that the problem of the PIC detecting the key last is because of some artificial delay or latency, or simply because of the speed of the chip?
My tact switches came today, so the circuit board is now in a controller Razz.

The problem is that the chip needs to detect the voltage drop with more sensitivity. It is not an artificial delay or anything, it is just the chip's threshold I have to get around.

I just did a little testing and the chip detects the keypress when the voltage drops to .75 V. This is definitely what the problem is. The voltage starts at 1.36, the controller detects it at 1.15, and my chip detects it at .75, giving the controller plenty of time to mess up what I am doing.

So is there any way to wire it so that it is more sensitive, or wire it so that a little change on the trigger makes a big change on the chip?
thepenguin77 wrote:
My tact switches came today, so the circuit board is now in a controller Razz.

The problem is that the chip needs to detect the voltage drop with more sensitivity. It is not an artificial delay or anything, it is just the chip's threshold I have to get around.

I just did a little testing and the chip detects the keypress when the voltage drops to .75 V. This is definitely what the problem is. The voltage starts at 1.36, the controller detects it at 1.15, and my chip detects it at .75, giving the controller plenty of time to mess up what I am doing.

So is there any way to wire it so that it is more sensitive, or wire it so that a little change on the trigger makes a big change on the chip?
Well, you could certainly use one of several strategies to amplify it, but I don't understand why you have a slow gradient of voltages in the first place.
The slow gradient comes from the fact that the left and right triggers are long-pull triggers with potentiometers in them. That's for racing games where you need to adjust your acceleration and such. But in a shooting game, they are essentially either shooting or not. That's why the gradient is affecting me.
thepenguin77 wrote:
The slow gradient comes from the fact that the left and right triggers are long-pull triggers with potentiometers in them. That's for racing games where you need to adjust your acceleration and such. But in a shooting game, they are essentially either shooting or not. That's why the gradient is affecting me.
Ahhh, then that makes perfect sense. May I ask what the problem with a comparator was, as Ben suggested? If you used a reference voltage of 1.5v or so, you could easily adjust the trigger of your circuit relative to the controller's built-in circuit.
Ah, yes, that would be a good way to do it. I never thought of using the comparator like that. The reason that it won't work though is that I have two triggers to deal with and only one comparator.

Here is a thought that I had on how to do this. Essentially I have three lines, ground, trigger, and pin. I have to be able to send both ground and positive to the trigger from the pin. Here was my idea:


Code:

ground   trigger    pin
  |         |        |
  |         -----K----
  \         |        /
    \      | |     /
      \    |Ω|   /
        \   |  /
        transistor

I'm glad to see code is fixed width.

I don't know the value of the resistor but that was my idea. I can never figure out which transistor is which, but I want it so that when the trigger starts to drop, it sends ground to the pin. The diode is so that the pin can send ground to the trigger. And I believe to send positive, it can just back track through the resistor.

Should this work?
That would sorta work, but here's another suggestion: Comparators come in nice discrete op-amp chips; would you consider a quad op-amp IC in your design?
you can always buy one of these:

http://www.play-asia.com/paOS-13-71-dd-49-en-70-3jg9.html

my friend bought one its for those to lazy to make a rapid fire controller
Ted3681 wrote:
you can always buy one of these:

http://www.play-asia.com/paOS-13-71-dd-49-en-70-3jg9.html

my friend bought one its for those to lazy to make a rapid fire controller
*My *one; *it's *too *controller.

I consider Penguin's approach to have infinitely more technological respect and acumen. Smile
An op-amp chip could possibly work. But for now, I think I'll see if I can get that diagram I posted above to work. That is somewhat what someone else did. I saw it in a guide to install their mod chips Wink Should the overall concept of it work?
  
Register to Join the Conversation
Have your own thoughts to add to this or any other topic? Want to ask a question, offer a suggestion, share your own programs and projects, upload a file to the file archives, get help with calculator and computer programming, or simply chat with like-minded coders and tech and calculator enthusiasts via the site-wide AJAX SAX widget? Registration for a free Cemetech account only takes a minute.

» Go to Registration page
Page 2 of 3
» All times are UTC - 5 Hours
 
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum

 

Advertisement