6502.org Forum  Projects  Code  Documents  Tools  Forum
It is currently Fri Nov 22, 2024 9:42 am

All times are UTC




Post new topic Reply to topic  [ 4 posts ] 
Author Message
PostPosted: Sat May 09, 2020 1:03 pm 
Offline

Joined: Sat May 09, 2020 12:09 pm
Posts: 2
Hello - I hope someone can help me out.

I have 6850 UART connected per Grant's schematics. It all works, but now I'd like to trigger an interrupt when a character is received.

http://searle.x10host.com/6502/6502SbcS ... %201.1.gif

I have a logic probe connected to the IRQ pin, and and another one to the RDX pin. I see the levels changing on the RDX pin as expected. The IRQ pin is consistently low.

Here is the init code:
LDA #$3 ;master reset
STA ACIA_6850_Control
LDA #$95 ; Set ACIA_6850 baud rate, word size and Rx interrupt (to control RTS)
STA ACIA_6850_Control

$95 = %1001 0101‬ = The seventh bit is the IRQ receive enable bit.

Any other initialization I need to perform?


Top
 Profile  
Reply with quote  
PostPosted: Sat May 09, 2020 3:47 pm 
Offline
User avatar

Joined: Tue Mar 05, 2013 4:31 am
Posts: 1385
dvltav410 wrote:
Hello - I hope someone can help me out.

I have 6850 UART connected per Grant's schematics. It all works, but now I'd like to trigger an interrupt when a character is received.

http://searle.x10host.com/6502/6502SbcS ... %201.1.gif

I have a logic probe connected to the IRQ pin, and and another one to the RDX pin. I see the levels changing on the RDX pin as expected. The IRQ pin is consistently low.

Here is the init code:
LDA #$3 ;master reset
STA ACIA_6850_Control
LDA #$95 ; Set ACIA_6850 baud rate, word size and Rx interrupt (to control RTS)
STA ACIA_6850_Control

$95 = %1001 0101‬ = The seventh bit is the IRQ receive enable bit.

Any other initialization I need to perform?


If your schematic is still per Grant's system, then it's not going to work. Look more closely... the IRQ line of the CPU is pulled to +5V. You need to disconnect the IRQ and use a 3.3K resistor to pull it to +5V. Then re-route the IRQ line of the 6850 to the CPU IRQ line. You'll also need to manage the RTS/CTS signals as well. Once that's done, you'll need to write an interrupt handler to service the IRQ when generated by the 6850.

You can reference an older book (can be found online as a PDF) called "6502 Assembly Language Subroutines" by Lance Leventhal and Winthrop Saville. Page 464 shows a decent set of routines to init, send and receive using the 6850. You can certainly streamline the code once you get it working.

_________________
Regards, KM
https://github.com/floobydust


Top
 Profile  
Reply with quote  
PostPosted: Sat May 09, 2020 9:04 pm 
Offline

Joined: Sat May 09, 2020 12:09 pm
Posts: 2
Kevin - your answer has been most helpful. I had the IRQ not connected to anything just a logic probe. Pulling the IRQ high per your recommendation has resolved the issue. Also I had to make sure I was not reading from the receive buffer in order for the interrupt to trigger.

Best,

Dominik


Top
 Profile  
Reply with quote  
PostPosted: Sun May 10, 2020 4:44 am 
Offline
User avatar

Joined: Thu Dec 11, 2008 1:28 pm
Posts: 10985
Location: England
(welcome Dominik! Glad your system is working now.)


Top
 Profile  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 4 posts ] 

All times are UTC


Who is online

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