cbscpe wrote:
BDD thanks for the EXTBDRT document. I never found that one in the internet (was I too lazy or just blindfolded, I don't know).
I don't know if that one is online. I got it from directly from Philips technical support some years ago.
Quote:
But I still have a problem to get those NXP UARTs to work. I have now a SCC2691 connected to my small workbench computer (using a GTE G65SC816-4
) running at 2MHz. This should not be too fast.
I'm not familiar with the GTE MPU. Does it generate false address bus states like the W65C816S? If so, you may be getting tripped up by it.
Quote:
But I can't seem to setup the registers. The CE is just the address range $8000 to $9FFF decoded with a 74HC138 and the REN and WEN are generated with another 74HC138 with R/W connected to A and G2 to PHI2 (and G1A=G1B=GND). No buffers in the Address or Databus. All the other I/O on my computer works perfectly (CDP65C51-4, which is the current RS-232 to my PC, the W65C22 and also a 74HC574 latch and a 74LS367 digital input).
Can you post a schematic (not in color!) to illustrate your interface to the 2691? I have my suspicions but can't confirm them without seeing a schematic.
Quote:
The bad thing is that there are no registers that you can read back, so I have no clue whether I can successfully write/read the registers. I tried to set MR1 and MR2 but never can read back the same value (worse, no matter how I reset the MR Pointer using the dataregister, the MR1 and MR2 always read back the same value).
Quick note: you reset the MR pointer by writing the bit pattern
%00010000 to the command register (CR). Always allow a minimum of three DUART clock cycles to elapse after accessing CR. That would be at least 0.814 µsecs, assuming a 3.6864 MHz clock. Violating that requirement will result in an internal error in the 2691, which may require a reset to clear. After resetting the MR pointer, you should be able to read back what you wrote into MR1.
In situations like this, your logic probe and 'scope are your friends. Some things to consider:
- Have you verified that the 2691 is being selected when you try to access it?
- Are you sure nothing else is being inadvertently selected at the same time?
- Are the /RDN and /WRN inputs being strobed at the right time?
- Is /CE being asserted before /RDN or /WRN are strobed?
- Is your glue logic correctly accounting for tAS and tAH?
Not having a copy of your schematic before me, I can't offer a whole lot of advice right now.
Quote:
the X-TAL seems to work perfectly (on my scope on XTAL2 it shows a very smooth sine with 4.4Vpp, so the oscillator does work).
4.4 Vpp sounds good. What frequency are you using, and are you sure the crystal is resonating at that frequency and not at some subharmonic?
Quote:
I have no clue how to proceed. Do you have any hint? Or a code sample how to initialise this baby?
See the attached ZIP file. This is code for setting up and driving the 26C92, but can be readily adapted to the 2691 (all Philips 26xx UARTs use the same basic programming model). The code is in the Kowalski simulator's assembler format (with macros for implementing 65C816-unique instructions) but should be easy to decipher, as there is lots of commentary. Included files are:
Code:
816macs.asm 65C816 instruction macros
65c816.asm 65C816 hardware definitions
26c92.asm 26C92 hardware definitions
buffers.asm I/O buffer definitions
config_constants.asm 26C92 register configuration constants
config_loop.asm code that configures the 26C92 at reset
config_table.asm data table used during 26C92 configuration
datatypes.asm atomic data types
directpage.asm direct page definitions
foreground.asm foreground functions
interrupt.asm interrupt service routine
masks.asm various runtime mask values
In the Kowalski assembler,
@ is used to define a bitwise value, which is contrary to the MOS Technology standard, which uses
% for that purpose. Also note that the 26C92 has an MR0 register, as well as TxD FIFOs, the latter which are accounted for in the interrupt service routine.
An additional file, assemble.asm, assembles all of the above. I used it to verify that there were no unresolved references.
Quote:
And I must say Aslak3 is right saying the datasheets leave much to the imagination.
Sorry.
Learning how to read between data sheet lines is a skill that develops over time. I've been perusing data sheets for some 40 years and still wonder where the authors of some of them got their education.
Attachment:
File comment: Philips/NXP 26C92 Assembly Language Routines
26c92.zip [19.69 KiB]
Downloaded 129 times