6502.org Forum  Projects  Code  Documents  Tools  Forum
It is currently Sat Nov 23, 2024 5:44 pm

All times are UTC




Post new topic Reply to topic  [ 60 posts ]  Go to page Previous  1, 2, 3, 4
Author Message
PostPosted: Tue Dec 29, 2020 6:11 pm 
Offline
User avatar

Joined: Sat Dec 01, 2018 1:53 pm
Posts: 730
Location: Tokyo, Japan
ProfessorCagan wrote:
The reason behind me not cutting more wire is because I want to use it for completing the kit when all is said and done, I use the jumpers to conserve wire,
same reasoning for the resistor leads, because I may need to cut them at different lengths; resources aren't easy for me to come by at the moment.

Well, coming from a software background myself, I can certainly understand that. It's frustrating to go from a world of infinite resources (if you need more code, you just write it!) to a world where you can run out of the parts you need.

The best way around that, I've found, is just to buy more parts. A box of various coloured rolls of 22 AWG solid wire is fairly cheap and will keep you in supply for quite some time. (For breadboarding, make sure you get solid core wire, not stranded.) And a selection of common resistor values is even cheaper.

Quote:
I was trying to copy that NOP I saw in the picture I posted earlier, I'll fully admit that I do not know what a NOP is, which is why I didn't know it needed a clock source.

It will help a lot if you learn the basics of what assembly language is about. You don't need to become expert in it or, at this point, even be able to write programs, just have some sort of understanding of what an instruction is, what addresses are, and so on. Something like the first three or four chapters of Machine Language I from this site should get you started.

_________________
Curt J. Sampson - github.com/0cjs


Top
 Profile  
Reply with quote  
PostPosted: Tue Dec 29, 2020 7:11 pm 
Offline

Joined: Tue Dec 22, 2020 5:46 pm
Posts: 23
I'll see what I can do about getting more wire, I downloaded the book, will spend some time reading. Thank you.


Top
 Profile  
Reply with quote  
PostPosted: Tue Dec 29, 2020 7:30 pm 
Offline
User avatar

Joined: Thu Dec 11, 2008 1:28 pm
Posts: 10986
Location: England
For myself, I bought a 'Jumper Wire Kit' - not the most cost-effective, but an easy purchase.


Top
 Profile  
Reply with quote  
PostPosted: Wed Dec 30, 2020 7:35 am 
Offline
User avatar

Joined: Wed Feb 13, 2013 1:38 pm
Posts: 589
Location: Michigan, USA
The wire from inside 50-pair telephone cable works very well on solderless breadboards...

Good luck and cheerful regards. Mike

Attachment:
6502-on-breadboard proto.jpg
6502-on-breadboard proto.jpg [ 767.24 KiB | Viewed 1162 times ]


Top
 Profile  
Reply with quote  
PostPosted: Wed Dec 30, 2020 5:16 pm 
Offline
User avatar

Joined: Sat Dec 01, 2018 1:53 pm
Posts: 730
Location: Tokyo, Japan
Michael wrote:
The wire from inside 50-pair telephone cable works very well on solderless breadboards...

Come to think of it, I seem to recall that Radical Brad used wire from Ethernet cable for his massive breadboard projects.

I've not tried stranded wire in breadboards myself, but hey, if it works for at least some people, I guess it's worth a go.

_________________
Curt J. Sampson - github.com/0cjs


Top
 Profile  
Reply with quote  
PostPosted: Wed Dec 30, 2020 6:06 pm 
Offline
User avatar

Joined: Thu Dec 11, 2008 1:28 pm
Posts: 10986
Location: England
Good thinking, Curt! Here Brad tells us that (his) Cat5 cable is solid core.


Top
 Profile  
Reply with quote  
PostPosted: Thu Dec 31, 2020 9:22 am 
Offline
User avatar

Joined: Thu May 14, 2015 9:20 pm
Posts: 155
Location: UK
Fixed (as in cable designed/intended to be permanently installed) telephone and ethernet cabling is all solid core. Telecommunications cables are often 0.63mm or 0.9mm diameter copper cores with PVC insulation. They use a colour code to denote the different pairs in the cables.

The 0.63mm stuff is a very useful size for use on breadboards. The 0.9mm is good for the +5V and 0V/GND power supply wiring.

It is just about possible to use stranded cable in breadboards, but it’s rather tricky and time consuming. Definitely not recommended.

Mark


Top
 Profile  
Reply with quote  
PostPosted: Mon Jan 04, 2021 4:31 pm 
Offline

Joined: Tue Dec 22, 2020 5:46 pm
Posts: 23
Hello!
I've been reading some of that 6502 cookbook, and my wires came in today. I also managed to get ahold of a few spare parts, including another 65c02, so I'll be looking back through here to see what needs doing.


Top
 Profile  
Reply with quote  
PostPosted: Mon Jan 04, 2021 10:05 pm 
Offline

Joined: Tue Dec 22, 2020 5:46 pm
Posts: 23
Ok, so while I'm working on the NOP with one chip (the old one,) I used the spare one I purchased to see if I could get any information from it via an Arduino (connected to the address pins,) once again following Ben Eater's video, I checked over my code 3 or 4 times, it compiled and when I turned on the serial monitor I got garbage instead of random binary numbers like he did.
There wasn't anything connected to his data pins, and if I remember the video right, he said it was performing a "No Operation" opcode.


Attachments:
File comment: Serial Monitor receiving data.
serialmonitor.PNG
serialmonitor.PNG [ 8.99 KiB | Viewed 1057 times ]
Top
 Profile  
Reply with quote  
PostPosted: Mon Jan 04, 2021 10:56 pm 
Offline
User avatar

Joined: Fri Dec 11, 2009 3:50 pm
Posts: 3367
Location: Ontario, Canada
ProfessorCagan wrote:
Ok, so while I'm working on the NOP with one chip (the old one,) I used the spare one I purchased to see if I could get any information from it

:arrow: I think it'll be best for you to focus on one goal at a time.

Wanna show and tell us the latest re: the NOP setup? Remember photos are always a big help. :)

-- 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: Tue Jan 05, 2021 8:18 am 
Offline
User avatar

Joined: Sat Dec 01, 2018 1:53 pm
Posts: 730
Location: Tokyo, Japan
ProfessorCagan wrote:
...I used the spare one I purchased to see if I could get any information from it via an Arduino (connected to the address pins,) once again following Ben Eater's video, I checked over my code 3 or 4 times, it compiled and when I turned on the serial monitor I got garbage instead of random binary numbers like he did.

That looks suspiciously like what you get when your serial rate is incorrect; are you sure the program runs the Arduino side at 9600 bps?

But yes, Dr. Jefyll is correct, it's better to focus on one thing at a time. Especially since you have a 'scope, despite its low bandwidth, even with a 1 MHz clock you should be able to see square wave within its frequency range on the high address pins when you're runnng NOPs. (If you have your 32 kHz osciallator, you should be able to see every waveform in the system.) Successfully debugging that will give you some of the tools you need to be able to debug the Arduino-as-a-logic-analyzer system.

_________________
Curt J. Sampson - github.com/0cjs


Top
 Profile  
Reply with quote  
PostPosted: Tue Jan 05, 2021 2:57 pm 
Offline
User avatar

Joined: Thu May 14, 2015 9:20 pm
Posts: 155
Location: UK
The important thing to remember is that a microprocessor like the 6502 (or indeed any of the other variations including the 65C02) have very little intelligence. They have to be told what to do.

As with any system where operations are divided up into different time slots, it’s important that the information (or data) is available at the correct time.

Note that in the following paragraphs, I only give a simplified description of what actually happens. As I don’t want to get bogged down in to too much detail.

Hence a microprocessor like the 6502 has a defined set of cycles (or time slots). Before it can carry out an operation, it needs to read in the instruction. So it generates an sixteen bit address on the address bus, that is the lines labelled A0 to A15. The number on the address lines is the address that it wants to read from an external memory chip where it wants to read its instruction from. After a very short delay, it will read whatever data is on the data bus, that is the lines labelled D0 to D7. The number on the data bus is interpreted by the 6502 as an instruction code.

If it is a valid instruction code, the 6502 will then process this instruction. If it’s not a valid instruction code, the 6502 may stop processing instructions or it may perform no useful operation and increment the number that it next puts on the address bus. For valid instructions, it either executes (processes) the instruction, or it carries out a data read or write operation to memory. Either way, it increments the number that it next puts on the address bus. It will then start the next cycle.

Now in the circuits that you are working on, there is no external memory. But the 6502 does not know this, or does it care. It will still try to go through it’s normal sequence of cycles.

With the NOP generator, the resistors connected to the data bus (D0 to D7) pretend to be “fake” memory so that when the 6502 tries to read an instruction code, it gets the instruction code for the ‘NOP’ instruction. The NOP instruction instructs the 6502 to do nothing other than to increment the number that it will next put on the address bus.

However, the 6502 does need a good square wave signal on its clock input pin and it needs the various control input signal pins to be at the correct logic levels. And obviously the 6502 needs the power +5V/Vcc and 0V/GND/ground/Vss pins being correctly connected.

In other words, every link in the chain has to be present and correct otherwise it won’t work.

This why having a schematic diagram helps. Because it shows all the required parts and connections. So you can check your physical set-up to the diagram.

If schematic diagrams are not your thing, do a connection grid/table instead.
List all 40 pins of the 6502 in the first column. Then in the next column write down where each pin connects to. If there is more than one connection point, add further columns until all connections are listed.

Mark


Top
 Profile  
Reply with quote  
PostPosted: Tue Jan 05, 2021 8:05 pm 
Offline

Joined: Tue Dec 22, 2020 5:46 pm
Posts: 23
Yes, the baud rate was wrong, stupid of me, the program even defines the rate I'm to use (57600,) I'll get a pic of the NOP of soon.
I don't have a 32kz oscillator, sadly, I did buy one, but it got lost in the mail.


Top
 Profile  
Reply with quote  
PostPosted: Sun Jan 10, 2021 11:00 pm 
Offline

Joined: Tue Dec 22, 2020 5:46 pm
Posts: 23
So, Ben's video further, he does in fact place resistors on the data bus and create a NOP, placing the resistor in various pull-ups/downs, creating 01010111 or EA, the 6502's op code for doing nothing. I followed suit, well, turns out I must've connected my Arduino in reverse, because I was getting the memory reset opcode 57, according to the monitor program and my datasheet.
But I get the idea of what's going on.


Top
 Profile  
Reply with quote  
PostPosted: Sun Jan 10, 2021 11:18 pm 
Offline
User avatar

Joined: Sat Dec 01, 2018 1:53 pm
Posts: 730
Location: Tokyo, Japan
01010111 is indeed $57: 0101 = 5 and 0111 = 7. That is not a "memory reset instruction" but an invalid opcode. $EA is the reverse of that: 1110 1010.

As usual, it sounds as if you need to slow down a bit and check what you're doing quite carefully. It may seem tedious at first, but it will become faster over time, so long as you focus on being correct.

_________________
Curt J. Sampson - github.com/0cjs


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

All times are UTC


Who is online

Users browsing this forum: GARTHWILSON and 56 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: