Jump to content
IGNORED

can someone show an example of custom SIC flashing


Marius

Recommended Posts

Hi!

 

In the SIC-Technical registers paper I read that the write protection bit (bit 7) needs to read zero to be on, and reads one to be off.

 

But my question is now:

When I remove the write protection; how to write something to the flash chip?

 

The last two lines of the SIC-Register document are not clear to me.

 

A short example would help.

 

Another question:

Does the FLASHchip works like an Eprom, and needs data to be erased before it can be re-programmed?( I know in Eprom when bits are once set, they need to be switched back to zero before they can be programmed again)

 

And is it possible to erase just a smaller part of the chip.

 

If someone could explain me how to do that too... I would be very thankful.

 

Ofcourse I would appreciate a suggestion in the right direction too...

:D

Link to comment
Share on other sites

Ah... now I found out why it does not work what I want.

 

Indeed: you can set bits to zero, but you can not 'simply' reset bits back to one.

 

So when a certain location reads $05, I can change it to $04. But I can not change it back to $05 so easily.

 

Hmmm.

 

I need to investigate how that erasing works. If someone has a hint or a clue. I'd be happy to get some hints!

 

Thanks

Marius

Link to comment
Share on other sites

You'll want to read through datasheets for flash chips to get an idea of how it works. For instance, here's the datasheet for the 4Mbit Am29F040B:

 

http://www.xilinx.com/products/boards/ml310/current/pcb/ds/am29f040b.pdf

 

In a nutshell, you need to write a specific sequence of data values to specific addresses to unlock the flash chip, after which you can write commands to erase or program the chip. Usually you can program on a byte basis, but only erase on a sector or whole chip basis. However, you need to look at the datasheets for the specific flash chip on your cartridge as the different flash chips are not the same -- they sometimes vary in the exact address bits that are checked for the unlock sequence, guaranteed timings, and supported commands. I would recommend reading and understanding the datasheets before looking at flasher source because some of the flashers have bugs. For instance, I found out recently that a couple of the commonly used ones were using the wrong cartridge banks in the unlock sequence and it just happened to work with the flash chips used.

 

To write flash-based write code, I'd recommend prototyping on an emulator first and then testing on real hardware. Using an emulator first will avoid unnecessary write cycles on your physical cartridge and reduce the possibility of getting it into a hard to recover from state, like a cart image that immediately crashes the Atari on startup. Altirra emulates a Am29F040B flash chip for SIC!. OTOH, you need to test on real hardware because the emulator won't show you all the behaviors, such as the status bit toggling while programming is occurring or programming phases that can have varying timeouts from chip to chip. Also, keep in mind that two cartridges may not have the exact same flash chip, so you may need to program for multiple slightly different unlock sequences and check or at least report chip IDs.

  • Like 2
Link to comment
Share on other sites

Thanks guys, this is already very helpful.

 

I succeeded now in reprogramming a part of the cart without erasing the whole cart (this is exact what I want).

 

but...

 

In those datasheets (like the one in the link phaeron provided) -and even in his reply too- there is speaking of Toggling a certain status bit.

 

I don't know how to read out that bit. What address do I need to read out?

 

I now did simply this:

1. The three byte programming sequence

2. The actual programming of the byte

3. I read out the programmed byte

4. I read out the programmed byte another time

5. If ok then go on with the next byte.

6. If not ok repeat step 3.

 

Is that the way? It worked anyway... but I'm not sure whether this is the official method.

 

When I leave out this checking thing and I do the programming without checking (in fact without a pause) this causes problems, since a lot of bytes are not programmed then. So that is too fast. I could simply built in a pause loop, which will probably work too, but I would like to do it the right way with that status bit. So if anyone could explain, I would be happy!

 

And @phaeron: it's a good idea to test on emulator, thanks for the suggestion. The problem of locking out is not there, since you can always boot the flasher without a cart inserted, and then insert the sic. Or... using the on/off switch of the cart, and switching it on as soon as the flasher is started. But... another reason for using the emulator is saving the cart from unneeded erase cycles, which saves hardware.

 

Which comes to the next question: I have bought SIC carts from different batches, and all I have is having the 39SF040 (not 29!) ... I read the docs of the 39SDxx chips. Why isn't altirra emulating this 39xxxxx ones? And one other question: it would be great to be able to see realtime the contents of certain SIC banks, to see the effect of running routines). Is this possible? I do not know how...

 

Thanks a lot people. You are so helpful again!

Nice!

Link to comment
Share on other sites

Oh ... I tried looking into the source, but I have no idea how to get a readable thing on my screen.

I'm not into crossassembly. I tried to install mads, but instead of a binary I got a .pas file.

 

That is not an option for now. I don't understand a single thing of these crossassemblers. I don't understand Polish and I am not so experienced with windows. So that will be a whole new chapter for me ;) ...

 

So if someone still can explain how I get that bit toggling thing working on real atari, I would be happy.

Thanks

M.

Link to comment
Share on other sites

I've converted the files to ascii, so that should help in viewing.

In the sicflash.mae.asm file look at the "write" routine, the datapoll section is that bit toggling part of programming a byte.

 

Since the data is mapped to the A000-BFFF area, could you point the screen ram to that location in a character mode?

Otherwise, you would have to have a routine to display the data like in Sectorcopy.xex or similar...

SIC!FLASHSRC.ZIP

  • Like 1
Link to comment
Share on other sites

Thank you VERY VERY VERY much Atarigeezer. This is really fabulous information indeed. Phaeron and you: thanks guys!!

 

I created something amazing with SIC! now.

Well... I think it is amazing... for other people it is probably just simple.

 

This is what I have now!

The Sic checks first whether my Ramdisk is already installed or not; when not... it initialises ramdisk and fills it with equates and tools and macro's... then it boots XDOS24F (With HS SIO) and then finally it starts my Assembler. But... it is getting cooler:

 

You have a standard 130XE ramdisk at D8: and an extended 180K ramdisk on D9: (this one is not touched; you have to clear it first with dos command).

 

With your help guys I now created a tool that writes the 130XE ramdisk back to the SIC cart. It does only erase the banks that are used for this ramdisk. The other content is preserved. As soon as you switch off the atari, and start it again; the fresh saved SIC ramdisk will be copied back to XE RAM.

 

So now I can program on a stock 130XE without even a diskdrive attached. If I created something cool I could save it back to the SIC!

 

Next step is that I also write a tool that saved the 180K ramdisk (D9:) back to Sic.

 

It is only compatible with the 39SF040 Flash chip. I do not have other chips, and I understood indeed that especially the erasing sector size is different between several models of this chip.

There do exist Flash chips that erase a nice sector size of only 128bytes (that is great!) ... this 39SF040 uses a sector size of 4KB (Which is still very versatile). The Chip phaeron emulates in Altiraa uses erase sector size of 64KB. Hmmm... although that is not a problem for a 64K ramdisk, it results in the fact that I have to move my ramdisk-banks to another place on Sic. That will cost me two useless banks on SIC.

 

Anyway. Not a problem. I created this for my own use. If someone is interested let me know. Unfortunately I can not release this in it's current form. I am not allowed to release the ROM version of Synassembler. But even without ROM this might be interesting for some people. You could use this with Basic. Or even Turbobasic (although you have to run Turbobasic from the ramdisk then, and I'm not sure it is possible to move to DOS and back with XDOS). It's cool to be able to save things back to the SIC cart; this increases the fun of SIC!

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...