Page 4 of 6

Re: Daryl's 6502 SBC help

Posted: Tue Sep 13, 2016 6:59 pm
by BigDumbDinosaur
beholder wrote:
Here's the code:
* = $8000

ACIA_DATA = $7F70
ACIA_STAT = $7F71
ACIA_COMM = $7F72
ACIA_CTRL = $7F73

VIA1 = $7F50
VIA2 = $7F51

lda #$FF
sta $7F52
sta $7F53
sta VIA1
sta VIA2

lda #%00001011
sta ACIA_COMM
sta VIA1
lda #%00011111
sta ACIA_CTRL
sta VIA2

TX
lda ACIA_STAT
sta VIA1
and #$10
beq TX

lda #$AA
sta ACIA_DATA
sta VIA2
jmp TX
In the future, may I suggest you bound your code expositions with the [ code ] and [ /code ] markers? Viz:

Code: Select all

         *=$8000

ACIA_DATA=$7F70
ACIA_STAT=$7F71
ACIA_COMM=$7F72
ACIA_CTRL=$7F73

VIA1     =$7F50
VIA2     =$7F51

         lda #$FF
         sta $7F52
         sta $7F53
         sta VIA1
         sta VIA2

         lda #%00001011	
         sta ACIA_COMM
         sta VIA1
         lda #%00011111	
         sta ACIA_CTRL
         sta VIA2

TX       lda ACIA_STAT
         sta VIA1
         and #$10
         beq TX

         lda #$AA
         sta ACIA_DATA
         sta VIA2
         jmp TX
Doing so will greatly improve readability.

Re: Daryl's 6502 SBC help

Posted: Tue Sep 13, 2016 10:11 pm
by KC9UDX
BigDumbDinosaur wrote:
Doing so will greatly improve readability.
Normally I would agree. In fact, I still do agree. But ironically, your post, the (code) block is all but unreadable in the mobile layout.

In fact, until now, I was under the impression that many posters here intentionally write their code in a way that is difficult for me to read. I will have to keep in mind to try to view blocks of code another way.

Re: Daryl's 6502 SBC help

Posted: Tue Sep 13, 2016 10:26 pm
by GARTHWILSON
KC9UDX wrote:
Normally I would agree. In fact, I still do agree. But ironically, your post, the (code) block is all but unreadable in the mobile layout.
What are you seeing? I don't use a smartphone or tablet, but I checked nearly every page of my website on our son's smartphone, and it all appeared as it should, basically the same as on my large PC monitor but tiny. Everything showed up exactly as I intended, without my putting any effort at all into making it mobile-friendly.

Re: Daryl's 6502 SBC help

Posted: Tue Sep 13, 2016 10:30 pm
by KC9UDX
GARTHWILSON wrote:
KC9UDX wrote:
Normally I would agree. In fact, I still do agree. But ironically, your post, the (code) block is all but unreadable in the mobile layout.
What are you seeing? I don't use a smartphone or tablet, but I checked nearly every page of my website on our son's smartphone, and it all appeared as it should, basically the same as on my large PC monitor but tiny. Everything showed up exactly as I intended, without my putting any effort at all into making it mobile-friendly.
It took me a while but I attached an image; please see my previous post.

Re: Daryl's 6502 SBC help

Posted: Tue Sep 13, 2016 10:36 pm
by GARTHWILSON
So can't you just rotate it 90° to get a landscape layout? It works automatically with all the smartphones I've seen.

Re: Daryl's 6502 SBC help

Posted: Tue Sep 13, 2016 10:46 pm
by KC9UDX
I guess so. I hadn't realised that it would affect the code blocks.

Re: Daryl's 6502 SBC help

Posted: Wed Sep 14, 2016 5:50 am
by 8BIT
In case this helps:
If you have an android phone, you can press the three dots in the upper right of Chrome and there's an option to "Request Desktop Site". Check the box and it will try to load the normal web page vs.the mobile version. That usually fixes forced screen wrap (narrow screens) for me.

Daryl

Re: Daryl's 6502 SBC help

Posted: Wed Sep 14, 2016 8:55 am
by Tor
8BIT wrote:
In case this helps:
If you have an android phone, you can press the three dots in the upper right of Chrome and there's an option to "Request Desktop Site". Check the box and it will try to load the normal web page vs.the mobile version. That usually fixes forced screen wrap (narrow screens) for me.

Daryl
Yep, that's the only way of reading any website on a mobile phone, or any mobile or small-screened device (e.g. tablets), in my experience. Because those sites that have any kind of 'mobile' version will, among other ill things, disable zoom, which is completely counter-intuitive.

So my Android etc. devices all have their browsers permanently set to 'desktop'.

-Tor

Re: Daryl's 6502 SBC help

Posted: Wed Sep 14, 2016 9:00 am
by BigEd
On this site at least, it seems you can double-tap on an element to zoom it to fit. But using landscape is usually my first resort, with desktop mode second. But I see we're thoroughly off-topic now!

Re: Daryl's 6502 SBC help

Posted: Wed Sep 14, 2016 5:14 pm
by beholder
Hello.
Here's a video of my oscilloscope probing the 6551 pin 7:
https://www.youtube.com/watch?v=1qdtXO_ ... e=youtu.be

Do you think this variation might be too high?
Should I change capacitor or resistor?
Thanks

Re: Daryl's 6502 SBC help

Posted: Wed Sep 14, 2016 10:12 pm
by KC9UDX
beholder wrote:
Hello.
Here's a video of my oscilloscope probing the 6551 pin 7:
https://www.youtube.com/watch?v=1qdtXO_ ... e=youtu.be

Do you think this variation might be too high?
Should I change capacitor or resistor?

No, I think it's right in line with what Garth said. You would see different results on a good 10 digit counter.

Re: Daryl's 6502 SBC help

Posted: Wed Sep 14, 2016 10:19 pm
by GARTHWILSON
Agreed. The variation seems to be a result of the noise you're picking up somewhere. The 'scope is a great tool, but trying to get frequency from cursors on a single cycle with noise on it isn't going to work very well. A good counter will count cycles for a tenth of a second or a whole second or something like that. A whole second would give you 6½ digits at 1.8MHz. What the 'scope is doing there is like putting the counter on the "period" setting which is what you do for extremely low frequencies where you can't wait for lots of cycles.

Re: Daryl's 6502 SBC help

Posted: Tue Sep 20, 2016 7:05 pm
by beholder
Hello everyone.

I've been trying to figure out my sbc but not success yet.
I suspect my SBC might not be working correctly at full speed (1MHz) when using the oscillator.
When I probe the oscillator with my oscilloscope it seems fine, outputting a steady signal.

The way I've been testing my sbc I/O so far is by providing a slower clock by an arduino output pin.
Then I read the VIA's outputs.
I did a small test where my via 2 ports will output a growing 16 bit number from $0000 to $FFFF.
When I use the arduino's clock signal it works perfectly... but when I use the 1MHz can oscillator the leds dont blink.
1 port is all 1s and the second port is all 0s.

Have anyone had issues with sbc not working correctly when using 1MHz can oscillator?
Thanks

Re: Daryl's 6502 SBC help

Posted: Tue Sep 20, 2016 7:10 pm
by beholder
Yeah, so I checked the 6502 reset vector pin 1 and it's going HIGH then LOW.
Seems like when the sbc is at full 1MHz the 6502 is resetting constantly.
Anyone had this problem before?

Thanks!

Re: Daryl's 6502 SBC help

Posted: Tue Sep 20, 2016 7:57 pm
by Dr Jefyll
beholder wrote:
Yeah, so I checked the 6502 reset vector pin 1 and it's going HIGH then LOW.
Seems like when the sbc is at full 1MHz the 6502 is resetting constantly.
Pin 1 (VPB) goes low when a vector is being fetched. This could mean Reset, but altogether there are three vectors to consider: reset (triggered by the RESB pin) and the two interrupts (triggered by IRQB and NMIB).

I suggest you review what's connected to these three pins, and verify they remain high when they're supposedly inactive. (IRQB and NMIB, if not used, usually get tied to Vcc -- possibly using a pullup resistor.)

For more detail see Garth's articles, Interrupt Connections: IRQ and NMI and What Do I Do With the "Mystery" Pins, SYNC, RDY, S.O., Φ1, MLB, BE, and VPB?

cheers,
Jeff