UK Vintage Radio Repair and Restoration Powered By Google Custom Search Vintage Radio Service Data

Go Back   UK Vintage Radio Repair and Restoration Discussion Forum > Specific Vintage Equipment > Vintage Computers

Notices

Vintage Computers Any vintage computer systems, calculators, video games etc., but with an emphasis on 1980s and earlier equipment.

Reply
 
Thread Tools
Old 11th Sep 2017, 10:52 pm   #1
PETERg0rsq
Hexode
 
PETERg0rsq's Avatar
 
Join Date: Jun 2009
Location: St Helens, Lancashire, UK.
Posts: 361
Default Help with 6802 Microcontroller

I hope this is the right section.

I have a fault with an old signal generator, which is in the CPU part of the instrument.

The instrument boots up erratically (more often not than does!). When it does boot up, it runs for 10 to 30 seconds before sending out a Hardware RESET instruction.

I am sure the problem is hardware related due to the erratic nature.

The boot sequence, looking at the I/O on the 6802 is different for a good boot as opposed to a bad boot! (I am using a 500MHz 40 channel logic analyser to read the chip).

Sometimes the boot sequence last a long time, and fails, sometimes it fails very quickly.

It usually fails with the 6802 sending out a hardware re-set instruction which latches the re-set pin low. Only way to reset is to power cycle the board.

All the basics are in place, E output, IRQ stays high etc I have re-seated all the socket mounted chips (and cleaned their pins).

So my questions:-

How does a 6802 boot up?
It must read the program from the ROM and/or EPROMS, but how does it address these to start loading a program? Is there a default start up sequence?

When I have a bad start up the 6802 is addressing the RAM and a GPIA before it looks at the ROM or EPROM. This does not sound right. (I have yet to capture a good startup as they are very rare!)

Can anyone suggest some kind of strategy for faultfinding on such a CPU board? I have just hooked up the logic analyser to read the Data ports, as can only think I need to see what the 6802 is doing on good startups and bad ones.

One other odd thing!

After powering up the CPU board before the RESET goes HIGH, all the address bits are low, except for A0, which is high! When the RESET is HIGH then A0 operates as expected. Replaced the output buffers, but just the same!

I enclose the schematic. If anyone wants a better copy please send me a PM.

Thanks in anticipation
Attached Files
File Type: pdf adret730A_maintenance_manual_II 78.pdf (248.6 KB, 53 views)
__________________
SPECIALIST.....Knows everything about nothing
EXPERT..........Knows nothing about everything
PETERg0rsq is offline   Reply With Quote
Old 11th Sep 2017, 11:06 pm   #2
MrBungle
Octode
 
MrBungle's Avatar
 
Join Date: Jun 2016
Location: South West London, UK.
Posts: 1,637
Default Re: Help with 6802 Microcontroller

6802 is a 6800 with built in clock gen. nothing more.

Startup vector is 0xFFFE and 0xFFFF which usually has a JMP to wherever the entry point is.

I'd concentrate on looking at the ^RESET and ^HALT lines to start with. I've had some stuff go weird on the power in reset before and not reset the CPU state properly. After that it's possible the EPROM is dicky and it's skipping the startup vector and then PC is rolling over into RAM at 0x0000. I don't think the 6800 had PC overflow traps. Been many years since I had anything with one in it.

If you pull the EPROM out, A0 should pulse out if it doesn't trap. (No logic analyser for me - just a crappy old logic probe )

http://www.andysarcade.de/data/elect.../6802_6808.pdf contains a full startup flow on page 9.

Before everything though get a scope on the 5v rail and look for any spikes and ripple. May be old tantalum playing up or the power supply failing as well.
MrBungle is offline   Reply With Quote
Old 11th Sep 2017, 11:40 pm   #3
PETERg0rsq
Hexode
 
PETERg0rsq's Avatar
 
Join Date: Jun 2009
Location: St Helens, Lancashire, UK.
Posts: 361
Default Re: Help with 6802 Microcontroller

Thanks for response

Please forgive me but I am a beginner on Microcontrollers.

I only have experience of PIC's and the like!

The PSU's are stable, but well worth another look at them since not paid much attention to them since hooking up the logic analyser (had this thing on the bench for about two weeks, and just getting to grips of how the elements work together!)

Quote:
Startup vector is 0xFFFE and 0xFFFF which usually has a JMP to wherever the entry point is.
Sorry do not really understand this. Is this the start up address that the 6802 first reads?
A13, A14, A15 are the chip select bits so the boot up would read ROM1 (A13-A15 all = 1) address A0-A15 all = 1. Is that correct?

Quote:
If you pull the EPROM out, A0 should pulse out if it doesn't trap.
Again what do you mean? Is it simply that A0 will pulse ON and OFF with E when no EPROM

Thanks for the link, some reading to be done next I think

Regards

peter
__________________
SPECIALIST.....Knows everything about nothing
EXPERT..........Knows nothing about everything
PETERg0rsq is offline   Reply With Quote
Old 12th Sep 2017, 3:46 am   #4
TonyDuell
Octode
 
Join Date: Jun 2015
Location: Biggin Hill, London, UK.
Posts: 1,992
Default Re: Help with 6802 Microcontroller

Actually, isn't the 6802 a 6800 with a little bit of RAM on-chip too?

After a reset, these processors read the 2 bytes at the very top of memory, locations 0xFFFE and 0xFFFF. They stick those together to make a 16 bit number (I can't remember which is the high byte and which is the low byte, but it's in the datasheet) and then jump to that address. And start executing code there. The top 2 locations are not themselves a JMP (or any other) instruction.
TonyDuell is online now   Reply With Quote
Old 12th Sep 2017, 8:29 am   #5
Radio Wrangler
Dekatron
 
Radio Wrangler's Avatar
 
Join Date: Mar 2012
Location: Fife, Scotland, UK.
Posts: 9,031
Default Re: Help with 6802 Microcontroller

As A0 is changing and all the other address bits are high, you are seeing the 6800 read the top two bytes of the memory space. It expects this area to be EPROM/ROM and those two bytes to be the address of where it should go to start the boot-up code.

If you never see the address bus go to anything other than FFFE and FFFF, then it's not making the JuMP command to go anywhere. Possibilities then become a duff EPROM/ROM or something wrong on the databus spoiling the read.

David
__________________
Can't afford the volcanic island yet, but the plans for my monorail and the goons' uniforms are done
Radio Wrangler is online now   Reply With Quote
Old 12th Sep 2017, 8:45 am   #6
MrBungle
Octode
 
MrBungle's Avatar
 
Join Date: Jun 2016
Location: South West London, UK.
Posts: 1,637
Default Re: Help with 6802 Microcontroller

That's it.

Apologies if my rambling made no sense last night. I was half asleep
MrBungle is offline   Reply With Quote
Old 12th Sep 2017, 1:43 pm   #7
G0HZU_JMR
Octode
 
Join Date: Sep 2010
Location: Cheltenham, Gloucestershire, UK.
Posts: 1,198
Default Re: Help with 6802 Microcontroller

Way back in around 2002 I reverse engineered a load of car ECUs that use the 680x MCU. If you dump out the ROM code from the MCU I can have a look through the program if that helps?

I'm older and slower these days but I can probably still read this code quite well. Back in 2002 -2008 I was able to reverse engineer quite a few ECUs and worked out how each car managed its fuel and ignition, how it dealt with knock sensors and how it used sensor inputs to access various maps. I also reverse engineered the ECU housekeeping. Also found a few easter eggs in the code including a hidden diagnostic interface.

From what I can remember of a typical ECU system, the MCU program ROM code (written by the ECU manufacturer) jumps to the reset vector, then their program code in ROM sets up the stack and the ports and some interrupts then it does some housekeeping to check its internal RAM with a very quick read write of most of the RAM. It then does a rapid ROM checksum.

But during runtime it sets a watchdog timeout. I can't remember the exact details but I think it used an external timer that had to be reset by the MCU chip if it is healthy. If this didn't happen then the external hardware assumed the MCU was in a crash state and it sent a reset pulse to the MCU chip.

If it failed the ROM checksum the MCU deliberately ran itself into an endless loop waiting for the hardware to reset the MCU so it could try again... and again and again...

So maybe your system has this type of watchdog reset? Can you dump out the ROM code from the MCU? Note that I've not played with the MC6802 but I have played with MC6801 and the EPROM window version.
__________________
Regards, Jeremy G0HZU
G0HZU_JMR is offline   Reply With Quote
Old 12th Sep 2017, 2:30 pm   #8
G0HZU_JMR
Octode
 
Join Date: Sep 2010
Location: Cheltenham, Gloucestershire, UK.
Posts: 1,198
Default Re: Help with 6802 Microcontroller

I had a quick skim of the datasheet for the 6802 and it looks like it is a dedicated CPU with no internal ROM. I worked on the other variants of 680x where the chip could act as an MCU or a CPU depending on the mode pins (set during reset).

The runtime ROM was mask programmed internally as the chip ran as an MCU when in the ECU. It's still possible to dump out the ROM but it is quite fiddly to do it. But in the case of the 6802 CPU you could just read the external memory chip(s) to get the program code to see what it is supposed to do?
__________________
Regards, Jeremy G0HZU
G0HZU_JMR is offline   Reply With Quote
Old 12th Sep 2017, 6:16 pm   #9
SiriusHardware
Octode
 
Join Date: Aug 2011
Location: Newcastle, Tyne and Wear, UK.
Posts: 1,408
Default Re: Help with 6802 Microcontroller

Peter, what is the make / model number of your generator and what exactly is the fault history here?

Have you always (or at least for quite some time) owned this item and did it work OK originally?

Did this problem start off as small / occasional and progressively get worse, or was it working one day, and then straight on to relatively severe problems the next?

One possibility is that you are the victim of 'bit rot', which is the gradual fading away (over time) of the code stored in the firmware eprom.

If so, the only cure would be to obtain a copy of the original code from someone with a working unit and refresh the content of your eprom, or have someone program that code into the same kind of EPROM and swap it into your CPU board.

I'm guessing you don't have a general purpose EPROM programmer / reader, since you've already stated that you are more familiar with single chip microcontrollers such as PIC devices, and not so familiar with classic 'discrete' CPU systems like Z80, 6502, 6800 and so on.
SiriusHardware is offline   Reply With Quote
Old 12th Sep 2017, 6:50 pm   #10
G0HZU_JMR
Octode
 
Join Date: Sep 2010
Location: Cheltenham, Gloucestershire, UK.
Posts: 1,198
Default Re: Help with 6802 Microcontroller

I had a quick skim over the circuit looking for components that might age and fail and my first question would be about 1uF caps C10, C11. What kind of caps are these and are they in good health? These caps look to be part of a level shift/detect circuit associated with a couple of JK flip flops that connect to the reset line.

Is C25 in the monostable circuit OK? (4.7uF) C25 is next to the MC6821 PIA chip.
__________________
Regards, Jeremy G0HZU
G0HZU_JMR is offline   Reply With Quote
Old 12th Sep 2017, 8:49 pm   #11
PETERg0rsq
Hexode
 
PETERg0rsq's Avatar
 
Join Date: Jun 2009
Location: St Helens, Lancashire, UK.
Posts: 361
Default Re: Help with 6802 Microcontroller

Wow...what a great response

Some good suggestions, which I will certainly follow up.

I will try and answer as many questions/comments as possible.

I have read all the ROM and EPROM chips. I read them several times and got validation between each read, so I believe my eprom programmer is reading them OK. I can certainly upload a copy, but I would not want to put anyone through too much trouble...just yet.

I do not believe there is a problem with the ROM/EPROMs as the signal generator will boot and run, maybe 1 in 100 starts! I could re-burn the EPROMS, but not the ROM. Certainly worth a try.

The signal generator is an Adret 742A 2.4GHZ RF generator (never seen one before, but has CPU board and front panel same as Adret 730A.). It is my main generator. I bought it about 2 years ago not working, and fixed a fault in one of the DAC's, and used it regularly until about 2 weeks ago when it just failed to fully power on. I powered on and off a few times and it worked for a short while, then failed again, and is where I am today!

I have tested the operation of the reset circuit, and it works fine. PA monitors the floating 5V line, and when 5V it is up, PA turns ON and applies 5V to RESET.
When the 6802 sends out an 1000 to 17FF hex address the RESET line is driven low via SN1, SN6 and SN3. I will replace both capacitors though as a precaution.

My diagnostics have not lead me to C25, as do not really understand the function, other than pulses the PIA CB1 interrupt flag. I do not know the meaning or function of "MONO" (french abbreviation!) Unfortunately I can not read the PIA as it is hidden behind a heatsink!
Again worth replacing the capacitor.

I like the possibility of there being a watchdog timer, but how to see it?

Tonight I will get a full reading of the 6801 ports during a failed boot, and see what I can read.

The information from MrBungle yesterday was very helpful in understanding how the 6802 boots from the ROM. I had read the data sheet many times before, but not understood the booting references.
I can see the top two Bytes on my logic diagrams from the logic analyser as the first instructions as it boots.

Sometimes the 6802 will stop due to an external reset, and sometimes it seems to just keep on running (when successfully boots it boots up, then WAITs for an interrupt from the front panel (INT.CLAV/MAN) then wakes up and processes the information, then WAIT for next interrupt.
However the boot to fail time is variable.

David, all the address and data bits change during the booting (I will post a picture of the activity later), but I noted that before the RESET goes high to start the booting, that all the Address pins are LOW, except A0 which is HIGH!

I think that covers it.

Tonight I will try and capture a good boot sequence, as well as a bad boot sequence (reading the ports on the 6802) and see what differences I can observe. I should also be able to read what the program is doing by observation.

First to replace those capacitors (without dislodging all my probes)

Thanks again
__________________
SPECIALIST.....Knows everything about nothing
EXPERT..........Knows nothing about everything
PETERg0rsq is offline   Reply With Quote
Old 13th Sep 2017, 10:46 pm   #12
JohnBHanson
Hexode
 
Join Date: Aug 2009
Location: Worthing, Sussex, UK.
Posts: 250
Default Re: Help with 6802 Microcontroller

6802 is a 6800 but accepts a single phase clock (xtal).

On start up it reads the two bytes at the top of memory (locations 0xfffe and 0xffff)
and these are loaded into the program counter.

Note 0xfffe contains the most significant byte, oxffff contains the least significant byte

it will then start executing code at the program counter (interrupts are disabled at
that point).

NMI is by definition always enabled. It could be that the 6802 is getting an NMI
and that is causing the crash - worth a check.

I have had a quick scan of the instruction set and I don't think the CPU can issue a reset onto the bus - something else must be triggering the reset.

It could be that an external watchdog has been fitted and this is hitting the reset.
JohnBHanson is offline   Reply With Quote
Old 14th Sep 2017, 12:07 am   #13
PETERg0rsq
Hexode
 
PETERg0rsq's Avatar
 
Join Date: Jun 2009
Location: St Helens, Lancashire, UK.
Posts: 361
Default Re: Help with 6802 Microcontroller

I managed to save a logic trace of a good boot and a bad boot (unfortunatly the R/W pin was not recording on the good boot

It shows something quite interesting!!

John just to answer your points first.

NMI is connected to PA which also triggers the RESET. NMI goes HIGH significantly before the RESET goes HIGH, and stays HIGH until the power is turned OFF

The circuit uses address bits A11 to A15 (0x1000 to 0x17FF) to externally turn the RESET line OFF via logic chips SN1 and SN6, resetting SN3.

However my problem seems to be with the first boot instructions, as I have compared the first instructions after RESET goes HIGH, and there is an immediate difference I can not explain.

On the good boot the Address sequence was:-

FFFE, FFFF, C3CD, C3CE, C3CF, C3D0, C3D1

The first two being the reset addresses and read FF, and CD on the DATA lines from ROM1 respectively.

These are all ROM2 Addresses

On a bad boot the sequence was:-

FFFE, FFFF, FFCD, FFCE, FFCF, FFFF, FFFF

these all being ROM1 addresses! (A13 to A15 are chip select bits)

The RESET addresses also reads FF and CD from ROM1 respectively.

Any idea why the RESET addresses both read the same results, but immediately the 6802 starts outputting different addresses?

It looks like the most significant byte is getting corrupted to 0xFF

I replaced SN9 and SN11 in case they were loading the address outputs.

All other 6802 pins are identical (but I will confirm tomorrow as not monitoring at moment, but have checked they are all correct to schematic)

I have just noticed that the addresses A8 to A15 are 0xFF (and occasionaly they change to 0x00) for a long time, before it starts addressing other ROMs

These result in reading in 0xFF on the data lines (confirmed by looking at the ROM image)

Could the 6802 be faulty?

Peter
Attached Thumbnails
Click image for larger version

Name:	Untitled-3.jpg
Views:	45
Size:	88.0 KB
ID:	149408  
__________________
SPECIALIST.....Knows everything about nothing
EXPERT..........Knows nothing about everything
PETERg0rsq is offline   Reply With Quote
Old 14th Sep 2017, 6:37 am   #14
MrBungle
Octode
 
MrBungle's Avatar
 
Join Date: Jun 2016
Location: South West London, UK.
Posts: 1,637
Default Re: Help with 6802 Microcontroller

Possible. Worth checking that nothing else is jamming the bus up. A couple of the devices have DMA by the looks (68488 for example). Worth checking that isn't trying to talk to the bus as well (not sure how to go about that to be honest).
MrBungle is offline   Reply With Quote
Old 14th Sep 2017, 8:00 am   #15
ionburn
Pentode
 
ionburn's Avatar
 
Join Date: Dec 2014
Location: Lincoln, Lincolnshire, UK.
Posts: 240
Default Re: Help with 6802 Microcontroller

Perhaps a step sideways but if the ROM / Eprom adressed on startup is removable is it possible to program a replacement with test program to test the heart of the system? The 6802 has on board RAM if required.
ionburn is offline   Reply With Quote
Old 14th Sep 2017, 8:02 am   #16
JohnBHanson
Hexode
 
Join Date: Aug 2009
Location: Worthing, Sussex, UK.
Posts: 250
Default Re: Help with 6802 Microcontroller

Yes the first byte is being corrupted to 0ffh sometimes.
Two options

1. There is a buffer between the eeprom and the data input to the 6802 that is not being enabled fast enough after reset the the cs or oe input to the rom is not going
active. If you can add these signals to the logic analyser trace.

2. There is something else on the bus that is pulling all the address lines high.
(Try removing all the other uv-eproms and see if you get a better reset trace).


I think 1 is more likely.

What is happening is the first byte read by the processor is getting changed to 0xff. Thus the processor is reading the wrong vector and then starts executing the program from the wrong location.

With eraseable eeproms you can get the effect that the program deteriorates over the years but is still readable at slow speed. If you are sure you can read the uv-eeproms successfully then try re-programming them without erasing them. Just to be sure are the labels still stuck on them as a few years of normal light will start to erase uv-eeproms.

Just an idea.
JohnBHanson is offline   Reply With Quote
Old 14th Sep 2017, 8:18 am   #17
JohnBHanson
Hexode
 
Join Date: Aug 2009
Location: Worthing, Sussex, UK.
Posts: 250
Default Re: Help with 6802 Microcontroller

Just got the circuit diagram. Worth checking the clock is ok - look at pin extal and check it is a stable waveform with no glitches. Looks like the microprocessor is clocked
via T2 transformer and the 'range' led used to check the clock is ok. Very strange
JohnBHanson is offline   Reply With Quote
Old 14th Sep 2017, 5:49 pm   #18
Jon_G4MDC
Hexode
 
Jon_G4MDC's Avatar
 
Join Date: Nov 2015
Location: Welwyn Garden City, Hertfordshire, UK.
Posts: 279
Default Re: Help with 6802 Microcontroller

And watch for the EProms and paper labels - or slightly translucent or missing ones!
I did my pieces over a board that worked sometimes but not at other times.
Light getting in the EPROMs was the root of it all. They want total dark. Other advice about partly erased etc - I take with gratitude.
Jon_G4MDC is offline   Reply With Quote
Old 14th Sep 2017, 10:02 pm   #19
PETERg0rsq
Hexode
 
PETERg0rsq's Avatar
 
Join Date: Jun 2009
Location: St Helens, Lancashire, UK.
Posts: 361
Default Re: Help with 6802 Microcontroller

The "range" LED will light if there is no clock.
The 10 MHz clock I guess is isolated via T2, divided by SN2 and level shifted by Q3/SN1. All looks OK, and I get a good "E" clock which is derived from the EXTAL input.

Anyway I seem to have a partial success

I hooked up the last few channels of my logic analyser to SN9/SN11 5V supply, ROM1 CE, ROM2 CE, ROM1/2 DE and the ROM 5V supply and

The signal generator boots up perfect every time, and doesn't lock up!

I will have to leave it for tonight, but tomorrow I will try and find out why connecting the logic analyser makes it work.

pods state 200 KΩ by 3 pF so will have little effect on the logic, but obviously enough to change the timings!

Will keep you informed of what I find.

Peter
__________________
SPECIALIST.....Knows everything about nothing
EXPERT..........Knows nothing about everything
PETERg0rsq is offline   Reply With Quote
Old 15th Sep 2017, 7:54 am   #20
Ancient Geek
Tetrode
 
Join Date: Aug 2017
Location: Chipping Sodbury, South Gloucestershire, UK.
Posts: 53
Default Re: Help with 6802 Microcontroller

Peter, I'd have a look at the rom size jumper/dip switch labelled f/g on the schematic, and maybe the two rom ce pullups. I think it's likely that your logic analyser has weak pullups, and that may be why it started working.

Last edited by Ancient Geek; 15th Sep 2017 at 7:56 am. Reason: Additional point.
Ancient Geek is online now   Reply With Quote
Reply

Thread Tools



All times are GMT. The time now is 5:48 pm.


All information and advice on this forum is subject to the WARNING AND DISCLAIMER located at https://www.vintage-radio.net/rules.html.
Failure to heed this warning may result in death or serious injury to yourself and/or others.


Powered by vBulletin®
Copyright ©2000 - 2017, vBulletin Solutions, Inc.
Copyright ©2002 - 2017, Paul Stenning.