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
BigEd
Posts: 11464
Joined: 11 Dec 2008
Location: England
Contact:

Re: CHOCHI E with USB Power

Post by BigEd »

Could the ehbasic problem be related to an unimplemented decimal mode??

Cheers
Ed
Klaus2m5
Posts: 442
Joined: 28 Jul 2012
Location: Wiesbaden, Germany

Re: CHOCHI E with USB Power

Post by Klaus2m5 »

Ehbasic uses decimal mode only in HEX$(). This should not affect any floating point results.

You actually said it yourself: viewtopic.php?f=8&t=2209#p20153

And a patch was presented by Lee: viewtopic.php?f=8&t=2209#p20278
6502 sources on GitHub: https://github.com/Klaus2m5
ElEctric_EyE
Posts: 3260
Joined: 02 Mar 2009
Location: OH, USA

Re: CHOCHI E with USB Power

Post by ElEctric_EyE »

Also, I believe Arlet's latest version does have decimal mode working. You're thinking of the 65Org16 Ed! :lol:
Klaus2m5
Posts: 442
Joined: 28 Jul 2012
Location: Wiesbaden, Germany

Re: CHOCHI E with USB Power

Post by Klaus2m5 »

That could actually be a problem. I don't see a CLD in the coldstart vector of Enso's EhBASIC. Just do a ?HEX$(123) and repeat your math tests. The HEX$ will clear decimal mode for sure.

The use of decimal mode in EhBASIC for the HEX$() function involves invalid BCD and may still fail. So the patch is recommended.
6502 sources on GitHub: https://github.com/Klaus2m5
User avatar
Arlet
Posts: 2353
Joined: 16 Nov 2010
Location: Gouda, The Netherlands
Contact:

Re: CHOCHI E with USB Power

Post by Arlet »

Yes, the standard 8 bit core has decimal mode support. It initializes itself with D=0.
User avatar
BigEd
Posts: 11464
Joined: 11 Dec 2008
Location: England
Contact:

Re: CHOCHI E with USB Power

Post by BigEd »

Yes, sorry, my wild guess does seem pretty weak! Post in haste, repent at leisure...
Cheers
Ed
User avatar
8BIT
Posts: 1787
Joined: 30 Aug 2002
Location: Sacramento, CA
Contact:

Re: CHOCHI E with USB Power

Post by 8BIT »

BigEd wrote:
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)

Hi Ed,

I tried your calculation with EhBASIC from the CHOCHI website and it seems to work correctly for me. Did you ever find anything else wrong?

Code: Select all

?22/7
 3.14286

Ready
?4+5
 9

Ready
?355/113
 3.14159
Daryl
Please visit my website -> https://sbc.rictor.org/
User avatar
8BIT
Posts: 1787
Joined: 30 Aug 2002
Location: Sacramento, CA
Contact:

Re: CHOCHI E with USB Power

Post by 8BIT »

enso wrote:
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.
Hi Enso,

Sorry this is late - it's been a busy week!

Here are the fixed files. The sbc.bin file is ready to load into the CHOCHI E. Load address is $F800-$FBA8. That gives a little more room for additional commands. I also fixed the reset code to point the Interrupt/BRK handler vector to the code in reset.asm. Now, a BRK will dump the registers and return you to the monitor.

Daryl
Attachments
SBCOS.zip
Lite version of SBC2OS for the CHOCHI E board.
(19.04 KiB) Downloaded 95 times
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 »

Daryl, thank you. I will update the site as soon as I can. I truly appreciate your effort.

EDIT: Posted Daryl's updates to CHOCHI website.
Last edited by enso on Sun Nov 03, 2013 7:13 pm, edited 1 time in total.
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 »

Happy to help!
User avatar
8BIT
Posts: 1787
Joined: 30 Aug 2002
Location: Sacramento, CA
Contact:

Re: CHOCHI E with USB Power

Post by 8BIT »

Hi Enso,

I am attaching the sources and bin file for my full SBC2OS, minus EhBASIC. The 65C02 opcodes were removed and the bin file loads on the CHOCHI board ($E000-$F743). This code includes the disassembler and mini-assembler. Both support 65C02 opcodes as I forgot to modify the code, but as long as just 6502 opcodes are used, it will work fine. I may refine the sources to remove the CMOS opcodes at a later date.

Feel free to post on your website if you like.

Daryl
Attachments
SBC2OS.zip
Full SBC2OS for CHOCHI
(73.73 KiB) Downloaded 97 times
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 »

Posted on the CHOCHI site. Thanks again!
In theory, there is no difference between theory and practice. In practice, there is. ...Jan van de Snepscheut
User avatar
BigEd
Posts: 11464
Joined: 11 Dec 2008
Location: England
Contact:

Re: CHOCHI E with USB Power

Post by BigEd »

8BIT wrote:
BigEd wrote:
... ehbasic has some funny ideas:

Code: Select all

Ready
PRINT 22/7
 0.34144E+15
... it seems to work correctly for me.
(I've been away for a couple of weeks...)
enso said, I think, that I have a mixed-up version of the bitstream. So, not a hardware or software problem!
Cheers
Ed
User avatar
enso
Posts: 904
Joined: 29 Sep 2012

Re: CHOCHI E with USB Power

Post by enso »

My working theory is that BigEd's board somehow got a polluted bitstream (I've been working with SD-specialized bitstream that was perhaps bogus at the time and was rushing to get a bunch of boards out). I will try to get his board re-flashed with the good bitstream, or replace it if it doesn't work out.

I've been running EhBASIC on every board since then to check for the bug before shipping. So far I haven't found any problems.
In theory, there is no difference between theory and practice. In practice, there is. ...Jan van de Snepscheut
rwiker
Posts: 294
Joined: 03 Mar 2011

Re: CHOCHI E with USB Power

Post by rwiker »

enso wrote:
My working theory is that BigEd's board somehow got a polluted bitstream (I've been working with SD-specialized bitstream that was perhaps bogus at the time and was rushing to get a bunch of boards out). I will try to get his board re-flashed with the good bitstream, or replace it if it doesn't work out.

I've been running EhBASIC on every board since then to check for the bug before shipping. So far I haven't found any problems.
Could it be that BigEd got hold of a corrupted EhBasic or incompatible binary? I had some strange behavior from the fig forth binary which disappeared when I re-downloaded it.

I just brought the original back from backup and compared it with the working one: the original is 6072 bytes while the new one is 6091 bytes.
Post Reply