6502.org Forum  Projects  Code  Documents  Tools  Forum
It is currently Sun Nov 24, 2024 7:19 pm

All times are UTC




Post new topic Reply to topic  [ 25 posts ]  Go to page Previous  1, 2
Author Message
PostPosted: Tue Oct 06, 2015 4:51 pm 
Offline
User avatar

Joined: Thu Dec 11, 2008 1:28 pm
Posts: 10986
Location: England
When we looked at this for the all-16-bit 65Org16, we realised there's no harm in doing 16-bit wide accesses to 8-bit peripherals - you just ignore the upper byte.


Top
 Profile  
Reply with quote  
PostPosted: Tue Oct 06, 2015 6:24 pm 
Offline
User avatar

Joined: Fri Aug 30, 2002 1:09 am
Posts: 8546
Location: Southern California
BigEd wrote:
When we looked at this for the all-16-bit 65Org16, we realised there's no harm in doing 16-bit wide accesses to 8-bit peripherals - you just ignore the upper byte.

That usually works, but sometimes you'll have to be careful in the design. For example, on the 65c51, with normal addressing where register numbers are at consecutive addresses, if you write to the transmit register with a 16-bit write, you'll also write to the status register which causes a software reset.

_________________
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: Tue Oct 06, 2015 6:31 pm 
Offline
User avatar

Joined: Thu Dec 11, 2008 1:28 pm
Posts: 10986
Location: England
Good point, but not so for the 65Org16 - writes and reads are word-wide. For the '816, indeed, it might be necessary to hook up such a peripheral only to even addresses, with a simple change of address decode. Does that work? I think it does...


Top
 Profile  
Reply with quote  
PostPosted: Tue Oct 06, 2015 6:47 pm 
Offline
User avatar

Joined: Fri Aug 30, 2002 1:09 am
Posts: 8546
Location: Southern California
BigEd wrote:
Good point, but not so for the 65Org16 - writes and reads are word-wide.

Ah yes, you're refreshing my memory.

Quote:
For the '816, indeed, it might be necessary to hook up such a peripheral only to even addresses, with a simple change of address decode. Does that work? I think it does...

The I/O IC's register-select bits could be shifted up the address bus by one, and A0 would have to go into the chip-select logic so the IC is only selected if A0 is 0. This exposes another disadvantage to locking out a trait of the 816 though. If you want to read or write a 65c22 VIA's timer counter or latches, it's nice to be able to address both bytes at once, which the '816 can do, in a pair of consecutive clocks, all in one instruction.

_________________
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: Tue Oct 06, 2015 6:58 pm 
Offline
User avatar

Joined: Tue Nov 16, 2010 8:00 am
Posts: 2353
Location: Gouda, The Netherlands
Quote:
If you want to read or write a 65c22 VIA's timer counter or latches, it's nice to be able to address both bytes at once, which the '816 can do, in a pair of consecutive clocks, all in one instruction.

You could make a 6522 derivative with 16 bit data, and access the entire register in one cycle.


Top
 Profile  
Reply with quote  
PostPosted: Tue Oct 06, 2015 7:01 pm 
Offline
User avatar

Joined: Thu May 28, 2009 9:46 pm
Posts: 8514
Location: Midwestern USA
Alienthe wrote:
Broccoli requires delicate handling. If you boil it until it changes colour into a green-yellow tinge you have overdone it. It should remain dark green and be a little crispy, or "al dente". Alternatively you can stir fry it - fast and efficient.

Best not to boil any vegetable. When I prepare any fresh vegetable I bring the water to a rolling boil, add a pinch of salt, let it boil for another minute and then turn off the fire. As soon as the water has settled down I put in the vegetables and let them sit for no more than ten minutes. I drain the water and then dot the vegetables with some butter, and they're ready.

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


Top
 Profile  
Reply with quote  
PostPosted: Tue Oct 06, 2015 7:28 pm 
Offline
User avatar

Joined: Thu May 28, 2009 9:46 pm
Posts: 8514
Location: Midwestern USA
GARTHWILSON wrote:
The I/O IC's register-select bits could be shifted up the address bus by one, and A0 would have to go into the chip-select logic so the IC is only selected if A0 is 0.

The fact that the '816 can do byte- or word-size accesses mirrors what other 16 and/or 32 bit MPUs can do. For example, the MC68000 MOVE instruction can handle a byte, a word or a double word. The MOVE opcode has a bit field (bits 12 and 13) that tells the MPU the data size to be handled. So the 68000 is doing in the instruction itself what the '816 would do with two instructions (REP or SEP followed by LDA or STA).

The ability to read or write byte-sized data is essential to achieving trouble-free I/O. For example, if I wish to output a character to POC's console I would do it by writing a byte to the DUART's channel A transmitter FIFO, which is at offset $03 in the device (absolute address $00D103). If I were to write a word to that offset I would also touch the register at offset $04, which happens to be the auxiliary control register (ACR). Among other things, the ACR is where the baud rate table is selected and the counter/timer is configured. You'd best believe that an errant write on the ACR could cause a major malfunction.

Kludges like excluding odd addresses to avoid writing the MSB are treating the symptom, not the problem, and merely add to the amount of decoding hardware needed to make the system work.

Quote:
This exposes another disadvantage to locking out a trait of the 816 though. If you want to read or write a 65c22 VIA's timer counter or latches, it's nice to be able to address both bytes at once, which the '816 can do, in a pair of consecutive clocks, all in one instruction.

Plus it's an atomic read, so you are guaranteed to grab all 16 bits before an impending interrupt hits.

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


Top
 Profile  
Reply with quote  
PostPosted: Tue Oct 06, 2015 7:30 pm 
Offline
User avatar

Joined: Thu May 28, 2009 9:46 pm
Posts: 8514
Location: Midwestern USA
Arlet wrote:
Quote:
If you want to read or write a 65c22 VIA's timer counter or latches, it's nice to be able to address both bytes at once, which the '816 can do, in a pair of consecutive clocks, all in one instruction.

You could make a 6522 derivative with 16 bit data, and access the entire register in one cycle.

That seems to be a lot of work just to make up for a deficiency in the microprocessor.

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


Top
 Profile  
Reply with quote  
PostPosted: Tue Oct 06, 2015 9:22 pm 
Offline
User avatar

Joined: Tue Nov 16, 2010 8:00 am
Posts: 2353
Location: Gouda, The Netherlands
BigDumbDinosaur wrote:
That seems to be a lot of work just to make up for a deficiency in the microprocessor.

Perhaps, but probably still easier than adding processor support for mixed-width data.


Top
 Profile  
Reply with quote  
PostPosted: Tue Oct 06, 2015 9:23 pm 
Offline
User avatar

Joined: Thu Dec 11, 2008 1:28 pm
Posts: 10986
Location: England
Yes, it doesn't seem too bad to me - some peripherals just work, some need spaced-out mapping, some will be fine but not optimal.


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

All times are UTC


Who is online

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