6502.org Forum  Projects  Code  Documents  Tools  Forum
It is currently Wed Oct 23, 2024 6:25 pm

All times are UTC




Post new topic Reply to topic  [ 80 posts ]  Go to page Previous  1, 2, 3, 4, 5, 6  Next
Author Message
PostPosted: Tue Sep 20, 2016 8:11 pm 
Offline

Joined: Wed Sep 02, 2015 7:28 pm
Posts: 63
Hi Jeff, thanks for the reply.
I'm not using IRQB or NMIB
The IRQB and NMIB pins are connected to 5v through a 3.3kohm resistor.

The only reset that seems to be triggering is normal RESET.
Just in case I made all my reset vectors go to the begging of the test program at $8000

The reset wont trigger if I use the arduino I/O pin as a clock. Program runs fine.
But when I switch to the can oscillator (1MHz) that's when program doesn't run and reset vector pin goes HIGH & LOW

Thanks


Top
 Profile  
Reply with quote  
PostPosted: Tue Sep 20, 2016 8:27 pm 
Offline
User avatar

Joined: Fri Dec 11, 2009 3:50 pm
Posts: 3367
Location: Ontario, Canada
OK, it's time for a thorough review of some details. For example you may have a wiring error (meaning either a wire not connected according to plan, or a plan which itself contains an error).

beholder wrote:
The IRQB and NMIB pins are connected to 5v through a 3.3kohm resistor.
Alright, you need to check they're actually at 5V, then. This is the kind of detailed double-checking I mean. There could be a flaky connection, an error with the resistor color code, or even a defective resistor -- it happens! But we want IRQB and NMIB at 5V, so check that they really are.

Quote:
Just in case I made all my reset vectors go to the begging of the test program at $8000
OK, but that doesn't mean your program will work correctly when faced with spurious interrupts. (It can't work correctly, as it would be continually restarting.)

Quote:
The reset wont trigger if I use the arduino I/O pin as a clock. Program runs fine.
But when I switch to the can oscillator (1MHz) that's when program doesn't run and reset vector pin goes HIGH & LOW

I'll admit it seems odd. But construction errors often present with odd symptoms. Can you post some photos? It's hard for us to help when we can't see what's going on! :)

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


Last edited by Dr Jefyll on Tue Sep 20, 2016 8:29 pm, edited 1 time in total.

Top
 Profile  
Reply with quote  
PostPosted: Tue Sep 20, 2016 8:29 pm 
Offline
User avatar

Joined: Thu May 28, 2009 9:46 pm
Posts: 8451
Location: Midwestern USA
Dr Jefyll wrote:
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).

Also if a BRK is executed.

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


Top
 Profile  
Reply with quote  
PostPosted: Tue Sep 20, 2016 8:32 pm 
Offline
User avatar

Joined: Thu May 28, 2009 9:46 pm
Posts: 8451
Location: Midwestern USA
Dr Jefyll wrote:
Can you post some photos? It's hard for us to help when we can't see what's going on! :)

A current schematic would be useful as well.

Incidentally, I hope RDY and BE are being pulled up.

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


Top
 Profile  
Reply with quote  
PostPosted: Tue Sep 20, 2016 8:56 pm 
Offline

Joined: Wed Sep 02, 2015 7:28 pm
Posts: 63
Hi Jeff and BDD. Thanks for the help!

I tested and IRQB, NMIB, RDY and BE are HIGH (oscillating between 4 to 5v)
I have no BRK in my code, no interrupt either.
Its just incrementing a 16 bit value from 0000 to FFFF and outputing it on VIA port A&B.

I took out the can oscillator and put it on a breadboard. Works and I can see the signal.
However I noticed the can voltage is from 0 to 3.3v! I wonder if I have a 3.3v logic and if that would cause the 6502 to not tick or reset :(
Will post pics soon!


Top
 Profile  
Reply with quote  
PostPosted: Tue Sep 20, 2016 9:01 pm 
Offline

Joined: Wed Sep 02, 2015 7:28 pm
Posts: 63
Here's the can oscillator I bought:
http://www.mouser.com/Search/ProductDet ... HST-3C-1.0

Datasheet says operating voltage 5v
But My peak is definitely below 3.5v

I wonder if Mouser sent me a 3.3v instead :/


Top
 Profile  
Reply with quote  
PostPosted: Tue Sep 20, 2016 9:04 pm 
Offline
User avatar

Joined: Thu Dec 11, 2008 1:28 pm
Posts: 10961
Location: England
The datasheet says the output high will be 2.4V or more - that's TTL compatible. But might not be good enough to drive a CMOS part's clock input. Perhaps you can put the clock through a buffer?


Top
 Profile  
Reply with quote  
PostPosted: Tue Sep 20, 2016 9:45 pm 
Offline

Joined: Wed Sep 02, 2015 7:28 pm
Posts: 63
Thanks Ed.
Apparently I can't read datasheets very well :oops:

I believe I do have a buffer ic somewhere. Will try using it!
What would be a good place to get a 1Mhz half can that outputs 5v logic?
I've already soldered a half can socket and have no space :(

Thanks


Top
 Profile  
Reply with quote  
PostPosted: Tue Sep 20, 2016 10:46 pm 
Offline
User avatar

Joined: Fri Aug 30, 2002 1:09 am
Posts: 8524
Location: Southern California
beholder wrote:
I've already soldered a half can socket and have no space :(

If you have to un-solder it anyway, you can put an 8-pin IC socket there and plug the next oscillator can in.

_________________
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: Tue Sep 20, 2016 11:35 pm 
Offline

Joined: Wed Sep 02, 2015 7:28 pm
Posts: 63
Hi Garth, sorry for my bad writing! I do have the socket soldered, not the oscillator :)
I meant, hope I can find a 8 pin half can oscillator because I dont have room for a 14 one.

I found this 1Mhz half can oscillator at digikey:
http://www.digikey.com/product-detail/e ... 9-ND/39059

Datasheet says output minimum is 4.5v. I guess that's the one I should use it?
Thanks!


Top
 Profile  
Reply with quote  
PostPosted: Wed Sep 21, 2016 1:18 am 
Offline

Joined: Wed Sep 02, 2015 7:28 pm
Posts: 63
Used a 74HC541 and now my 1MHz oscillator works!
Nest step, try serial!
Thanks guys :)


Top
 Profile  
Reply with quote  
PostPosted: Wed Sep 21, 2016 4:01 am 
Offline
User avatar

Joined: Thu May 28, 2009 9:46 pm
Posts: 8451
Location: Midwestern USA
beholder wrote:
I found this 1Mhz half can oscillator at digikey:
http://www.digikey.com/product-detail/e ... 9-ND/39059

Datasheet says output minimum is 4.5v. I guess that's the one I should use it?
Thanks!

That's the oscillator series I use in POC. Note that the other oscillator's output is rated at 90 percent of Vcc going into a CMOS load. That value will quickly fall if there are any TTL loads on the output. The ECS part can drive a 16 ma load and maintain a 4.5 volt output, assuming Vcc is 5 volts. Note that output symmetry can vary up to ±5 from a 50 percent duty cycle. That won't cause any problems at 1 MHz, but may as you close in on Fmax. This is why the recommendation to run the oscillator output through a flop if you are going for higher clock rates.

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


Top
 Profile  
Reply with quote  
PostPosted: Wed Sep 21, 2016 4:44 pm 
Offline

Joined: Wed Sep 02, 2015 7:28 pm
Posts: 63
Thanks BDD.
I always have a hard time fully understanding the electronics side of projects like that.
Programming is fine, but when comes to datasheets I get confused easily :lol:

Had a tiny progress this morning. Now that my oscillator is working I went back to getting my serial connection working.
Wrote a simple test code to write out "OK" again and again as you type anything back to the SBC.
I output the Status and Data registers into the VIA outputs so I can monitor with my arduino.
When I type I can see that my VIA values change, so SBC is receiving data from my ftdi.
I can see that the FTDI RX (ACIA TX) led lights up, but I cant my terminal doesnt get anything.
So... its semi working :mrgreen:
Connection is at 19200 8N1

Here's the code:

Code:
* = $8000

8000 ACIA_D = 7F70
8000 ACIA_S = 7F71

8000 VIA_A  = 7F50
8000 VIA_B  = 7F51

8000        LDA #$FF        A9 FF
8002        STA $7F52       8D 52 7F
8005        STA $7F53       8D 53 7F

8008        LDA #$0B        A9 0B
800A        STA $7F72       8D 72 7F
800D        STA VIA_A       8D 50 7F
8010        LDA #$1F        A9 1F
8012        STA $7F73       8D 73 7F
8015        STA VIA_B       8D 51 7F

8018 START 
8018        LDA #$4F        A9 4F
801A        JSR TX          20 2A 80
801D        LDA #$4B        A9 4B
801F        JSR TX          20 2A 80
8022        LDA #$0A        A9 0A
8024        JSR TX          20 2A 80
8027        JMP RX          4C 3D 80


802A TX     LDA ACIA_S      AD 71 7F
802D        STA VIA_A       8D 50 7F
8030        AND #$10        29 10
8032        BEQ TX          F0 F6
8034        LDA #$AA        A9 AA
8036        STA ACIA_D      8D 70 7F
8039        STA VIA_B       8D 51 7F
803C        RTS             60

803D RX     LDA ACIA_S      AD 71 7F
8040        STA VIA_A       8D 50 7F
8043        AND #$08        29 08
8045        BEQ RX          F0 F6
8047        LDA ACIA_D      AD 70 7F
804A        STA VIA_B       8D 51 7F
804D        JMP START       4C 18 80


Top
 Profile  
Reply with quote  
PostPosted: Wed Sep 21, 2016 5:09 pm 
Offline

Joined: Wed Sep 02, 2015 7:28 pm
Posts: 63
Oops! small fix to the code! Was outputting $AA instead of OK

Code:

pass 2

* = $8000

8000 ACIA_D = 7F70
8000 ACIA_S = 7F71

8000 VIA_A  = 7F50
8000 VIA_B  = 7F51

8000        LDA #$FF        A9 FF
8002        STA $7F52       8D 52 7F
8005        STA $7F53       8D 53 7F

8008        LDA #$0B        A9 0B
800A        STA $7F72       8D 72 7F
800D        STA VIA_A       8D 50 7F
8010        LDA #$1E        A9 1E
8012        STA $7F73       8D 73 7F
8015        STA VIA_B       8D 51 7F

8018 START 
8018        LDA #$4F        A9 4F
801A        JSR TX          20 2A 80
801D        LDA #$4B        A9 4B
801F        JSR TX          20 2A 80
8022        LDA #$0A        A9 0A
8024        JSR TX          20 2A 80
8027        JMP RX          4C 3D 80


802A TX     PHA             48
802B LOOP   LDA ACIA_S      AD 71 7F
802E        STA VIA_A       8D 50 7F
8031        AND #$10        29 10
8033        BEQ LOOP        F0 F6
8035        PLA             68
8036        STA ACIA_D      8D 70 7F
8039        STA VIA_B       8D 51 7F
803C        RTS             60

803D RX     LDA ACIA_S      AD 71 7F
8040        STA VIA_A       8D 50 7F
8043        AND #$08        29 08
8045        BEQ RX          F0 F6
8047        LDA ACIA_D      AD 70 7F
804A        STA VIA_B       8D 51 7F
804D        JMP START       4C 18 80
done.


Top
 Profile  
Reply with quote  
PostPosted: Thu Sep 22, 2016 5:23 am 
Offline

Joined: Wed Sep 02, 2015 7:28 pm
Posts: 63
Ok! Got my first serial data sent back and forth between my computer and the SBC!!!!!
Hurray!

The bad news... it only works if I have my arduino providing the clock :(
It's very strange because I have the 1MHz oscillator going through a 75hc541 and now the voltage is between 0-4.5v.
I can see through my VIA outputs that the SBC is receiving data from serial and outputting values through the VIA ports, but no data goes from SBC to my computer.

It's so bizarre, all I have to do is switch the oscillator with the arduino and it works! I can see in my terminal window the word "OK"
At least now I know is something to do with my 1MHz can oscillator.

Back to more testing :D
I wont give up!


Top
 Profile  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 80 posts ]  Go to page Previous  1, 2, 3, 4, 5, 6  Next

All times are UTC


Who is online

Users browsing this forum: barnacle, Google [Bot] and 24 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: