background image

5

TUTORIAL

This section was written to help you get started with the specifics of the CME11E9 software
development process.  Be sure to read the rest of this manual for further information.  Also,
you should see the 68HC11 reference manual and other documentation on the CD.

The following sections take you through the complete development cycle of a simple "hello
world" program, which sends the string "Hello World" to the serial port.

Creating source code

You can write source code for the CME11E9 board using any language that compiles to
Motorola 68HC11 instructions.  Included on the CD is a free Assembler and also a freeware
C compiler.  Inexpensive or free compilers are also available for Basic and Forth languages.
See the www.axman.com web page for more information.

You should write your source code using a standard ASCII text editor.  Many powerful code
editors are available or you can use the free EDIT or NOTEPAD programs that come with
your computer.  Once your source code is written and saved to a file, you can assemble or
compile it to a Motorola S-Record (hex) format.  This type of output file usually has a .MOT,
.HEX or .S19 file extension and is in a format that can be read by the programming utilities to
be programmed into the CME11E9 board.

It's important to understand your development board's use of Memory and Addressing when
writing source code so you can locate your code at valid addresses.   For example, when in
"debug" mode, you should put your program CODE in External RAM.  In assembly language,
you do this with ORG statements in your source code.  Any lines following an ORG
statement will begin at that ORG location, which is the first number following the word ORG,
for example:

     

ORG $2000

.

You must start your DATA (or variables) in a RAM location unused by your program, for
example: ORG $1040.  When finished debugging, you must change these ORG statements
so that your program is moved to a valid EEPROM area - somewhere after hex E000.  Do
this by putting an ORG $E000 in front of your Program CODE.  Data may remain where it is
or be moved down to internal RAM starting at ORG $0000.  You must also program the
STACK register somewhere at the top of your available RAM, for example hex 1FF.  Do this
with this instruction as the first instruction in your program code:  LDS #$01FF.

A look at the example programs on the CD can make all of this clearer.  If you're using a
compiler instead of an assembler, consult the compiler documentation for methods used to
locate your code and data.

Source code created to run under the buffalo monitor environment will be slightly different
than code written for stand-alone operation.  The buffalo monitor contains interrupt and
RESET vectors for example, your code must provide these when it's no longer running under
the monitor.  See the 

Programming External EEPROM

 section for more information on this.

Summary of Contents for CME11E9-EVBU

Page 1: ... 1999 2813 Industrial Ln Garland TX 75041 972 926 9303 FAX 972 926 6063 email Gary axman com web http www axman com xiom anufacturing CME11E9 EVBU Development Board ...

Page 2: ...1 ADDRESS DECODING 11 MEMORY MAP 12 HARDWARE 13 PORTS AND CONNECTORS 14 SERIAL PORT 14 LCD_PORT 14 SS KEYPAD 15 MCU_PORT 15 A D REFERENCE 15 BUS_PORT 16 VPP Connector 16 PWR Terminal Block 16 JUMPERS 16 Mode Select Jumpers 16 Memory Selection Jumpers 17 Programming Jumpers 18 TRACE PROG Jumper 18 SYNC Jumper 18 MEM EN Jumper 18 TROUBLESHOOTING 19 TABLES 22 TABLE 1 LCD Command Codes 22 TABLE 2 LCD ...

Page 3: ...lopment board CME11E9 EVBU from the drop down menu bar just below the main menu Board Startup Follow these steps to connect and power on the board This assumes you re using the provided utility program described in the previous section or a similar communications terminal program on your PC and that all the jumpers are in their default from the manufacturer positions If you re using a different te...

Page 4: ...n the CD is a free Assembler C compiler and example source code to help get you started Software Development Software development on the CME11E9 is performed using the Buffalo Monitor utility to test and debug your program that is stored in RAM on U5 During this debug phase your program should be located just above the internal register block for example 2000 see the Memory Map section for details...

Page 5: ...ry and Addressing when writing source code so you can locate your code at valid addresses For example when in debug mode you should put your program CODE in External RAM In assembly language you do this with ORG statements in your source code Any lines following an ORG statement will begin at that ORG location which is the first number following the word ORG for example ORG 2000 You must start you...

Page 6: ... free assembler Use it by selecting Build from the menu This will prompt you for the file to be assembled DO NOT use long path names 8 characters The free assembler is an old DOS tool that does not recognize them If there are no errors in your source code 2 output files will be created HELLO S19 a Motorola S Record file that can be programmed into memory HELLO LST a common listing file which shows...

Page 7: ...LLO S19 Your program will be sent to the board thru the serial port 4 When finished loading you will see the prompt again Type CALL 2400 This tells buffalo to execute the subroutine at address 2400 which is the start of our test program 5 If everything is working properly you should see the message Hello World on your terminal screen then since we return at then end of our program a line containin...

Page 8: ... running under buffalo since it must handle the stack cause the program to NOT try to return at the end and lastly program the HC11 reset vector to go to the beginning of the program when powered on 5 Re Assemble HELLO ASM as described in the Assembling Source Code section 6 Start AxIDE and select Configure and follow the onscreen instructions Make sure ROMON is disabled and if not configure it to...

Page 9: ...a 68HC711 device 2 Change the Reset Vector in your code to D000 then re assemble it 3 Apply a 12V DC programming voltage to the VPP connector 4 Install a jumper in the PROG position 1 2 5 Start the programming interface AX11E for DOS or AXIDE for windows 6 Select Configure Processor or Configure and follow the onscreen instructions Make sure ROMON is enabled and if not configure it to be so 7 Sele...

Page 10: ...ernal RAM When you re ready to program your application into the Internal EEPROM change the starting location of your code to address B600 hex This should be the address of the first instruction to be executed not data or a subroutine Also make sure you add the stack pointer initialization as described in the previous Programming External EEPROM section You can use internal RAM for this also 1FF f...

Page 11: ...d to the same location as the internal ROM of the HC11 P Peripheral Access CS0 CS7 B580 through B5FF All of these signals except P are active low P is active high Signal line M2 is also connected to the BUS_PORT expansion connector allowing M2 to work in conjunction with the CS and Address lines to implement off board page banked memory When M2 is used in this manner U6 must be removed from the bo...

Page 12: ...ket U7 8K device if ROMON disabled or E000 D000 68HC711E9 Internal PROM 12K in U1 if ROMON enabled CFFF B800 Program or Data Memory EEPROM or RAM in U6 not installed B7FF B600 HC11 Internal EEPROM in U1 Program or Data Peripheral Area CS0 CS7 CS7 B5F2 B5FF LCD B5F0 B5F1 CS6 B5E0 B5EF CS5 B5D0 B5DF CS4 B5C0 B5CF CS3 B5B0 B5BF CS2 B5A0 B5AF CS1 B590 B59F CS0 B580 B58F Program or Data Memory EEPROM o...

Page 13: ...h no device installed Also the 68HC11 chip configuration word is set as follows EEON On Chip EEPROM ENABLED ROMON On Chip ROM ENABLED NOCOP Watchdog System DISABLED NOSEC Security DISABLED RS232 Level Translator LCD Control Logic LCD_PORT SS KEYPAD MCU_PORT BUS_PORT Serial Port PWR Terminal Block Power Jack 68HC11E9 RESET U5 U6 U7 8 MHz Crystal VPP Connector TRACE PROG Jumper Prototype Area EVBU I...

Page 14: ...nnect directly to a PC serial port 7 Ÿ Ÿ with a straight thru type of cable supplied Ÿ Ÿ 2 TXD 6 Ÿ Ÿ Ÿ Ÿ 1 LCD_PORT The LCD Display interface is connected to the data bus and memory mapped to locations B5F0 through B5F3 Addresses B5F0 and B5F1 are the Command and Data registers respectfully The LCD interface supports all OPTREX DMC series displays up to 80 characters and provides the most common p...

Page 15: ...ut only output only and some are input or output All MCU port lines serve dual functions with internal CPU peripherals such as the timer subsystem and port A the A D converter on port E and the SPI or SCI on port D PD0 RXD0 1 2 PD1 TXD0 PD2 SI 3 4 PD3 SO PD4 SCLK 5 6 PD5 SEL0 PA0 7 8 PA1 PA2 9 10 PA3 PA4 11 12 PA5 PA6 13 14 PA7 PE7 15 16 PE3 PE6 17 18 PE2 PE5 19 20 PE1 PE4 21 22 PE0 VRL 23 24 VRH ...

Page 16: ... the 68HC711 On Chip EPROM PWR Terminal Block These 3 connection points allow for alternate power input such as a battery or power supply as well as output voltage supply V 7 to 16V DC unregulated Input or Output GND Ground 5V 5V Input or Output Gnd 39 40 RESET BUS_PORT JUMPERS Mode Select Jumpers The MODA and MODB pins of the HC11 are pulled high by two 10k resistors This is the normal EXPANDED M...

Page 17: ...0 3FFF 4000 5FFF and 6000 7FFF This position will allow CPU internal Ram and I O ports to segment the 8K address space ON configures 8K from 2000 3FFF hex and mirrored at 6000 7FFF This is the recommended position for Buffalo Monitor and Small C operation No segmentation occurs JP4 JP6 U6 Device Configuration JP6 write protects the device in U6 when OFF JP4 JP5 JP7 JP6 8K RAM or EEPROM OFF OFF OFF...

Page 18: ... line for programming the internal EPROM of a 68HC711 device installed in U1 CAUTION should be used so that the PROG jumper is only installed and VPP applied during this programming operation SYNC Jumper This jumper changes the timing of the peripheral chip selects C0 7 When open default the chip selects will be active for the whole bus cycle to the connected peripheral This position provides chip...

Page 19: ...by substituting a known good serial device or by doing a loop back diagnostic 2 Verify the jumpers on the board are installed correctly 3 Verify the power source You should measure approximately 9 volts between the GND and 9V test point pads on the board 4 If no voltage is found verify the wall plug connections to 115VAC outlet and the power connector 5 Disconnect all external connections to the b...

Page 20: ...e set to off disabled to enable external EEPROM U7 and must be on enabled to enable the 68HC11 Internal EPROM in U1 During program development the EEON should be enabled The other bits should be disabled Make sure you load your code to an address space that actually exists See the Memory Map If you are running in a multi tasking environment such as Windows close all programs in the background to b...

Page 21: ...is file should be a label __START This is where you should CALL or GO to when debugging in buffalo SMALLC Compiler If you re programming to ROM delete the first line of the S19 record generated since SMALL C adds data there Make sure you put the CODE DATA and STACK at the correct locations per your memory configuration DATA may need to be at 0000 if you re burning a ROM and STACK should have plent...

Page 22: ...ink off 08 40us Display on Cursor and Cursor Blink off 0C 40us Display and Cursor on Cursor Blink off 0E 40us Display Cursor and Cursor Blink on 0F 40us Cursor Display Shift nondestructive move Cursor shift left 10 40us Cursor shift right 14 40us Display shift left 18 40us Display shift right 1C 40us Display Function default 2x40 size 3C 40us Character Generator Ram Address set 40 7F 40us Display ...

Page 23: ... given in Hex notation for example asm 2bf0 See the buffalo monitor users guide on the CD for more information TABLE 4 Buffalo Monitor Interrupt Jump Table 00C4 00C6 Serial communications Interface SCI 00C7 00C9 Serial Peripheral Interface SPI 00CA 00CC Pulse Accumulator Input Edge 00CD 00CF Pulse Accumulator Overflow 00DO 00D2 Timer Overflow 00D3 00D5 Timer Output Compare 5 00D6 00D8 Timer Output...

Reviews: