Jump to content
IGNORED

Programming the Lynx for a living - blank carts


karri

Recommended Posts

I'm in if there is still room :-)

 

Great! We found out that in order to meet a sensible price for the carts we aim for a batch of 200 carts. So a few more guys to share the batch is a good thing. We are now 6.

Link to comment
Share on other sites

Hi karri,

In a previous post you were aiming for 100 carts, the post prior to this one your aiming for 200 carts. I'm going to struggle with trying to program 1. I'm in for 10 to help with cost however 25 for me would be pretty pointless. Do you have cost prices for each batch size? I fully appreciate bigger batches reduce cost but we are only a small group atm.

 

Is there a specific Raspberry Pi to purchase for the project and a specific OS to install on it?

 

Rgds

BadPricey

Link to comment
Share on other sites

Hi BadPricey,

 

So far the total investment has been

total price for the 10 cart proto series in euros = 100.96

total price for the 10 programmer boards in euros = 90.47

 

So for 19€ you get the programmer board and one blank cart to play around with.

 

After that everything is still just speculation. We have not agreed on any numbers to be made. My idea was to sign up for a certain amount of carts. After we know what kind of amount people need we can find out what the price per cart will be.

 

I may be interested in 20 carts myself. If I am alone I have to pay 10€ per cart for the PCB and chips. In quantities of 200 we may get down to 4€.

 

Of course there is also some cost for the 3D printing, manuals, boxes etc. But these are not my concerns - it is up to the developers to find out how to make the rest. This project would just create a programmer board for the Raspberry Pi and blank carts that use 1.0mm thick PCBs.

 

I was thinking of using RetroPi as the SD cart image. It emulates the Lynx very nicely and I have also compiled the cc65 toolchain on it.

 

I believe that any Raspberry Pi would work. But if you have an older model you need to make a narrower cable that fits the older Pi.

Edited by karri
  • Like 1
Link to comment
Share on other sites

I may be interested in 20 carts myself. If I am alone I have to pay 10€ per cart for the PCB and chips. In quantities of 200 we may get down to 4€.

 

If we can get the costs down, I'm interested to buy more carts, so if the price would be able to drop to around 4 euro, I don't mind getting 20/25 carts.

Link to comment
Share on other sites

Just the PCB prices go like

10 - 6 euro

50 - 4 euro

100 - 2.5 euro

200 - 1.5 euro

 

Soldering is about 1. This is actually a very simple card to solder manually so we could drop that as well.

 

I can get the chips cheaper from Finland than from abroad.

 

So many options :)

 

We can also turn the question around. How much do you want to pay for a lot of 10 carts?

- 30 euros and do all soldering by yourself

- 40 euros and get it assembled

...

- 100 euros and still do all work by yourself (the current prototype)

 

The more developers sign up the cheaper it becomes...

Edited by karri
Link to comment
Share on other sites

Thank you. The proto cards are also 1.0mm and I will ship them with a 3d printed cover.

 

Actually I am working on a real release. Hopefully within the summer. So it is in my interest to get an idea of the numbers before August. The alternatives are 50, 100, 200. One possibility is to order 200 PCB's and buy chips only for the exact amount that is made. The chip prices have much smaller discounts when the numbers go up. The ordering steps for the eeprom is multiples of 20. The flash chips are ordered in bags of 2, 10, 20, 40 or 100 pieces. The max savings is just 30%.

 

At this very moment I am testing the design and learning how to program the MPC23S17 so that it does what I want it to do. This is also the first time for me to get into SPI programming so I am doing most things wrong. But hopefully I get it tamed during today ;)

 

The new Raspberry Pi 2 cost €39.80 at the local hw store. (without a micro SD card)

 

Yesterday they reduced the old Raspberry Pi B to £16 in the UK. Don't know the price in Finland yet.

Update: it was 16 pounds without VAT. In my opinion no point in getting anything but Pi 2. Unless you already have a model A or B.

Edited by karri
Link to comment
Share on other sites

Karri, I am in, 19€ for the programmer board and 10 carts, 6 euros. That's correct ? I have Raspberry Pi B, but probably going to buy Pi 2 at some point anyway.

 

--------

 

Is it 10 carts, 6 euros per item ? If so, then I need only 19 euro programmer board + one cart, I assume the cart is rewritable ?

Edited by jp48
Link to comment
Share on other sites

If you just want to code your music synth you get along with a single cart. It is rewritable. The programmer uses the first SPI port plus some GPIO pins. It should work ok with Pi B.

 

Yesterday I spent hours reading the datasheet of MCP23S17. There is no clear timing diagram for how to add the payload to it.

 

Life came in the way so there is still things to do before the code is ready and the system works.

Link to comment
Share on other sites

Excellent, single cart, then ! It is for music sequencer I have programmed and which is already running full speed :) ! Lots of things to do with it, but my goal is multitimbral sequencer for Lynx, and if all goes well, it will be published for others too. Lynx's sound palette is huge, there are much more variation than I thought before I started programming.

 

Pi B would be nice, still going to buy Pi 2 at some point. I probably need to ask some soldering help, just soldered ZX Spectrum composite video (bypassing RF modulator) and it was quite a mess, realized that I can't focus my sight/eyes, constantly blurring vision, tested other glasses, but no help. Got it soldered though, which I consider small miracle :)

Link to comment
Share on other sites

Ordered a Raspberry Pi 2 today :) . I'm aiming to get the thing setup before you have the programmer and cart ready karri! I've also downloaded the latest version of RetroPi.

 

Is there anything else I might need? How are we connecting to the programmer board?

 

(Keyboard, micro sd card, wireless dongle, mouse and monitor sorted).

 

Rgds

BadPricey

Link to comment
Share on other sites

So far I have mainly connected from my laptop using ssh. Or if you have a monitor and keyboard connected you can exit the Emulation Station and get shell access.

 

I configured my Raspberry Pi WiFi dongle to be an access point so I need no cables in order to connect to it from my laptop or mobile phone. It shows up as RP_Ap on my WiFi screen.

 

I assume that we only need one command to use this:

program mygame.lnx

 

In theory programming one byte should take 20us. Erasing the cart is 100ms. Which makes about 11 seconds to program the 512k cart. It is going to be interesting to see if the cart can be programmed this fast. :)

 

For RetroPi the lynxboot.img goes into /home/pi/RetroPi/BIOS and the lnx roms into /home/pi/RetroPi/roms/atarilynx if I remember correctly.

 

I also checked out build_essential and git. Then I went to /opt and checked out the lynx tools from bitbucket.

 

So the programmer is found in /opt/lynx/contrib/blankcarts/programmer/

 

It might make sense if I clone my (8GB) RetroPi SD card with all the extras when I have everything working.

Edited by karri
Link to comment
Share on other sites

Back from the library. There was one young guy who recommended to use higher quality. This printout took a little over 3 hours.

 

[..]

 

A great thank you to Johannes from Duranik for this fabulous stl file. Which is included here so that you can already print out the covers while waiting for the boards to arrive.

 

How heavy were the covers you printed (and what type of material did you use) ?

 

[edit] Oh just noticed you mentioned 7 grams. :)

Edited by EvilActivity
Link to comment
Share on other sites

It took me some time to get my head around programming the SPI chips. There was an errata saying that at startup the chips have a selection bit A2 set so in order to initialize them you have to write stuff to non-existent addresses. omg!

 

In any case I can read carts with the programmer now.

 

The first 5 bytes from Blue Lightning :)

 

fb c5 bf a3 9a f7

 

The next step is to write a lnx file to the cart. But that will not happen today as I have some theatre tonight.

 

The max SPI speed of 32MHz produced bit errors. But on 16MHz reading the cart produced a good target in 12 seconds.

Edited by karri
Link to comment
Share on other sites

It took me some time to get my head around programming the SPI chips. There was an errata saying that at startup the chips have a selection bit A2 set so in order to initialize them you have to write stuff to non-existent addresses. omg!

 

In any case I can read carts with the programmer now.

 

The first 5 bytes from Blue Lightning :)

 

fb c5 bf a3 9a f7

 

The next step is to write a lnx file to the cart. But that will not happen today as I have some theatre tonight.

 

The max SPI speed of 32MHz produced bit errors. But on 16MHz reading the cart produced a good target in 12 seconds.

Great news karri, you're a genius! :thumbsup:

Link to comment
Share on other sites

Obviously there is something wrong with the cart itself. I tried to read the manufacturer ID and chip ID from it. The results are wrong and not the same between runs.

 

GadgetUK, do you have a programmer for programming the chip itself? It would speed up debugging to get a few chips programmed with known good content. The I could try out the cart in a real Lynx to see if it is running ok.

 

Now I do not know if the wiring is bad, the chip itself is bad or my coding is bad.

Link to comment
Share on other sites

  • 3 weeks later...

Status update. I had some weird problems with programming the chip. After banging my head against the wall for hours the reason was pretty obvious.

 

The contact pads were too short on the cart. When you pushed it all the way in the standard Lynx connector it did no longer make contact. The next step is to make the connector strips a few mm longer and then it is just to order the carts. No other flaws were found. The programmer was able to program the SRAM carts and read in carts also.

 

I still need to test the 2k eeprom on the cart.

 

This project is kind of slow due to many other things. But it goes forward.

Link to comment
Share on other sites

About the 2k eeprom. In earlier Lynx eeproms you typically just had 64 bytes of storage and it made no sense to have a directory. The size was barely big enough for the high score table.

 

With 2048 bytes it may be possible to have game saves like on EOTB. I hope that 2048 bytes is the right choice. It cost only 40 cents extra and it allows you to customize the character name, keep your inventory between gaming sessions and perhaps also maintain progress of the game.

 

The question here is that should the eeprom driver be using a directory? Or is it enough to just have 2048 individually addressable bytes?

 

Usually cc65 has provided 16 bit reads and writes only. In order to keep the new eeprom consistent the routines could be

 

unsigned int __fastcall__ lynx_eeread_24LC16B(unsigned int addr);

void __fastcall__ lynx_eewrite_24LC16B(unsigned int addr, unsigned int val);

 

It may be a good idea to write some magic number in the 1st entry of the eeprom. When you run the game you can look if the chip exists and you can read the array into ram. If it does not exist you can just initialize the ram array to something sensible. In this way you can still play the game in Handy, Mednafen or your flash cart.

 

Unfortunately the 24LC16B does not contain any ID fields so it is not possible to detect if the chip is there or not.

 

It is still possible to change the chip to something else if 2k is too small. EOTB had 16k.

 

--

Karri

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...