Home

1 INTRODUCTION 1.1 Congratulations! 1.2 Purpose of Adapt11

image

Contents

1. onstration program already programmed into the EEPROM when you receive it This is a useful program for testing your communications setup and monitoring amp controlling the various I O lines of the micro You can power the module in one of two ways 1 supply power via the external power connector just connect a DC voltage greater than 5 6 Volts up to 15V maximum to the external power connector on Adapt11 Red is positive and black is negative ground CAUTION Make sure you have the polarity correct 2 alternatively you can supply regulated 5VDC via the appropriate pins on the 50 pin connector H1 See Ap pendix A for the pinout diagram of Adapt11 Don t use method 1 and method 2 at the same time CAUTION Double check your connections before applying power To use the demo program connect the supplied se rial cable between Adapt11 and a serial port on your PC With some PCs you will need a 9 pin to 25 pin adapter Run a terminal program such as HyperTerminal or MinilDE on your PC In your terminal program set the baud rate to 2400 use 38400 for turbo versions of the board parity to NONE DATA BITS 8 and STOP BITS 1 With SW2 set to RUN press the Adapt11 RESET button LED D1 will blink twice indicating the demo programming is running Hit lt ENTER gt on your keyboard A menu of commands will appear on your terminal window s screen followed by a command prompt symbol Each command is activated b
2. Center P O Box 20912 Phoenix AZ 85036 1 800 441 2447 e Motorola Microcontroller Development Tools Directory MCUDEVTLDIR D M68HC11 Reference Manual M68HC11RM AD e M68HC11 E series Technical Data book MC68HC11E D MCU Toolbox MCUTLBX D e Single and Multiple Chip Microcomputer Interfacing Prentice Hall or Motorola TB316 Lib of Cong Cat 87 60656 e Motorola Freeware PC Compatible 8 Bit Cross Assemblers Users Manual M68FCASS AD1 e PCBUG11 User s Manual M68PCBUG11 D2 Other Books The 68HC11 Microcontroller Joseph D Greenfield at R I T ISBN 0 03 051588 2 1992 Saunders College Publishing Harcourt Brace Jovanovich Data Acquisition amp Process Control w the M68HC11 Microcontroller Frederick Driscoll Robert Coughlin Robert Villanucci of Wentworth Institute of Technology 1994 Macmillan Publishing Company ISBN 0 02 33055 X example applications of interfaces to various sensors Design with Microcontrollers John B Peatman professor at Georgia Tech ISBN 0 07 049238 7 31 for assistance A number of documents and resources are available there to help you If you think you may have faulty hardware check the relevant documents and follow the rec ommended steps If you still can t resolve it send a detailed description of the problem to support technologicalarts com Make sure to mention which product you are using For all other issues eg application hardware and software
3. adequate for the application Table 2 lists the standard Starter Package configu Internal External Internal External Replacement MCU Type RAM RAM EEPROM EEPROM Port Type supplied in Start Start Start Start Register Starter Starter Package Ete lei tj ir elelc t t Mmr elolc 1 t ME Ceo lett Block Package Type 256 2K Adapt11 0000 o F800 o none 68HC811E2 512 512 one Adapt11EVB 0000 o B600 BUFFALO none 68HC11E9B in ROM 512 68HC24 Adapt11C24DX8K 0000 o o 8K E000 10xx 68HC11E0 512 32K 68HC24 Adapt11C24DX32K 0000 o o 8000 10xx 68HC11E0 32K 0000 512 P 32K 68HC24 Adapt11C24DX60K 0000 with ak o 8000 10xx 68HC11E0 hole at 2000 none 512 32K 512 68HC24 Adapt11C24DXEVB 0000 8000 6600 BUFFALO 10xx 68HC11E9B in ROM TABLE 2 Starter Package Memory Configurations amp Address Maps rations available at the time this manual was printed New products are being added all the time so be sure to check the website regularly If you subscribe to the techart micros internet based discussion group you will automatically re ceive notification of new products and options as soon as they are released 1 5 Communications An RS 232 compatible 3 wire serial interface port RX TX and Ground is built into all Adapt11 variants al lowing communication with a PC or any other device whic
4. design problems third party utilities assemblers compilers tools etc we rec ommend you join one or more of the internet based discussion groups mentioned on the Tech Support webpage Our own group techart micros is a forum for discuss ing various software tools available with boards made by us any applications you may be working on or interested in getting help with debugging your software and to receive news from us about bugs upgrades and new products Motorola s 68HC11 discussion list has probably the world s largest group of 68HC11 users and ranges from total beginners to advanced users and Motorola engineers It is highly recommended for 68HC1 1 specific questions ImageCraft s discussion group is for all customers using their CC11 C compilers Look inside your C compiler s manual for instructions on how to join this group 30 the Reference section of this manual and links provided on the Resource page of our website see back cover for URL CAUTION Never insert Adapt11 into or remove Adapt11 from a live breadboard Make sure the power is OFF 3 1 Getting Started Important Be sure to browse the README TXT file on your Starter Package disk for information on what s on the disk and how to use it Use any text editor or browser you like such as Notepad or DOS edit and follow the instructions for copying the disk contents onto your hard drive All versions of Adapt11 except EVBs have a dem
5. from the file browser Just follow the instructions for switch set tings and click OK that s all there is to it Press RESET to start your code running Note avoid powering up the board with the WRITE PROT switch in the WRITE position If you do so one or more external EEPROM locations may get inadvertently cor rupted If this happens your code may not work as intended and you ll have to repeat the above procedure to download it again This precaution only applies to external EEPROM not to 68HC11 internal EEPROM 3 4 Using Adapt11 in Expanded Multiplexed Mode On Adapt11C24DX boards the 68HC11 runs in ex panded mode already since the program memory is in an external chip EEPROM or RAM Users of these boards can skip to section 3 5 Adapt11 however normally runs in single chip mode SCM To run Adapt11 in expanded mode with a memory expansion card for example slide the SCM switch down You ll need to switch it back to SCM every time you download code though so that the MODA and MODB lines of the MCU will be properly configured for Special Bootstrap mode Note after changing the SCM switch position always press RESET to cause the new mode to be activated 15 When in expanded mode the MCU uses PORTC lines to multiplex the 8 bit data bus with the 8 low order ad dress lines AO through A7 and they are referred to as ADO through AD7 You can use the AS signal with an external 8 bit latch eg 74HC373 or 74HC573
6. series chip type the following command at the DOS prompt after RE SET in BOOT mode pcbug11 a port 2 if you re using COM1 omit the port 2 parameter For 68HC11E0 E1 E9 or 711E9 enter the fol lowing command instead 21 having more than 256 bytes of internal RAM loading con tinues until a timeout delay has elapsed with no characters arriving at the serial port At this point the internal bootstrap program loads the Program Counter with 0 causing the CPU to begin executing the program just loaded into RAM Thus the program that you have just downloaded begins execut ing This feature of the 68HC11 allows an EEPROM erase write routine to be placed in RAM and executed automatically Routines for programming internal 811E2 EEPROM in single chip mode and external EERPROM RAM in expanded mode from a Motorola s record file are in cluded on the Starter Package disk The source code files are called b8s19 asm and xload asm respectively Note these files are provided mainly for instruction For normal downloading we recommend using MicroLoad instead To program the EEPROM in either of these configu rations you could use the appropriate DOS batchfiles For 811E2 in single chip mode ie Adapt11 Starter Package use ps1 bat with COM1 or ps2 bat when using COM2 For example to download your s record file called mycode s19 via COM1 to the EEPROM in your Adapt11 s 68HC811E2 at the DOS prompt you woul
7. the CONFIG register at the time of RESET It is a read only register The actual EEPROM cell implementing the CONFIG register is a Write only location from the user s point of view Also note if you write a new 4K mapping address in the CONFIG reg ister of an 811E2 you will not be able to read it with PCBUG11 This is because PCBUG11 must always start up in BOOT mode which is a single chip mode The 811E2 forces the upper 4 bits of the CONFIG register to ones during reset in any single chip mode It also forces EEON to one to ensure that the 2K EEPROM is located in the HC11 s vector space and is enabled This fact makes it impossible to ac cess locations in the upper 2K of external memory in BOOT mode on a system using an 811E2 4 26 Using PCBUG11 s Terminal Window PCBUG11 has a basic communications terminal which is useful for testing and debugging your software To use it set up the neces sary communications parameters such as baud rate parity etc By entering control A list of parameters is displayed Use the Page Down and Page Up keys to move to the parameter that needs chang ing Use the Up and Down arrow keys to make the changes or enter new values via the keyboard When you re done press the ESC key to return to the PCBUG11 prompt Now enter term to open the terminal window If you have the Demo program loaded in your board you can use the terminal window to 25 switch SW3 away from the SCM positi
8. the mode can be changed by altering the HPRIO register if neces sary To access external memory modify the HPRIO reg ister ms 103c e5 To change the value stored in a RAM or register location eg clear location 2000 simply use the Memory Set command as follows ms 2000 00 To modify an internal EEPROM location make sure you have first specified the address range of EEPROM and that you have cleared the Block Protect Register see Loading an S record File above You can view locations and modify them as you require by using the Memory Modify command as follows mm 2000 In this example PCBUG11 will display the current value of location 2000 If you wish to change it type the new value and press ENTER If not just press ENTER The next memory location will be displayed To end the Memory Modify mode press ESC on your keyboard 4 24 Programming External EEPROM To use the MX1E Memory Expansion Card eg Adapt11 64K Starter Pack age with PCBUG11 slide switch SW1 on the MX1E card to WRITE and then use Memory Modify or Memory Set as above To prevent unwanted modification of EEPROM lo cations slide the switch back to PROT when you are finished and before resetting or cycling power To run the code 23 pcbug11 e port 2 if you re using COM1 omit the port 2 parameter If you have a Turbo version of Adapt11C24DX add the parameter baud 9600 to the command line If you prefer to use hexadecimal numbers in yo
9. 29 PE4 and develop your application ideas PE1 23 28 PE5 PE2 24 27 PE6 1 3 Product Description PE3 25 26 PE7 Adapt11 Starter Packages come with on chip or AERIAL VIEW on board EEPROM program memory depending on ver sion that is directly loadable via your PC serial port for quick Note indicates active low and easy programming The 68HC11 s handy BOOT mode makes separate programming hardware unnecessary All REV 3r Adapt11 modules will work with any A series and E series 68HC11 chips that are packaged in a 52 pin PLCC see Ta ble 1 for some examples 1 4 Description of Product Configurations The original Adapt11 Starter Package includes a 68HC811E2 with 2K EEPROM on chip Operating in single chip mode all I O ports are available for user appli cations When operated in expanded chip mode additional memory can be added externally however two of the I O ports form the address and data buses and are thus un available for user applications A memory expansion card for Adapt11 is available Adapt11MX71 is offered in two configurations AD11MX1 provides 32K RAM lower half of memory map and an empty 28 pin DIP socket mapped to the upper half You can plug an EPROM EEPROM or RAM chip in this socket for even more memory The board is also offerd with a 32K EEPROM device in the socket Adapt11MX1E Both configurations include address demultiplexing circuitry and can be coupled to Adapt11 using a mini backplane adapter a
10. Adapt11 contain EEPROM the way in which it is programmed is different depending on whether the EEPROM is inside the microcontroller eg 68HC811E2 or in external parallel EEPROM eg 28C64 or 28C256 Thus two different boot programs are provided for programming each type The concept of the boot pro gram is described below All 68HC11 MCUs contain an internal bootstrap loader program in ROM This program runs whenever the chip is powered up or reset with the mode select pins con figured for SPECIAL BOOTSTRAP mode see Motorola 68HC11 Reference Manual for details This configuration can be selected on Adapt11 modules by placing the BOOT RUN switch in the BOOT position When the RESET button is pressed the micro executes the internal bootstrap program bootloader ROM source code listings can be found in Appendix B of the M68HC11 Reference Manual It first initializes the serial port SCI and waits in a loop checking its receive buffer until it gets a value of FF BREAK control character It uses that character to determine the incoming baudrate and adjusts its BAUD register accordingly It then places each byte it receives in RAM storing them sequen tially starting at address 0 and continuing to the end of in ternal RAM address FF on 68HC811E2 For HC11 MCUs 19
11. COMPONENT SIDE APPENDIX A 1 INTRODUCTION Pinouts for SB Connector Option 1 1 Congratulations Adapt11 and Adapt11C24DX You are now the proud owner of Adapt11 a unique ons e EE and useful tool for working with 68HC11 microcontrollers PD4 3 48 PDO RXD Your questions and comments are always welcome We PD5 4 47 5VDC provide friendly knowledgeable technical support by tele PD1 TXD 5 46 IRQ phone fax and e mail to all our customers As well we have PA7 6 45 XIRQ a comprehensive website with a resource page featuring PAG 7 44 RESET new information software and links to other useful sites on PA5 8 43 STRB on C24DX the Internet See back cover for how to contact Technologi PA4 9 42 PC7 calarie PA3 10 41 PC6 PA2 11 40 PC5 ral 1 2 Purpose of Adapt11 PA1 12 39 PC4 D i l PAO 13 38 PC3 X Adapt11 was designed as an evaluation and appli PB7 14 37 PC2 Lu cation tool for various members of the Motorola MC68HC11 PB6 15 36 PCT A microcontroller family Itis unique among evaluation boards PB5 16 35 PCO 2 in that it is designed to plug vertically into any standard PB4 17 34 STRB R W solderless breadboard It is a fully functional standalone PB3 18 33 E implementation of a 68HC11 configuration and can be PB2 19 32 AS treated just like a chip in your breadboard Then it is simply PB1 20 31 VRL a matter of wiring up the desired application circuits and PBO 21 30 VRH downloading the appropriate code into the micro to evaluate PEO 22
12. adboard section in parallel on each side of Adapt11 for easier wiring of your circuits HELPFUL HINT If you are using the Analog inputs make sure to wire your analog circuits as close to these pins as possible to keep noise levels down 4 Choose a convention for wiring your power distribu tion buses A logical approach is to make the inside bus logic 5V and the outside buses GROUND Never supply external power via J1 if you are supplying 5VDC via the breadboard connector pins However always connect the breadboard GROUND to Adapt11 GROUND 5 If you are using voltages other than 5V make sure to keep these well away from Adapt11 pins and tie strips to avoid accidental shorts which may damage the module 3 TUTORIAL Note that this manual is not meant to provide an ex haustive study of the 68HC11 family but rather to help you get started using the Adapt11 series of microcontroller boards as a learning and application development tool for 68HC11 whether you re a beginner or an expert If you are a beginner you will benefit from additional material listed in 5 0 SOURCES Internet Resources Technological Arts Check here often for new product info new utilities tips applications information and resources on the web website www technologicalarts com e mail address support technologicalarts com Publications Motorola Fax on Demand 602 244 6609 or 800 774 1848 Motorola Semiconductor Literature Distribution
13. ay free trial of the fully functional ICC11 C cross compiler and Integrated Development Environment IDE for Windows is available in the DEMOS area of www imagecraft com software The first time you run ICC11 use the Setup Wizard in Project Options Target to select your board type Unless you are using an EVB with BUFFALO monitor in ROM the MCU won t know after reset where your program starts It looks in a special location in memory Oxfffe called the Reset Vector to get the 27 interact with it First make sure you have set up the baud rate etc as required for the demo program Then switch your board to RUN and press RESET Pressing ENTER will cause the menu of the demo program to be displayed Select the menu commands as you desire When you have finished using the demo program you can return to PCBUG11 by hitting ESC To re establish communication between PCBUG11 and the HC11 reset your board in BOOT mode and enter baud 9600 restart 4 27 Exploring Further with PCBUG11 For information about PCBUG11 commands and their syntax enter help at the PCBUG11 prompt For complete details on PCBUG11 refer to the PCBUG11 Manual The introductory pages of an HTML version of the manual are included on the Starter Pack age disk To access the entire manual in HTML form with your web browser follow the PCBUG11 link provided on the RE SOURCE page of our website see back cover for our URL 4 3 JBUG11 JBug11 is a new Win
14. d enter ps1 mycode For all other Adapt11 versions you would use xload1 bat for COM1 or xload2 bat for COM2 For example to download your S record file called myprog s19 to Adapt11C24DX via COM2 at the DOS prompt you would enter xload2 myprog 4 2 Using PCBUG11 with Adapt11 Motorola s PCBUG11 is a flexible powerful and 20 If you wish to use a precision voltage reference you may insert an LM385 or LM336 or equivalent part in location U2 Make sure it is a TO 92 style package Remove jumper W1 only if you wish to use a VRL other than system ground It is easiest to use a 2 5V version but you ll have to make sure none of your analog input voltages will exceed 2 5V or you risk burning them out Some 68HC11 users claim that the Vref voltage cannot be as low as 2 5V However a careful reading of the Analog to Digital Converter Characteristics in the M68HC11 E Series Technical Data book published by Motorola will debunk that myth A 2 5V reference is used in many real world 68HC11 based products and is perfectly acceptable If you wish to use a 5 0V reference you will need to supply an adequate voltage source for it above 5V One possibility is the external voltage supply if regulated that you may already be providing to the board via J1 Just desolder the pin 1 end square pad of shunt resistor R2 and jumper it to the input pin 1 of J1 using a small piece of insulated tubing or heatshrink to insulate the connecti
15. dows based replacement for PCBug11 Check our Resources and Support webpages for links and instructions on using it with our 68HC11 products 4 4 Using SBASIC Here are some example configurations and the approprate c and v compiler options used to specify the starting addresses for code EEPROM usually and variables RAM where infile is your SBASIC program filename and outfile is the name you want the target assembly language file to be called 1 Adapt11 with 68HC811E2 in single chip or expanded mode with no external E E PROM 26 hardware mistakes A much more sensible and rewarding approach is to start with something that works and then add new fea tures incrementally The modular design of Adapt11 gives you that starting point hardware that works and software that works Now if you build on that incrementally each diagnostic step is small and manageable And it will probably end up taking a lot less time and costing a lot less money A powerful asset for program development is the se rial communications interface SCI The SCI gives you a window on what s going on inside the microcontroller Sim ple diagnostic messages placed at strategic points in your evolving program will be invaluable in debugging your soft ware and hardware If you look at the demo source code demo asm for Adapt11 or demo8 asm for Adapt11C24DX you will see that it consists of an initialization section one main loop and severa
16. dth value wraps around Note If you plan to incorporate all or part of the demo program in your own code and you re using a different cross assembler than AS11 you may have to revise the syntax 3 21 A Very Simple Program If you are a beginner the size of the demo program may look overwhelming and you may wonder what is really required just to do something very simple In reality you can throw away almost everything ending up with about a half dozen lines of code to produce a very simple program Rule 1 Every program requires a Reset Vector located at fffe and ffff since the contents of these locations is loaded into the Program Counter imme diately after reset Therefore the Reset Vector should point to the beginning of your code Below is an example of a very basic program which just turns on the LED on PORTA PA6 and then waits in an infinite loop It will work on any of the Adapt11 family of modules but was written specifically for the Adapt11 Starter Package with 68HC811E2 If you are using a different board you can change the code origin ORG to point to your EEPROM start address but it s not necessary org f800 start of EEPROM in 68HC811E2 12 modify the location This is because the Memory Set and Memory Modify commands automatically attempt to verify the change they just made In the case of the CONFIG register reading location 103f returns the contents of a register which reflects the value of
17. e Hall Englewood Cliffs NJ 07632 Explains basics Many clear concise examples Microcontroller Technology The 68HC11 Peter Spasov ISBN 0 13 583568 2 Prentice Hall Microcontrollers Architecture Implementation amp Programming Kenneth Hintz and Daniel Tabak ISBN 0 07 028977 8 1992 McGraw Hill Inc Mobile Robots Inspiration to Implementation Joseph L Jones and Anita M Flynn Very hands on book Focuses on every detail involved in design amp construction of Rug Warrior based on 68HC11A1 using Interactive C compiler Programming Microcontrollers in C Ted Van Sickle ISBN 1 878707 14 0 1994 HighText Publications 394 pages 29 95 thorough tutorial on C programming covers aspects of C programming specific to embedded systems MC68HC11 An Introduction Han Way Huang West Publishing ISBN 0 314 06735 3 Single and Multiple Chip Microcomputer Interfacing G J Lipovski 1988 Prentice Hall ISBN 0 13 810557 X 025 68HC11 specific textbook with examples amp problems 32 typing space is virtually unlimited using solderless bread boards When you ve got a design working and you re ready to move to something more permanent Adapt11 Modular Prototyping System AMPS accessories give you the ability to easily build fully customized compact applications at low cost with a full range of accesories including backplanes prototyping cards memory expansion and application sp
18. ecific cards 2 USING ADAPT11 WITH SOLDERLESS BREADBOARDS Note In descriptions throughout this manual Adapt11 re fers to any member of the Adapt11 family unless specified otherwise The standard connector option installed on Starter Package boards is the SB style designed to plug into a solderless breadboard If your board has a different con nector option you may still be able to use it with a solderless breadboard by way of a 50 pin solderless breadboard adapter See the Accessories page on our website or con tact us for further information on these adapters For con tact information refer to the back cover of this manual CAUTION Never insert your module into or remove it from a live breadboard Make sure the power is OFF 1 Any breadboard will do however you will find that the kind made with a softer more pliable plastic such as nylon will be easier to use and more durable Avoid excessive removal and insertion of your board to extend the life of your breadboard 2 When plugging Adapt11 into your breadboard keep it vertical and press gently but firmly rocking the module back and forth slightly until the pins are seated in the sock ets Use the same side to side gentle rocking motion while pulling gently upward to remove the board 3 Plug Adapt11 into the middle area of your bread board strip to allow maximum access on each end to all the signals If possible place an additional bre
19. h has an RS 232 serial port The logic level RXD and TXD signals from the MCU are also brought out to the 50 pin header for applications such as RS 485 or MIDI 1 6 Adapt11 Versus Other Evaluation Boards There are many evaluation and development sys tems available Most of them try to be universal in their ap plication containing every imaginable kind of support cir cuitry on board or providing a large area for prototyping by soldering or wire wrapping parts on the board The designer tried to second guess what you might want to do and as a result you pay more and have less flexibility We chose in stead to take a modular approach With Adaptt11 all I O lines and control signals are brought out to a standard 50 pin interface connector With several different connector op tions available you can use the module in whatever way best suits your needs With the solderless breadboard header you can treat the module like a big chip and plug it right into your breadboard Forget soldering or wire wrapping get started developing your application right away Your proto 33 This book is on a more advanced level Uses both the 68hc11 and Intel 8096 as example systems Embedded Systems Programming in C and Assembler John Forrest Brown ISBN 0 442 01817 7 Van Nostrand Reinhold 1994 304 pages 49 95 covers Motorola and Intel processors Microcomputer Engineering Gene H Miller ISBN 0 13 584475 4 1993 Prentic
20. ing an Adapt11EVBU or Adapt11C24DXEVB Motorola s BUFFALO debug monitor pro gram will be running from ROM Connect the serial cable to your PC s COM port and use a terminal program set for 9600 baud no parity 8 data bits 1 stop bit and no handshaking Make sure the BOOT RUN switch is set to RUN On Adapt11C24DXEVB set the WRITE PROT switch to WRITE so that you ll be able to load and modify programs in RAM To see a list of the BUFFALO commands type Help Refer to Motoro la s documentation on BUFFALO for more details To imple ment the Trace command you ll need to connect the MCU s XIRQ pin to OC5 via I O connector H1 on your breadboard If PEO is pulled high during reset BUFFALO will jump to a user program in EEPROM 4 7 Troubleshooting If you experience any problems using your Adaptt1 product be sure to check the Tech Support page of our website 29 address of the start of your program To make sure your pro gram s starting address gets put there automatically every C program you write will need to have the file vectors c included either explicitly at the end of the program or as one of the files in the Project You should examine and compile the program hello c in the Examples directory of ICC11 This program has the essentials set up for you The only time you would not need vectors c is if you had a resident monitor that was controlling the loading and execution of a user program such as the Buf falo monit
21. l subroutines and interrupt routines The main sub routine is called ProcessCommand Its primary function is to interpret a single character command that is received via the serial port and perform the appropriate action for that com mand You can easily extend the list of commands within the ProcessCommand subroutine by adding code to recognize and process other single character commands you define Then it is simply a matter of writing those subroutines to perform the functions you wish to implement This software structure gives you a way to independently test each new function one at a time For example let s suppose you are implementing an autonomous vehicle using a miniature toy car You will need to read position and collision sensors and control the speed and direction of one or more motors First write a basic motor speed control routine and assign some commands to test it You could assign F for faster increase the motor 11 speed and S for slower to decrease motor speed Then implement a pulse width modulation scheme in your motor speed routine decreasing the pulse width by some incre ment every time the S key is pressed and incrementing pulse width by the same amount every time the F key is pressed Of course you will want to put tests for minimum and maximum pulse widths before you decrement or incre ment so that the motor doesn t suddenly jump from stopped to full soeed when the pulse wi
22. module and one of the COM ports of yourPC You can use a different COM port but you will need to edit the batchfile to reflect the COM port number you use DOS Users For a single chip mode system using 68HC811E2 ie Adapt11 Starter Package use ps1 bat for COM 1 or ps2 bat for COM2 For expanded mode systems ie all other models use xload1 bat for COM1 or xload2 bat for COM2 If required use a text editor to modify these batch files to suit your needs On a Windows95 system you may have to add dev to every reference to the com port path eg copy 1 s19 dev icom1 Instead of a DOS batchfile you may choose to use Motorola s PCBUG11 program for DOS or HCLOAD for W95 NT to download your code See section 4 2 for details You may find using the batchfile more convenient if you put it into your working directory along with the assembler or compiler you are us ing and the source code you are writing Make sure to put the associated boot file in the directory as well b8s19bin is required by ps1 bat and ps2 bat while xload bin is required by xload1 bat and xload2 bat Always reset the board in 14 4 23 Accessing External Memory You can access exter nal memory in any expanded mode system eg Adapt11 with MX1 Memory Expansion Card and all other members of the Adapt11 family by placing the HC11 in Special Test Mode Note remember that a system must always be in BOOT mode to run PCBUG11 once inside PCBUG11
23. nd connect the wiper to an ANALOG input through a 1K Ohm current limiting resistor then change the pot setting moni toring the ANALOG values on the screen Unused ANALOG channels should be grounded to VRL through a minimum 1K Ohm resistor These inputs are not internally protected from electrostatic discharge ESD as the other input port lines are HELPFUL HINT Grounding multiple adjacent analog inputs is easy by plugging a bussed resistor SIP in your breadboard and jumpering the SIP common pin to VRL 3 2 Writing Your First Program If you are already experienced with the 68HC11 family of microcontrollers you can skip this section How ever you may find the suggestions here useful to familiarize yourself with the essentials of getting a program to work the first time As mentioned in the previous section a demo pro gram resides in your microcontrollers EEPROM when you receive it This demo program is written in Motorola s Free ware AS11 cross assembler syntax and is intended to pro vide you with an easy way to verify your hardware setup ie power supply serial connection PC software etc It also provides you with an excellent starting point for developing your own program Rather than starting from scratch you can make a copy of the demo source file and remove and add features to transform it into what you need Many people approach programming by spending hours or even days writing a program from scratch then as
24. o examine and modify on chip memory RAM EEPROM and EPROM load HC11 code debug trace erase EEPROM disassemble blocks of code assemble line by line and even includes a basic terminal program What s more it works with all varieties of HC11 micros and is fully compatible with the entire Adapt11 family of modules PCBUG11 is included on your Starter Package disk and is also available on the Resource page of our website It is a self extracting archive so just copy it to the directory on your harddrive where you want it to reside and type pcbug342 at the DOS prompt to extract all the files If you get a RUNTIME ERROR when attempting to execute this program check our Tech Support webpage for a patch that resolves this problem 4 21 Running PCBUG11 Always RESET your module in BOOT mode before starting PCBUG11 if you re using an Adapt11 module also make sure SW3 is set to SCM It is important to make sure there are no background tasks run ning on you PC such as faxmodem drivers networks etc PCBUG11 needs to access the serial port chip directly and does not co exist very happily with other programs When ever possible start PCBUG11 directly from DOS not a DOS shell If you can t get it to work at all see section 4 3 below It is also strongly recommended that you get the Adobe format version of the Motorola s PCBUG11 User Manual Look for the link on our website RESOURCE page If your micro is a 68HC811E2 or any A
25. on CAUTION When using the analog inputs make sure the input signals do not exceed the reference voltage or go be low VRL GROUND or damage may occur to the A D con verter 3 7 About the On board Voltage Regulator Adapt11 family boards are supplied with an on board regulator in a TO 92 package capable of dissipating about 500 mW at room temperature This regulator National Semiconductor part number LM2931Z 5 has some nice features such as a very low quiescent current and will work with an input voltage down to 5 Volts or below making it quite well suited to battery operation It is also designed to 17 withstand reverse polarity and if unused does not present a load to an external regulated 5 Volt supply applied via the 50 pin header H1 One drawback however is that it can become unstable and start to oscillate at low temperatures especially if the input voltage source is connected to J1 via long wires If temperature is an issue in your application the on board 10uF tantalum capacitor can be replaced with a higher value 47uF or 100uF To compensate for long lead in wires add capacitance of 100uF or so at or close to the J1 connector Most of the Adapt11 family circuit boards were de signed to accomodate a voltage regulator with a tab style package to provide more current at 5 Volts for your appli cation circuitry This means you can remove the TO 92 package supplied and replace it with a TO 220 package if nece
26. on ie put it in Ex panded Memory mode switch SW2 to RUN and press RE SET It is also possible to use PCBUG11 s loads com mand to load an s record file into external EEPROM al though it is fairly slow To do this specify the EEPROM address range eg eeprom e000 ffff Then enter eeprom erase disable to disable the Erase before write function Now use loads as described in section 4 22 above 4 25 Programming the CONFIG Register The CONFIG register 103f allows the user to enable or disble such things as the EEPROM ROM or EPROM and COP watchdog timer In the 811E2 it also specifies to which 4K boundary the internal 2K EEPROM will be mapped in ex panded mode The CONFIG register is implemented in EE PROM so you need to specify this in PCBUG11 before you can modify it Enter the following command eeprom 103f If PCBUG11 returns a message saying Erase before write disabled enter the following command to enable automatic erase eeprom erase enable Then make sure the PTCON bit in the Block Protect Register is cleared ms 1035 Of Now you can use Memory Modify or Memory Set to change the CONFIG register contents There is one caveat how ever The new value of the CONFIG register will not take effect until following a RESET of the HC11 Therefore PCBUG11 will return a BAD MEMORY error when you try to 24 begin Idaa 40 write a logic high to PA6 staa 1000 and logic low to all other portA bits b
27. or from Motorola To compile and download hello c select Make Project in the pulldown menu ICC11 will com pile assemble and link creating an s record file called hello s19 This is the file you will download to your board using the built in downloader Note if you are using a turbo version of Adapt11C24DX you ll have to use MicroLoad to download The ICC11 downloader only supports 8MHz targets Make sure Bootstrap Download Mode is checked in the Rees es ASI microl c hallo ES Compie Optone OOOO xj volatile unsigned char Pathe Compicr Target volatile unsigned shor Device Con guration PRINTF Version F smoll mt only no modiher l long long and modifiers float hal function Addnonal Lib unsigned char CONTINUC void main void doy C240 GOK Advanced Other Options I F No Stortup Ub OPTION opts Non dediault Stamap ADCTL admaski INTR_OPF TMSK2 tmask PACTL rtimsk icc1 1w c IC Nicc include OK Conca s D Help ice 1 1w o OMD LCAicc ib a EstAs Detaur Lood Dotout e D ik Done 2521 C Documents and Setings sharvey Deskiop mi C C CODE OMD OMD pej S19 4 Ast JERE Brow icc DAE 2am 28 allow you to examine the states of PORTA PORTC and PORTD Try putting switches on some of these input port lines Use a 10K or higher pullup resistor on one side and connect the other side of the switch to ground Note that PAO PA2 are inputs PA3 and PA7 a
28. ra i branch forever until reset occurs org fffe define the reset vector to point to fdb begin the beginning of your code Now let s take it one more step blink the LED on and off To make the blinking slow enough to perceive with the human eye we will write a subroutine to create a half second delay Rule 2 If you are using interrupts or incorporating any subroutines in your program you must initialize the stack pointer at the beginning of your program org f800 start of EEPROM begin Ids ff initialize the stack pointer loop Idaa 40 write a logic high to PA6 staa 1000 and a logic low to all other portA bits bsr Delay do a time delay clr 1000 make all portA bits logic low bsr Delay bra loop do it all again Delay Idy HS fff D1 dey pad delay loop with extra cycles iny for total of 15 cycles dey this gives approx 1 2 second at 8MHz bne D1 rts org fffe define the reset vector to point to 13 fdb begin the beginning of your code 3 3 Downloading Your Code Once you have assembled your code with no errors you can download the resulting s record file filename s19 to your board using our Windows based MicroLoad included with your Starter Package If you don t use Windows you can use the appropriate DOS batch file provided on the HC11 disk Connect the supplied serial cable handshaking signals are jumpered inside the cable for use with DOS be tween connector J2 on your
29. re programmable as input or output and default to inputs PA4 PA6 are outputs only In the demo program PAG is used as a tone output for a speaker It is also connected to LED D1 to provide a visual output You can drive a small piezo speaker directly by hooking one end to PA6 through a 330 Ohm resistor and the other end to ground When you press RESET or type S when the demo program is running you will hear two beeps from the speaker or the LED will flash twice PORTB is an output only port on the Adapt11 In the demo program however it is set up as an output Typing a digit between 0 and 7 causes the output state of the corre sponding PORTB line to be toggled eg typing 3 causes PB3 to flip to a high if it was low previously or a low if it was high previously This allows you to activate LEDs when driving LEDs directly from an output port limit the current to a maxi mum of 10mA with 330 Ohm current limiting resistors on each LED or drive relays solenoids or motors with ap propriate driver circuits Typing B forces all PORTB output lines low Typing R causes the values of all 8 analog to digital converter ANALOG channels of PORTE to be con tinuously updated on the screen near Real time updates The display will continue to be updated until a key is pressed Analog channels ANALOGO ANALOG7 can read voltages between 0 and 5 Volts Try putting a 10K Ohm or higher pot across the VRL and VRH pins pins 30 and 31 a
30. sembling it and downloading it Then they cross their fingers and reset the board praying everything will work About 99 of the time their hopes are dashed as the board does something completely different than they expected or worse it appears to do nothing At that point they either give up or purchase expensive diagnostic equipment such as logic analyzers and in circuit emulators to begin the long hard road of diagnosing and correcting their software and or 10 sbasic infile cf800 v0000 sOOff gt outfile asc 2 Adapt11C24DX with 68HC11E0 and 8K EEPROM sbasic infile ce000 v0000 s01ff gt outfile asc 3 Any Adapt11 series board using 68HC711E9 12K EPROM sbasic infile cd000 v0000 s01ff gt outfile asc 4 Any Adapt11 series board with 32K EEPROM or RAM in the upper half of the memory map sbasic infile c8000 v0000 s01ff gt outfile asc 5 Adapt11C24DX 60K board with 32K EEPROM and 20K RAM sbasic infile c8000 v0000 sOfff gt outfile asc The resulting file outfile asc is in assembler source code and can be viewed and edited if you wish When ready assemble the file to produce an s record file suitable for downloading to your board Use the assembler provided with SBASIC as fol lows asmhc11 outfile and it will produce the file outfile s19 4 5 Using ImageCraft s ICC11 Windows C Compiler ImageCraft offers a good low cost ANSI C cross compiler which is quite popular in the 68HC11 community A 30 d
31. ssary The double line shown on the board outline shows how the metal tab of the package should be oriented Remember that the package tab is Ground so be careful not to let it short to other components on the board Another possible mounting method is to insert the voltage regulator pins through the solder side of the board and bend the package body parallel to the plane of the board This will place the tab away from the board and it can be safely at tached to a heatsink if desired Double check the orienta tion of the new regulator with the manufacturer s data sheet and the board s schematic keeping in mind that square pads on the board always designate Pin 1 4 REFERENCE 4 1 How EEPROM is Programmed All Adapt11 family modules use EEPROM for pro gram storage except the EVB versions which use RAM and use the MCU in special bootstrap mode to erase and 18 load the code via any serial port This means you can erase and re program your code right in circuit without the need for special programming boards and UV erasers This approach results in a low cost easy to use configuration suitable for education and new product development Also there is nothing proprietary about the design configuration and the parts used The MCU is a standard Motorola part you can buy it from Technological Arts or any Motorola supplier to use in your application without being concerned about availabil ity and licensing While most versions of
32. stackable connector arrangement or a standard 50 pin ribbon cable eg SCSI cable For those applications requiring an all in one board solution with more memory resources while keeping all the I O ports there is Adapt11C24DX It combines Motorola s 68HC24 PRU with a 68HC11 and 8K or 32K EEPROM of fering full register compatibility with the 68HC11 From both a hardware and software point of view this board can be viewed as a single chip 68HC11 with 8K or 32K EEPROM and 512 bytes RAM This combination is particularly well suited to users who are developing applications for eventual use in a single chip OTP based design eg 68HC711E9 35 Software developed using 512 0 0 68HC11E0 Adapt11C24DX can be directly 68HC11E1 512 512 0 burned into the OTP PROM of am 7 2K 0 the 711E9 destined for the target GBH THES 512 512 1x single chip application using a SBHCTHTEAD 768 52 2K_ programmer designed for those TABLE 1 MCU MEMORY RESOURCES chips For T11E9 applications that will be using on chip EEPROM a 68HC11E1 can be used to provide the 512 byte EEPROM block resulting in virtually true emulation Adapt11C24DX is also offered in a 60K version which has a 32K RAM chip piggy backed on top of the 32K EEPROM A 4K block of the RAM is decoded out of the memory map to allow for the 68HC24 registers so the available RAM is 28K This configuration is useful when the on chip 512 bytes of RAM is not
33. to de multiplex the signals The upper 8 address bits are generated on PORTB output lines Control signals E and R W are then used with address decoding chips and EPROM RAM ROM EE PROM or data latches plugged into your solderless bread board Note that even in expanded mode internally mapped memory blocks such as RAM registers and EE PROM take priority over any external devices mapped into this address space 3 5 Remapping Internal RAM and Register Block In some situations you may wish to move the internal RAM and or Register Block to a different 4K address boundary To do this change the value of the INIT register in the first few lines of your code Refer to the 68HC11 Pro gramming Reference Guide for information on the INIT reg isters Take care when relocating RAM since it is used for the stack This is especially important if you re using Im ageCraft s ICC11 C compiler since it jumps to your startup code by executing a JSR instruction If your startup code moves RAM then the subsequent RTS instruction will not find the return address on the stack because it won t even find the stack 3 6 Using a Precision Voltage Reference Adapt11 family boards use the 5VDC you supply via your breadboard or the on board 5 Volt regulator if you supply external power via connector J1 as the voltage ref erence VRH for the analog to digital converter on the MCU 16 easy to use program that runs on a PC It allows you t
34. ur PCBUG11 session instead of the default decimal notation enter the following command at the PCBUG11 prompt control base hex 4 22 Loading an S record File into 6HC811E2 EEPROM First tell PCBUG11 the range of addresses that contain EE PROM as follows eeprom f800 ffff Then make sure the Block Protect Register EEPROM bits are cleared ms 1035 10 To do a bulk erase of the entire EEPROM block before pro gramming it eeprom erase bulk f800 Then to make downloading faster you can disable Erase before Write to prevent PCBUG11 from erasing each byte before writing the new value eeprom erase disable Now you re ready to load your s record file Suppose you have generated a file called myprog s19 use the following command to load it into EEPROM loads myprog If it is in a different directory eg c myfiles you should specify the directory path For example loads myfiles myprog To verify that your file myprog s19 was actually written to EEPROM use the Verify command verf myfiles myprog 22 BOOT mode just before you download Also if your version of board has Write Protection make sure to slide the WRITE PROT switch to WRITE After downloading switch back to PROT and switch back to RUN mode MicroLoad Users simply set your target board type and com port the first time you use MicroLoad and it will be saved and used for each subsequent session Then click the LOAD button and select the s19 file you wish to load
35. y a single keystroke A sample screen showing results of each command is shown in Figure 3 1 Typing a command not listed will cause the menu to be re displayed The A C and D commands in the demo program ADAPT11 DEMO PROGRAM COMMAND MENU gt SHOW PORT A STATUS gt CLEAR PORT B OUTPUTS gt SHOW PORT C STATUS gt SHOW PORT D STATUS gt SHOW REAL TIME ANALOG VALUES gt BEEP SPEAKER CONNECT TO PA6 0 TO 7 gt TOGGLE THE SELECTED B PORT LINE lt A gt PORTA 000 lt B gt PORT B CLEARED lt C gt PORTC 000 lt D gt PORTD 001 lt R gt Figure 3 1 Adapt11 Demo Software Menu as it appears in a terminal program s window TERMINAL pulldown menu Then activate the terminal window and click on Bootstrap Options Select the appropriate Boot loader Programming setting for your hardware configuration Internal EEPROM for Adapt11 External EEPROM for all others Adapt11 configurations Leave the CONFIG Register setting at 0 ie don t change unless you want the bootloader to change the value of the CONFIG register Remember the new setting only takes effect following a Reset of the 68HC11 After exiting Bootstrap Options click on Bootstrap Download and select the s record file you wish to download Press your board s Reset button and where applicable slide the Write Protect switch to WRITE Then click OK Refer to your ICC11 manual for more information 4 6 Using BUFFALO If you are us

Download Pdf Manuals

image

Related Search

Related Contents

Compte rendu d`Assemblée Générale du samedi 30 novembre 2013  JBL gto755.6 II Car Amplifier User Manual    Eclipse 5145 - Honeywell Scanning and Mobility  ALTPLL (Phase-Locked Loop) IP Core User Guide  GTS User Manual - Newport Corporation  

Copyright © All rights reserved.
Failed to retrieve file