Page 7 of 8
Re: It begins! (Wren Prototype build log)
Posted: Sat Nov 25, 2023 4:55 pm
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.
Re: It begins! (Wren Prototype build log)
Posted: Sat Nov 25, 2023 6:20 pm
by drogon
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
Re: It begins! (Wren Prototype build log)
Posted: Sat Nov 25, 2023 7:14 pm
by BigDumbDinosaur
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. 
Seriously, glad to see you are making good progress with this.
Re: It begins! (Wren Prototype build log)
Posted: Sun Nov 26, 2023 4:35 am
by WCMiller
Hm, but shouldn't it be "02 65"?
(Little Endian!

)
-- Jeff
You are technically correct. The best kind of correct.
Re: It begins! (Wren Prototype build log)
Posted: Sun Nov 26, 2023 9:57 am
by allisonlastname
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.
Re: It begins! (Wren Prototype build log)
Posted: Sun Nov 26, 2023 3:08 pm
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.
Re: It begins! (Wren Prototype build log)
Posted: Sun Nov 26, 2023 5:21 pm
by BigDumbDinosaur
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. 
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.
Re: It begins! (Wren Prototype build log)
Posted: Sun Nov 26, 2023 11:24 pm
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.
Re: It begins! (Wren Prototype build log)
Posted: Sun Nov 26, 2023 11:29 pm
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!
Re: It begins! (Wren Prototype build log)
Posted: Tue Nov 28, 2023 12:44 am
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.
Re: It begins! (Wren Prototype build log)
Posted: Tue Nov 28, 2023 1:24 am
by GARTHWILSON
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.
Re: It begins! (Wren Prototype build log)
Posted: Tue Nov 28, 2023 1:55 am
by and3rson
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).
Re: It begins! (Wren Prototype build log)
Posted: Tue Nov 28, 2023 5:49 pm
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.
Re: It begins! (Wren Prototype build log)
Posted: Wed Nov 29, 2023 1:02 am
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.
Re: It begins! (Wren Prototype build log)
Posted: Wed Nov 29, 2023 2:49 am
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.