CHOCHI E with USB Power

Topics relating to PALs, CPLDs, FPGAs, and other PLDs used for the support or creation of 65-family processors, both hardware and HDL.
User avatar
enso
Posts: 904
Joined: 29 Sep 2012

CHOCHI E with USB Power

Post by enso »

Ladies and Gentlemen, I have a dozen or so updated CHOCHE (rev E) boards with a USB connector for power:
CHOCHI-E.JPG
The USB connector makes it much easier to use. There are 3 ways to power the board: USB, an unregulated 5V-6V connector, and a regulated 3.3V connector.

All the software including FIG-FORTH, EhBASIC, C and the examples work without any changes.

If anyone is interested (PM me), the price is still US $25.00 plus actual shipping costs.

If you missed the original CHOCHI thread (viewtopic.php?f=10&t=2644), this is a complete 45MHz 6502 system with 128K of fast SRAM, a serial port, an 8-bit input and and 8-bit output port. It is based on a Xilinx XC3S50 FPGA and can be reconfigured for other purposes as well. The CHOCHI website is here: http://apple2.x10.mx/CHOCHI/
In theory, there is no difference between theory and practice. In practice, there is. ...Jan van de Snepscheut
User avatar
barrym95838
Posts: 2056
Joined: 30 Jun 2013
Location: Sacramento, CA, USA

Re: CHOCHI E with USB Power

Post by barrym95838 »

Lookin' good, man!

I can't tell for sure ... did you keep the blinkin' light for basic diagnostic purposes, or get rid of it out of lack-of-need?

Can you show us a rear-view as well?

Mike
User avatar
enso
Posts: 904
Joined: 29 Sep 2012

Re: CHOCHI E with USB Power

Post by enso »

The LED is still there, upper left corner just below the crystal. It is extremely useful - I can verify that the unit is programmed correctly.

Here is the backside:
CHOCHI-E-BACK.SM.JPG
I try to put a table of pinouts right on the back of my boards. It's much easier than digging through a pile of paper or the filesystem when you need to know how a pin is connected.
In theory, there is no difference between theory and practice. In practice, there is. ...Jan van de Snepscheut
User avatar
enso
Posts: 904
Joined: 29 Sep 2012

Re: CHOCHI E with USB Power

Post by enso »

Here is a labelled diagram:
parts.png
A couple of new additions:
-a crystal disconnect solder jumper (drop a ball of solder to disable the on-board crystal)
-2 normally unused pins (for 512K SRAM) are routed to 2 pads for optional serial handshaking
In theory, there is no difference between theory and practice. In practice, there is. ...Jan van de Snepscheut
User avatar
8BIT
Posts: 1787
Joined: 30 Aug 2002
Location: Sacramento, CA
Contact:

Re: CHOCHI E with USB Power

Post by 8BIT »

Hi Enso,

Got the Rev E board up and running this morning. BASIC and FigFORTH work great. I could not get the sbc.bin file to respond, however. After loading, the LED stays on and there is no response from the terminal. Any thoughts?

I may work on some bit-banged SPI code to see if I can get my ENC28J60 board working.

Can you provide the pinout for the JTAG header - I want to be sure my programmer has the same pinout. Also, is there another way to reset the FPGA back to the code boot mode besides power cycling it?

Thanks again!

Daryl
Please visit my website -> https://sbc.rictor.org/
User avatar
enso
Posts: 904
Joined: 29 Sep 2012

Re: CHOCHI E with USB Power

Post by enso »

Pin 96 is connected as RESET to the CPU. It is pulled down, active high. You can connect it to a pushbutton with 3.3V on the other end. Check the 'top.ucf' file in the CHOCHI_6502_45_004 source distribution for other pinout information.

The JTAG pinout is standard Xilinx - works with Digilent Spartan3 board. Keeping the same orientation as the CHOCHI insignia, the JTAG pinout is:
JTAG.png
JTAG.png (2.06 KiB) Viewed 2591 times
Keep in mind that VCCJ for XC3S chips is 2.5V; most newer program cables support this.

I will look into the software issue as soon as possible.

PS - if you want, I can post a customized version of the bitstream that I've been using to bitbang SPI for my SD-card project. It makes it a little easier as the MOSI goes out bit 0 and MISO goes into bit 7 of a dedicated port, so all you need to do is shift right 8 times as you twiddle the clock pin... Let me know.
In theory, there is no difference between theory and practice. In practice, there is. ...Jan van de Snepscheut
User avatar
8BIT
Posts: 1787
Joined: 30 Aug 2002
Location: Sacramento, CA
Contact:

Re: CHOCHI E with USB Power

Post by 8BIT »

Thanks Enso,

I think I will need to take some time and study that FPGA's datasheet and some Xilinx docs too, before I start making modifications to the bitstreams. In the mean time, I'll play around with the board as-is. I will add the reset switch though, as that will be easier than power cycling. My Xilinx programming cable is old - the Xilinx III parallel port cable, which used 5v TTL chips. I will need to update that too.

Nice work on this board!

Daryl
Please visit my website -> https://sbc.rictor.org/
User avatar
enso
Posts: 904
Joined: 29 Sep 2012

Re: CHOCHI E with USB Power

Post by enso »

Thanks Daryl.

About reset: it's a little bit counter-intuitive - the computer wakes up with 64K RAM (minus the IO page) with the bootloader magically pre-loaded into the top page. If your code overwrites the bootloader (it's writeable RAM) or the vectors, reset will not help and you'll have to power-cycle. So it may appear as broken sometimes.

As for the Xilinx stuff, it's not too hard to get started. It's pretty easy to reassign the IO pins or change the address of the IO page or change the startup code as a way to get into it.

Let me know if I can help with anything.
In theory, there is no difference between theory and practice. In practice, there is. ...Jan van de Snepscheut
User avatar
barrym95838
Posts: 2056
Joined: 30 Jun 2013
Location: Sacramento, CA, USA

Re: CHOCHI E with USB Power

Post by barrym95838 »

Ah, so there's a difference between a cold 'magic' reset and a 'warm' reset?
Is there a way to externally trigger the full 'magic' without cycling the power?
I don't know if it's applicable, but I find myself reminded of the Auto-Start Apple ][ ROM's 'powered-up' byte.

Mike
User avatar
enso
Posts: 904
Joined: 29 Sep 2012

Re: CHOCHI E with USB Power

Post by enso »

Well, the simplest thing to do is to write protect the top page, making it impossible to overwrite the bootloader and the vectors. The bootloader could in turn check a 'magic byte' somewhere and vector to some loaded code, and if not, bootload via serial. That way 6502 reset will always run something usable pretty much every time.

The power cycle reset is extremely fast, so the only downside is that eventually the USB connector will break. I have a USB extension box with rocker switches, so I use that to restart.
In theory, there is no difference between theory and practice. In practice, there is. ...Jan van de Snepscheut
User avatar
8BIT
Posts: 1787
Joined: 30 Aug 2002
Location: Sacramento, CA
Contact:

Re: CHOCHI E with USB Power

Post by 8BIT »

I found the problem with the sbc.bin file. It loads from $FC00-$FFFF. However, the bootloader resides at $FF00 and is getting overwritten by the sbc.bin file as it loads - eventually corrupting the bootloader code. It appears that earlier versions had the bootloader load at $0000. Does that sound right?

I recompiled the sbc.bin to go from $FB00-$FE80 (and removed the vectors) and it ran fine.

I am now working on converting the full SBC2OS to 6502 code vs. 65C02. This will include xmodem transfer and EhBASIC.

Daryl
Please visit my website -> https://sbc.rictor.org/
rwiker
Posts: 294
Joined: 03 Mar 2011

Re: CHOCHI E with USB Power

Post by rwiker »

My CHOCHI E arrived today, and works just great - I had some initial problems with the fig-forth image, but that appears to have been caused by a corrupted or out-dated file.
User avatar
BigEd
Posts: 11464
Joined: 11 Dec 2008
Location: England
Contact:

Re: CHOCHI E with USB Power

Post by BigEd »

Mine arrived today too! A bit of messing with minicom and the raspberry pi, and I got the blinky test, the helloworld and the figforth to work... but ehbasic has some funny ideas:

Code: Select all

Ready
PRINT 22/7
 0.34144E+15

Ready
PRINT 4+5
 5.26515E-07

Ready
PRINT 355/113
 5.43216
Cheers
Ed
(I assume sbc.bin will get an update, given Daryl's comments above)
(BTW, I tried running with two stop bits, but that was less successful than running with one)
User avatar
enso
Posts: 904
Joined: 29 Sep 2012

Re: CHOCHI E with USB Power

Post by enso »

8BIT wrote:
... It appears that earlier versions had the bootloader load at $0000. Does that sound right?
Bah, of course. I changed the mapping a while ago. Thanks!

Daryl, please send me the fixed source file/binary I will put it up on the website.
In theory, there is no difference between theory and practice. In practice, there is. ...Jan van de Snepscheut
User avatar
enso
Posts: 904
Joined: 29 Sep 2012

Re: CHOCHI E with USB Power

Post by enso »

Please let me know if any files on the CHOCHI website are not working (sbc is one I know about). It's a never-ending job making sure that the fresh files are up - I have a gazillion versions of everything on my computer...
In theory, there is no difference between theory and practice. In practice, there is. ...Jan van de Snepscheut
Post Reply