Subject: COP8 microcontroller FAQ

All FAQs in Directory: microcontroller-faq
All FAQs posted in: comp.robotics.misc, comp.realtime, comp.arch.embedded


Archive-name: microcontroller-faq/COP8 Posting-Frequency: monthly (20thish of each month) Last-modified: 20June1995 URL: http://www.nsc.com/
This article is a draft collection of information sources on the line of National Semiconductor Corporation ("National") COP8 microcontrollers. The following topics are addressed: 0) Changes Since Last Time 0.1) Why should I read this? 1) ABOUT THIS FAQ 1.1) Who put this FAQ together? 1.2) How can I contribute to this list? 1.3) What newsgroups will this FAQ be posted to? 1.4) May I post this FAQ to my local BBS? 1.5) Are there any FAQs pertaining to other microcontrollers? 2) ABOUT THE COP8 2.1) The COP8 microcontroller 2.2) COP8 flavors / Numbering Scheme 2.3) COP8 chips and approximate prices (in US $) 2.4) Advantages in implementing control applications on this family of microcontrollers 2.5) Techy Details 2.5.1) How fast are the parts? 2.5.2) What is the operating voltage of the devices? 2.5.3) How can I guarantee that my program will run reliably? 2.5.4) What kind of power savings features are available? 2.5.5) What about EMI? 2.5.6) Instruction Set 2.5.7) Can I hook up a LED to pins direct? 3) COP8 PRODUCTS 3.1) FTP sites 3.2) BBSs 3.3) Free languages and development tools 3.4) Free C compilers 3.5) Plans for COP8-based boards 3.6) Commercially available products 3.7) Contacting National 4) COP8 DOCUMENTATION 4.1) Periodicals 4.2) Data Books / Application Notes ---------------------------------------------------------------------- 0) Changes since Last Time Added a reference to coptools@esd.nsc.com (a support line for help on cop8 tools). Somebody pointed out to me the other day - Since the COP8 and the 8051 are modified harvard - they can do a load/store instruction in one instruction cycle. A Von Neuman machine can not do that. This makes (for memory intensive applications) a harvard machine almost 2 times as fast as a Von Neuman running at the same speed..... Maybe architecture does make a difference on a 8-bit controller.... 0.1) Why should I read this document? The COP8 is a pretty cool 8-bit microcontroller that has never had a lot of exposure into the hobbiest/smaller manufactures marketplace. I would like to change that. (& on the internet the indiviaul can do anything!) In a nutshell, some of the strengths of the COP8 are: o Efficient Instruction Set - 77% os instructions are single cycle/ single byte o Efficient Input/Output utilization - i.e. on a 44-pin package > 80% of this pins are devoted to I/O. Efficient pin usage facilitiates a cleaner hardware design and smaller die size = Overall cost reduction o Powerful Timers - i.e. processor-independent Pulse Width Modulation (PWM) and capture capabiliy - less software and processor overhead o Low Poer Consumption (Low Voltage / Low Current) o Multi-Input Wake Up (MIWU) - Only COP8 offers this unique feature o Wide range of temperature and power supply operation o Low cost Basic Family to address low-end 8-bit applications and feature family to address mid-to-high end 8-bit market And the Opposite side to the coin (have to be fair): o Difficult (i.e. none) external memory interface o No Multipy / Divide instructions o Multiply / Divide hardware only offered on a couple devices o Lack of EEPROM, and LCD (Although they are working on it) ----------------------------------------------------------------------- 1) ABOUT THIS FAQ 1.1) Who put this FAQ together? After reading the excellent FAQs on the 8051 (Intel/Phillips) and the 68hc11 (Motorola) put together by Russ Hersch <sibit@datasrv.co.il> (Nice work Russ), I decided to make a FAQ on the COP8, National's family of 8-bit microcontrollers. I work for National in the Geographic Business Unit (GBU) responsible for technical support for New Business Development (NBD), so if you want to call this advertising, and don't want me to continue to post this in the future, please email me (that doesn't mean I will stop, but you will get it off your chest ;-). I think that I have kept most of the hype out - please let me know if you think otherwise. This FAQ will hopefully give everyone a brief overview of why you should have a further look at the COP8 instead of automatically picking a HC11, or 8051. Not that they are bad parts, in fact they are better at some things than the COP8. And COP8 is much better at some things than the HC11 or 8051. The COP8 is a good chip, and well worth learning and developing with. With everyone's help this FAQ should turn out to be a useful document. Because I admire Russ's FAQ's and I was too lazy to take the time to think up my own format, I have copied his basic format and a couple of sections (with his permission, of course). 1.2) How can I contribute to this list? I ask that if you have any suggestions or additions, or you would like to correct any of the information contained herein, please send me a note. My Email address is: rgetz@esd.nsc.com My Smail address is: Robin Getz National Semiconductor Corporation MS 16-325 Santa Clara, CA, 94086 USA I certainly hope that those of you who know of interesting items for the COP8 will share with everyone by contributing to this list. If you are a manufacturer and have an anonymous ftp site available that supports the COP8, please let me know by Email so that I can add it to this FAQ. 1.3) What newsgroups will this FAQ be posted to? This FAQ will be posted to the following newsgroups: comp.realtime Issues related to real-time computing. comp.robotics All aspects of robots and their applications. sci.electronics Circuits, theory, electrons and discussions. comp.arch.embedded Embedded computer systems topics. And sometime later, depending on what people think.... news.answers comp.answers sci.answers The first four newsgroups often contain discussions, announcements, or information on microcontrollers. Check them out from time to time. By posting to the *.answers newsgroups, the FAQ will automatically be archived. The archive name of this FAQ (also included in the header) is: cop8-microcontroller-faq. Items will be posted once a month. I can't promise that it will be on time, but I hope to post it on the 25th of each month. You may also want to check out the following newsgroups, since they occasionally have items of interest for COP8 users. comp.lang.misc alt.comp.hardware.homebuilt 1.4) May I post this FAQ to my local BBS? I am putting no restrictions on the use of this FAQ except - It must be distributed in its entirety with the copyright notice, and no financial gain may be realized from it. After all, I have spent, and continue to spend, a lot of time on this, and the only thing that I intend to gain from it is more information on the COP8, and getting to know my fellow COP8 groupies better. For this reason I have appended a copyright statement to the end of this FAQ. I feel pretty silly doing this, but I just want to protect myself. The copyright does not limit the use of this list for non-commercial purposes. I hereby give my permission to one and all to pass this list around and post it wherever you want - as long as it is not for financial gain. Thanks. 1.5) How about FAQs on other microcontrollers? If anyone wishes to start a FAQ on another microcontroller, please feel free to copy the format of this FAQ (I did). With a common format, we will all benefit when trying to find information on a particular microcontroller. If anyone has any comments on the format itself, I'm open for suggestions. Other Microcontroller FAQs Subject: 68hc11 microcontrollers Newsgroups: comp.realtime comp.robotics sci.electronics Archive: rtfm.mit.edu : <plus all mirror sites> /pub/usenet/comp.answers/microcontroller-faq/68hc11 /pub/usenet/sci.answers/microcontroller-faq/68hc11 /pub/usenet/news.answers/microcontroller-faq/68hc11 Maintainer: Russ Hersch Email: sibit@datasrv.co.il Subject: PIC microcontrollers Newsgroups: comp.realtime comp.robotics sci.electronics Maintainer: Tom Kellett Tom@takdsign.demon.co.uk Subject: 8051 microcontrollers Newsgroups: comp.sys.intel comp.realtime comp.robotics comp.lang.forth sci.electronics Archive: rtfm.mit.edu : <plus all mirror sites> /pub/usenet/comp.answers/microcontroller-faq/8051 /pub/usenet/sci.answers/microcontroller-faq/8051 /pub/usenet/news.answers/microcontroller-faq/8051 Maintainer: Russ Hersch Email: sibit@datasrv.co.il Subject: Microcontroller primer and FAQ Newsgroups: comp.sys.intel comp.realtime comp.robotics sci.electronics alt.comp.hardware.homebuilt Archive: rtfm.mit.edu : <plus all mirror sites> /pub/usenet/comp.answers/microcontroller-faq/primer /pub/usenet/sci.answers/microcontroller-faq/primer /pub/usenet/news.answers/microcontroller-faq/primer Maintainer: Russ Hersch Email: sibit@datasrv.co.il Additional FAQs of interest Subject: Robotics Newsgroups: comp.robotics Maintainer: Kevin Dowling Email: nivek@ri.cmu.edu Subject: Electronics Newsgroups: sci.electronics Maintainer: Filip Gieszczykiewicz Email: filip@smi.med.pitt.edu Subject: Real-time Newsgroups: comp.realtime, comp.answers, news.answers Archive: rtfm.mit.edu : pub/usenet/comp.realtime Maintainer: Mark Linimon Email: linimon@nominil.lonesome.com Subject: Neural Networks Newsgroups: comp.ai.neural-nets,comp.answers,news.answers Archive: rtfm.mit.edu : pub/usenet/neural-net-faq URL: http://wwwipd.ira.uka.de/~prechelt/FAQ/neural-net-faq.html Maintainer: Lutz Prechelt Email: prechelt@ira.uka.de Subject: Fuzzy Logic Newsgroups: comp.ai.fuzzy,comp.answers,news.answers Archive: rtfm.mit.edu : pub/usenet/fuzzy-logic/ URL: http://www.cs.cmu.edu:8001/Web/Groups/AI/html/faqs /ai/fuzzy/part1/faq.html (should be one line) Maintainer: Mark Kantrowitz Email: mkant+@cs.cmu.edu Other useful articles are also available. One article provides a tabular cross reference of features and pin counts. This lists was compiled and is being maintained by Roger Nelson <rnelson@wsuaix.csc.wsu.edu>. For more information on various microcontrollers and their features, refer to the Microcontroller primer and FAQ listed above. URL: ftp://rtfm.mit.edu/pub/usenet/comp.answers/microcontroller-faq/primer ---------------------------------------------------------------------- 2) ABOUT THE COP8 2.1) The COP8 microcontroller General Firstly - COP8 (Control Orientated Processor) actually stands for something. (Although the rest of the numbering scheme leaves something to be desired). This is not a failed microprocessor that was cut down for 8-bit control (like some others). This is a full featured microcontroller designed for bit level control. (Although National does make a 32-bit processor (32000), the COP8 has nothing to do with it). The COP8 is a powerful 8-bit data, 15-bit address (32K max ROM) microcontroller from National with an instruction set that is similar (somewhat) to the 8051, although it is much easier for the beginner to understand and pick up (In my unbasised opinion of course :) Depending on the variety, the COP8 has built-in EEPROM/OTPROM, RAM, digital I/O, timers, A/D converter, PWM generator, and synchronous and asynchronous communications channels (RS232 and MICROWIRE/PLUS). Typical current draw is less than 12ma, with powerdown modes that can reduce current draw to typically less than 1 uA. (Although I have seen ***50nA***) A typical COP8 contains: - CPU with Boolean processor - fully static processor - up to vectored 14 interrupts: 2 are external (8 pins can be ORed into one interrupt, for a total of 9 external) - arbitration levels - 1,2 or 3 16-bit timer/counters (min 1 max 3) - programmable full-duplex serial port (UART/USART or MICROWIRE/PLUS) - up to 56 I/O lines (11 pins min + Vcc/GND/Reset/CKI/CKO) - up to 512 bytes RAM (64 bytes min) - up to 16K ROM/EPROM in some models (768 bytes min) - new parts are LOW EMI (typically lower than 14dB emissions) The COP8 peripherals are POWERFUL. The timer that you will find on a COP8 is much more powerful than on a typical microcontroller. I will get into this a little later. The COP8 instruction set is optimized for the one-bit operations so often desired in real-world, real-time control applications. The Boolean processor provides direct support for bit manipulation. This leads to more efficient programs that need to deal with binary input and output conditions inherent in digital-control problems. Bit addressing can be used for test pin monitoring or program control flags. Architecture The COP8 is a modified Harvard architecture. With the Harvard architecture, the ROM is separated from the data memory (RAM). Both ROM and RAM have their own separate addressing space with separate address busses (there are two 0 addresses - 1 for ROM, 1 for RAM). The COP8, though based on the Harvard Architecture, permits transfers from ROM to RAM (hence modified). The CPU has an 8-bit accumulator (A) that all arithmetic operations go into. Two 8-bit index registers are present (X, B) to provide indexing to anywhere in the memory map. Having the two index registers means the COP8 is very good for processing data. Although an 8-bit processor, the COP8 has some 16 bit (and bigger) peripherals (timers, 24 by 8 divide, 16 by 8 multiply, 16-bit A/D). An 8 bit stack pointer is also present, and instructions are provided for stack manipulation. Feature Family / Basic Family The COP8 family is divided into two families - the Basic Family and the Feature Family. There is little difference between the devices although the feature family has the following advantages: - 7 more instructions (including PUSH and POP) - 2 auto-reload registers on timers / Basic family only has one - IDLE Mode (Basic family only offers HALT mode) - powerful peripherals ( A/D, UART, high speed timers, WatchDog, comparators, etc. ) Onboard subsystems Timer - Main timer system comprises of a single 16-bit counter (2 x 8-bit registers) clocked at tc (1MHz at Crystal frequency of 10MHz). Timers have at least one associated register and all Feature Family devices have 2 registers. All timers have at least 1uSec accuracy and some have 100nS - check datasheet for specific details. Timers can be configured in the following methods: - External Counter (clocked on positive or negative edge) - Timer w/ Auto-Load Register (PWM output) - Timer with Capture (triggered on positive or negative edge) Pulse Stream Generators - Some of the devices have specific timers that are 100ns resolution 16-bit PWM (Pulse Width Modulation) outputs only. Multi-Input Wakeup -The Multi-Input WakeUp (MIWU) is used to return (wakeup) the microcontroller from either HALT or IDLE modes. Alternately MIWU may also be used to generate up to 8 edge selectable external interrupts. The user can select whether the trigger condition on the pins is going to be either a positive edge (low to high) or a negative edge (high to low). A-D Converters - 8-bit, 8-channel (multiplexed input) SAR (Successive Approximation Register). Two dedicated pins Vref and Agnd are provided for voltage reference. The time required for an A/D conversion is dependent on the prescaler (fast conversion = more power consumed - you can run the microcontroller fast - and the A/D slow). The A/D converter has the following