65C22 acting goofy...

Building your first 6502-based project? We'll help you get started here.
Post Reply
User avatar
cbmeeks
Posts: 1254
Joined: 17 Aug 2005
Location: Soddy-Daisy, TN USA
Contact:

65C22 acting goofy...

Post by cbmeeks »

So, the good news is that I have successfully implemented a 65C22 to my L-Star. :-D

I have the VIA mapped to $4000+.

For those that don't know, the L-Star provides 16K of RAM and 8K of ROM to the 65C02.

Anyway, I wrote a little BASIC program to cycle through PORT A of the VIA.

Things are working great until I noticed some of the pins are backwards. I have checked and rechecked the datasheet but it appears that P3 and P2 are reversed as are P6 and P5. I cannot see where I've connected anything incorrectly. P0 goes to LED0, P1 to LED1, etc.

I initially ran the following code:

Code: Select all

poke 16387, 255       -- PORT A output all pins
poke 16385, 170       -- %10101010
I connected all 8 pins of PORT A to some LED's but the pattern that's lit up is: %11000110

I've tried several examples:

%00001111 results in %00001111 (CORRECT)
%00000100 results in %00001000 (INCORRECT... P3 lit instead of P2)
%11111111 results in %11111111 (CORRECT)

Am I missing something?

For reference, I have A15 tied to CS2, A14 tied to CS1 and A3:0 tied to RS3:0

Thanks
Cat; the other white meat.
User avatar
Dr Jefyll
Posts: 3525
Joined: 11 Dec 2009
Location: Ontario, Canada
Contact:

Re: 65C22 acting goofy...

Post by Dr Jefyll »

cbmeeks wrote:
So, the good news is that I have successfully implemented a 65C22 to my L-Star. :-D
Good stuff! There's SO much that a VIA can do! (Versatile Interface Adapter, or VIA, is marketing-speak for 6522 :) )
cbmeeks wrote:
I cannot see where I've connected anything incorrectly. P0 goes to LED0, P1 to LED1, etc.
Did you also check that each of the VIA data-bus pins connects to the corresponding CPU data-bus pin? (ie, VIA d7 to CPU d7, VIA d6 to CPU d6 etc)

-- Jeff
In 1988 my 65C02 got six new registers and 44 new full-speed instructions!
https://laughtonelectronics.com/Arcana/ ... mmary.html
User avatar
cbmeeks
Posts: 1254
Joined: 17 Aug 2005
Location: Soddy-Daisy, TN USA
Contact:

Re: 65C22 acting goofy...

Post by cbmeeks »

My old eyes aren't what they used to be.

That was it!

Ugh...totally missed that one. I hadn't noticed my wires were mixed up on the data bus side. LOL

Thanks!

Now it's time to have some fun!
Cat; the other white meat.
User avatar
jac_goudsmit
Posts: 229
Joined: 23 Jun 2011
Location: Rancho Cucamonga, California
Contact:

Re: 65C22 acting goofy...

Post by jac_goudsmit »

cbmeeks wrote:
So, the good news is that I have successfully implemented a 65C22 to my L-Star. :-D

I have the VIA mapped to $4000+.
I'm glad you got it to work!
Quote:
For those that don't know, the L-Star provides 16K of RAM and 8K of ROM to the 65C02.
Well... that's just a little bit inaccurate.

The Propeller on the L-Star can map up to 32K of memory (RAM and/or ROM) into the 65C02 address space, at any location, in up 8 blocks of consecutive addresses. But for most configurations, that's a bit optimistic because for any projects that do anything other than provide memory to the 65C02, the other functionality will take up some hub memory space.

For example, the Apple 1 emulator project provides 16K RAM and 8K ROM because the rest of the hub memory is used by the PIA emulator, the video generator and the drivers for the serial port and the PS/2 keyboard. But the KimStar project only provides (virtual) RAM to the MicroKim, so it's configured as 24KB (pre-initialized with MS Basic). I could probably be modified to present the full 32KB but I wanted to keep the code simple.

L-Star Plus has a 128KB SRAM chip that makes it unnecessary to worry about available memory in the Propeller. It just doesn't work yet because I haven't written a software module for it yet :)

===Jac
User avatar
cbmeeks
Posts: 1254
Joined: 17 Aug 2005
Location: Soddy-Daisy, TN USA
Contact:

Re: 65C22 acting goofy...

Post by cbmeeks »

Ah, right you are. Sorry, I was going by the base config that I've been using. :-)

And yeah, let me know when L-Star Plus is ready!
Cat; the other white meat.
Post Reply