6502.org Forum  Projects  Code  Documents  Tools  Forum
It is currently Mon Oct 07, 2024 3:32 am

All times are UTC




Post new topic Reply to topic  [ 5 posts ] 
Author Message
PostPosted: Sun Jun 11, 2017 6:58 pm 
Offline

Joined: Thu Nov 10, 2016 12:28 am
Posts: 13
Hi there. I made a thread here a while ago with some pretty newbie questions and ideas about how to make a 6502 system. (Like trying to divide memory with only NAND gates.) I've learnt quickly after that and I breadboarded a mostly-functional 6502 system a few months ago. Making modifications was difficult though, because it was a total rats nest, and I am now rebuilding the logic circuitry on a more permanent prototyping pcb. Before I complete it however, I have some questions about the more difficult area of my design: an Atari CO12294-22 POKEY chip. I want to use the POKEY as a serial interface with my computer, using an Arduino as an intermediate. However, I could never get it quite right. The POKEY chip was functional and getting good power, but the system would freeze if the serial bidirectional clock was connected to my ardiuno. I also could not get audio out of the chip using an LM386. I know the CPU, VIA and ROM/RAM worked from monitoring activity with LEDs, but the POKEY would never spit out ASCII over serial or sound either. Documentation of the POKEY is not as good as I wish it was so this may be difficult to figure out. I will upload my ca65 assembly code soon. Any idea where to look first?

UPDATE: Attached .asm file of the contents of my 8KB ROM.


Attachments:
File comment: assembly code
SYS65ROM.asm [3.66 KiB]
Downloaded 86 times


Last edited by pw132 on Sun Jun 11, 2017 9:00 pm, edited 1 time in total.
Top
 Profile  
Reply with quote  
PostPosted: Sun Jun 11, 2017 7:10 pm 
Offline
User avatar

Joined: Wed Mar 01, 2017 8:54 pm
Posts: 660
Location: North-Germany
Do you have an URL with a datasheet of that chip? The only quick search result was that the chip is much more complex and one of its many functions is some sort of serial IO (not necessary like a UART, perhaps like SPI ?).


Top
 Profile  
Reply with quote  
PostPosted: Sun Jun 11, 2017 8:51 pm 
Offline

Joined: Thu Nov 10, 2016 12:28 am
Posts: 13
The wikipedia page is the best place to start. It contains a pinout and detailed register functions. For voltage characteristics and otherwise the internal Atari datasheet has those. I'm updating the OP now to include my assembler code.


Top
 Profile  
Reply with quote  
PostPosted: Sun Jun 11, 2017 11:58 pm 
Offline
User avatar

Joined: Wed Mar 01, 2017 8:54 pm
Posts: 660
Location: North-Germany
This is very very preliminary:
You initialize SKCTL with 0. This would mean you require an external clock (from Arduino? or from VIA?) to have any serial IO.
If it freezes - perhaps there is no clock?
The clock must be x1 the desired baudrate - unusual but who cares :)
Perhaps you check for the clock and assuming there is one, try do send "Hello W" without using IRQs - but polling the ODN (?) flag and then clear it and send next char.

I did not went to your audio tests, but perhaps this influence the serial IO. There you use bit 0 of SERLCTL. But you check bit 1 whether you can transmit a character - ??

BTW: your code looks like being written for plain 6502 (no CMOS). You did not clear the decimal mode flag during BOOT (highly recommended) nor did you init the stackpointer (recommended and necessary if you do not have a full page 1).

A little more comments and names for some magic memories ($09, $20) would be helpful :)


Top
 Profile  
Reply with quote  
PostPosted: Mon Jun 12, 2017 12:44 am 
Offline
User avatar

Joined: Fri Aug 30, 2002 1:09 am
Posts: 8522
Location: Southern California
I'm not familiar with the POKEY; but make sure that you're clearing the cause of the interrupt when you service it, so a persistent interrupt cause doesn't get you in a trap.

Also remove the SEI and CLI from the interrupt-service routines (ISRs). The interrupt sequence already sets the interrupt-disable bit I, which in the case of IRQ, was clear (or you wouldn't have gotten there), and RTI will restore that.

_________________
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  [ 5 posts ] 

All times are UTC


Who is online

Users browsing this forum: dmsc and 54 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: