Author Topic: Programming (non-JTAG) MAX7000 devices  (Read 31926 times)

0 Members and 2 Guests are viewing this topic.

Offline migryTopic starter

  • Regular Contributor
  • *
  • Posts: 71
  • Country: gb
Re: Programming (non-JTAG) MAX7000 devices
« Reply #25 on: September 28, 2020, 09:45:21 pm »
Question.

Can the JTAG type "S"/"AE" devices (e.g. EPM7032S) be programmed in "parallel" mode, i.e. not using the JTAG? In other words did Altera make the newer "S" devices backwards compatible with the older devices?

Actually it is sort of ironic. To implement JTAG you need quite a few flip-flops (for state machine, instruction register, data registers), however the main EPM7032 device only has 16 macrocells, therefore with only 16 flip-flops (as far as I understand).

@bingo wrote
Quote
Wasn't there something about , if jtag was disabled and protection set on a 7000.
Then you'd need a special (expensive) programmer to reset it.

@joeqsmith wrote
Quote
The security bit doesn't prevent reprogramming.  Actually, that's how you clear it.   I started out making my own programmer.  I think they published the design for one of their early programmers.     

I wonder if someone who knows for sure can confirm that - if the security bit of a "S" type device has been set, can the device be erased by means of JTAG only, or as @bingo beleves, do you need a "parallel" mode type programmer to clear the security bit and erase the device?

--migry
« Last Edit: September 28, 2020, 09:49:16 pm by migry »
 
The following users thanked this post: edevaldo

Offline abyrvalg

  • Frequent Contributor
  • **
  • Posts: 823
  • Country: es
Re: Programming (non-JTAG) MAX7000 devices
« Reply #26 on: September 29, 2020, 04:42:38 pm »
My idea was to make DOSBOX controlling the pins of a real MAX7k. I.e. you connect an Arduino between the PC’s serial port and the MAX, write a sketch that listens to commands like "set pin X to Y state", "get pin X state" and send these commands from DOSBOX’s IO port handler, bridging the programmer exe to your MAX and letting it doing it’s job directly.
 

Offline migryTopic starter

  • Regular Contributor
  • *
  • Posts: 71
  • Country: gb
Re: Programming (non-JTAG) MAX7000 devices
« Reply #27 on: September 30, 2020, 01:20:25 am »
My idea was to make DOSBOX controlling the pins of a real MAX7k. I.e. you connect an Arduino between the PC’s serial port and the MAX, write a sketch that listens to commands like "set pin X to Y state", "get pin X state" and send these commands from DOSBOX’s IO port handler, bridging the programmer exe to your MAX and letting it doing it’s job directly.

Hi @abyrvalg, I did understand what you were suggesting, and I did briefly consider this. I was incorrect in my previous reply, in that of course it is possible from the DOSBOX-X (modified) source code to write to real hardware (I just got confused), if I can figure out the correct library calls. Since DOSBOX-X is compiled under Linux with gcc, then I guess it should be possible to write to the serial port. I have an old Maplin kit for a ISA I/O card (un-built) which uses a INS8255. This would have been perfect. No good for my modern PC with PCIe ! Certainly I could devise a protocol and send serial data to a hardware COM port, then use an Arduino to capture this data and re-assemble the parallel packets. The ALL03 programmer is built from 8 bit chunks, so that maps nicely. I would need a couple of DACs for Vcc and Vpp, however I possibly could get away with simply switching these supllies on and off. I do see in the programmer I/O logs that Vpp is ramped slowly up and (later) down again using the DAC. Vcc is simply enabled on or off, having been previously programmed to the right level. The ALL03 can route 3 different high voltage supplies to nearly all pins (they didn't connect to all pins to save some costs I assume). If I use the "serial" Arduino method or the "parallel" stand-alone method, Vcc and Vpp will be handled the same way. The benefit of the way you suggest is that the timing information is at least "maintained" from the original software. With my method of logging I have no idea (currently) how long between writes to the programmer registers, and I think that some "pulses" may have minimum or critial lengths.

--migry
 

Offline ale500

  • Frequent Contributor
  • **
  • Posts: 415
Re: Programming (non-JTAG) MAX7000 devices
« Reply #28 on: October 26, 2020, 03:57:56 pm »
Did you get further with your efforts ?
I ask because I have a stack of EPM7128S that have the security fuse programmed.
 

Offline MadTux

  • Frequent Contributor
  • **
  • Posts: 785
Re: Programming (non-JTAG) MAX7000 devices
« Reply #29 on: October 26, 2020, 05:07:43 pm »
Actually it is sort of ironic. To implement JTAG you need quite a few flip-flops (for state machine, instruction register, data registers), however the main EPM7032 device only has 16 macrocells, therefore with only 16 flip-flops (as far as I understand).
As fas as I know, EPM7032 should have 32Flipflops, just like as with XC95xx, xx is the number of flipflops available. 32FFs are very few for anything with clock, the small CPLDs are IMO better suited to replace lots of 74xx AND/OR.... combinatorial logic.

BTW anyone who has downloaded Quartus II 9.0 for linux, before it was taken offline?
 

Offline migryTopic starter

  • Regular Contributor
  • *
  • Posts: 71
  • Country: gb
Re: Programming (non-JTAG) MAX7000 devices
« Reply #30 on: October 28, 2020, 04:32:32 pm »
Yes I did make a little more progress, but then decided to move onto something else, as a form of break, but intending to re-visit later. I do have 10 EPM7032S JTAG devices on order from China, and assuming that they are not fake  ;D I will be able to program them using my Altera USB Blaster clone, in order to try various actions on my hardware.

My new hardware now has two DAC channels, one of which is required for Vpp. 12V on this pin puts the device into test mode and reconfigures all the special pins.

My new hardware is based around an Arduino MEGA2560. I have a script, into which I hard code sequences which have been learnt by reverse engineering the DOSBOX + ALL03 programmer hardware and software. The EPM7032 programming software (for the ALL03) gives me traces of certain commands. I see common sequences on groups of pins. Certain commands do not work as the software does not see the expected response from the emulated ALL03 programmer and emulated EPM7032 device. Blank check for example is still reporting a failure even though I applied the waveforms using my hardware to a blank device. Probably my emulated "blank" EPM7032 needs some minor tweaks.

Some commands such as erase seem to have simpler sequences, but need more pins to be toggled.

I finally found the special test pin names for the 44 pins EPM7064. There are more pins used for programming on this device, some with new names as compared to the 44 pin EPM7032. I do not know the pinout of the test pins for the EPM7128. This would need someone with an adapter for the ALL03 programmer to reverse engineer the adapter to 40 pin socket. With this information I could use the MAX7000 version of the ALL03 programmer to work out which waveforms to apply to which pins.

I have added a JPG of the list of test pin names for the EPM7032 and EPM7064.

If I or someone can find the same list for the EPM7128 then I might be able to help (in the longer term).
« Last Edit: October 28, 2020, 04:40:38 pm by migry »
 

Offline migryTopic starter

  • Regular Contributor
  • *
  • Posts: 71
  • Country: gb
Re: Programming (non-JTAG) MAX7000 devices
« Reply #31 on: October 28, 2020, 04:38:54 pm »
As fas as I know, EPM7032 should have 32Flipflops, just like as with XC95xx, xx is the number of flipflops available. 32FFs are very few for anything with clock, the small CPLDs are IMO better suited to replace lots of 74xx AND/OR.... combinatorial logic.

My point was that adding the extra circuitry to convert the non-JTAG device to the new JTAG equivalent would add many more extra flops, as compared to the 32 which form the basis of the device as "seen" by the end user.
 
To implement JTAG you need at least 4 flops for the state machine, one for the re-timing of TDO, at least 4 for the instruction register, 32 flops if you implement the Device ID register, plus any addition flops to tie into the old programming circuitry.

From my experiments on the non-JTAG EPM7032 there are at least two shift registers each 10 bits long (so this requires 20 flops). So even in the non-JTAG design there are more "hidden" flops needed for programming, than the 32 which are used by the end user.

[Edit: I originally said 16 user flops and not 32!]
« Last Edit: October 29, 2020, 12:41:33 am by migry »
 

Online bingo600

  • Super Contributor
  • ***
  • Posts: 1976
  • Country: dk
Re: Programming (non-JTAG) MAX7000 devices
« Reply #32 on: October 28, 2020, 05:18:42 pm »
@migry

That is some serious effort, put into reviving some old devices.
I hope you have quite a few.

Interesting read.

Thanx for sharing  :-+

/Bingo
 

Offline ale500

  • Frequent Contributor
  • **
  • Posts: 415
Re: Programming (non-JTAG) MAX7000 devices
« Reply #33 on: October 29, 2020, 02:21:50 pm »
Quote
I do have 10 EPM7032S JTAG devices on order from China

Mine also come from China, fuse locked :(, (because I cannot read/program them with a USB Blaster, nothing found on JTAG). Maybe one of the pins is a JTAG enable pin...
Firstly I saw that they came packaged in a reel and I thought maybe they are NOS or so (very naive from my part). After closer inspection... all chips have different date codes !
I also bought several XC9572XL-vq64, those work great though.
« Last Edit: October 29, 2020, 02:24:09 pm by ale500 »
 

Offline migryTopic starter

  • Regular Contributor
  • *
  • Posts: 71
  • Country: gb
Re: Programming (non-JTAG) MAX7000 devices
« Reply #34 on: October 29, 2020, 03:03:13 pm »
Mine also come from China, fuse locked :(, (because I cannot read/program them with a USB Blaster, nothing found on JTAG). Maybe one of the pins is a JTAG enable pin...

My limited understanding, with assumptions, is that for the JTAG devices, if you utilise the I/O's shared with the JTAG pins as user I/O, then of course the JTAG has to be disabled using some fuse. These parts cannot therefore be re-programmed using JTAG. If you do not use the JTAG shared I/O as user pins, then the JTAG remains enabled, allowing re-programisation. Perhaps the 12V on the Vpp re-enables the JTAG I/O. This is something which I will investigate in the future.

In IC design, particularly for low pin count chips, where JTAG is used internally for chip scan test, do you dedicate 4 (or 5) pins to JTAG, so making less pins available for user I/O, or do you share pins and add some mechanism (normally a single TEST pin) to enable JTAG and allow chip scan test? Altera have given maximum flexibility here, and we might assume that the fuse to enable/disable JTAG is "new", i.e. it is not on the non-JTAG devices. We can select to use fewer I/O and have JTAG always enabled, or use maximum I/O but lose JTAG programmability once the chip is programmed.

Having ordered cheap parts from China in the past: Flash ROMs and MC68000 DIL and PLCC, I am now aware of the problem of chip recovery and re-marking.

The MC68000 DILs were 8MHz devices, remarked as 16MHz devices. I found out simply by removing the fake marking with IPA, which clearly revealed the original markings.

The MC68000 PLCC did not work at all. Suspiciously they all had the same date-code markings, but the packages all differed slightly with respect to markings on the bottom and dimples. They were obviously remarked, possibly not even MC68000s. I got a full refund from the seller, who I will avoid in future.

Of the 4 Flash ROMs, 2 worked and 2 did not program. All had identical markings and date code, so obviously re-marked, but the markings did not come off with IPA. My programmer essentially rejected the devices saying that the manufacturer ID was not Intel. I wondered whether the 2 devices which did not program were from another manufacturer, but I could not get them to program when I tried to select different chip vendors. I got a refund for the 2 "broken" devices. Whether I can trust the speed rating of the 2 "good" (and remarked) devices is unclear.

Clearly all the above devices were re-claimed and were not NOS.

BTW I have absolutely no issue with chip recovery, but I simply want the sellers to be honest. Some sellers might buy chips from the recovery companies in good faith, and there will be good and bad recovery companies. What really p*****s me off is when the chips are re-marked. What a waste of time. Given the low selling cost of the chips, why bother?

So I will be interested to find out if the EPM7032S devices are genuine parts and if so, are they locked.
 
The following users thanked this post: Rasz

Offline westfw

  • Super Contributor
  • ***
  • Posts: 4196
  • Country: us
Re: Programming (non-JTAG) MAX7000 devices
« Reply #35 on: October 30, 2020, 12:50:54 am »
Quote
the extra circuitry to convert the non-JTAG device to the new JTAG equivalent would add many more extra flops
flip-flops in general are not "expensive", and the flipflops to make up the shift registers for basic JTAG access can be especially trivial (and may in fact be very similar to what is already there for the non-JTAG versions.)It's the fully-connected, fully-configurable flip-flops and their associated control logic and routing that make up one of the "Macrocells" that make them costly.(an SRAM is essentially flipflops, and you can get a million of them on a very cheap chip.  REAL old-timers will remember that shift registers were used for microprocessor storage back when SRAM was "too expensive.")

 

Offline migryTopic starter

  • Regular Contributor
  • *
  • Posts: 71
  • Country: gb
Re: Programming (non-JTAG) MAX7000 devices
« Reply #36 on: October 30, 2020, 01:25:49 pm »
My EPM7032S parts arrived. 10 off. All have identical markings on the top, i.e. same date code. However on the bottom almost all parts are different, which absolutely confirms that they are NOT from the same lot, and therefore must have been remarked.  >:(  >:(  >:(

Note: manufacturers use lot numbers and date codes to track "sets" of devices throughout the manufacturing process. Parts marked with the same date code are very likely to have come from the same wafers. They would have gone through assembly as a group and would have been processed by the same machines. I am unfamiliar with the machines which put the die in the plastic packages, but you should expect all devices with the same lot code to have used the same machine and therefore any package markings (top and bottom) and dimples should be identical.


I will now test them to see if they are even EPM7032S devices.
« Last Edit: October 30, 2020, 01:56:21 pm by migry »
 
The following users thanked this post: Rasz

Offline TomS_

  • Frequent Contributor
  • **
  • Posts: 834
  • Country: gb
Re: Programming (non-JTAG) MAX7000 devices
« Reply #37 on: October 30, 2020, 09:06:48 pm »
Altera EPM devices and Atmel ATF devices are very similar it seems, so much so that Atmel released a tool to convert Altera .pof files to .jed so you can program a design into one of their own parts.

If you use the JTAG pins as IOs, they can be re-enabled for programming by applying 12V to the OE pin.

Presumably it would be similar on the Altera parts.

How to clear the security bit is still to be discovered.
 

Offline Rasz

  • Super Contributor
  • ***
  • Posts: 2616
  • Country: 00
    • My random blog.
Re: Programming (non-JTAG) MAX7000 devices
« Reply #38 on: November 02, 2020, 03:38:25 pm »
This https://hackaday.com/2020/10/16/isastm-runs-vintage-cards-over-usb/ might give you ideas about linking emulator with real world. Manawyrm used PCem and USB CDC-ACM serial connection to STM32. https://www.vogons.org/viewtopic.php?p=902486#p902486
Who logs in to gdm? Not I, said the duck.
My fireplace is on fire, but in all the wrong places.
 

Offline migryTopic starter

  • Regular Contributor
  • *
  • Posts: 71
  • Country: gb
Re: Programming (non-JTAG) MAX7000 devices
« Reply #39 on: November 03, 2020, 02:09:29 pm »
Hi @Rasz thanks for the pointer to an interesting read.

I might just re-visit the idea of sending register writes from DosboxX via serial to the Arduino. I think that it might speed things up.

My only concern is that using serial comms under Linux appears to be unnecessarily complicated, what with all these IOCTLs and function calls. On the Arduino (and small development systems) serial comms is a piece of p--s, but under Windows and Linux all the additional wrapping seems to overcomplicate things (IMO). Over the years I've written lots of serial comms code for microcontroller and uPs in machine code, without much of a problem. As soon as I even try to find example code for Windows and Linux I can't find something nice and easy to understand.
 
 

Offline migryTopic starter

  • Regular Contributor
  • *
  • Posts: 71
  • Country: gb
Re: Programming (non-JTAG) MAX7000 devices
« Reply #40 on: November 04, 2020, 03:21:47 pm »
Update.

Using my homebrew perf board set-up shown below, I can connect up a cheap Chinese USB Blaster clone to the EPM7032S devices  in PLCC 44 pin.

| was pleasantly surprised to find out that all devices respond to JTAG and are blank. I must admit this was somewhat of a surprise, as I am still in no doubt that all 10 parts have been remarked. Some parts have a lighter colour of plastic and you can see where very black paint has been painted on top.

Next I tried to program a part with a simple 24 bit counter. I was using Quartus 13.1
I had the usual issue that it selects pin assignments for you first time around, and moved them to known adjacent pin positions. The strange this is that I see square waves on some pins, but not the ones which I chose. I have re-compiled several times in case something was out of date. The part programs and verifies correctly. I tried a second part and it behaved in the same way. I see the xtal divided output from the counter, but 1) on the wrong pins 2) lower frequencies on pins which I have not assigned (perhaps this is side effect of using macrocells?).

Now scratching my head.
 

Offline migryTopic starter

  • Regular Contributor
  • *
  • Posts: 71
  • Country: gb
Re: Programming (non-JTAG) MAX7000 devices
« Reply #41 on: November 04, 2020, 03:42:06 pm »
Update #2.

Silly me  :palm: . It's all OK!

I changed the "Unused Pins" option in "Device->Device and Pin Settings" from "As output driving and unspecified signal" to "As input tri-stated", and quickly saw that I had wired up the wrong part of the counter, so that I was outputting very low frequency square waves on the pins of interest.  |O

I updated the Verilog code, re-programmed, and the EPM7032S is now working as expected, outputting the correct square waves from dividing the xtal on the expected pins. Brilliant!
 

Offline Rasz

  • Super Contributor
  • ***
  • Posts: 2616
  • Country: 00
    • My random blog.
Re: Programming (non-JTAG) MAX7000 devices
« Reply #42 on: November 04, 2020, 05:04:33 pm »
under linux talking serial is just opening file descriptor and writing/reading to it

> cheap Chinese USB Blaster clone

fx2lp
https://www.newioit.com.au/archives/159

https://github.com/Wei1234c/FX2LP
This sems to have already implemented firmware for random GPIO access + glue python code

« Last Edit: November 04, 2020, 06:21:15 pm by Rasz »
Who logs in to gdm? Not I, said the duck.
My fireplace is on fire, but in all the wrong places.
 

Offline ale500

  • Frequent Contributor
  • **
  • Posts: 415
Re: Programming (non-JTAG) MAX7000 devices
« Reply #43 on: November 04, 2020, 05:58:42 pm »
Oh, you had more luck than I had :+1:

The ATF parts look similar at least they have the same pinout for the PLCC84 variants.  I found a forum post on the forums.6502.org about applying 12 V to OE1 to enable JTAG, but no docu as of yet. I'll try anyways :).  Thanks for the tip !
 

Offline TomS_

  • Frequent Contributor
  • **
  • Posts: 834
  • Country: gb
Re: Programming (non-JTAG) MAX7000 devices
« Reply #44 on: November 05, 2020, 07:56:47 am »
Pinout is also the same for the 44 pin PLCC package too.
 

Offline ale500

  • Frequent Contributor
  • **
  • Posts: 415
Re: Programming (non-JTAG) MAX7000 devices
« Reply #45 on: November 05, 2020, 01:15:52 pm »
It seems that I have no luck with this device. (EPM7128SCL84)

1. I apply 12 V at OE1 (Pin 84).
2. Apply 5 V at VCCINT/VCCIOs.
3. Send JTAG command (blank check, verify, program). I see that the clock does not go to 0V (Transitions between 5 V and 4.5 V), as if the chip were driving high on TCK.
  I see No output on TDO.

See trace: CH1 TCK, CH2 : TDI

2nd test:

1. Apply 5 V at VCCINT/VCCIOs.
2. I apply 12 V at OE1 (Pin 84).
3. Send JTAG command (blank check, verify, program). I see that the clock does not go to 0V (Transitions between 5 V and 2.5 V), as if the chip were driving high on TCK.
  I see No output on TDO.

 :(

I tested the GND pins and they seem to be at the right locations: i.e. both internal GNDs are connected as well as the IO GND, so I assume it is a EPM7128.

Something is missing, some other pins may need to be grounded or so.
« Last Edit: November 05, 2020, 01:22:16 pm by ale500 »
 

Offline migryTopic starter

  • Regular Contributor
  • *
  • Posts: 71
  • Country: gb
Re: Programming (non-JTAG) MAX7000 devices
« Reply #46 on: November 05, 2020, 01:26:51 pm »
@ale500 - where did you get your devices from?

During my many searches I have seen numerous messages from people wanting to clear the security fuse of the EPM7128S.

On the EPM7032 I apply 12V to the OE pin which is Vpp. I think it's a pretty fair guess that OE on the 7128 will also be Vpp, but... until we get someone who has an adapter for the ALL03 programmer, we can't be 100% sure.

 

Offline ale500

  • Frequent Contributor
  • **
  • Posts: 415
Re: Programming (non-JTAG) MAX7000 devices
« Reply #47 on: November 06, 2020, 05:34:10 am »
I got them from aliexpress: shenzhenYida Store.... I'll try to buy another batch from some other store...

To which OE pin do you apply the 12 V ? OE1 or OE2 the 44 PLCC has both too. And how do you apply it ? could you please describe the sequence of steps ?
 

Offline ale500

  • Frequent Contributor
  • **
  • Posts: 415
Re: Programming (non-JTAG) MAX7000 devices
« Reply #48 on: December 10, 2020, 02:58:42 pm »
I got to test all my devices (EMP7128S according to the markings). They fall into two categories: they do not respond to any command, even in "jatg debug mode", and the ones that say something like EMP7128DD_UNKNOWN when the IDCODE iteration test is used. (but nothing else).
They do seem to use the JTAG pins as IOs. That would also prevent JATG from working...
 

Offline CJay

  • Super Contributor
  • ***
  • Posts: 4136
  • Country: gb
Re: Programming (non-JTAG) MAX7000 devices
« Reply #49 on: December 10, 2020, 03:41:30 pm »
FWIW, I have a programmer which seems to support these devices but I'd need to hack together an adapter, happy to do so if it's just a wiring job.

If you want to check the supported device list here:
https://www.dataman.com/mwdownloads/download/link/id/6/

I'm happy to erase a few chips if that helps?

 


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf