Microsoft Basic 6502

Written in 1976, Microsoft BASIC for the 8 bit MOS 6502 has been available for virtually every 6502-based computer. Also for the SBC’s on this site: KIM-1, SYM-1, AIM 65 and as a port of Applesoft on the Apple 1.

Binary versions and manuals are on the pages dedicated to these machines:

Sources of early Microsoft Basic on 6502 are available on pagetable blog by Michael Steil

Build binaries from source on a Linux system (Raspberry PI OS)

First install CC65 package, the assembler and linker are required.

You need the CC65 package, a C and Macro assembler and linker for the 6502.

https://github.com/cc65/wiki/wiki is broken, https://cc65.github.io/getting-started.html is fine.

git clone https://github.com/cc65/cc65.git
cd cc65
make
sudo make avail

Now get the MS Basic source and assemble the binaries

https://github.com/mist64/msbasic
git clone https://github.com/mist64/msbasic
cd msbasic
./make.sh
cd tmp
ls

and you will see a directory of binaries (.bin), symbol table (.lbl) and object files (.o)

Compare the binary files with the binary files in the msbasic/orig folder and you will see hopefullyy they are identical!

It is not only nice to see the source, now you are able to customize a Microsoft Basic to your likings.

Steps as advised in the pagetable description:
1. Create a .cfg file by copying an existing one.
2. Adapt the make file for the new target.
3. Change the platform specific source files

and assemble again.

For example, the KB9 Basic can be changed:

  • Character in//out to a serial device
  • Control-C handler update
  • Remove the ROR workaround
  • Save/load to another storage device
  • See the KIM Kenner articles for patches on KB9 Basic

An example is this post by Gordon Henderson who made a serial interfaced Commodore Basic by creating a new variant and tweaking some conditionals, replacing the screen editor with the line editing interface of older versions.

KB-9 stands for Microsoft Basic V1.1 for the KIM-1  with 9 digits precision. .
Scanned manual
The original KIM-1 KB9 Microsoft Basic V1.1, audio wave, binary and papertape format

Noise fix for Replica Ten

and perhaps other Replica’s with the Propeller IC. Report by Didier.

Didier has 2 replica, the Red one Ten, the older one green, both With a propelle which had the same problem but it occurred rarely

in fact apparently all the Replica 1 with the Propeller IC ten are affected more or less by this problem.

Issue

Users have reported every few seconds a “/” appears on their screen followed by a linefeed. This renders any data entry impossible.
The Replica 1 seems to act like an antenna, moving hands above the Replica can trigger it.
The problem is reported by Reactive Micro as Screen Noise Issue.

Fix by Reactive Micro

Try adding a 100k resistor to the USB module as pictured below. And if there is still noise then add a .1uF cap (100nF) to Pin28 of the Propelelr to either Ground or +5v.

As little as 10k can be used for +3.3v pullup, but anything smaller risks damage to the FTDI module. 100k is much safer in all regards. This helps hold the data line high. It seems the RX line is held high by default. And both lines are held high when connected to a USB data port, which is why the noise issue is not seen when connected to a PC. You can connect the resistor most simply to the USB module. Or to the rear of the PCB to pin 39 (Tx) and pin 12 or 32 (+3.3v) of the Propeller.

Fix by Didier

The Reactive Micro fix dows only reduce the noise but does not stop it completely.
But adding two 2 resistors definitively fix the problem.
The real problem is the floating lines STROBE and DA of the Propeller.

To really understand this noise bug you need to check at the same time:
the circuit diagram, the Wozmon initialization, and the Propeller code

the other modification are for a change from a PIA to a PIAT for my 6502 monitor
PIAT (6524) = PIA 6250 + TIMER (as it is mounted with my patch the PIAT replace totally the PIA
without any software change)

2 lines CA and STROBE are input at the same time…
they are acting like an antenna and capturing noise
for example, if I pass my hand 5 cm above the propeller
I start to see:
/
/

as if the replica was resetting.

In fact, when the replica received a full buffer of junk it jumps to reset code…
The problem comes from the propeller code…
STROBE is programmed sometimes as input and sometimes as output to permit both the PS/2 and ASCII keyboard
it is possible to fix the propeller code to avoid the parasite but in that case, you lose the ASCII keyboard

To fix that on the back of the board add a resistor of 10K between the STROBE PIN and GND
The same problem occurs for the DA line but it only happens during the time the machine was powered up but not yet reset… the same way a 10K resistor between DA PIN and GND fix the problem

The fix for STROBE and DA is therefore two resistors added on the back of the PIA.

post

Elektor Computing 5 German

Thanks to Martin Seine I have added the German version of Elektor Computing 5, dedicated to the EC65 systen, Z80 card, 65818 etc.

And have a look at the EC65 Z80 card page also

 

Solid State Tape Device for the (micro)KIM


Willem Aandewiel designed a tape device for the (micro)KIM. With a Wemos D1, ES8266 and ATTiny and some clever software to make the KIM believe a audio cassette recorder is connected.
All details here on Willem’s website.

 

 

The device in action:
https://youtu.be/R_zD5T_khKs

Willem has now published the next generation, together with a 32K RAM card, of this device.

post

Cassette interface for Micro-KIM

or KIM Clone!

By Timothy Alicie

Demonstrates his  design for a cassette interface for the Micro-KIM single board computer from Briel Computers (a replica of the 1970’s KIM-1 SBC). The original KIM-1 has a built-in cassette interface, but the Micro-KIM replica does not, so I designed and built his own. The design uses a single PIC micro-controller, is very reliable, supports all HyperTAPE speeds, and has the ability to save and play back recorded data into the KIM-1.

post

Home-Brew Cassette Interface for Micro-KIM

Design by Timothy Alicie

Demonstrates his design for a cassette interface for the Micro-KIM single board computer from Briel Computers (a replica of the 1970’s KIM-1 SBC). The original KIM-1 has a built-in cassette interface, but the Micro-KIM replica does not, so I designed and built my own.

The design uses a single PIC micro-controller, is very reliable, supports all HyperTAPE speeds, and has the ability to save and play back recorded data into the KIM-1.


From the source of the microcontroller:

All design files (PCB gerbers, source and hex files PIC microcontroller) in this archive.

/*******************************************************************************
* Micro-KIM Cassette Interface, PIC16F6/27A/28A/48A Implementation
*
* The original KIM-1 uses a PLL and a comparator to implement the receive
* path of the cassette interface. These two parts have been replaced by
* this implementation which runs on a PIC microcontroller.
*
* The KIM-1 cassette format encodes each bit using two tones:
* 1) A high-frequency tone of 3623.188 Hz (1.5X the low-frequency tone)
* 2) A low-frequency tone of 2415.459 Hz
*
* Each bit is broken up into three periods, each of which is 2.484 ms long,
* during which either the low frequency or the high frequency tone is played.
*
* The high frequency tone is always played in the first time period, and the
* low-frequency tone is always played in the last time period. A bit is encoded
* as logic ‘1’ by playing the low-frequency tone in the middle time period, and
* a logic ‘0’ by playing the high-frequency tone in the middle time period:
*
* Logic 1: encoded as HiFreq-LoFreq-LoFreq
* Logic 0: encoded as HiFreq-HiFreq-LoFreq
*
* The KIM-1 cassette interface uses a PLL tuned to distinguish between the
* high and low frequency tone. The output of this PLL is then fed into a
* comparator to generate a logic ‘1’ whenever the high frequency is detected,
* and a logic ‘0’ whenever the low frequency is detected. This logic signal
* is analyzed by the KIM-1 to reconstruct the bit-stream stored on the cassette
* tape. Each bit begins with a low-high transition, and the bit value can be
* determine by the timing of the falling edge generated by the high-frequency
* to low-frequency transition within each bit.
*
* The job of the PIC KIM cassette interface implementation is to perform the
* same function of the original PLL and comparator: analyze the input signal,
* and generate a logic ‘1’ output whenever the high frequency is detected, and
* a logic ‘0’ output whenever the low frequency is detected. The implementation
* is rather simple: analyze the timings of zero-crossings detected in the input
* signal, use this information to determine the frequency of the input signal,
* and generate the output signal based on if the input signal is closer to the
* high frequency, or closer to the low frequency.
*
* The original KIM-1 tape algorithm uses a bit period of 7.452 ms, which is
* three periods of 2.484 ms each. Within each sub-period, exactly 9 cycles of
* the high frequency tone can be played, or exactly 6 cycles of the low
* frequency tone can be played.
*
* Jim Butterfield popularize an alternative called HYPERTAPE, which reduces
* these periods to speed up the data by a factor of 2X, 3X, or 6X. The only
* difference between the HYPERTAPE implementation and the original implementation
* is that the sub-bit periods are reduced. The 2X and 6X sub-bit periods are
* reduced such that a non-integer number of cycles of the high and low frequency
* tones are played within each sub-period. Thus, the PIC detects the frequency
* based on half-cycles to fully-support HYPERTAPE.
*
* Interesting facts:
*
* Original KIM-1 cassette bit-rate: 134.2 bits/sec (402.6 baud, 3 symbols/bit)
* HYPERTAPE 6X bit-rate: 805.2 bits/sec (2415.5 baud, 3 symbols/bit)
*
* Each data byte is represented as two ASCII hex digits, so the effective data
* transfer rate is 8.4 bytes/sec for the original speed, or 50.3 bytes/sec for
* HyperTAPE x6.
*
* High frequency tone: 3623.188 Hz, or 0.276 ms/cycle
* Low frequency tone: 2415.459 Hz, or 0.414 ms/cycle
* Center frequency: 2898.551 Hz, or 0.345 ms/cycle
*
* Frequency detection based on half-wave zero-crossings:
* High frequency tone: zero-crossing every 138 us
* Low frequency tone: zero-crossing every 207 us
*
* Separation between high-frequency and low-frequency zero-crossing: 69 us
* Threshold between high and low-frequency zero crossing: 172.5 us
*
* Implementation Notes:
*
* The bi-color LED lights red when an input signal is present, but it does
* not contain the correct frequencies to be a valid KIM-1 bit stream, for
* example, voice input. The bi-color LED lights green if the input signal
* contains the correct frequencies to be a valid KIM-1 bit stream. While
* receiving data, the green LED should be lit solid to ensure reliable data.

* Comparator 1 (CMP1) is used to detect signal zero-crossings by adding a bias
* to the input AC signal of Vcc/2. The bias is used as the V- comparator input.
*
* RB4 is used to monitor the PB7 line to/from the KIM-1. In audio-output mode,
* (dumping to a tape), the KIM-1 drives this line, so we can use it to detect
* audio-output mode and light the LED when the KIM-1 is dumping data.
*
* Timer 0 (TMR0) is used to light the LED indicators for a certain time period.
*
* Timer 1 (TMR1) is set up to count at 1.0 MHz, and it is used to precisely
* measure the time between zero crossings.
*
* Copyright Timothy Alicie, 2017, Timothy Alicie
*******************************************************************************/

post

G.Eisenack Programmieren von Mikrocomputern CPU 6502 Skriptum

New book added tot the KIM-1 Books resources: (thanks netzherpes)

G.Eisenack Programmieren von Mikrocomputern CPU 6502 Skriptum

Memory Plus manual and photo

Thanks to Dirk Dral, an old friend from the days of the Kim Kenner Club, with articles in KIM Kenner 13 and 16 (traffic control, cassette Interface) I have published a quality photo of his Memory Plus and a quality scan of the manual.

He also sent me photosof his KIM-1 and the Radio Bulletin RAM and EPROM cards.

PAL-1 extensions

Motherboard 6 slot, 32K RAM , second 6532 board, now on Tindie for the PAL-1 (and Micro-KIM)

post

NOP testers

I built two NOP testers, simple standalone devices to do a simple sanity check test if this CPU is at least doing something that can be expected. Not a thorough test of speed, instructions, all address lines or datalines or control lines.