Initial Test of an MV1200 microcontroller

Initial Test of an MV1200 microcontroller

Home

This is a first look at the device, I just hooked it up. Complete specs and price list are available at the vendor: www.star.net/people/~mvs
(see footnote 1)

The MV1200 is a low cost stand alone BASIC programmable microcontroller. The evaluation kit comes with a single 20 pin DIP (Dual Inline Package, the familiar bug shaped integrated circuit) The floppy contains utilities for both BASIC and assembly language programming of the chip.

NOTE: The BASIC interpeter will be overwritten the first time you download an assembly program. I did not see any utility for restoring it.

The absolute maximum ratings are +7 and -1 VDC on the input pins, however I put every combination of RS-232 voltages on them and did not damage the device.

SAMPLE CIRCUIT

IBM PC                       MV1200
9 pin
serial
port                                             + 5 VDC
                     Diode 1N4002 or equiv            | 
  33K ohm resistors  |---------------->|--------------|                
  (or,or,or)         |                                |                
                     |   _________________________    |                
Pin 7 ---/\/\/-------+--|pin 1 Reset      Pin 20  |---|                
Pin 2 ---/\/\/----------|Pin 2 RX           VCC   |                    
Pin 3-------------------|Pin 3 TX                 |
                        |                         |
                        |                         |
                        |                         |
                        |                         |
                        |                         |
                        |                         |
Pin 5-----------------+-|Pin 10 Ground            |                      
                      | |_________________________|
                    __|__                                                  
                     ___
                      _
(Note: A previous version of this page did not show the connection between Pin 5 and Ground..oops. It didn't affect circuit operation, althoughit's always better to keep your grounds 'common'.)

Testing the Circuit

The disk comes with a program called echo.bas witch will recieve a character from a terminal program, increment it by one, then echo it out.

The chip's default speed is 2400 bps, and assuming it is on com1, prepare the port by typing

mode com1,2400,n,8,1

The program is downloaded with the 'basic token' program, btoke.exe

btoke echo.bas

BTOKE v1.23
9 bytes uploaded

The program contains no error checking so it will not notice if you have the power turned off.

Then launch the terminal program, mvterm.com

MVTERM 2.2 (c) 1997 MVS Alt_H = help

1 @abcť¦ŁĄ˙ ˙

Unfortunately a string of garbage characters isn't too helpful. Actually I didn't have too much luck with MVTERM, but it is only 900 bytes long so you can't expect too much from it. I loaded up a shareware terminal called Telix but also didn't have much luck. Finally, using a divide and conquer method I checked both MVTERM and Telix at every supported baud rate and finally got telix to work reliably at 4800 bps. The chip will set it's baud rate to whatever it was downloaded at, so you can change it by typing:

mode com1,4800,n,8,1 then

btoke echo.bas

if you see 0, 1 or 2 garbage characters your term program is too slow for the chip..if you see 12 or 15 it is too fast. If everything is working right you'll see:

123MVS Uß
˙

That's a 123MVS, then about a 1 second pause, a big U, funny looking B, and a carriage return with a y umlaut. Thats not for certain, I've seen it with a tab after the 123MVS and without. The docs just say 'a serial string'.

I put an oscilloscope on the chip. Output is +5 VDC TTL (surprise). I think I'm having some problems since RS232 wants plus and minus 12VDC. The chip has a power up sequence, with that character string asserted on pin 3, and pin 11 goes low for 1/2 second. A 10K ohm resistor and an LED on that pin make a handy reset indicator. I also added a wire to reset pin 1 by touching it to ground.

So far I've been unable to get the chip to echo characters. The other programs included I can't get to work either. I could move on to assembly programs but that will overwrite the BASIC interepreter in flash memory. Unanswered questions:

Is there a way to tell if the BASIC interpreter has been overwritten?

Is there a way to restore it if it has been?

I'm real excited about this chip. I'm sure it does everything promised and it's my lack of knowledge at this point that prevents me from moving forward. The documention is extensive, although you can tell it was written by someone too close to the project, some of the beginner questions have been overlooked. I hope this page answers a couple of them, and I'll add to it as new info comes in.

MV1200 - Taking a Closer Look

I found out about this chip from MVS's ads in Nuts and Volts and Circuit Cellar Magazine. An altavista search on 25 Feb 98 for "mv1200" yields 14 hits, of which 1 is relevant. (The MVS web site)

Unfortunately the chip still won't report back reliably, at any combination of speeds or voltage levels. I ran it at both 4.5 VDC and 6VDC to no effect. The chip, like all chips, is susceptible to stray capacitances, what that your scope probe doesn't load it down.

Eventually, I stumbled on to:

Com Port and Chip 4800 bps.
(mode com1,4800,n,8,1 then btoke echo.bas)

Start up the Terminal Program: 9600 bps, 8,n,1 TTY or VT102 emulation, not ANSI
This works reliably.
ANSI works too but you get even more interesting garbage characters. Interestingly, this will give garbage if run a 6 Volts but at 4.5 you will see

123MVS

with no garbage characters or carriage return.
Also, MVTERM works now fine too.

Schematic is still identical to above

Part Two: The program doesn't work

Echo.bas would blip the output, without any rhyme or reason. Also at this point I couldn't tell if my programs were being downloaded.

Trying other programs, I discovered togglo0.bas, which will toggle pin 11, putting a square wave on it.
The program is simplicity in itself:

rem BENCHMARK TO SHOW HOW 1MHZ 1200 RUNS FASTER THAN 4MHZ STAMP.
rem WITH 20MHZ XTL IT'S 20 TIMES FASTER!
5 toggle 0
goto 5
end
Putting a scope on pin 11 (See footnote 2), I discovered about 1/2 second of an approximately 1 Khz square wave on pin 11. This was very good news as it told my BASIC interpreter had not been overwritten, and that it was accepting programs. I modified the program to drive the pin low, or high, and it worked.

The problem seemed to be that the GOTO wasn't looping correctly, or the program was terminating after 500 cycles or so. I still haven't solved this one. I've been modifying the code, making it a sub routine, etc.

The BASIC documentation is limited to about one side of one page, single spaced. Some of the commands take parameters that are not documented. The assembler docs look much more extensive, but I haven't gotten around to reading them yet.

Part Three: It's a big world out there, if you know where to look.

I first heard about the chip on the BASIC Stamp list server. Someone chimed in with, 'it just sounds like an Atmel AT90S1200'

Doing a web search on "AT90S1200" and got 134 hits. Found some good info.

I'll keep updating this page as I sort through and test what I've got now.

---------------------------------------------------------
Update March 2, 1998
Discovered a source of AT90S1200 chips: www.insight-electronics.com Call 1-888-677-3135 and ask for Credit Card Sales. They sell both the DIP and SOIC version so I ordered:
2 SOIC @ $4
3 DIP @ $3
and $5 shipping for a total of $22.

Found some links:
http://www.avrbasic.com Home Of AVR Basic - Updates, Appnotes, Docs,
http://www.avrone.com AVR Products and Resources
http://www.equinox-tech.com AVR Programmer and Development Tools
http://www.sistudio.com SimmStick (AVR) Boards

March 5
The chips arriverd from interstate, in a box way too large, about 2 feet long by 4" by 4" for two tubes containing five chips in all. Otherwise flawless.

March 8 mailed $14 to mvs for "as many mv1200's as this will buy"

Peter H. Anderson added a page on the MV1200 to his already excelllent site, http://www.access.digex.net/~pha

I connected the MV1200 to a bank of 4 D batteries and pulled every nonessintial, thinking I might have a grounding problem. Nope. I've now downloaded toggle0.bas (normally puts an aprox 1khz square wave on pin 12) and gotten a flaky looking 50 mv 1Mhz clock sitting on top of +5 VDC. A guy named Mark Moulding left a post that his MV1200 worked right out of the box, so I'll hold off for now until my next chips get here and work on the theory I've damaged it. (It seems extremely robust, but I have done everything except hook a sparg plug cable up to it!).

Part Four: Working with raw AT90S1200 chips
I decided to check out the included assembler. There was a demo program to blink an LED. I tried their demo program assemble.bat, but it died..couldn't find file mvavr.exe. I checked on the floppy, not there. Looking at assemble.bat I see:

rem ASSEMBLE
avrasm -i blnk1200.12 blnk1200.lst blnk1200.hex
rem DOWNLOAD WITH MVP1200 PROGRAMMER
mvavr blnk1200.hex

Apparently there is something else to buy. Checking out the other sites on the web, they all require a programmer. I have a Dontronics DT001 on a shelf around here, but I don't want to mess with that since it violates the Purity Principle (see footnote 3). However, I did discover a guy who worked out a zero component parallel port programmer. I'll make one and let you know the results at a future date.

more later...

27 March 1997
The new chips haven't arrived yet, but a call to MVS showed they are swamped..had a long, productice talk with Richard there, it seems this component is pretty popular. I'm still very enthusiastic about it.

Also got a flyer in the mail from WIRZ electronics http://wirz.com low cost AT90S1200 pcb's, among other things.

5 April 1998
The chips came in last week, and at last I'm updating this page..and it works. Lets take a look.
Of course, they don't work at first...I'm getting scrambled eggs out the serial pin. I decide to put a MAX232 TTT to RS232 Driver Reciever Chip on it..The two component distributors in town are Fryes and Norvac are both NTE, so in a metro area of around 1 million people if NTE doesn't make a version of the chip, you've got to mail order.
Wait, you say, there's a list of 5 suppliersdistributers on the Atmel page for Portland Oregon?
A typical conversation goes like this:

(Ring)
"Hello?"
"Do you sell Atmel Microcontrollers?"
"Yes!"
"Do you have any in stock?"
"No."
Almac/Arrow (yes, but none in stock)
All American (yes, but none in stock)
Insight Electronics (yes, but none in stock)
Marshall Industries (yes, but none in stock)
Pioneer Technologies (phone disconnected)

Fortunately I had a Dontronics DT.001 board sitting around and could pull a MAX232 off that. It works great--and I'm still getting cyrillic out of the serial port. By this time I have two laptops hooked to the thing, one to btoke and another to running a terminal program.

It doesn't work so hot for programming, because the output is innverted..not so bad for an AC data signal, a little more problematic for a bit banging chip. So I rearrange it so it's driving the input pin directly. No matter what key I press "echo.bas" returns an "f" or an "x".

I'm eventually down to the point watching the bits going in. Here's what the number one looks like:
(I broke down and put an image there instead..I'm not a masochist. Settings: On computer, type mode com1 9600,n,8,1. On oscilloscope, set for 5 volts per division, Timebase for .2ms, normal triggering not auto, and hold down the "1" on the computer. Twiddle with the trigger level on the and you should see an image similar to the one shown above, which is the number "101110011").

9 May 1998
I haven't updated the page in awhile, been working on other projects. Got an interesting email:

Just dropping you a line to let you know I'm following your page. When can I expect an update. I'm suprised there seems to be so little on the web on this one? I reread the footnote about the purity principle several times, I could write a book about ideas along the same line, but I don't think I'm very good at formulating those ideas into a neat package. Tiny, really cheap computers, that are easy to program without having to buy anything else, way cool! Preach mode on: We know technically its possible, and I don't have anything against people making money from technology, but I'm just tired of people trying to sell me hardware that I shouldn't need (eg. programmers) and arcane knowledge that I shouldn't need (eg. Book's on how to use their hardware). The rule seems to be "I can make it really cheap but it will be really hard to use, easy to use will cost you $$$$" Preach mode off. Thanks for blazing the trail Dave Carr Ontario, Canada

I've got partiallially on the breadboard a simple parallel mode programmer (not parallel port), want to finish that soon. Got a call from another guy who spent two days banging his head, I couldn't help him much except that the internal oscillator is unreliable, I think that's why atmel ships the chips stock with the oscillator set to off. An altavista simple search on mv1200 gives 22 hits, of which I think three are relevant. A similar search of Usenet gives a traffic of about 3 messages a month. The BASIC Stamp had a good couple years but the end of the STAMP age is in site. Great documentation and a loyal user base are the only things preventing this chip from taking off..imagine the exponentially better circuits you could design with five of these chips while still keeping your parts cost under ten bucks! Time is kryptonite, gentlemen.

May 17, 1998

Tried to breadboard a ultasimple parallel mode programmer to do read and set the RCEN oscillator bit. Since:
"In addition, the AT90S1200 is designed with static logic for operation down to zero frequency."
so I thought I could do it just flipping switches but couldn't get it to work..I'll make a page with the schematic and what I'm doing, maybe someone can trouble shoot it for me.

A mystery solved?

This is from ATMEL's AVR FAQ:
"Question: What does "AVR" stand for?
Answer
Nothing, it's just a name."

BUT look who wrote a white paper on AVR
"AVR Enhanced RISC Microcontrollers
Alf-Egil Bogen
Vegard Wollan
ATMEL Corporation
ATMEL Development Center, Trondheim, Norway"

Perhaps "Alf" and "Vergard" can solve the remaining "R" mystery.

May 19,1998
Found this, some might find it relevant.
AT90S1200 rev.D errata sheet
Effect:
After power up the micro is not working. Only the XTAL is working. External reset can not change this state. This state can only leaved by bringing VCC down to 0V.

Conditions:
This can occur, if VCC rising slow.

Explanation: There is an application note from Atmel: AVR190 Look at page 3 section 3: I have it tested with an AT90S1200 rev.D and its true. You must rise VCC in at least 100ms! Otherwise the micro does absolute nothing ! Look at page 4: In opposition to this, I found, that this time can not be increased with an external reset circuit. Using of an external clock source have no influence too.

Work around:
•Use not the AT90S1200 rev.D. •Use a cost expensive power supply with the desired power up timing(you must add power transistors, comparators, timers and watch, that no current from peripherals to the micro flow before power up). •Use a micro with external reset circuit (e.g. AT89C2051 & MAX690) •Use a micro with a right working internal power on reset (e.g. Dallas DS80C320). •Wait for the AT90S2313 (it is planned to be avaiable on 1998).

Atmels answer:
See Application note AVR190.
The new AT90S2313 have solved this problem (because is not avaiable today).

Other affected devices:
AT90S8515 (reading in application note, not tested)

New:
I have tested a device AT90S1200 rev.F and this bug is no longer valid. Be sure that you order AT90S1200 rev.F or later!

Author: Peter Dannegger
E-mail: danni@specs.de

May 21, 1998
Hi! Just thought I'd let you know that at least one other person is playing with the AT90S1200 and MVR stuff. I had bought 2 MVRs and, while I can get them to power up and display a message (seemingly too long of a message, lots of "(010)" sequences after the sign-on message), I have yet to get either to accept any programs. I'm sure my cable is correct, and it toggles pin 11 at startup.

On another note, I bought a few of the AT90S1200 chips with the on-board ocs enabled. They work flawlessly using my cut-open parallel cable connected through terminals to a breadboard. I wish they had included an on-board voltage regulator, as using timeing loops to delay for x number of seconds works only at a given voltage, where voltage = speed of the chip.

I'm thinking of using the little guys as replacements for timers we see in some commercial equipment we work on. (Commercial dish washers) There are a lot of old units out there that we can no longer get timers for, or are just outrageously priced mechanical types.

Keith Rolland

9 June 1998
I'm moving across country next week so this page will be static for awhile. It will stay at this url for many moons to come, however. I hope to come back soon with a low cost parallel mode AT90S1200 programmer, unless somebody beats me too it. (I wish somebody would!) more later...

This just came in:BR> I also start to develop experiments with MV1200 single chip computer. Here is my comments. I hope it could help and encourage other guys to do the same. Please excuse my poor english.

Some tips:

1) Since they are using the internal RC osclillator the supply must be VERY STABLE. Otherwise serial comunications will not be reliable. Best is power with 12 or 9 volts and use a 78L05 regulator.

2)Dont let any lines or spaces when writing programs like a= 5. Just write a=5. Syntax is very important. There are no error messages. Do not use upper cases. Allowed variables are only a to h.

3)There are only 64 bytes of avaiaiable EEPROM to user. This means only about 15 or 20 lines of code.Then keep the code well optimized as possible.

4)PWM instruction at pin 11 exibiths strange behavoir. I have some chips where the PWM.BAS works and others where this dont work. Some chip keeps the pin 11 outputing PWM even if PWM.BAS program is overwrited.

5)The sequence of power up and power off as well connecting with Serial port of PC seems have crucial importance, as sometimes the total program that I was working and monitored by the MVTERM as soon as the chip was placed in the bench test suddenly and misteriously stops. This was alleviated when I soldered in my programming board a 4 pin connector to PC (Reset, RX,TX, and GND) ad a 2 pin power VDC.

Even with these drawbacks the chip is very interesting and I already have many appications for it like interfacincing with STAMPS, LCDs, RF modules, Serial Servo Controllers , remote encoder/decoder and many others. I also hope that soon could be avaiable more powerfull versions of Basic MV1200 as there are released newer versions of the ATMELS 90 AVRs.

Thanks for your attention

Antonio Carlos Jacques

Footnotes:

(1)How come that's not a clickable link? Many more robots than people will ever read this page. 99% of them are time, bandwidth and money wasters from our perspective. If a human cares enough to know what's at the other end of that link, they can bear the burden of typing it in manually. Each page does contain one link, however, so that search engines can index it.

(2) I'm sure by now you have figured out an oscilloscope is an indispensable test tool. I picked up a good used Leader LBO-513 single channel 10Mhz for $75. Your life will definitely be easier with a scope.

(3) PREACH MODE ON: The Purity Principle: A coworker and I used to manage a 25 node DOS LAN. We had a thing going where ever more elaborate screens were drawn, using only batch files and files included with DOS. As a net admin, you deal with many different computers, and you can't load your favorite software on each. That's why I still edit small files with edit.com and program in QBasic. He was into colors and cursor positioning etc. I just wanted DIR to sort my directory listing with the Directorys first and files last. Or that's how it started, at least. Then came using a BT Router as a text editor (it was in the room, I could telnet to it from a VT52 terminal, and it had the crucial 3 1/2 inch floppy drive on it). That why I have a page about a completely freeware IPX network. My pages have text art instead of GIF's because someone like me, years from now, on a flaky antique WYSE-50 terminal over a bad connection in the middle of Absurdistan, will be trying to read it. That's why I think a BASIC microcontroller with no other parts is kewl. PREACH MODE OFF.