Joining two EPROMs (TL866CS EPROM programmer) - Page 1
Forum section: electronics / general

author: analogix
author_rank: Frequent Contributor
timestamp: February 25, 2018, 03:40:30 pm
content: 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?

author: Bruce Abbott
author_rank: Frequent Contributor
timestamp: February 25, 2018, 04:16:01 pm
content: 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: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.

author: Ampera
author_rank: Super Contributor
timestamp: February 25, 2018, 05:15:13 pm
content: 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.

author: analogix
author_rank: Frequent Contributor
timestamp: February 25, 2018, 07:24:06 pm
content: 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:cat Part1.bin Part2.BIN > Combined.BINHopefully 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?

author: helius
author_rank: Super Contributor
timestamp: February 25, 2018, 07:56:37 pm
content: 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.

author: analogix
author_rank: Frequent Contributor
timestamp: February 25, 2018, 08:19:26 pm
content: 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?

author: helius
author_rank: Super Contributor
timestamp: February 25, 2018, 08:43:30 pm
content: Quote from: analogix on February 25, 2018, 08:19:26 pmYes. 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 withCode:cmp -n4096 Combined.BIN Part1.BINcmp Combined.BIN Part2.BIN 4096

author: netdudeuk
author_rank: Frequent Contributor
timestamp: February 25, 2018, 08:59:35 pm
content: 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.

author: analogix
author_rank: Frequent Contributor
timestamp: February 25, 2018, 09:50:07 pm
content: Quote from: helius on February 25, 2018, 08:43:30 pmFrom what I've been told it should work fine to join the two files together as a (twice as big) new file.QuoteI just tried the whole thing (joining and checking):Code:$ 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.

author: helius
author_rank: Super Contributor
timestamp: February 25, 2018, 09:52:18 pm
content: No output fromcmpmeans it succeeded. When it fails to verify the files are equal, it prints$1 $2 differ: char 11, line 7type of thing.Combining the files is easy, but replacing two eproms with one depends on the circuit design.

author: analogix
author_rank: Frequent Contributor
timestamp: February 25, 2018, 10:00:56 pm
content: 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 lineThose 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.

author: Ampera
author_rank: Super Contributor
timestamp: February 25, 2018, 10:54:04 pm
content: Quote from: analogix on February 25, 2018, 10:00:56 pmHxD is about as simple as using a text editor. I never even had to look up how to use it.

author: analogix
author_rank: Frequent Contributor
timestamp: February 25, 2018, 11:17:41 pm
content: 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 thestartof "part1" andending 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.

author: helius
author_rank: Super Contributor
timestamp: February 25, 2018, 11:39:41 pm
content: The 4096 at the end of the line is an offset in the first file to skip before it starts comparing. The arguments tocmparefile1, file2, skip1,andskip2. After the two input files have beenseek()'d to skip1 and skip2 respectively,cmpbegins comparing bytes. If-n lenis supplied, it compareslenbytes and then stops.So depending on whether you want to ignore a range of the fileafterthe part that should be common, you would want to supply the-n lenoption. If you want to ignore a rangebeforethe part that should be common, you would want to supply the skip parameters to seek past before comparison begins.

author: analogix
author_rank: Frequent Contributor
timestamp: March 02, 2018, 10:31:56 pm
content: Thanks for explaining!

author: james_s
author_rank: Super Contributor
timestamp: March 07, 2018, 10:11:16 pm
content: 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.

author: analogix
author_rank: Frequent Contributor
timestamp: March 09, 2018, 05:46:45 am
content: 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?

author: helius
author_rank: Super Contributor
timestamp: March 09, 2018, 06:32:58 am
content: 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.

author: analogix
author_rank: Frequent Contributor
timestamp: March 09, 2018, 06:36:03 am
content: 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.

author: james_s
author_rank: Super Contributor
timestamp: March 09, 2018, 06:59:15 am
content: 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.

author: TheEPROM9
author_rank: Frequent Contributor
timestamp: March 31, 2019, 12:24:36 pm
content: Quote from: Bruce Abbott on February 25, 2018, 04:16:01 pmWhile this tecnicaly works, it does not do any of the clever & fancy stuff that puts the data in the right order.

author: technix
author_rank: Super Contributor
timestamp: May 08, 2019, 08:04:20 pm
content: 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:// 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];}}

author: CJay
author_rank: Super Contributor
timestamp: May 09, 2019, 01:34:50 pm
content: 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?

author: oPossum
author_rank: Super Contributor
timestamp: May 09, 2019, 02:14:16 pm
content: Yes. Just be sure to set clear buffer to disable for the second file or the previously loaded file(s) contents will be lost.

author: CJay
author_rank: Super Contributor
timestamp: May 09, 2019, 02:25:13 pm
content: 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 fileChange Buffer "Strat" Address to 01000Change Clear Buffer to Default to DisableLoad second file.Save file/Program chip.

author: james_s
author_rank: Super Contributor
timestamp: May 10, 2019, 06:44:03 pm
content: Command line concatenation seems easier and faster, but then I feel that way about a lot of things. The GUI is nice for discoverability and it's a simple way to navigate a file structure and move/copy significant numbers of files but other than that a command line is much quicker and more efficient and I tend to rely on it pretty heavily. The advantage increases even more when you start scripting things.

author: CJay
author_rank: Super Contributor
timestamp: May 13, 2019, 08:41:59 am
content: Don't get me wrong James, I come from DOS3.2, SCO Xenix 286 etc. and find it so simple to do things at the command prompt but for some things like EPROM programming where it's often necessary to join/split/interleave a file and the function is built into the software...