ukVac.com Homepage
Forum Home Forum Home > Technical > Tech, Maintenance & Repairs
  New Posts New Posts RSS Feed - Arduino In-Circuit Tester: Build Project
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

Skin:


Arduino In-Circuit Tester: Build Project

 Post Reply Post Reply Page  <1 1819202122>
Author
Message
 Rating: Topic Rating: 3 Votes, Average 5.00  Topic Search Topic Search  Topic Options Topic Options
wondras View Drop Down
Newbie
Newbie


Joined: 24 Mar 2019
Location: USA
Status: Offline
Points: 25

Feedback: 0
Post Options Post Options   Thanks (0) Thanks(0)   Quote wondras Quote  Post ReplyReply Direct Link To This Post Posted: 06 Jul 2019 at 7:39pm
Originally posted by Arcadenut Arcadenut wrote:

Spent a bit of time today updating the Wiki for my software here:


Will be spending time this weekend working on getting Centipede working through my software.

Just wanted to say that I will be watching with great interest as this develops, and hope to offer some help where possible. I originally thought the ICT should be PC-based, though I've grown to like the computer-free setup when I'm actually working on a board. 

There are so many useful things you can do with a connected PC... ROM identiication and dumping, limitless game support, diagnostic messages longer than 16 characters, etc., etc. And as you said, you could have a simplified config file for setting up a game, instead of doing it with C structs, etc.
Back to Top
wondras View Drop Down
Newbie
Newbie


Joined: 24 Mar 2019
Location: USA
Status: Offline
Points: 25

Feedback: 0
Post Options Post Options   Thanks (0) Thanks(0)   Quote wondras Quote  Post ReplyReply Direct Link To This Post Posted: 06 Jul 2019 at 7:53pm
Originally posted by Arcadenut Arcadenut wrote:

So I'm able to do RAM tests on Centipede by writing a specific byte and reading it back.  

For some reason I cannot read the ROMs though.  

Wondras, do you have that part working in your driver?

I'm also able to write to and read video memory (1024 - 1984) with no problem.  Nothing is on the screen however, so it would be nice to figure out how to get the video to display.


I defined the ROM sets and checksums (but not 2n byte tests.) I haven't actually hooked up my Centipede board yet, but I should be doing so soon.

Strange that ROM wouldn't be readable if RAM works; the address and data bus connections are the same. If you have a logic probe or voltmeter, you could check the ROM0 - ROM3 test points to see if they go low when you try to read different addresses (0x2000-0x27FF is ROM0, 0x2800-0x2FFF is ROM1, etc.)

Writes to video RAM will probably work (the ICT write pulse is very long, so it will probably span across the 4H window), but I'd be very surprised if it can be read reliably without being synced. (I had some success with my efforts in this regard, more to come on that front soon...)


Back to Top
Arcadenut View Drop Down
Newbie
Newbie


Joined: 29 Mar 2017
Status: Offline
Points: 99

Feedback: 0
Post Options Post Options   Thanks (0) Thanks(0)   Quote Arcadenut Quote  Post ReplyReply Direct Link To This Post Posted: 07 Jul 2019 at 2:00am
More progress and interesting progress....

I decided to go the Non- Bus mastering route today.

So I hooked up the ICT without the extra connectors and N1 unmodified.

I can R/W RAM (first 1K) no issues.

I can Write Video RAM no problems, but cannot read it.

Still no luck on ROMS, but I'm working on that.  That might have been a bug in my stuff, will probably play with it more in the next couple days.

I can test the color pallet no problem.

Sample Script for Color Pallet....
public override void StartTest()
{
    string result = "";
    string[] colorNames = new string[] { "White", "Cyan", "Magenta", "Blue", "Yellow", "Green", "Red", "Back"};
    int[] colorValues = new int[] { 0, 1, 2, 3, 4, 5, 6, 7 };

if (Tester == null)
{
        DisplayMessage("Connect to Device First");
        AbortTests();
        return;
}

    for(int x = 0; x < colorNames.Length; x++)
    {
        DisplayAlertMessage("Color should be " + colorNames[x]);
        result = Tester.WriteMemory(5120, 16, colorValues[x]);
        if (result != "")
        {
          DisplayMessage(result);
          AbortTests();
          return;
        }

        PauseTest();
    }        
}


Edited by Arcadenut - 07 Jul 2019 at 2:03am
Back to Top
wondras View Drop Down
Newbie
Newbie


Joined: 24 Mar 2019
Location: USA
Status: Offline
Points: 25

Feedback: 0
Post Options Post Options   Thanks (0) Thanks(0)   Quote wondras Quote  Post ReplyReply Direct Link To This Post Posted: 13 Jul 2019 at 3:37am
I've successfully created phi2 clock pulses synced to the 1.5 MHz phi0 clock on the PCB! This hopefully opens up access to hardware that uses clocks derived from the master clock on the PCB instead of the phi1/phi2 outputs from the 6502, without having to use the ICT's clock master mode (which kills real-time operation of the hardware.)

Thanks to a fortunate relationship between the 1.5 MHz clock of the CPU and the 16 MHz clock of the AVR/ATmega on the Arduino, I can get surprisingly accurate timing. It turns out that 11 AVR clocks take ever-so-slightly longer than one 6502 clock (20 nanoseconds).



If I use polling to get an approximate position somewhere in the low part of the 6502 clock cycle, I can then use an 11-cycle loop to look for the start of a high pulse. Each time it loops, it gets 20ns closer to the rising edge. When it finally hits it, I know the next one will come in about 10 cycles, so I time my phi2 pulse to occur at that time.

What little assembly coding I did was over 30 years ago, but I managed to cobble together a series of instructions that actually works! 

Here are the clock signals with a real 6502A (phi0 input on bottom, phi2 output on top):



Here are the same signals using the ICT:



It really is accurate to about 20ns -- this slight jitter makes phi0 look a little fuzzier with the ICT. It's much tighter than I expected to get, though, and should be more than sufficient.

Now I need to try using it to access the Battlezone mathbox and vector generator, which didn't play well with the ICT before. Centipede video RAM will require a somewhat different strategy, since phi0 skips pulses to avoid contention with the display hardware, but I think it can be adapted. 

I'm not sure how to turn this into proper code yet. Getting this sort of speed and timing requires hard-coding for specific pins/ports, instead of using the structures that abstract this away from the main code. Maybe it doesn't really fit, and will have to remain experimental. I guess I'll worry about making it useful first...

Anyway, thanks for listening! Geek
Back to Top
yorkshire_spam View Drop Down
User
User


Joined: 12 Jan 2002
Location: United Kingdom
Status: Online
Points: 939

Feedback: 0
Post Options Post Options   Thanks (0) Thanks(0)   Quote yorkshire_spam Quote  Post ReplyReply Direct Link To This Post Posted: 13 Jul 2019 at 10:24am
That's awesome! Nice one!
Back to Top
Judder View Drop Down
User
User
Avatar

Joined: 01 Mar 2012
Location: London
Status: Offline
Points: 1859

Feedback: 5
Post Options Post Options   Thanks (0) Thanks(0)   Quote Judder Quote  Post ReplyReply Direct Link To This Post Posted: 13 Jul 2019 at 11:35am
Just caught up on the thread - awesome work guys @wondras @Arcadenut Thumbs Up
http://www.thedefenderproject.com/
Back to Top
Arcadenut View Drop Down
Newbie
Newbie


Joined: 29 Mar 2017
Status: Offline
Points: 99

Feedback: 0
Post Options Post Options   Thanks (0) Thanks(0)   Quote Arcadenut Quote  Post ReplyReply Direct Link To This Post Posted: 13 Jul 2019 at 9:37pm
Messing with Centipede more today.  This is on a 100% functioning PCB.

1) I can run a RAM test (0 - 1024) just fine in regular 6502 and Clock Master mode.

2) I can run a Video RAM test under regular mode, but I can only write to the Video RAM.  Can't read it back.  However, I do get changes on the screen.

3) I can run a Video RAM test under Clock Mastering mode, but I don't get video on the screen.  I can however read and write to it just fine.

4) I cannot read from ROM at all.  Doesn't matter the mode.  Chip Select is never enabled.  I put the scope on pins 10 and 9 of J3 and they never pulsed.

I'm thinking it has to do with the LS244 at B1 as that seems to be fed by the 02 clock from the CPU.  That in turn feeds K3 which then feeds J3.

So in order to read ROM's we need to trigger the ROM select by hand or figure out why it's not working through the tester.

At least the RAM tests are working Smile
Back to Top
wondras View Drop Down
Newbie
Newbie


Joined: 24 Mar 2019
Location: USA
Status: Offline
Points: 25

Feedback: 0
Post Options Post Options   Thanks (0) Thanks(0)   Quote wondras Quote  Post ReplyReply Direct Link To This Post Posted: 14 Jul 2019 at 12:57am
I'd say #1-#3 are great!  With a little luck, it may even be possible to have video display and video RAM tests at the same time soon. Smile

#4 is strange if the board is fully working. Did you use resistors on your shield board, or did you use the version that eliminates them? The details are somewhere back in this thread, but IIRC some Atari boards don't work reliably when the resistors are used. WIth 470 Ohm resistors, you only get about 10 mA of current; perhaps that's not enough for the A13 line from the CPU, which is driving two inputs (on H3 and K3), whereas all the other lines are driving a single input on a '244 / '245 buffer IC.

I've been thinking about building up a shield with 100 Ohm resistors. This might be a good compromise, giving sufficient drive current while still affording some protection to the Arduino pins. I'll probably end up waiting until after I burn out my first Mega2560 board, though...

BTW, I made a PDF of the Centipede schematics with the sheets merged. PM me if you'd like a copy.


Edited by wondras - 14 Jul 2019 at 1:01am
Back to Top
dave11674 View Drop Down
Newbie
Newbie
Avatar

Joined: 14 Nov 2018
Location: Leeds uk
Status: Offline
Points: 94

Feedback: 0
Post Options Post Options   Thanks (0) Thanks(0)   Quote dave11674 Quote  Post ReplyReply Direct Link To This Post Posted: 14 Jul 2019 at 10:58am
Great stuff guys
Id like to jump on board
Have lots of ols atari boards etc at my disposal to help test
Im sure the boss wouldnt mind

Where can i buy the pcbs from

Thanks
Back to Top
Nes4life View Drop Down
Senior Members
Senior Members
Avatar

Joined: 02 Jan 2014
Location: Ashford, Kent
Status: Offline
Points: 5413

Feedback: 5
Post Options Post Options   Thanks (0) Thanks(0)   Quote Nes4life Quote  Post ReplyReply Direct Link To This Post Posted: 14 Jul 2019 at 1:23pm
The resistor-less shield (XR-shield) can be printed at:
https://oshpark.com/shared_projects/3XwrbmAy This shield still has the holes for the resistors but they are all bypassed by traces. You could ofcourse cut traces and insert resistors if you wanted.

This was my solution to reading RAMs and ROMs consistently on Atari Asteroids PCBs. Yeah there's some risk that the Arduino could be fried by a bad voltage but they're not ridiculously expensive to replace.

The headers and shields can all be found at the bottom of http://zzzaccaria.com/arcade/arcade.htm

You will need to have them printed or wait for someone else to print them and sell you a set.

Edited by Nes4life - 14 Jul 2019 at 1:28pm
NES4Life
-------------
An arcade tech - not a gamer
Back to Top
dave11674 View Drop Down
Newbie
Newbie
Avatar

Joined: 14 Nov 2018
Location: Leeds uk
Status: Offline
Points: 94

Feedback: 0
Post Options Post Options   Thanks (0) Thanks(0)   Quote dave11674 Quote  Post ReplyReply Direct Link To This Post Posted: 16 Jul 2019 at 5:34pm
Originally posted by Nes4life Nes4life wrote:

The resistor-less shield (XR-shield) can be printed at:
https://oshpark.com/shared_projects/3XwrbmAy This shield still has the holes for the resistors but they are all bypassed by traces. You could ofcourse cut traces and insert resistors if you wanted.

This was my solution to reading RAMs and ROMs consistently on Atari Asteroids PCBs. Yeah there's some risk that the Arduino could be fried by a bad voltage but they're not ridiculously expensive to replace.

The headers and shields can all be found at the bottom of http://zzzaccaria.com/arcade/arcade.htm

You will need to have them printed or wait for someone else to print them and sell you a set.


thank you nes4life

ive ordered 5 x of each of the pcb's so if anyone needs a set give me a shout
also ordered all parts from the 1st post

hopefully ill be good to go soon :)
just not 100% sure on compiling the code from github :S

the arduino on page 1
i cant seem to find the C34 !!
SainSmart "C34" Mega2560 + 1602 LCD Keypad Shield

will this one do the job ?
https://www.ebay.co.uk/itm/SainSmart-Mega2560-1602-LCD-Keypad-Shield-Kit-for-Arduino-ATMEL-ATMEGA8U2-AVR/301779576284?hash=item464376e5dc:g:0X8AAMXQwKdRe0pZ

or this one, closer to me :)
https://www.ebay.co.uk/itm/Geekcreit-MEGA-2560-R3-Development-Board-MEGA2560-With-LCD-1602-Keypad-Shield/223530701368?hash=item340b77d238:g:tooAAOSw9OJc6vER


on a side note the 6502 script
will this also work with missile command ?

thanks

dave


Edited by dave11674 - 16 Jul 2019 at 5:42pm
Back to Top
Arcadenut View Drop Down
Newbie
Newbie


Joined: 29 Mar 2017
Status: Offline
Points: 99

Feedback: 0
Post Options Post Options   Thanks (0) Thanks(0)   Quote Arcadenut Quote  Post ReplyReply Direct Link To This Post Posted: 16 Jul 2019 at 9:45pm
Originally posted by wondras wondras wrote:

I'd say #1-#3 are great!  With a little luck, it may even be possible to have video display and video RAM tests at the same time soon. Smile

#4 is strange if the board is fully working. Did you use resistors on your shield board, or did you use the version that eliminates them? The details are somewhere back in this thread, but IIRC some Atari boards don't work reliably when the resistors are used. WIth 470 Ohm resistors, you only get about 10 mA of current; perhaps that's not enough for the A13 line from the CPU, which is driving two inputs (on H3 and K3), whereas all the other lines are driving a single input on a '244 / '245 buffer IC.

I've been thinking about building up a shield with 100 Ohm resistors. This might be a good compromise, giving sufficient drive current while still affording some protection to the Arduino pins. I'll probably end up waiting until after I burn out my first Mega2560 board, though...

BTW, I made a PDF of the Centipede schematics with the sheets merged. PM me if you'd like a copy.

Yes, I have the 470 Ohm Resistors in there currently.  I have thousands of 0 (Zero) Ohm Resistors that I can replace them with so no need to get new boards made.

What are the odds of the voltage being too high or is it something else that could kill the Arduino?  If it's over voltage, as long as I verify power is at <= +5V at the CPU, I should be fine correct?

Would replacing the Resistor for A13 be enough in this case just to test the hypothesis ? I would hate to have to replace all 40 of them to find out that it doesn't do much.


Back to Top
Arcadenut View Drop Down
Newbie
Newbie


Joined: 29 Mar 2017
Status: Offline
Points: 99

Feedback: 0
Post Options Post Options   Thanks (0) Thanks(0)   Quote Arcadenut Quote  Post ReplyReply Direct Link To This Post Posted: 16 Jul 2019 at 9:58pm
Originally posted by dave11674 dave11674 wrote:

hopefully ill be good to go soon :)
just not 100% sure on compiling the code from github :S

It's not too bad.  First get the Arduino IDE here:
https://www.arduino.cc/

Then just download all the files into a directory on your computer from Paul's Repository.

Find one of the .INO files that you want to use (depending on the Games/CPU you want to test).

In the IDE you'll need to add libraries for Paul's stuff.

See here:
https://www.arduino.cc/en/guide/libraries

Quote

the arduino on page 1
i cant seem to find the C34 !!
SainSmart "C34" Mega2560 + 1602 LCD Keypad Shield

will this one do the job ?
https://www.ebay.co.uk/itm/SainSmart-Mega2560-1602-LCD-Keypad-Shield-Kit-for-Arduino-ATMEL-ATMEGA8U2-AVR/301779576284?hash=item464376e5dc:g:0X8AAMXQwKdRe0pZ

or this one, closer to me :)
https://www.ebay.co.uk/itm/Geekcreit-MEGA-2560-R3-Development-Board-MEGA2560-With-LCD-1602-Keypad-Shield/223530701368?hash=item340b77d238:g:tooAAOSw9OJc6vER

The first link looks like a good choice.


Quote
on a side note the 6502 script
will this also work with missile command ?

thanks

dave

The last several pages of discussion is about Atari boards and the 6502.  I have a couple Missile Command boards here and can do some testing later in the week, but it should work in a similar way to the rest.

MC is different in some respects as to how it handles video compared to say Centipede, but you should be able to test MC in similar ways such as writing specific values to video RAM and watching the results on screen.

Back to Top
Nes4life View Drop Down
Senior Members
Senior Members
Avatar

Joined: 02 Jan 2014
Location: Ashford, Kent
Status: Offline
Points: 5413

Feedback: 5
Post Options Post Options   Thanks (0) Thanks(0)   Quote Nes4life Quote  Post ReplyReply Direct Link To This Post Posted: 18 Jul 2019 at 6:44am
Yeah, building and using the ICT is great as it now supports a good range of games. Adding support for new games isn't too hard but requires a little research or diving through MAME source code. Some of us keep another repo to support a few more games such as Asteroids.
NES4Life
-------------
An arcade tech - not a gamer
Back to Top
wondras View Drop Down
Newbie
Newbie


Joined: 24 Mar 2019
Location: USA
Status: Offline
Points: 25

Feedback: 0
Post Options Post Options   Thanks (0) Thanks(0)   Quote wondras Quote  Post ReplyReply Direct Link To This Post Posted: 20 Jul 2019 at 3:27pm
Originally posted by Arcadenut Arcadenut wrote:


Yes, I have the 470 Ohm Resistors in there currently.  I have thousands of 0 (Zero) Ohm Resistors that I can replace them with so no need to get new boards made.

What are the odds of the voltage being too high or is it something else that could kill the Arduino?  If it's over voltage, as long as I verify power is at <= +5V at the CPU, I should be fine correct?

Would replacing the Resistor for A13 be enough in this case just to test the hypothesis ? I would hate to have to replace all 40 of them to find out that it doesn't do much.

The risk is that something on the board could be holding the pin at a different voltage from what the Arduino is trying to set. For example, if a pin is shorted to ground (0V) and the ICT tries to set it high (+5V), it would pass "unlimited" current trying to bring it to 5V, exceeding the maximum current the Arduino pin is designed to handle. There are also bi-directional pins for the data bus, where the board and the ICT will "fight" each other if they both try to drive them at the same time,  In practice these things can tolerate a fair amount of abuse, but sooner or later, something will burn out.

The 470 Ohm resistors limit the current so it stays well within what the Arduino can handle. Unfortunately, they seem to limit it too much in some cases, to the point where the ICT can't drive all the devices connected to it.

In your case, I would definitely try a zero Ohm resistor (aka a "wire") for the A13 line. For Centipede it's the only address line driving more than one device, so this may be enough to get everything working for you.

Good luck!
Back to Top
Arcadenut View Drop Down
Newbie
Newbie


Joined: 29 Mar 2017
Status: Offline
Points: 99

Feedback: 0
Post Options Post Options   Thanks (0) Thanks(0)   Quote Arcadenut Quote  Post ReplyReply Direct Link To This Post Posted: 28 Jul 2019 at 1:29am
No luck Cry

I replaced all the resistors on the shield with Zero Ohm resistors and still cannot read the ROM address space.

I'm wondering if there is a problem with the Arduino, Shield or Adapter...

I do a Buscheck and I get this (I also got this prior to replacing the resistors):

Error:E:A0 07ff


Back to Top
Arcadenut View Drop Down
Newbie
Newbie


Joined: 29 Mar 2017
Status: Offline
Points: 99

Feedback: 0
Post Options Post Options   Thanks (0) Thanks(0)   Quote Arcadenut Quote  Post ReplyReply Direct Link To This Post Posted: 02 Aug 2019 at 2:44am
Purchased a new Arduino (Authentic one) and should be here in a day or two... will post the results I get from that.

Back to Top
wondras View Drop Down
Newbie
Newbie


Joined: 24 Mar 2019
Location: USA
Status: Offline
Points: 25

Feedback: 0
Post Options Post Options   Thanks (0) Thanks(0)   Quote wondras Quote  Post ReplyReply Direct Link To This Post Posted: 04 Aug 2019 at 2:30am
Arcadenut, this may or may not be helpful to you, but I committed Centipede support to Nes4life's GitHub repo. 

 It definitely works with:
- Centipede board using ROM set 3
- ICT in non clock master mode
- shield board that has 0 Ohm links/jumpers. 

 Other configurations have not been tested.
Back to Top
Arcadenut View Drop Down
Newbie
Newbie


Joined: 29 Mar 2017
Status: Offline
Points: 99

Feedback: 0
Post Options Post Options   Thanks (0) Thanks(0)   Quote Arcadenut Quote  Post ReplyReply Direct Link To This Post Posted: 04 Aug 2019 at 6:15am
New Arduino arrived.  Same results. Ouch

I have to be doing something wrong hardware wise.  I'll have to dig out another Centipede and test on that as well.

I loaded up your test driver (Thank you!) and it's not working with that either (I get the same results).

I tried with 2 different shields (one with Resistors and one with 0 Ohm Resistors).  I tried with 2 different Adapters.  Now I assembled all of them so if I screwed something up on one, it's possible I did it to multiple ones.

Ok, so here is the 40 DIL Adapter jumpered:



and here is the tester hooked up to the PCB




Here I have my scope hooked up to wait for an access to ANY ROM...

and here is how I have my scope setup:

2v/div
Single Step
Trigger on Pulse
Tigger level is slightly above 0.



I can read and write to anything below 8192 (0x2000) just fine.  It's everything from that and above that isn't working.  So A13 seems to be the issue.

I assume that if I had the ribbon cables hooked up wrong, or the jumpers on the board wrong I wouldn't be able to read/write to anything.

So would it be possible to test the Shield and Adapter without having it connected to the board? I.e. I just want to make sure all the pins are functioning as they should?




Back to Top
wondras View Drop Down
Newbie
Newbie


Joined: 24 Mar 2019
Location: USA
Status: Offline
Points: 25

Feedback: 0
Post Options Post Options   Thanks (0) Thanks(0)   Quote wondras Quote  Post ReplyReply Direct Link To This Post Posted: 04 Aug 2019 at 5:16pm
This is good... we're running out of things that could be the problem. :)  Seems like it has to be a physical connection issue, so I think the most likely culprit would be your 40-pin ribbon cables. 

Are yours homemade? Sometimes a pin won't make contact if the plug isn't crimped on hard enough. Or did you repurpose a CD-ROM or IDE cable? These sometimes have missing wires. I can see you don't have 80-pin cables, which is good, because these definitely wouldn't work.

Wherever they came from, doing an end-to-end continuity test between the Arduino shield and the probe head is probably worth a try.


Side note: I've been meaning to mention for a while that DigiKey will custom assemble twisted-pair ribbon cables using 3M wire and connectors. They ship right away, and the cables look and work great.



I bought the 20" version for $9.19US/each. Part number is M3CCA-4020K.



Back to Top
 Post Reply Post Reply Page  <1 1819202122>
  Share Topic   

Forum Jump Forum Permissions View Drop Down



This page was generated in 0.313 seconds.