6502.org Forum  Projects  Code  Documents  Tools  Forum
It is currently Sun Sep 29, 2024 6:35 am

All times are UTC




Post new topic Reply to topic  [ 18 posts ]  Go to page 1, 2  Next
Author Message
PostPosted: Fri Apr 29, 2011 1:23 am 
Offline

Joined: Tue Feb 01, 2011 3:10 am
Posts: 41
Hey again, the R65c51 I ordered finally arrived. Been trying to get it to work. I connected it up pretty much to how it's connected in this circuit
http://members.multimania.co.uk/leeedav ... index.html.

Only thing different is I wired the XTAL1 and 2 to a actual crystal. The crystal is rated at 1.84320mhz. I wired the phi2 to the clock.

From the MAX232, I wired the the RTS, CTS, TXD, and RXD lines into the holes in a DB25 null modem cable I had (was using it for my Amiga). Sadly only thing I get is a bunch of garbage once in a while.

Code (pretty much from that site, but changed the address:

; initialise 6551 ACIA

STA $6001 ; soft reset (value not important)
LDA #$0B ; set specific modes and functions
; no parity, no echo, no Tx interrupt
; no Rx interrupt, enable Tx/Rx
STA $6002 ; save to command register
; all the following 8-N-1 with the baud rate
; generator selected. uncomment the line with
; the required baud rate.
; LDA #$1A ; 8-N-1, 2400 baud
; LDA #$1C ; 8-N-1, 4800 baud
LDA #$1E ; 8-N-1, 9600 baud
; LDA #$1F ; 8-N-1, 19200 baud
STA $6003 ; set control register

Then I loop this forever, and output a ! after the STA.

LAB_WAIT_Tx:
LDA $6001 ; get status byte
AND #$10 ; mask transmit buffer status flag
BEQ LAB_WAIT_Tx ; loop if tx buffer full

LDA #"X"
STA $6000 ; save byte to ACIA data port

I get two ! to appear, then it just sits there.

Added:

Nevermind, found out I was using the wrong capacitors for the max232.


Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: Fri Apr 29, 2011 5:20 am 
Offline
User avatar

Joined: Thu Dec 11, 2008 1:28 pm
Posts: 10939
Location: England
Hi ioncannon
can you remind us what kind of debugging equipment you have to hand?

have you changed the character you send and found that it does change the character you receive? That would be quite positive: it means you have data transmission but something wrong with flow control

are you sending several characters or do you only try to send one? it isn't clear from your code snippet.

thanks
Ed


Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: Fri Apr 29, 2011 5:52 am 
Offline

Joined: Wed May 20, 2009 1:06 pm
Posts: 491
Have you tried 300 BPS?


Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: Fri Apr 29, 2011 5:52 am 
Online
User avatar

Joined: Fri Aug 30, 2002 1:09 am
Posts: 8521
Location: Southern California
ioncannon,

Put [code] and [/code] around your code so the spaces you put in for readability won't get eaten up. (I did a different trick here to make them show instead of doing their job.)

You might need to put a capacitor in the 65c51 circuit to make it work right. See http://www.6502.org/users/garth/project ... chematic=4


Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: Fri Apr 29, 2011 5:55 am 
Offline
User avatar

Joined: Thu Dec 11, 2008 1:28 pm
Posts: 10939
Location: England
ioncannon wrote:
...
I get two ! to appear, then it just sits there.

Added:

Nevermind, found out I was using the wrong capacitors for the max232.
So, it's working OK now?


Top
 Profile  
Reply with quote  
PostPosted: Fri Apr 29, 2011 2:58 pm 
Offline
User avatar

Joined: Thu May 28, 2009 9:46 pm
Posts: 8406
Location: Midwestern USA
ioncannon wrote:

I got a 404 trying to access that site through the original link. There's a period right after the .HTML part that is being picked up as part of the link.

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


Top
 Profile  
Reply with quote  
PostPosted: Fri Apr 29, 2011 3:03 pm 
Offline
User avatar

Joined: Thu May 28, 2009 9:46 pm
Posts: 8406
Location: Midwestern USA
ioncannon wrote:
Nevermind, found out I was using the wrong capacitors for the max232.

Your schematic shows 10 uF. Those capacitors should be 1.0 uF. According to Maxim's technical support people, oversized caps can eventually cause the chip to fail. In any case, there is nothing to be gained by going beyond the recommended values. If the charge pump output is at least +/- 9.5 volts it is working.

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


Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: Fri Apr 29, 2011 3:13 pm 
Offline

Joined: Tue Feb 01, 2011 3:10 am
Posts: 41
BigEd: I didn't have 1uf capacitors on hand so will test today when I pick em up. Only thing I noticed is a random character (usually a Cyrillic y or something) appears on powerup, and if TX is connected by itself (w/o RTC or CTS) it starts to output the y over and over. However an X should be being sent.

BigDino: Sorry, basically I send one character down the serial line, and then output a ! onto the LCD screen, when the register empties. It seems to be stuck waiting for the register to empty. Yea the circuit said 10u which threw me off. Should have read the datasheet instead. Hopefully it didn't kill the chip.

Garth: Does that say 22pf?


Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: Fri Apr 29, 2011 5:57 pm 
Online
User avatar

Joined: Fri Aug 30, 2002 1:09 am
Posts: 8521
Location: Southern California
Quote:
Garth: Does that say 22pf?

yes


Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: Fri Apr 29, 2011 10:04 pm 
Offline

Joined: Tue Feb 01, 2011 3:10 am
Posts: 41
Super, now it's outputting Xs onto the terminal :D. I can now being actually coding a monitor or something! Thank's Garth about the info with the 22pf cap, wasn't working w/o it.

So there was a lot of confusion I had with 10u and 1uf. I thought f was the unit and u just ment micro? Don't know much about capacitors (just looking through the 8+ kinds is intimidating lol. At least I know for future use.


Top
 Profile  
Reply with quote  
PostPosted: Fri Apr 29, 2011 10:43 pm 
Offline
User avatar

Joined: Thu May 28, 2009 9:46 pm
Posts: 8406
Location: Midwestern USA
ioncannon wrote:
So there was a lot of confusion I had with 10u and 1uf. I thought f was the unit and u just ment micro? Don't know much about capacitors (just looking through the 8+ kinds is intimidating lol. At least I know for future use.

Righto. F is farad (atomic unit of capacitance, named after Michael Faraday) and u or µ is "micro." You may also see the symbol mf, which is the same as µf. In electron tube audio circuits, as well as in RF applications, it's not uncommon to see pf (picofarads, referred to in real old electronics texts as mmf).

BTW, a one farad capacitor can store a lot of energy. If you had one that could be charged to, say, 250 volts and then shorted it out, the resulting discharge would be like a shotgun blast.

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


Top
 Profile  
Reply with quote  
PostPosted: Sat Apr 30, 2011 8:55 am 
Offline

Joined: Tue Jul 05, 2005 7:08 pm
Posts: 1041
Location: near Heidelberg, Germany
BigDumbDinosaur wrote:
You may also see the symbol mf, which is the same as µf.


Wouldn't mf not be milli-Farad, i.e. 1000 uF?

André


Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: Sat Apr 30, 2011 9:12 am 
Online
User avatar

Joined: Fri Aug 30, 2002 1:09 am
Posts: 8521
Location: Southern California
Yes, and the production workers at our company kept writing MF, and I kept kidding them about a capacitor the size of a car (10^12uF per MF).


Top
 Profile  
Reply with quote  
PostPosted: Sat Apr 30, 2011 3:21 pm 
Offline
User avatar

Joined: Thu May 28, 2009 9:46 pm
Posts: 8406
Location: Midwestern USA
fachat wrote:
BigDumbDinosaur wrote:
You may also see the symbol mf, which is the same as µf.


Wouldn't mf not be milli-Farad, i.e. 1000 uF?

André

With today's standards you'd be right. However, back before symbology got standardized, m was understood to be micro when referring to capacitors and transconductance (micro-mhos), and milli when referring to inductance (millihenries). The switch to using µ to indicate micro took a while, even though it was obviously unambiguous. Using m for micro confused me on occasion, and I grew up with the old symbology. I still have some tube amplifier circuits here from the 1950s and 1960s that use mf to refer to capacitor sizes. I also have an ancient electronics text (from the days when audio power tubes had plate caps) that refers to capacitors as "condensers," which term also persisted in automotive technology before the demise of point ignition systems.

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


Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: Sat Apr 30, 2011 3:22 pm 
Offline
User avatar

Joined: Thu May 28, 2009 9:46 pm
Posts: 8406
Location: Midwestern USA
GARTHWILSON wrote:
Yes, and the production workers at our company kept writing MF, and I kept kidding them about a capacitor the size of a car (10^12uF per MF).

Just think what it would take to charge it up. :)

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


Top
 Profile  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 18 posts ]  Go to page 1, 2  Next

All times are UTC


Who is online

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