Saturday, April 30, 2011

How hard would it be to create schematics for rare laserdisc hardware?

This morning I've been trying to fix bugs in my LD-V1000 interpreter so I decided to build the latest MAME and use Visual Studio's debugger to observe some key LD-V1000 behaviors that I am curious about. (MAME emulates the LD-V1000 whereas DAPHNE just simulates it, so MAME may be a good point of reference)

In process of doing this, I started looking at MAME's Esh's Aurunmilla driver which is based (entirely?) off of DAPHNE's since no schematics are available and getting access to real PCBs is difficult.

Well, it got me to thinking... next time we have access to an Esh's PCB (hehe), why can't we create our own schematics for it? At the very least, figure out what these unknown Z80 ports are hooked up to inside the DAPHNE (and by extension MAME) drivers.

Thursday, April 28, 2011

All hardware on the PCB tested and working

After reflowing some solder connections, I successfully tested the PCB (with all hardware installed) on my Dragon's Lair. The Dragon's Lair booted up properly and ran through the attract mode. Which means all the onboard hardware is working!

  • 5V Power Working
  • 14.7456MHz crystal working
  • ISP pins working
  • AVR working
  • LM1881 working
  • BNC port working
  • LED working
  • LD-V1000 working
  • MAX3232 IC working
  • DB9 port working
That means that I can turn my attention to getting a second revision of the PCB drafted, getting the media server up and running on the BeagleBoard, and working on the web server. I can tell you right now that the first two choices are much more fun than the third. :)

Mods applied, seems to work

I applied Warren's recommended modifications tonight. I plugged in the PCB to my serial port and turned it on and got the expected serial data (at the 115200 bit rate) so it _seems_ to work. So I am going to say that the LD-V1000 connector remains the final thing for me to test on this thing.

Final remaining PCB modification

My PCB has two known defects. I've already fixed one of them with a black ground wire. The other one is a little more complicated to fix. Hopefully these images illustrate the task that lies before me.

Warren's advice:

* cut trace from existing C3 to MAX pin 2
* solder wire from cut side of C3 to ground (MAX pin 15)
* (strip and tin the end of the wire, then cut it very short. It'll easily hook onto the component lead with just a little heat)
* (wire goes on bottom side of board)
* solder new cap (C12, I guess) directly to pins 2 and 16 on bottom side of MAX socket
* remove the chip during this process (not critical, but safer and keeps it from drawing away heat)
* as for C4, use pin 16 and the near lead of the 680k resistor (which is also ground)

PCB can be powered by STK600 through ISP pins :)

Just noticed that I can power the AVR, LM1881, and LED using the STK600 and the ISP pins. That is pretty handy. Putting the ISP pins on this PCB was a really smart move on my part, and I did it as kind of a "Well this isn't necessary but it might be nice to have" type addition.

Vsync LED is blinking!

This video says it all.

* 5V Power Working
* 14.7456MHz crystal working
* ISP pins working
* AVR working
* LM1881 working
* BNC port working
* LED working

Yet to be tested:
* LD-V1000 port
* MAX3232 IC
* DB9 port

ISP pins on the PCB work!

After some tense moments of failure, I actually decided to read the instructions for how to use the STK600 to program external devices via the ISP pins. Turns out I had to remove a jumper (phew, glad I didn't damage anything). Once I did that, AVR Studio was able to see the AVR on my PCB! I haven't yet worked up the guts to switch the clock source from the internal oscillator to my external crystal since I fear that if the crystal isn't working that I may "brick" the AVR temporarily until I can get a routing card for the STK600 to reset it. Deep breaths...

Wednesday, April 27, 2011

Finished soldering

I put the finished product on my flatbed scanner just to see what it would look like. As you can see, it looks weird! :)

But the soldering is finished... well except for the modification I nedd to do to fix the MAX3232 chip. I think I may need my wife's help for that one.

Got S-Video working on the beagle broad

I spent probably an hour trying to figure out how to enable s-video on the beagle board. The information out there is conflicting and often out of date.

I finally got a picture showing but it was black and white and rapidly scrolling. I think I was in PAL mode.

After some more tweaking I finally got the picture I was expecting. I fired up the media player for beagleboard on a random .M2V file and it looked fantastic at full screen (and was only using 30-40% of the cpu). That is a good starst but the big test will be trying to get my LDImage files playing at full speed.

I'll probably do some more soldering next since Warren wants me to program his AVR for him :)

Tuesday, April 26, 2011

Did some soldering this morning; almost done! :)

I did some soldering this morning. It actually went faster than I thought it would which is great. The part that took the longest was finding the components and placing them on the board.

I got enough of the parts soldered on to test the power supply. And... it wooks!

The digikey shipment came last night! Here's some pictures of the contents, including the ultra small Beaglebroad!

Monday, April 25, 2011

Disc enumeration reflected on web server

The layout of these radio buttons is questionable, but the concept is sound; I want to let the user put more than one disc image on a USB stick and choose which one should be active. When I pondered whether I should go to the trouble to do this, I thought "Well almost all users are going to only have one image per stick so why should I make it selectable?" Then I thought "Well, there will probably be an exception I didn't think about." So here it is.

Microzine #40 rescued!

I've been sitting on Microzine #40 for almost a month trying to figure out how to save it. The problem is it has failing sectors so typical copy programs like Copy ][+ or archival programs like Shrinkit will see an I/O error and either skip the bad sector or else abort entirely.

But I've had a belief that repeated reads of the bad sectors would eventually result in success.

So I finally wrote my own little sector copy program.

Or at least I intended to. I started writing a DOS 3.3 sector copy program only to realize that all of my development tools were in ProDOS so instead I decided to write a block copier. A block is merely 2 sectors which means I would need to get two good sector reads at a time instead of just one which is twice as "hard" on a disk full of errors, but still very doable.

I am pleased to report that by using my own copy program I was able to "brute force" copy Microzine #40 and save it. (at least, the disk checksums passed so I think I most likely got good reads)

For fun, here is the little ProDOS program that I wrote to accomplish this feat.

* matt copier

mli EQU $BF00
cout EQU $FDED
prbyte EQU $FDDA
ptr equ $6

ORG $2000

jsr outstr
asc "Insert 5.25 disks to copy and press a key to start",8d,00
wait LDA $c000
bpl wait
sta $c010
lda block_idx
sta readblock
sta writeblock
cmp #$18
bcc :1
lda block_idx+1
sta readblock+1
sta writeblock+1
cmp #$01
bcs :done
jsr outstr
asc 8d,"Block: ",00
lda block_idx+1
jsr prbyte
lda block_idx
jsr prbyte

; read block
jsr mli
db $80
da read_parms
bcs :error ; if no error, do the write

jsr mli
db $81
da write_parms
bcc :next

jsr outstr
asc " Err code: ",00
jsr prbyte
bra loop

; increment block index
lda block_idx
sta block_idx
cmp #$00 ; did we overflow?
bne loop ; if we didn't overflow
lda block_idx+1
sta block_idx+1
bra loop
jsr mli
db $65
da quitparms

block_idx ds 2

quitparms db 4
ds 6

db 3 ; 3 parameters
db %01100000 ; drive 0, slot 6
da buf ; read buffer
readblock ds 2 ; block to read

db 3
db %11100000 ; drive 1, slot 6
da buf ; write buffer
writeblock ds 2 ; block to write

outstr pla
sta ptr
sta ptr+1
ldy #1
:1 lda (ptr),y
beq :4
jsr cout
bra :1
:4 clc
adc ptr
sta ptr
lda #0
adc ptr+1
lda ptr


typ #$ff
sav copy.system

Saturday, April 23, 2011

More work on disc image enumeration

I did more work on this today. I have all of the code fully covered by unit tests.

Friday, April 22, 2011

Digikey skipped!

E-mail from digikey:

Thank you for your order! Digi-Key has processed and shipped ...

Once these components arrive then I can start soldering them onto the PCB. I wonder how long it will take.

Recorded song, uploaded it to youtube

Last night I had some free time so I recorded a song. And since I stayed up late doing it, I slept in this morning and missed my usual early morning VLDP development work. Ohwell.

Check it out and please give a thumbs up on youtube for me if you like it. Thanks!

Wednesday, April 20, 2011

Prototype PCB has arrived!!!

The prototype PCB has come back from BatchPCB and it looks great! As you can see, it's pretty small. It fits in the palm of your hand.

Digikey estimates that they will ship out all the parts for this thing tomorrow, so when those arrive I can start soldering.

It is super cool to see my design manifest in a physical PCB. Really awesome. I'm sure the novelty will wear off but for now I am stoked!

Media server now starts up properly, disc images are being enumerated properly

I've finished this task and am halfway finished with this task.

Tuesday, April 19, 2011

Manager app now (in theory) will start up the media server

I made great progress on this task today. It's basically done but it needs testing (so I will probably find some defects).

Monday, April 18, 2011

Woohoo! The PCB has been shipped!

Just got this email from BatchPCB:

Dear Matt Ownby,

Your order has been shipped!

Shipping Method:
United States Postal Service PRIORITY
Estimated Transit time: 2 - 3 Days

Finished making web server remember its settings

I'm done with this task. It took almost 4 hours which is surprisingly long. Software development never is as fast as one would expect. :(

Saturday, April 16, 2011

Web server remembering its settings is practically finished

I've finished the hard part for making the web server remember its settings. I decided to save the settings as name/value pairs so that its easy to add new ones. The only thing remaining to do with this story is to choose where and what the settings file will be called and have the web server reference that location. However, I'm out of time for today so marking off this story as complete will have to wait.

Friday, April 15, 2011

Worked on loading/saving settings

Today I worked on this feature: Loading and Saving. I'm mostly done but I still need to write unit tests.

Thursday, April 14, 2011

LDImage finder, project tracker, and new code name!

I've finished writing the code to scan a folder (and its subfolders) for .ldimg files. Unit tests written also.

Once I finished this task, I couldn't think of what to work on next so I decided I needed a project tracker. My IRC buddy, ScottD, has been pestering me for literally years about how awesome RedMine is so I installed it. It was relatively painless as part of Ubuntu 10.04

Check it out here. It has very minimal stuff.

Also I've decided on a code name for the VLDP-HW project. The name will be Dexter, to continue the tradition set by the Daphne project. Dexter is a little easier to say than VLDP-HW.

Wednesday, April 13, 2011

finding laserdisc images

This morning I worked on code to make it so the VLDP-HW user can insert a USB stick and any laserdisc images on the stick will be auto-discovered.

I also want to list off a few invaluable debugging/troubleshooting tools since I'm thinking about it:

Even though I am targetting an ARM/linux environment, I've been doing most of my development lately in Visual Studio because the debugger is so good. And since I write cross-platform code and unit tests, it will be a simple matter to get everything running in linux with minimal debugging.

Tuesday, April 12, 2011

Messing around with avahi this morning

This morning I spent most of my time messing around with avahi. The documentation is _really_ sparse (like so many open source projects). I hate that. I wonder how bad DAPHNE's documentation is. Hey, at least I have a getting started tutorial!

Monday, April 11, 2011

More work on web server

Clicking on stuff is starting to work. It's very basic (it does a full post back on each click, no AJAX stuff) but it works.

Try it out here.

Saturday, April 9, 2011

Friday, April 8, 2011

Parts ordered!

I've justed placed a large order from Digikey for parts for the VLDP-HW PCB for when it arrives. Included in this order is a BeagleBoard which will serve as a tiny PC-like piece of hardware.

I'll probably have the first prototype built at the end of the month. (that's how long all of this stuff is going to take to arrive)

Thursday, April 7, 2011

I worked some more on the control panel design

I'm trying to make the control panel as simple/minimal as possible so everything on here has a purpose:
  • Show a picture of the laserdisc player so the user doesn't need to know the make/model of the player they want to replace.
  • Put the laserdisc players in a side-bar so the user visualizes choosing the laserdisc player as the first choice before choosing the disc or other tweaks.
  • Reduce clutter by putting configurable stuff inside drawers.
  • Reduce clutter by putting log file inside a drawer.
  • Display current configuration even when drawers are closed so the user doesn't have to open a drawer to see what's inside (exception, the log file).
I hope I succeeded. :)

Wednesday, April 6, 2011

rev 02 (preliminary)

I fixed the two errors that I found in my design. I'm not going to send anything off to be fabricated until I can test rev 01b and see if there are any more problems. But here is is just for reference.

Working on web control panel for vldp-hw

My intention is that the VLDP-HW project will be configured via web browser. (no messing with jumpers!)

I want the web page to be minimal so that it is both easy to use and easy to program. I will likely code it all in C++ which is about the hardest way to code up a web page/server but I want it to be really small, light, and fast.

Here's my initial design for the content I want displayed.

Tuesday, April 5, 2011

Mistakes in PCB design

I've noticed a few mistakes in my PCB design already. Fortunately, these can be corrected manually.

Pins 2 and 6 of the MAX232 are not connected properly. This is because the Sparkfun tutorial I followed was wrong also. Looking at the datasheet for the MAX232 (and clones) you can see the right way.

I think that the MAX232 may be an optional component. It may be possible to wire the RX and TX pins of the AVR directly to the DB9. This is non-standard but may still work depending on the serial port at the other end.

The ground for the LM7805 isn't hooked to anything.

Jumper a small wire to the 9V plug's ground. Shouldn't be a big deal.

I'll log more mistakes as I find them.

Monday, April 4, 2011

Submitted to be manufactured!

The design for my PCB has been submitted to be manufactured. It will take about 20 days for me to get the actual PCB back from the manufacturing process. I'll be sure to post pics once it arrives :)

rev 01b

I've hooked up the video input and output ports. I decided to use BNC plugs for now because a) the LD-V1000 has a BNC output, and b) trying to mount RCA jacks on PCBs seems hard, and c) I already had a pre-canned BNC plug part so I felt the chances of success were greater.

The bottom image is the "gerber" representation. This is what gets sent off to the PCB fabrication house to be err.. fabricated :) Unless I can see (or someone else can see) a defect in my design, I'm pretty much ready to send this thing off and see what happens. My expectations should be that it won't work but that I need to go through this step in order to get a good design. It will cost about $32 to make one of these and take 3 weeks. Does anyone else want one? :)

Saturday, April 2, 2011

Schematic finished? ... :)

I created the part for the LD-V1000 connector (including the size dimensions which was surprisingly fun) and added the rest of the parts. Looking at the schematic, this thing seems pretty complicated. I guess the STK600 shields a lot of the complexity. Next step is to create the PCB layout from this schematic... or should I try and add the VP931 connector on here first? I really want to play around with the PCB layout... :)

Started on the VLDP-HW schematic...

I found pre-canned parts for the AVR, the MAX232, and the LM1881. Note that the AVR is labeled as an ATMega644P but it is the same size as the 324P which I intend to use. Even with 40 pins, space seems tight, so I think moving to the 40 pin model up from the 28 pin model is a wise move.

I doubt I will be able to find a precanned part for the LD-V1000 connector so I will probably have to *gulp* make that one from scratch. To quote Zed, "nothing is ever easy".

Friday, April 1, 2011

Learning how to make a real PCB

I followed this tutorial and this one and made these. Having the pre-canned "parts" was very helpful. If I can find "parts" for all of my components, that would be nice.

Last night I uploaded some more rescued Microzine disks

Microzine #23, #29, and #30 are now available. Right here.

Microzine #40 has read errors and I don't know whether I will be able to recover it. It depends on how many sectors are bad. (there may be duplicate files on each of the four sides)

Can't reproduce problem in simulator

I fed in the string of LD-V1000 bytes that seems to caused a crash into the AVR simulator and it did not crash. This probably means that I will need to use a hardware debugger to see what the ploblem is.