6502.org Forum  Projects  Code  Documents  Tools  Forum
It is currently Fri Mar 29, 2024 2:15 pm

All times are UTC




Post new topic Reply to topic  [ 15 posts ] 
Author Message
 Post subject: Potpourri6502 is alive!
PostPosted: Wed Oct 17, 2018 2:12 am 
Offline
User avatar

Joined: Wed Aug 17, 2005 12:07 am
Posts: 1206
Location: Soddy-Daisy, TN USA
So, I finally got the board populated. But before did all of that, I did electrical checks, etc.

At first, I was having a really difficult time getting it to free-run. My final design was to use a 1.0MHz half-can oscillator. If I can run at 1MHz, then I'm happy. But before that, I wanted to slowly ramp up the speed with my function generator and monitor it that way. So I put the FG at 100 Hz, then 100 kHz, etc. but nothing seemed to work. It was flaky. Sometimes it would work, sometimes not. So I think I was doing something wrong with the FG. I had it at a square wave with 5 VPP. So, not sure on that one.

Now, the bad part is that I don't have a 1MHz half-can oscillator. I only have it in a full can. I do have a bunch of 3.58MHz half-can oscillators so I thought what the heck.

I plugged everything in and wrote a simple program to increment the VIA on PORT A (after confirming the free-running NOP program).

I connected some LED's to the PORT A and noticed all solid. Even PA7. Well, stupid me...at 3.58MHz, it was SCREAMING along! So I kept adding long loops and delays! Finally, I settled on this program:

Code:

        .debuginfo  +
        .setcpu     "65C02"
        .ORG   $8000

VIA     :=      $6000
PB      :=      VIA
PA      :=      VIA + 1
DDRB    :=      VIA + 2
DDRA    :=      VIA + 3

; reset vector points here
RESET:

        LDA     #$FF
        STA     DDRA
        STA     DDRB
MAIN:
        INC     PA

        LDX     #00
        LDY     #04
LOOP1:
        DEX
        CPX     #00
        BNE     LOOP1
LOOP2:
        DEX
        CPX     #00
        BNE     LOOP2
LOOP3:
        DEX
        CPX     #00
        BNE     LOOP3
LOOP4:
        DEX
        CPX     #00
        BNE     LOOP4

        DEY
        CPY     #00
        BNE     LOOP1

        JMP     MAIN



; system vectors 
; (IGNORE THESE..ASSEMBLER ONLY PUTS ZERO SO I MANUALLY EDIT THE VECTORS)
;  I will figure this out later.

        .org $7FFA
        .byte $00,$80,$00,$80,$00,$80



So, after all of those loops, I finally got it slow enough that I can see the lights blink! It's been running solid at 3.58MHz for over an hour. I can't believe it! It actually works first time!!

For grins, I put my oscilloscope on PA0 and as you can see in the pic, I am getting a SOLID 62.5Hz square wave. I mean it's not fluctuating one little bit that I can see. :-D

I'm literally grinning ear to ear with this. This is a long time coming! Thanks to everyone on this board for all of the help.

Now, it's time for some more advanced experiments. My first expansion card is going to be a NXP DUART card so that I can remote in and run some BASIC...

Shoot, if the speed holds steady at 3.58MHz, I might just leave it at that instead of 1MHz like I planned. When everything settles in and I get some more demos going, I will crank the speed up and see what she can do!


BTW, I'm trying to upload a video of it but YouTube is being cranky.

This is SUPPOSED to be the YouTube link but it's not playing for me. For some reason, it rotated the video!! Ugh.

https://youtu.be/hsMCq5HHSic


You will notice a bridged wire instead of a power switch. The reason is that I don't have a power switch handy. LOL

Also, the reset button is the only one I have.


Attachments:
File comment: Populated board
BoardPopulated.jpg
BoardPopulated.jpg [ 5.02 MiB | Viewed 4378 times ]
File comment: Blinky lights
RunningProgram.jpg
RunningProgram.jpg [ 5.43 MiB | Viewed 4378 times ]
File comment: PA0 running at a STABLE 62.5Hz
VIA_PA0_63Hz.jpg
VIA_PA0_63Hz.jpg [ 4.79 MiB | Viewed 4378 times ]

_________________
Cat; the other white meat.
Top
 Profile  
Reply with quote  
PostPosted: Wed Oct 17, 2018 3:15 am 
Offline
User avatar

Joined: Fri Dec 11, 2009 3:50 pm
Posts: 3328
Location: Ontario, Canada
cbmeeks wrote:
It actually works first time!!

Probably means you've overlooked something. :wink:

Just kidding, cbmeeks -- please forgive the dour joke. Congrats on your success!!

-- Jeff

_________________
In 1988 my 65C02 got six new registers and 44 new full-speed instructions!
https://laughtonelectronics.com/Arcana/ ... mmary.html


Top
 Profile  
Reply with quote  
PostPosted: Wed Oct 17, 2018 3:53 am 
Offline
User avatar

Joined: Fri Aug 30, 2002 1:09 am
Posts: 8412
Location: Southern California
cbmeeks wrote:
So, after all of those loops, I finally got it slow enough that I can see the lights blink! It's been running solid at 3.58MHz for over an hour. I can't believe it! It actually works first time!! <...> I'm literally grinning ear to ear with this.

Makes one feel great, doesn't it?! :D It an energizer.

BTW, in this repeating segment,
Quote:
Code:
        DEX
        CPX     #00

the CPX #0 is redundant. It's an automatic, implied part of the DEX (along with anything else that affects X). Same for the CPY #0 after the DEY. If you really want the extra two cycles' delay, NOP gives it with a single byte.

Quote:
BTW, I'm trying to upload a video of it but YouTube is being cranky.

This is SUPPOSED to be the YouTube link but it's not playing for me. For some reason, it rotated the video!! Ugh.

YouTube stopped working for me this afternoon too. [Edit: It's working again now.] Other video sites work. https://www.real.video/ is a new one that's growing very fast, without the censorship of YouTube. Get a channel, free.

_________________
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?


Top
 Profile  
Reply with quote  
PostPosted: Wed Oct 17, 2018 4:37 am 
Offline
User avatar

Joined: Thu May 28, 2009 9:46 pm
Posts: 8115
Location: Midwestern USA
GARTHWILSON wrote:
YouTube stopped working for me this afternoon too. [Edit: It's working again now.] Other video sites work. https://www.real.video/ is a new one that's growing very fast, without the censorship of YouTube. Get a channel, free.

U-Toobe hasn't been the same since Google got its meathooks into it. Those people are very annoying, to politely put it.

_________________
x86?  We ain't got no x86.  We don't NEED no stinking x86!


Top
 Profile  
Reply with quote  
PostPosted: Wed Oct 17, 2018 10:22 am 
Offline

Joined: Mon Jan 07, 2013 2:42 pm
Posts: 576
Location: Just outside Berlin, Germany
Contrats! It looks great even sideways.


Top
 Profile  
Reply with quote  
PostPosted: Wed Oct 17, 2018 12:40 pm 
Offline
User avatar

Joined: Wed Aug 17, 2005 12:07 am
Posts: 1206
Location: Soddy-Daisy, TN USA
Thanks again for the kind words, everyone.

Dr Jefyll wrote:
cbmeeks wrote:
It actually works first time!!

Probably means you've overlooked something. :wink:

Just kidding, cbmeeks -- please forgive the dour joke. Congrats on your success!!

-- Jeff


Hey, no one is more surprised than me that it worked first try. I'm a software developer by trade and I'm used to many iterations until something works. lol


GARTHWILSON wrote:
...
the CPX #0 is redundant. It's an automatic, implied part of the DEX (along with anything else that affects X). Same for the CPY #0 after the DEY. If you really want the extra two cycles' delay, NOP gives it with a single byte.
...


Ah, thanks for the tip.

Yeah, I've been so focused on the hardware side of things that I've neglected my 6502 skills. Which is yet another reason to build this computer and my upcoming "trainer" computer.

In fact, I may shift gears a little bit. I have a nice 20x4 character screen that I want to start programming a monitor for it. Along with a small matrix keypad. So I definitely see some coding questions coming in the near future. :-)

BTW...the ROM situation is already getting annoying. Pulling that chip out with tweezers each time I program it has got to go.

Unfortunately, I only have one ZIF socket of that size and the pins are super fragile and bend easily. But it appears that if I can get it elevated just a little bit...like the height of 1-2 DIP sockets, then it clears everything just fine. So this evening I hope to build a little riser card for it using some WW pins I have.

Another problem I ran into is that my programmer sometimes won't burn my code onto the ROM. I have to remove the chip and re-socket it a couple times and it works. However, I can erase it any time I want. So I'm not sure what that's all about.

_________________
Cat; the other white meat.


Top
 Profile  
Reply with quote  
PostPosted: Wed Oct 17, 2018 12:55 pm 
Offline
User avatar

Joined: Fri Nov 09, 2012 5:54 pm
Posts: 1387
Congrats, having your first selfbuilt SBC up and running for the first time is a moment you always will remember. :)

Would suggest to go for more expensive connectors and IC sockets when soldering the next SBC.
It's annoying if a piece of technology which perfectly had worked suddenly stops working
because of saving just a little bit of money at the wrong end.

The big electrolytic capacitors are a bit close to the J8..J11 connectors.
If this causes problems when plugging something into these connectors,
one "workaround" would be placing the capacitors at the bottom of the PCB...

About the oscillators:
My trick was to have a 74393 (containing two 4 Bit counters) on the PCB.
Then to use the counters as dividers for the CPU and UART oscillators,
tapping into the counter outputs with jumpers for getting the CPU and UART clock signal.
This way, I didn't need a collection of oscillators for many different frequencies.

An interesting question is, how hot that 7805 is going to get when plugging some PCBs into these connectors.
Maybe it would make sense to check temperature with a thermocouple connected to the 7805 package sometimes.
(some of the multimeters can read thermocouples).

The MIC29300-5.0WT low drop regulator is more expensive than the 7805, but can take quite a beating.

Hmm... maybe some of the "wall warts" have + at the center of the connector, while some others might have GND.
Maybe it would be good to have a diode reversed between Vin and GND of the regulator,
for clobbering down negative voltage at the regulator input (SB560 is cheap nowaday).

cbmeeks wrote:
Another problem I ran into is that my programmer sometimes won't burn my code onto the ROM.

If the programmer programs the ROM, but there seems to be a "bit rot" in the ROM after some "minutes",
this usually means that the ROM needs a different "programming algorithm" than the programmer had used...
...please check, if vendor and part number are identical on the chip package and in the programmer settings.

Oh, and try to avoid Google. It's evil. //Everybody is supposed to know this by now.


Top
 Profile  
Reply with quote  
PostPosted: Wed Oct 17, 2018 1:08 pm 
Offline

Joined: Sun Apr 10, 2011 8:29 am
Posts: 597
Location: Norway/Japan
Ouch. I had a look at real.video. What a cesspool. I think I'll stick with u-t.

Anyway, congrats to cbmeeks. It looks good, even sideways as scottws says! :)


Top
 Profile  
Reply with quote  
PostPosted: Wed Oct 17, 2018 3:09 pm 
Offline
User avatar

Joined: Wed Aug 17, 2005 12:07 am
Posts: 1206
Location: Soddy-Daisy, TN USA
ttlworks wrote:
Congrats, having your first selfbuilt SBC up and running for the first time is a moment you always will remember. :)


Oh yeah. I still have my 10 PCB's I made earlier. I keep one on display as a reminder. I use another as a bookmark. LOL.

But this one...this one actually works! So yeah, I will remember this one for a long time.


ttlworks wrote:
Would suggest to go for more expensive connectors and IC sockets when soldering the next SBC.


I totally agree on that one. I normally get connectors from Taydae (http://www.taydaelectronics.com) because they are so cheap. Even the dual-wipe sockets. And, I almost always get them within a week instead of waiting a month or more from China. They are good for cheap, throw away boards I build. However, I plan on using two of these boards in the immediate future. One as a bench PC and the other in a case I want to put on display. So for them I want some good connectors. Do you have any recommendations?


ttlworks wrote:
The big electrolytic capacitors are a bit close to the J8..J11 connectors.
If this causes problems when plugging something into these connectors,
one "workaround" would be placing the capacitors at the bottom of the PCB...


Already caused an issue. LOL

I made a little board to plug into the slot (not pictured). It bumped up against the cap a little so I just cut a notch on the board. I figure when I design a real PCB for expansion slots, I will make it more "L shape" to accommodate large caps. Plus, it will give it that retro-vibe I'm looking for. :-)


ttlworks wrote:
About the oscillators:
My trick was to have a 74393 (containing two 4 Bit counters) on the PCB.
Then to use the counters as dividers for the CPU and UART oscillators,
tapping into the counter outputs with jumpers for getting the CPU and UART clock signal.
This way, I didn't need a collection of oscillators for many different frequencies.


That's a good idea. I seriously thought this machine would never run over 1 MHz because I was being a little (a lot??) sloppy in the routing, using 2 layer, etc. I'm genuinely surprised I'm running at 3.58MHz. Anyway, I plan on putting serial on-board of my next computer so I will probably share an oscillator to save space.

ttlworks wrote:
An interesting question is, how hot that 7805 is going to get when plugging some PCBs into these connectors.
Maybe it would make sense to check temperature with a thermocouple connected to the 7805 package
sometimes.


I ran it for almost two hours last night and it was barely warm to the touch. I don't have a real heat-sink on it but I do have a screw that goes through the hole and then into the (small) mounting hole. So that's a tiny little bit of metal to sink some heat. If I notice it gets too hot I will do something better. I don't have a thermocoupler at the moment but I do have one of those heat sensor guns I could try. When I mount it in my metal case, I plan on doing something much better like using the case as a giant heat-sink.


ttlworks wrote:
Maybe it would be good to have a diode reversed between Vin and GND of the regulator,
for clobbering down negative voltage at the regulator input (SB560 is cheap nowaday).


Yeah, that's a good idea as well. I may add that on my next revision. I will certainly add it on my next design.

_________________
Cat; the other white meat.


Top
 Profile  
Reply with quote  
PostPosted: Wed Oct 17, 2018 3:24 pm 
Offline
User avatar

Joined: Sun Jun 30, 2013 10:26 pm
Posts: 1918
Location: Sacramento, CA, USA
Tor wrote:
Ouch. I had a look at real.video. What a cesspool. I think I'll stick with u-t.

The content? Yeah, at first glance it seems to have a far-right slant that I find unpalatable.

Quote:
Anyway, congrats to cbmeeks. It looks good, even sideways as scottws says! :)

Agreed.

_________________
Got a kilobyte lying fallow in your 65xx's memory map? Sprinkle some VTL02C on it and see how it grows on you!

Mike B. (about me) (learning how to github)


Top
 Profile  
Reply with quote  
PostPosted: Thu Oct 18, 2018 6:16 am 
Offline
User avatar

Joined: Fri Nov 09, 2012 5:54 pm
Posts: 1387
cbmeeks wrote:
Oh yeah. I still have my 10 PCB's I made earlier. I keep one on display as a reminder. I use another as a bookmark. LOL.

Pedestal for coffee cups.

cbmeeks wrote:
However, I plan on using two of these boards in the immediate future. One as a bench PC and the other in a case I want to put on display. So for them I want some good connectors. Do you have any recommendations?

MPE Garry 115-2-020-0-MTF-XS0.
Fischer Elektronik BL6 025 series.

Fischer Elektronik has some nice nice stuff: heat sinks, casings, etc., but industry grade parts ain't cheap.

BTW: when a PCB trace goes to a connector pin, in my PCB layouts I tend to make the last segment of the trace 32 mil or such,
just to make sure the traces to the connector pins don't get hairline cracks after a lot of connector plugging/unplugging cycles.
Sometimes I also did this with EPROM sockets.

cbmeeks wrote:
I figure when I design a real PCB for expansion slots, I will make it more "L shape" to accommodate large caps.

Murata GRM31CR60J227ME11L, ceramic 1206, 220uF 6.3V 2.10€ ? ;)

Hmm... from the ST datasheet, 78xx regulators with >6V output can be damaged when they have a lot of capacitance at the output
while the input is switched to GND, and suggest to add a diode reversed between input and output as a protection.
If you are paranoid that your voltage regulator might be getting damaged during power_off,
you could add something like a 1N4007 to your voltage regulator.

Attachment:
st_7805.png
st_7805.png [ 31.58 KiB | Viewed 4225 times ]


The MIC29300-5.0WT I had mentioned above in the thread costs ca. 3€, has short circuit current protection,
doesn't mind a lot of capacitance at the output, can take -20V input voltage...
and because it's a low drop regulator, in theory it can generate 5V from a 6V input voltage at 3A.
7805 would need more than 8V at the input for generating 5V.

Of course the interesting question is how the output voltage of your "wall wart" goes down when current increases,
and how much AC ripple the "wall wart" has at the output while sourcing the full current.

Another idea would be buying a switchmode power supply like the Meanwell RS-15-5 for ca. 8€.

cbmeeks wrote:
[SB560 diode preventing negative supply voltage]
Yeah, that's a good idea as well. I may add that on my next revision. I will certainly add it on my next design.

SMD version of the SB560 would be SK56C.

Also, it would be good to add a TVS diode (transient voltage supressor) against electrostatic discharge between +5V and GND.

BTW: Just taking a look at real.video gives me a headache.


Top
 Profile  
Reply with quote  
PostPosted: Thu Oct 18, 2018 9:04 am 
Offline
User avatar

Joined: Thu Dec 11, 2008 1:28 pm
Posts: 10760
Location: England
Well done cbmeeks!

(It would be great if we could resist the temptation to bash one or other corporation - you can see how it derails the conversation. Just make your own choices, and trust that others are also making theirs.)


Top
 Profile  
Reply with quote  
PostPosted: Fri Oct 19, 2018 12:40 pm 
Offline
User avatar

Joined: Fri Dec 12, 2008 10:40 pm
Posts: 993
Location: Canada
Very cool! Congratulations.

It is indeed a thrill to have something work as planned. Even if it takes a couple of attempts.

_________________
Bill


Top
 Profile  
Reply with quote  
PostPosted: Fri Oct 19, 2018 1:43 pm 
Offline
User avatar

Joined: Tue Mar 05, 2013 4:31 am
Posts: 1373
Congrats on getting a PCB SBC up and running... always gratifying to see your efforts work. You should be able to keep the clock speed up around 4MHz without much issue. I've been running a split PCB setup at 12MHz... using a CPU board with RAM/ROM, decode and a second board with a 65C22 and 65C51, albeit a very short ribbon cable between them.

_________________
Regards, KM
https://github.com/floobydust


Top
 Profile  
Reply with quote  
PostPosted: Fri Oct 19, 2018 1:50 pm 
Offline
User avatar

Joined: Wed Aug 17, 2005 12:07 am
Posts: 1206
Location: Soddy-Daisy, TN USA
Thanks for the comments!

Yeah, I'm very happy with the board so far. Everything I've tested works well. I think I've settled on running it at 4 MHz. I was happy at 1 MHz but if it can handle 4, then so be it. Makes the math a little easier than the 3.58 MHz it's running now. Just need to get some oscillators ordered.

When I get some more code working, I may try to drive it from my function generator again. It can do 5 MHz. So I'm not sure why it didn't work reliably before. I used to use it all the time to drive some AY-3-8912 sound chips. So I probably just goofed something up.

_________________
Cat; the other white meat.


Top
 Profile  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 15 posts ] 

All times are UTC


Who is online

Users browsing this forum: No registered users and 8 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to: