InGameRoutines for NESRGB

Discussion in 'Modding and Hacking - Consoles and Electronics' started by borti4938, Oct 14, 2014.

  1. Bad_Ad84

    Bad_Ad84 The Tick

    Joined:
    May 26, 2011
    Messages:
    8,566
    Likes Received:
    1,308
    Yes, I did mean you would need them on all lines... I'd assumed you would be smart enough to figure that out (and rightly too)

    I don't know how the new pad works off the top of my head, but if there is a clock from the console to the controller you can't put a diode on that line.

    Need to do some trial and error or look how the nes controller works and what the lines do exactly. Any signal that goes Console to controller can't have a diode
     
    Last edited: Feb 27, 2016
  2. Marmotta

    Marmotta Dauntless Member

    Joined:
    Apr 14, 2009
    Messages:
    755
    Likes Received:
    49
    The NES controller has Latch, Clock and Data lines. I think the only one sending signals from the pad to the console is Data.
     
    Last edited: Feb 27, 2016
  3. borti4938

    borti4938 Robust Member

    Joined:
    May 8, 2014
    Messages:
    205
    Likes Received:
    64
    I don't think that it is a good idea to combine the signals for both controllers.
    However, I want to say a few words to that.
    I haven't looked into NES schematics. If it is the similar to the SNES' one, the Latch signal is the same for both - P1 and P2. Only the clock and, of course, data is different.
    I expect that P1 and P2 are getting the same clock from the CPU. One may check that with an oscilloscope or just test it. If my assumption is correct, the connection to P1 clock is enough.
    The data lines to the PIC can be combined using an AND-gate (e.g. a 74HCT08 or 74HC1G08 (samples are available from TI)).
    The AND-gate combines both data lines for the PIC.
    But keep in mind: a button comibination for the PIC can be spreaded over both controllers. E.g. If P1 presses A+B and P2 Sel+St, the PIC reads Sel+St+A+B and initiate a reset.
     
  4. Marmotta

    Marmotta Dauntless Member

    Joined:
    Apr 14, 2009
    Messages:
    755
    Likes Received:
    49
    I'll try out the AND-gate idea as well. I don't think the chances of a button combination across both controllers would be very high (how often would you need to press A and B together or even the Select button alone in general use?).

    This is what I found about the Latch and Clock signals (read Pulse as Clock):

    The NES uses a serialized polling mechanism to query the state of the buttons. Every 60 Hz, the NES sends a 12us high signal to the Latch pin, telling the controller to latch the state of of all buttons internally. Six microseconds later, the NES sends 8 high pulses on the Pulse pin, 12us per full cycle, 50% duty cycle.

    After the initial wide pulse on the Latch pin, Data goes high until the eighth pulse passes, at which point it drops low again. For each pulse on the Pulse pin, Data will assert ground if the button corresponding to that pulse was pressed. (The button states on Data are thus negative true.) The button order is always the same: A, B, Select, Start, Up, Down, Left, Right.
     
    Last edited: Feb 28, 2016
  5. borti4938

    borti4938 Robust Member

    Joined:
    May 8, 2014
    Messages:
    205
    Likes Received:
    64
    The information about pulse widths is not correct.
    The pulse width of latch is around 3.5us, the width of a clock pulse around 350ns (negative to positive edge). One cannot say that this is a 50% duty cycle :D
    Also: as the NES does not have a auto joypad read feature like the SNES. Every game reads the joypad on its own code and the structure may look a bit different from game to game.
     
    Last edited: Feb 28, 2016
  6. Marmotta

    Marmotta Dauntless Member

    Joined:
    Apr 14, 2009
    Messages:
    755
    Likes Received:
    49
    Got round to trying out some stuff - my code works fine, so that's good. However, I did try running both controller data lines through an AND gate, but the second controller didn't work and on Contra the three different palettes were cycled through automatically, so I may have to try something else... Unfortunately I don't have an oscilloscope to check what is happening on the lines.
     
    Last edited: Mar 5, 2016
  7. splitter

    splitter Newly Registered

    Joined:
    Jun 9, 2016
    Messages:
    3
    Likes Received:
    0
    I was going to order a board from OSH Park, but I'd like to check that the current US schematic is OK. I just uploaded the .brd file to OSH Park and the output is below.

    Some of the through holes extend off the board (RCA jacks), as in the picture. It shows up like this in multiple viewers. Just want to check.

    Also, were the J4 jumpers intentionally removed?

    4a9a0e2a3e60c69a52c85ff0b8002a81.png
     
  8. borti4938

    borti4938 Robust Member

    Joined:
    May 8, 2014
    Messages:
    205
    Likes Received:
    64
    Looks good.

    The holes of the RCA jacks are partly off the dimension layer - that is as designed. Once produced and soldered it should looks like as the in the attached pictures.

    I also removed J4 for the US version.

    Btw: I have seen that C1 is shifted too much to the right.
     

    Attached Files:

  9. splitter

    splitter Newly Registered

    Joined:
    Jun 9, 2016
    Messages:
    3
    Likes Received:
    0
    Thanks for confirming that. This is an awesome project. I was about to install an NESRGB and re-cap the power supply/component out/RF daughterboard before finding this thread, but I was lamenting having to open a hole for my multiav port. This is the perfect solution--with some extra functionality to boot.

    I have never programmed a PIC microcontroller, but I have a model 1 RPi B with the Slice of Pi I/O addon board, and there is a package called "pickle" that apparently is able to program the 16F684.

    Also, I wanted to ask: I was looking at rectifier diodes, and the 1N5059s look like 1A diodes. Is that correct, or should I be looking for 1.5A diodes?
     
  10. splitter

    splitter Newly Registered

    Joined:
    Jun 9, 2016
    Messages:
    3
    Likes Received:
    0
    I put together the "new" version of the NES-IO board and it works great in my NES. Thank you!

    I'd like to put one of the "old" versions in my Famicom AV, but can I program the PIC after soldering it to the board, or do I have to program it somehow beforehand?
     
  11. boogieman

    boogieman Newly Registered

    Joined:
    Mar 10, 2018
    Messages:
    4
    Likes Received:
    0
    I installed the IGR board on my toploader NES. Since I already had the NESRGB board all soldered up, I opted to lift pin 22 and connect it with a jumper wire to pin 3 of the CPU. That took care of the crashing on reset issue like was talked about here.

    There is an issue where I need to push reset at startup to get the NES to work. I think the issue came from where it shows to cut the traces in the picture. The bottom reset in location shows the trace severed just below and to the left of the green circle. If you follow this trace downwards to the through holes, this is a capacitor. This capacitor is the one you replace if your nes (unmodded) needs to have reset pushed to start. Usually it's a bad cap issue, or in this case, the cap's trace is severed from the circuit.

    I thought the solution would be to NOT cut the lower trace but only the upper trace. That capacitor is the only thing on the bottom leg of that circuit, so it makes no sense to cut it unless having it hooked up to your IGR board would be an issue.

    I did try to jump the lower severed trace and it doesn't work. The NES refuses to start, even if reset is pushed. I'd really like to figure this out since it's annoying to push reset when powering up, but it's not the end of the world or anything if it's not possible.

    Does anyone have an idea on fixing the issue of having to push restart on initial power on?
     
  12. borti4938

    borti4938 Robust Member

    Joined:
    May 8, 2014
    Messages:
    205
    Likes Received:
    64
    Have you tried to reconnect the upper pin of the cap with pin 3 of the CPU after you made the two cuts?
    Which code version is on the PIC?
     
  13. boogieman

    boogieman Newly Registered

    Joined:
    Mar 10, 2018
    Messages:
    4
    Likes Received:
    0
    I haven't tried to connect the upper pin of the cap with pin 3 but I can try that. I don't know what code version I have as I bought it already flashed.
     
  14. borti4938

    borti4938 Robust Member

    Joined:
    May 8, 2014
    Messages:
    205
    Likes Received:
    64
  15. CrazedBinary

    CrazedBinary Newly Registered

    Joined:
    Nov 4, 2016
    Messages:
    2
    Likes Received:
    0
    Hi Borti,

    For the US Toploader is this still the correct procedure as detailed here?
    [​IMG]
    I don't want to cut any traces I don't need to as mentioned before about the capacitor!

    Thanks all - Crazed
     
    Last edited: Apr 27, 2018
sonicdude10
Draft saved Draft deleted
Insert every image as a...
  1.  0%

Share This Page