It begins! (Wren Prototype build log)

Building your first 6502-based project? We'll help you get started here.
User avatar
allisonlastname
Posts: 88
Joined: 06 Mar 2023
Location: UK
Contact:

Re: It begins! (Wren Prototype build log)

Post by allisonlastname »

Yet more progress! The monitor can now read intel hex records over the serial connection and verify the checksum. Combined with a "j" command that simply jumps to a location in memory, I can now theoretically load and run programs over serial.
probably the youngest person on this forum
User avatar
drogon
Posts: 1671
Joined: 14 Feb 2018
Location: Scotland
Contact:

Re: It begins! (Wren Prototype build log)

Post by drogon »

allisonlastname wrote:
Yet more progress! The monitor can now read intel hex records over the serial connection and verify the checksum. Combined with a "j" command that simply jumps to a location in memory, I can now theoretically load and run programs over serial.
Excellent... Now, I have this TinyBasic you might want to play with ;-)

Cheers,

-Gordon
--
Gordon Henderson.
See my Ruby 6502 and 65816 SBC projects here: https://projects.drogon.net/ruby/
User avatar
BigDumbDinosaur
Posts: 9425
Joined: 28 May 2009
Location: Midwestern USA (JB Pritzker’s dystopia)
Contact:

Re: It begins! (Wren Prototype build log)

Post by BigDumbDinosaur »

allisonlastname wrote:
The monitor can now read intel hex records over the serial connection and verify the checksum.

Blasphemy!!!  People have been burned at the stake for allowing Intel cruft to infiltrate 6502 machines. :D

Seriously, glad to see you are making good progress with this.
x86?  We ain't got no x86.  We don't NEED no stinking x86!
WCMiller
Posts: 33
Joined: 28 Oct 2023
Location: Missouri

Re: It begins! (Wren Prototype build log)

Post by WCMiller »

Dr Jefyll wrote:
Quote:
"65 02" in hex
Hm, but shouldn't it be "02 65"?

(Little Endian! :mrgreen: )

-- Jeff
You are technically correct. The best kind of correct.
User avatar
allisonlastname
Posts: 88
Joined: 06 Mar 2023
Location: UK
Contact:

Re: It begins! (Wren Prototype build log)

Post by allisonlastname »

BigDumbDinosaur wrote:
Seriously, glad to see you are making good progress with this.
It's happened surprisingly quickly - I expected writing the monitor to take hours and hours of debugging and poring over hex dumps, but it was pretty painless. In fact, the biggest error I found was with the code running on the AVR, not the 6502.

I'm not fully decided on where to go next - I might write a forth, while following along to https://colorforth.github.io/POL.htm.
probably the youngest person on this forum
User avatar
allisonlastname
Posts: 88
Joined: 06 Mar 2023
Location: UK
Contact:

Re: It begins! (Wren Prototype build log)

Post by allisonlastname »

I'd also like to change how the monitor works a little - as is, it runs at about 8khz at full speed, which... isn't great. Unfortunately, with my current setup, I can't run the clock any faster (say, by using the AVR's timer to output a square wave on a pin) because I need to check the bus every cycle to perform serial operations. I can deal with it for now, but I'd like to have a proper freestanding UART at some point.
probably the youngest person on this forum
User avatar
BigDumbDinosaur
Posts: 9425
Joined: 28 May 2009
Location: Midwestern USA (JB Pritzker’s dystopia)
Contact:

Re: It begins! (Wren Prototype build log)

Post by BigDumbDinosaur »

allisonlastname wrote:
Unfortunately, with my current setup, I can't run the clock any faster (say, by using the AVR's timer to output a square wave on a pin) because I need to check the bus every cycle to perform serial operations. I can deal with it for now, but I'd like to have a proper freestanding UART at some point.

As I’ve often said when someone tries to do roll-your-own TIA-232 communication, there is a reason UARTs were invented.  :D

BTW, you might want to look at the AVR’s data sheet before using it as a clock source.  WDC MPUs’ clock requirements demand a full CMOS signal with a rise/fall time not to exceed 5ns.  While you can fudge that to some extent, it becomes a question of how stable do you want it.
x86?  We ain't got no x86.  We don't NEED no stinking x86!
User avatar
allisonlastname
Posts: 88
Joined: 06 Mar 2023
Location: UK
Contact:

Re: It begins! (Wren Prototype build log)

Post by allisonlastname »

Looks like my earlier maths was completely off, because I just doubled the AVR's clock speed (from 4mhz to 8mhz) and now it's clocking the 6502 at about 330khz. That's a much more acceptable speed, so I think I'll leave the monitor as it is for a while.
probably the youngest person on this forum
User avatar
allisonlastname
Posts: 88
Joined: 06 Mar 2023
Location: UK
Contact:

Re: It begins! (Wren Prototype build log)

Post by allisonlastname »

No, I was just being stupid and forgot to reset the monitor before testing the speed. It seems closer to 60khz, which is still way better than 8.

And if I remove some unnecessary sleeps in the code, I can get it all the way up to 100khz. Result!
probably the youngest person on this forum
User avatar
allisonlastname
Posts: 88
Joined: 06 Mar 2023
Location: UK
Contact:

Re: It begins! (Wren Prototype build log)

Post by allisonlastname »

I think my next goal will be talking to a character LCD I have (HD44780, of course). I'm currently thinking of using the 4-bit interface to save on IO pins.
probably the youngest person on this forum
User avatar
GARTHWILSON
Forum Moderator
Posts: 8773
Joined: 30 Aug 2002
Location: Southern California
Contact:

Re: It begins! (Wren Prototype build log)

Post by GARTHWILSON »

allisonlastname wrote:
I think my next goal will be talking to a character LCD I have (HD44780, of course). I'm currently thinking of using the 4-bit interface to save on IO pins.
See the sample LCD driver code at http://wilsonminesco.com/6502primer/LCDcode.asm in several forms, including for the 4-bit interface, linked in the 6502 primer.
http://WilsonMinesCo.com/ lots of 6502 resources
The "second front page" is http://wilsonminesco.com/links.html .
What's an additional VIA among friends, anyhow?
User avatar
and3rson
Posts: 163
Joined: 17 Feb 2023
Location: Lviv, Ukraine
Contact:

Re: It begins! (Wren Prototype build log)

Post by and3rson »

allisonlastname wrote:
I think my next goal will be talking to a character LCD I have (HD44780, of course). I'm currently thinking of using the 4-bit interface to save on IO pins.
FYI - there are some really nice T6963C-based displays as well (most modern versions come with UCI6963, which is compatible with T6963C). You might need to cut some jumpers though to select a proper font, those are usually marked on display's PCB.
They have built-in fonts, graphic mode, come in sizes up to 240x128 (40*16 chars) and work at up to 5 MHz (5 times faster than HD44780). This allows them to be put directly on CPU bus without having to bit-bang (alternatively, you can use clock stretching circuits for slow LCDs - there have been some recent posts on this topic by gfoot, Jeff & myself over the past month). My Deck65 SBC uses one (240*64, 40*8 chars).
Last edited by and3rson on Tue Nov 28, 2023 8:10 pm, edited 1 time in total.
/Andrew

deck65 - 6502 slab with screen and keyboard | ПК-88 - SBC based on KM1810VM88 (Ukrainian i8088 clone) | leo80 - simple Z80 SBC
nice65 - 6502 assembly linter | My parts, footprints & 3D models for KiCad/FreeCAD
User avatar
allisonlastname
Posts: 88
Joined: 06 Mar 2023
Location: UK
Contact:

Re: It begins! (Wren Prototype build log)

Post by allisonlastname »

Looking at it, I might just put it on the bus and use it in 8 bit mode. I only have one VIA, and port B is already reserved for SPI data in.

However I do it, physically connecting it will be very awkward, because the module I have just has an 8*2 pin header on, which I'm connecting to by jamming jumper wires into the other end of a ribbon cable. Some day I'll make a proper breakout for it, but today is not that day.
probably the youngest person on this forum
User avatar
allisonlastname
Posts: 88
Joined: 06 Mar 2023
Location: UK
Contact:

Re: It begins! (Wren Prototype build log)

Post by allisonlastname »

And now the RAM has somehow exploded. This basically kills the computer because (as already mentioned earlier in the thread) the 62256s I have don't play nicely with the 6502 for whatever reason, and the 43256 worked for some reason.
probably the youngest person on this forum
User avatar
GARTHWILSON
Forum Moderator
Posts: 8773
Joined: 30 Aug 2002
Location: Southern California
Contact:

Re: It begins! (Wren Prototype build log)

Post by GARTHWILSON »

allisonlastname, without digging back through earlier posts of yours, I don't remember if you've been through the 6502 primer.  It shows using a 62256 SRAM and also how you can multiplex pins on the 6522 for putting loads of things on a single 6522.
http://WilsonMinesCo.com/ lots of 6502 resources
The "second front page" is http://wilsonminesco.com/links.html .
What's an additional VIA among friends, anyhow?
Post Reply