Author Topic: Joining two EPROMs (TL866CS EPROM programmer)  (Read 7917 times)

0 Members and 1 Guest are viewing this topic.

Offline analogixTopic starter

  • Regular Contributor
  • *
  • Posts: 172
  • Country: no
Joining two EPROMs (TL866CS EPROM programmer)
« on: February 25, 2018, 03:40:30 pm »
Does anyone know how to join two EPROM files together as one with the TL866CS EPROM programmer?

I have two (part A/part B) .BIN files which are meant to be burnt into two 2732 EPROMs, but I would like to combine those two .BIN files into a single file and burn it into a 2764 chip instead. How do I do that? 

Offline Bruce Abbott

  • Frequent Contributor
  • **
  • Posts: 627
  • Country: nz
    • Bruce Abbott's R/C Models and Electronics
Re: Joining two EPROMs (TL866CS EPROM programmer)
« Reply #1 on: February 25, 2018, 04:16:01 pm »
Use the DOS copy command to append files. Here is the command line I used to put several cartridges ROMs into a single EEPROM:-

Code: [Select]
copy /b "babasic.bin" + "utopia.bin" + "logo.bin" + "chess.bin" "roms.bin"
Option /b is required when working with binary files. Files are appended with '+'. The final name ("roms.bin" in this example) is the created file.
 
The following users thanked this post: barbeque

Offline Ampera

  • Super Contributor
  • ***
  • Posts: 2578
  • Country: us
    • Ampera's Forums
Re: Joining two EPROMs (TL866CS EPROM programmer)
« Reply #2 on: February 25, 2018, 05:15:13 pm »
HxD can probably do that. Just open the two files, and copy one into the other. Good if you don't like messing about with commands.
I forget who I am sometimes, but then I remember that it's probably not worth remembering.
EEVBlog IRC Admin - Join us on irc.austnet.org #eevblog
 

Offline analogixTopic starter

  • Regular Contributor
  • *
  • Posts: 172
  • Country: no
Re: Joining two EPROMs (TL866CS EPROM programmer)
« Reply #3 on: February 25, 2018, 07:24:06 pm »
I'm actually a Mac user (I run the EPROM programming software in Windows through BootCamp on my Mac) and wonder if this could be done easily on the Mac itself.
I don't know if I've misunderstood when searching for help, but the "cat" UNIX command appears to be able to join files together. If I'm not mistaken I could open "Terminal" (the UNIX command-line window in Mac OSX) and enter something like this:

Code: [Select]
cat Part1.bin Part2.BIN > Combined.BIN
Hopefully the newly created "Combined.BIN" would consist of "Part1.BIN" at the beginning, followed by "Part2.BIN" at the end.
Assuming this would work, concerning the EPROM data itself -does each file have some sort of header which needs to be edited/removed before joining the files together, or will "Part2.BIN" simply just continue where "Part1.BIN" ended?

Offline helius

  • Super Contributor
  • ***
  • Posts: 3639
  • Country: us
Re: Joining two EPROMs (TL866CS EPROM programmer)
« Reply #4 on: February 25, 2018, 07:56:37 pm »
What is missing here is a specification of how the address, data, and CS lines of the two 2732s are connected in circuit. For instance, if they are data-parallell with a common address bus, they form a 16-bit ROM and you would either need one of those (not a 2764), or use logic to demux the data. If they have a common data bus and use OE to select one at a time onto the bus, you could wire OE to either the high or the low address line (or indeed any other line) of the 2764 and then swizzle the two 32Kbit images as necessary.
 

Offline analogixTopic starter

  • Regular Contributor
  • *
  • Posts: 172
  • Country: no
Re: Joining two EPROMs (TL866CS EPROM programmer)
« Reply #5 on: February 25, 2018, 08:19:26 pm »
That's what I was worried about. I'll try to find out.
In the meantime, would that "cat" command join together the two files as intended?

Offline helius

  • Super Contributor
  • ***
  • Posts: 3639
  • Country: us
Re: Joining two EPROMs (TL866CS EPROM programmer)
« Reply #6 on: February 25, 2018, 08:43:30 pm »
In the meantime, would that "cat" command join together the two files as intended?
Yes. That would work for a 2764 with its A12 line wired to part1's /OE, under the assumption that both EPROMs receive separate decoded /OE signals as the means to select one at a time onto a common data bus, and no other source is selected using the same method*. part1's /OE will be low when the data should come from the first part, and A12=0 means the first half of the 2764. Part1's /OE will be high when part2 is selected, and A12=1 means the second half of the 2764.

*Because if it can be the case that both Part1 and Part2 are deselected while something else drives the bus, you lose big!

You can verify that the combined .BIN contains the correct data with
Code: [Select]
cmp -n4096 Combined.BIN Part1.BIN
cmp Combined.BIN Part2.BIN 4096
« Last Edit: February 25, 2018, 08:45:59 pm by helius »
 

Offline netdudeuk

  • Frequent Contributor
  • **
  • Posts: 447
  • Country: gb
Re: Joining two EPROMs (TL866CS EPROM programmer)
« Reply #7 on: February 25, 2018, 08:59:35 pm »
Have a look at the Free Hex Editor (http://frhed.sourceforge.net/) which lets you insert multiple hex files into the editor.  Then you could save the combined image.
 

Offline analogixTopic starter

  • Regular Contributor
  • *
  • Posts: 172
  • Country: no
Re: Joining two EPROMs (TL866CS EPROM programmer)
« Reply #8 on: February 25, 2018, 09:50:07 pm »
In the meantime, would that "cat" command join together the two files as intended?
Yes. That would work for a 2764 with its A12 line wired to part1's /OE, under the assumption that both EPROMs receive separate decoded /OE signals as the means to select one at a time onto a common data bus, and no other source is selected using the same method*. part1's /OE will be low when the data should come from the first part, and A12=0 means the first half of the 2764. Part1's /OE will be high when part2 is selected, and A12=1 means the second half of the 2764.

*Because if it can be the case that both Part1 and Part2 are deselected while something else drives the bus, you lose big!

From what I've been told it should work fine to join the two files together as a (twice as big) new file.


Quote
You can verify that the combined .BIN contains the correct data with
Code: [Select]
cmp -n4096 Combined.BIN Part1.BIN
cmp Combined.BIN Part2.BIN 4096

I just tried the whole thing (joining and checking):

Code: [Select]
$ cat Part1.BIN Part2.BIN > Combined.BIN
$
$ cmp -n4096 Combined.BIN Part1.BIN
$ cmp Combined.BIN Part2.BIN 4096
$

After a few failed attempts (typos etc. in the commands) I ended up with no error messages, and the "Combined.BIN" file actually shows up as taking 8192 bytes in the OSX Finder, so it's all worked out as it should?
If that's the case I'll give the EPROM burner a go and see what happens afterwards.

Offline helius

  • Super Contributor
  • ***
  • Posts: 3639
  • Country: us
Re: Joining two EPROMs (TL866CS EPROM programmer)
« Reply #9 on: February 25, 2018, 09:52:18 pm »
No output from cmp means it succeeded. When it fails to verify the files are equal, it prints $1 $2 differ: char 11, line 7 type of thing.
Combining the files is easy, but replacing two eproms with one depends on the circuit design.
 

Offline analogixTopic starter

  • Regular Contributor
  • *
  • Posts: 172
  • Country: no
Re: Joining two EPROMs (TL866CS EPROM programmer)
« Reply #10 on: February 25, 2018, 10:00:56 pm »
Ah! That's the sort of error I got first, but then I realized I had forgotten to type "4096" at the end of the line  :P

Those hex-editors are probably fine, but just taking note of the above command leaves me not having to learn some new software (which looks pretty complex IMHO). Next I'll try to burn the 2764 EPROM and see if the actual data is recognized.


Offline Ampera

  • Super Contributor
  • ***
  • Posts: 2578
  • Country: us
    • Ampera's Forums
Re: Joining two EPROMs (TL866CS EPROM programmer)
« Reply #11 on: February 25, 2018, 10:54:04 pm »
Ah! That's the sort of error I got first, but then I realized I had forgotten to type "4096" at the end of the line  :P

Those hex-editors are probably fine, but just taking note of the above command leaves me not having to learn some new software (which looks pretty complex IMHO). Next I'll try to burn the 2764 EPROM and see if the actual data is recognized.

HxD is about as simple as using a text editor. I never even had to look up how to use it.
I forget who I am sometimes, but then I remember that it's probably not worth remembering.
EEVBlog IRC Admin - Join us on irc.austnet.org #eevblog
 

Offline analogixTopic starter

  • Regular Contributor
  • *
  • Posts: 172
  • Country: no
Re: Joining two EPROMs (TL866CS EPROM programmer)
« Reply #12 on: February 25, 2018, 11:17:41 pm »
Sounds good. Maybe I'll install it just in case.

Good news after burning the 2764 EPROM: everything worked fine!
A small question (I always write notes for my own use, in case I need to do this two years from now and have forgotten the details); I looked up the "man" (manual) for the compare command ("man cmp"), but don't quite understand what is meant by the numbering:

Does the "-n4096" (compare at most limit bytes) mean that the combined file is compared with the start of "part1" and ending at 4096 bytes, while the second line means that the combined file is compared with "part2" starting at 4096 bytes, hence the 4096 at the end of the line?
I suppose with different length EPROM files (or more than two of those 4K 2732 EPROMs as in the example here) I would just change the numbering for the correct length.

Offline helius

  • Super Contributor
  • ***
  • Posts: 3639
  • Country: us
Re: Joining two EPROMs (TL866CS EPROM programmer)
« Reply #13 on: February 25, 2018, 11:39:41 pm »
The 4096 at the end of the line is an offset in the first file to skip before it starts comparing. The arguments to cmp are file1, file2, skip1, and skip2. After the two input files have been seek()'d to skip1 and skip2 respectively, cmp begins comparing bytes. If -n len is supplied, it compares len bytes and then stops.

So depending on whether you want to ignore a range of the file after the part that should be common, you would want to supply the -n len option. If you want to ignore a range before the part that should be common, you would want to supply the skip parameters to seek past before comparison begins.
« Last Edit: February 25, 2018, 11:45:14 pm by helius »
 

Offline analogixTopic starter

  • Regular Contributor
  • *
  • Posts: 172
  • Country: no
Re: Joining two EPROMs (TL866CS EPROM programmer)
« Reply #14 on: March 02, 2018, 10:31:56 pm »
Thanks for explaining!

Offline james_s

  • Super Contributor
  • ***
  • Posts: 21611
  • Country: us
Re: Joining two EPROMs (TL866CS EPROM programmer)
« Reply #15 on: March 07, 2018, 10:11:16 pm »
I usually just use the copy/b command from a dos prompt, it works fine for joining files end to end. Just make sure you use .bin files and not .hex. If you try to join a pair of .hex files it doesn't work.
 

Offline analogixTopic starter

  • Regular Contributor
  • *
  • Posts: 172
  • Country: no
Re: Joining two EPROMs (TL866CS EPROM programmer)
« Reply #16 on: March 09, 2018, 05:46:45 am »
Would the inability to join .HEX files apply to the UNIX command line method as well, or is this a limitation with the DOS method?

Offline helius

  • Super Contributor
  • ***
  • Posts: 3639
  • Country: us
Re: Joining two EPROMs (TL866CS EPROM programmer)
« Reply #17 on: March 09, 2018, 06:32:58 am »
hex files have an address pointer command, so concatenating two hex files won't have the intended effect. Instead the address pointer of one will overlap the other.
 

Offline analogixTopic starter

  • Regular Contributor
  • *
  • Posts: 172
  • Country: no
Re: Joining two EPROMs (TL866CS EPROM programmer)
« Reply #18 on: March 09, 2018, 06:36:03 am »
I see, so in that case I would have to convert the individual parts to .BIN first, then join them together using the methods discussed here.

Offline james_s

  • Super Contributor
  • ***
  • Posts: 21611
  • Country: us
Re: Joining two EPROMs (TL866CS EPROM programmer)
« Reply #19 on: March 09, 2018, 06:59:15 am »
Yep, I have a tool called swap.exe that converts between bin and hex, I forget where it came from. If I need to join two ROMs I convert to bin first. There's another tool I saw somewhere that can join and interleave ROM images but I don't remember what it's called.
 

Offline TheEPROM9

  • Frequent Contributor
  • **
  • Posts: 254
  • Country: gb
  • I have a Kali USB and I'm not afraid to use it!
    • EPROM 9 Home
Re: Joining two EPROMs (TL866CS EPROM programmer)
« Reply #20 on: March 31, 2019, 12:24:36 pm »
Use the DOS copy command to append files. Here is the command line I used to put several cartridges ROMs into a single EEPROM:-

Code: [Select]
copy /b "babasic.bin" + "utopia.bin" + "logo.bin" + "chess.bin" "roms.bin"
Option /b is required when working with binary files. Files are appended with '+'. The final name ("roms.bin" in this example) is the created file.

While this tecnicaly works, it does not do any of the clever & fancy stuff that puts the data in the right order.
TheEPROM9 (The Husky Hunter Collectors inc.)
Knowledge should be sheared freely to those who want it.
https://www.flickr.com/photos/146977913@N06/ https://www.youtube.com/channel/UC4vOnjz1G-aM8LddSbrK1Vg https://www.facebook.com/groups/118910608126229/
 

Offline technix

  • Super Contributor
  • ***
  • Posts: 3507
  • Country: cn
  • From Shanghai With Love
    • My Untitled Blog
Re: Joining two EPROMs (TL866CS EPROM programmer)
« Reply #21 on: May 08, 2019, 08:04:20 pm »
Since you are using a Mac, you can grab Xcode, a free download from App Store, and use Swift Playground for that. Swift is easier to use as a programming language than bash or Windows command prompt thanks to its vast library.

And what you want to achieve should be at the level of beginner Swift if you follow some online tutorials assuming you have a grasp on what programming is at all.

I don’t really use Swift though, instead I use Objective-C with Cocoa, which is also available in Xcode. Something for you to take a reference to:

Code: [Select]
// clang main.m -framework Foundation -fobjc-arc -o concat
#import <Foundation/Foundation.h>

int main(void) {
    @autoreleasepool {
        NSMutableData *bin = [NSMutableData dataWithContentsOfFile:@“file1.bin”];
        bin.length = 4096; // 32 kibibits = 4 KiB
        [bin appendData:[NSData dataWithContentsOfFile:@“file2.bin”];
        bin.length = 8192; // 64 kibibits = 8KiB
        [bin writeToFile:@“out.bin” atomically:YES];
    }
}
« Last Edit: May 08, 2019, 08:13:09 pm by technix »
 

Offline CJay

  • Super Contributor
  • ***
  • Posts: 4136
  • Country: gb
Re: Joining two EPROMs (TL866CS EPROM programmer)
« Reply #22 on: May 09, 2019, 01:34:50 pm »
Why would you even need to do that, can you not change the load address in the TL866 software to $1000 and load a second file?
 

Online oPossum

  • Super Contributor
  • ***
  • Posts: 1415
  • Country: us
  • Very dangerous - may attack at any time
Re: Joining two EPROMs (TL866CS EPROM programmer)
« Reply #23 on: May 09, 2019, 02:14:16 pm »
Yes. Just be sure to set clear buffer to disable for the second file or the previously loaded file(s) contents will be lost.
 

Offline CJay

  • Super Contributor
  • ***
  • Posts: 4136
  • Country: gb
Re: Joining two EPROMs (TL866CS EPROM programmer)
« Reply #24 on: May 09, 2019, 02:25:13 pm »
Software downloaded, installed and confirmed, trivially simple to do, no need for silly command line stuff, just use the feature that's been in every EPROM programmer software I've ever used since forever.

Select your target EPROM (27C64)
Load file
Change Buffer "Strat" Address to 01000
Change Clear Buffer to Default to Disable
Load second file.

Save file/Program chip.
 


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf