MC68B50 TTL Serial case of a curious missing bit. - Page 1
Forum section: electronics / projects

author: theworldbuilder
author_rank: Regular Contributor
timestamp: June 18, 2019, 09:24:09 pm
content: Hi all,In a homebrew computer I'm making I'm currently having this curious issue of a single bit consistently going missing over the USB to TTL serial connection between my PC and my single board computer.The expected start-up message should be: Cold  or Warm  start?The message I receive is as follows: /,$ /2 7!2- 34!24?The binary for the first message is:01000011 01101111 01101100 01100100 00100000 01011011 01000011 01011101 00100000 01101111 01110010 00100000 01010111 01100001 01110010 01101101 00100000 01011011 01010111 01011101 00100000 01110011 01110100 01100001 01110010 01110100 00111111The binary for the second is:00101111 00101100 00100100 00100000 00101111 00110010 00100000 00110111 00100001 00110010 00101101 00100000 00110011 00110100 00100001 00110010 00110100 00111111Comparing the first and second set of data from the last byte received backwards, you can see that from the second last byte the data is identical except for b6 (from right to left starting with b0).b6 is consistently low in the second set of data even though it is expected to be high for some bytes as seen in the first set of data.The MC68B50 is running at 7.3728MHz which is well above it's given spec but I've seen the likes of Grant Searle using it at these frequencies in his z80 computer:http://searle.hostei.com/grant/z80/SimpleZ80.htmlTo further this, on rare occasions the the data will come trough correctly and the computer will function as desired.Any suggestions or ideas as to what is causing this issue? And even perhaps how to fix it?I've done a good bit of digging myself but haven't been able to find much about it online.

author: mikerj
author_rank: Super Contributor
timestamp: June 18, 2019, 10:09:51 pm
content: A dodgy connection between the ACIA and D6 on the data bus perhaps? You are playing with fire running a clock at almost 5 times the datasheet maximum though, this kind of thing could easily be caused by a timing violation within the IC logic.

author: ChristofferB
author_rank: Frequent Contributor
timestamp: June 18, 2019, 10:16:42 pm
content: okay, so first thing: make sure D6 isnt stuck. get a probe on there and check it actually transmits data. You'd be amazed how long a simple computer can get with a stuck bit.2nd make sure it's decoupled VERY well. solder an 100 nf directly between the power legs on the chip. oh, and check that your clock has nice clean rises and falls.If that doesn't lead to anything interesting make a simple flip flop clock divider and put it between the main clock and your uart. If you have a slower divisable xtal, ideally an 1.8432mhz one, try that and adjust the prescaler in the uart to 4 times less than what it was. If this works you can just copy the main oscillator circuit for the cpu and have one with the 7.3728 mhz and one with the slower UART clock.Hope that helps!

author: ChristofferB
author_rank: Frequent Contributor
timestamp: June 18, 2019, 10:18:11 pm
content: Oh, and also: going beyond freq. spec, it can very well be that some versions, manufacturers or even batches will handle it fine, and some just can't.Either way having a 2nd oscillator is a small modification.

author: theworldbuilder
author_rank: Regular Contributor
timestamp: June 20, 2019, 09:43:24 pm
content: Quote from: mikerj on June 18, 2019, 10:09:51 pmQuote from: ChristofferB on June 18, 2019, 10:16:42 pmThanks for the responses guys. I've done a bit of digging around the board, checking for a stuck bit, ensuring correct decoupling and making sure the clock is behaving itself. Unfortunately all checks out as okay here.I then simply reprogrammed the EEPROM and slowed the clock down and as expected the chip worked a-okay.I'm still unsure as to exactly what is causing the issue as I have tried it with multiple different MC68B50s I have on hand and they all present the same issue. I'm starting to think that perhaps it's related to my clock frequency. Perhaps the clock is running slightly too fast or slightly too slow? This would answer as to why in certain cases the connection is perfectly fine and I can use the computer without issue. Perhaps the crystal just happens to drift just into spec for the baud rate?

author: ChristofferB
author_rank: Frequent Contributor
timestamp: June 21, 2019, 01:40:53 am
content: Ahh I'm beginning to remember something..I think the way Grant Searle has implemented the E line, there's a mild timing issue. I don't recall specifically but remember, the 6850 is made for the Motorola 6800 chipset - this cpu uses a 2 phase clock and has that E line as a native thing. Maybe it's your z80 that's slightly off spec. Or, probably within spec for z80 family chips but different enough from the one Searle used to cause issues.Remember, you are also overclocking your Z80 by almost 100%! And the baud rate he uses is VERY fast. Try messing with the prescaler. To run the BASIC he does, you'll never feel the difference between 19200 baud and 115200.