6502.org Forum  Projects  Code  Documents  Tools  Forum
It is currently Fri Sep 20, 2024 9:34 am

All times are UTC




Post new topic Reply to topic  [ 138 posts ]  Go to page Previous  1 ... 3, 4, 5, 6, 7, 8, 9, 10  Next
Author Message
PostPosted: Sat Aug 05, 2017 9:40 pm 
Offline

Joined: Fri Jul 21, 2017 8:16 pm
Posts: 59
If for future Project useful! Maybe I Should Buy one.

Its 100nF I have no smaller ones. I have tried without condenser .


Top
 Profile  
Reply with quote  
PostPosted: Sat Aug 05, 2017 10:00 pm 
Offline
User avatar

Joined: Fri Dec 11, 2009 3:50 pm
Posts: 3367
Location: Ontario, Canada
Quote:
Its 100nF
Thank you.
nei02 wrote:
I have tried without condenser .
And are the results the same? Really, it's important to provide plenty of information! Otherwise it becomes harder for anyone trying to help.

nei02 wrote:
I get only dots ........... :oops:
Do you mean the UART is connected to a terminal, and the terminal is receiving the period character ($2E)?

_________________
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: Sat Aug 05, 2017 10:58 pm 
Offline

Joined: Fri Jul 21, 2017 8:16 pm
Posts: 59
I am using CoolTerm.
Adapter: PL2303HX USB zu TTL RS232. https://www.amazon.de/gp/product/B00WE0 ... UTF8&psc=1

Dots mean Hex00. So basically nothing.

When I run it without the condenser it is the same.
I have checked address decoding. When the programm reaches the step to store to address $4080
The write pin gets low. CS0 High, CS1B Low, RS0 & RS1 Low.

1-VSS-ground
2-CS0-A7
3-CS1B - output NAND address decoding
4-RESB - 5V
5-RXC - NC
6-XTLI - Crystal
7-XLT0 - Crystal
8 - RTSB - NC
9 - CTSB - ground
10 - TXD - Adapter pin green TXD
11 - DTRB - NC
12 - RxD - Adapter pin white RXD
13 - RS0 - A0
14 - RS1 - A1

15 - VDD - 5V
16 - DCDB - ground
17 - DSRB - ground
18-25 Data
26 - IRQ - NC
27 - PHI2 - Clock CPU 1 MHz
28 - RWB - Read/Write CPU


Top
 Profile  
Reply with quote  
PostPosted: Sun Aug 06, 2017 5:55 am 
Offline

Joined: Fri Jul 21, 2017 8:16 pm
Posts: 59
Since the loopback test with CoolTerm and am RS232-USB adapter doesn't work,
(First time that I those things) I will stop testing and order a new adapter.


Top
 Profile  
Reply with quote  
PostPosted: Sun Aug 06, 2017 7:48 am 
Offline
User avatar

Joined: Fri Aug 30, 2002 1:09 am
Posts: 8510
Location: Southern California
You can put [code] and [/code] around your code so the forum software will keep the white space you intended instead of throwing out all the spaces it thinks are extra.

Next, some things to simplify the code a bit (although this still leaves a problem I'll address further down):

  • You can leave out the LDA #$00 because you don't do anything with it before the LDA ACIA_DATA further down.

  • You can leave out the LDX #$00 because it doesn't matter what the data is when storing to the status register. You can store anything to the status register and it will reset the '51. Even if it did need to be 0, you could save a byte by doing INX (a single byte, since you had $FF in there from before the TXS). Assuming you have a CMOS 6502 (65c02), you could store 0 without it being in a register, using STZ ACIA_STAT.

  • You can leave out the LDY #$00 because you have it below anyway.

  • Since you null-terminate the string, you can use the LDA Hello,Y's automatic, implied compare-to-0 and leave out the CPY.

So the result is:
Code:
RESET:  LDX  #$FF
        TXS
        STZ  ACIA_STAT      ; You can store anything to ACIA_STAT.  It doesn't matter.
        LDA  ACIA_DATA
        LDA  #%00011110
        STA  ACIA_CTRL
        LDA  #%00001011
        STA  ACIA_COMM   
      
START:  LDY  #$0

OUTPUT: LDA  Hello,y
        BEQ  START          ; If we just picked up the null terminator, start over.
        STA  ACIA_DATA
        INY
        BRA  OUTPUT

hello:  .byte  "HELLO", 0
========================


Now: The next thing is that you have a severe overrun problem! You don't have any delay between bytes fed to the '51 to give it time to send each one. If you don't have a WDC '51 with the bug, you would use bit 4 of the status register to make sure it's ready for the next byte. But with WDC's bug, you can either use a delay loop (not my favorite, because then the computer can't do anything else while waiting), or use one of the timers in a 65(c)22 VIA, and then either poll the timer or set it up to produce an interrupt.

nei02 wrote:
Currently I have a 100nF connected.

If you have a 100nF (ie, 0.1µF) in the crystal circuit, it absolutely will not work. You should have something like what's in the second diagram at http://wilsonminesco.com/6502primer/IO_ICs.html, in about the middle of the page. 100nF is about 4,000 times too much. (1nF is a thousand pF.)

_________________
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: Sun Aug 06, 2017 11:09 am 
Offline

Joined: Fri Jul 21, 2017 8:16 pm
Posts: 59
Thank you for revising my code. This helps a lot to learn! :!:

Capacitor:
Will order a couple of capacitors to have various values at hand.

Delay:
Yes I have a WDS 65C02. The manual says that there is a bug and one should use a delay.
But even without delay I would have assumed that I get a least some characters transmitted.
For the first step I will go with a delay since I don't have an AVIA. And I want to reduce the complexity.
I saw anywhere in this forum (or it was the primer turorial) how to implement a delay. Will study this.

Adapter:
But still believe that the adapter doesn't work since the loopback test doesn't work.
I ordered a new one with an CP2102.


Top
 Profile  
Reply with quote  
PostPosted: Sun Aug 06, 2017 3:56 pm 
Offline
User avatar

Joined: Fri Aug 30, 2002 1:09 am
Posts: 8510
Location: Southern California
nei02 wrote:
Delay:
Yes I have a WDS 65C02. The manual says that there is a bug and one should use a delay.
But even without delay I would have assumed that I get a least some characters transmitted.

Yes, if you try transmitting "HELLO" over and over, you should see those letters coming through, but not in order, since many letters would get skipped between the ones that do get sent. The problem is that the onboard oscillator will not work with the .1µF capacitor from input to ground. If you use an outboard oscillator can, you don't need the capacitor at the input at all. Make sure you put the 1M resistor across the crystal like the WDC data sheet shows. Not all brands use this. Also, check the lot on your '51. I see now that the WDC data sheet says the internal oscillator didn't work right in a couple of lots SA1105A and SA0519A. Darn. It looks like they hurried this thing too much! I never had any trouble with the other (slower) brands of '51 I used, as long as I had the 22pF capacitor at he input.

Quote:
For the first step I will go with a delay since I don't have an AVIA. And I want to reduce the complexity.

You wouldn't need the VIA for just RS-232 I/O; but soon you'll probably want the other benefits of a VIA anyway, especially some parallel I/O and timers. BTW, it's "VIA" (for "Versatile Interface Adapter," not "AVIA." The "A" in "ACIA" (the 65c51) is for "Asynchronous," in "Asynchronous Communications Interface Adapter.")

At 1MHz processor clock speed, one frame of RS-232 at 9600,8,N,1 will take a little over 1042 processor clock cycles. Your software delay could be something like:
Code:
        LDX  #$D0
loop:   DEX
        BNE  loop
which with the other instructions in your loop, will give just a few more cycles than you need. I'm in a hurry to leave now so I can't take time to merge it with your code, but I'll take a look later.

_________________
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: Sun Aug 06, 2017 4:24 pm 
Offline

Joined: Fri Jul 21, 2017 8:16 pm
Posts: 59
Thank you very much! I was thinking to buy an oscillator can 1.8432 MHz. So I will do now.
I ordered a collection of ceramic capacitors anyway. So I can test both variants.

I can't read the lot on the chip.
The 1Mg resistor is in parallel to the crystal.

I bought the eBook of Programming the 6502, 65C02,.... as suggested.

Vielen Dank
Ralf


Top
 Profile  
Reply with quote  
PostPosted: Sun Aug 06, 2017 4:43 pm 
Offline

Joined: Fri Jul 21, 2017 8:16 pm
Posts: 59
So -> Ordered

a second ACIA 65C51 (just in case)
Oscillator can 1.8432 MHz
22 pF, 37pF
CP CP2102N-MINIEK http://www.mouser.com/ds/2/368/SiLabs_0 ... 080002.pdf


It would mean so much to me if my 65C02 could talk to me! :-)


Top
 Profile  
Reply with quote  
PostPosted: Sun Aug 06, 2017 6:57 pm 
Offline

Joined: Fri Jul 21, 2017 8:16 pm
Posts: 59
Found this interesting cause I was wondering why the 6502 steps to different addresses when powered on

http://www.pagetable.com/?p=410


Top
 Profile  
Reply with quote  
PostPosted: Sun Aug 06, 2017 7:55 pm 
Offline

Joined: Fri Jul 21, 2017 8:16 pm
Posts: 59
The Ophis Assembler seems to have a problem with the OPCODEs
STZ and BRA

Perhaps because Ophis is only for 6502 and not for 65C02

:oops: :twisted:


Top
 Profile  
Reply with quote  
PostPosted: Sun Aug 06, 2017 8:00 pm 
Offline

Joined: Fri Jul 21, 2017 8:16 pm
Posts: 59
And I have a question:

If I assemble my the (unrevised) code and disassembled this. I don't understand where the last three opcodes come from and where the .byte "Hello World" is stored.
The jump at the end to $004F concerns me since my code start at $8600 (ROM)

But which opcode tells the 6502 to store the .byte "Hello World"

Assembler: Ophis


Attachments:
code2.jpeg
code2.jpeg [ 71.41 KiB | Viewed 1228 times ]
code1.jpeg
code1.jpeg [ 19.49 KiB | Viewed 1228 times ]
Top
 Profile  
Reply with quote  
PostPosted: Sun Aug 06, 2017 8:19 pm 
Offline
User avatar

Joined: Fri Aug 30, 2002 1:09 am
Posts: 8510
Location: Southern California
I'm back.
nei02 wrote:
The Ophis Assembler seems to have a problem with the OPCODEs
STZ and BRA

Perhaps because Ophis is only for 6502 and not for 65C02

:oops: :twisted:

The 65c02 has only been out about 35 years. Maybe they just need a little more time to catch on! :lol: :roll:

Quote:
And I have a question:

If I assemble my the (unrevised) code and dissemble this I don't understand where the last three opcodes come from and where the .byte "Hello World" is stored.
The jump at the end to $004F concerns me since my code start at $8600 (ROM)

But which opcode tells the 6502 to store the .byte "Hello World"

That's a problem with disassemblers. They don't understand when something is data rather than code. Your "HELLO",0 is there. ASCII for "H" is the $48 which is also PHA; ASCII for "E" is $45 which is also EOR ZP; and so on.

_________________
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: Sun Aug 06, 2017 8:19 pm 
Offline

Joined: Thu Mar 03, 2011 5:56 pm
Posts: 284
Hint: what are the hexadecimal values for the ascii codes of "H", "E", "L" and "O"?


Top
 Profile  
Reply with quote  
PostPosted: Sun Aug 06, 2017 8:23 pm 
Offline
User avatar

Joined: Fri Aug 30, 2002 1:09 am
Posts: 8510
Location: Southern California
nei02 wrote:
Found this interesting cause I was wondering why the 6502 steps to different addresses when powered on

http://www.pagetable.com/?p=410

The reset circuit should always do its thing upon power-up, not just when someone presses a button. So on power-up, the reset routine will always be the first thing run, and automatically. It's the one whose address is found at $FFFC and $FFFD. The other two vectors are for interrupts, and their sources should be disabled by the reset, and should not be enabled until the software enables them. My 6502 interrupts primer is here.

_________________
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  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 138 posts ]  Go to page Previous  1 ... 3, 4, 5, 6, 7, 8, 9, 10  Next

All times are UTC


Who is online

Users browsing this forum: No registered users and 59 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: