Home
NMIN-12A256B Single Board Computer
Contents
1. S F 01E F 40 F RELH 5 SHT CMD BEGIN DAT READY UNTIL GET DA S F FDUP 2 8E 6 0405E F FOVER F linear RH FSWAP linear rh raw rh 3 SHT CMD BEGIN DAT READY UNTIL GET DAT S gt F 01E F 40 temperature for compensation linear rh raw rh temp 25E F FSWAP 00008 F 01E F F F RH true To get results from the sensor chip you must first initialize the port and then get data For example if we get data and then breath on the chip to increase humidity and humidity we can get the following results INIT SHT OK EMP 26 36C OK RELH 43 94 OK breathe on sensors for 5 seconds EMP 27 75C OK RELH 80 76 OK 8 4 Implementing an Interrupt The HCS12 contains a lot of parts to get right usually all of them before you can make an interrupt more generally referred to as an exception happen You must set up the CPU the interrupt controller and an interrupt source such as a peripheral Setting up the CPU involves modifying CPU control register while setting up the interrupt controller and peripheral involves modifying their memory mapped control registers User Manual V 1 Aug 18 2003 14 The interrupt machinery on the HCS12 supports a wide range of operational capabilities You can just use one interrupt or support a complex system of prioritized interrupts from all periphe
2. WWW NEWMICROS COM e User Manual V 1 Aug 18 2003 U2 2 1 Cl 3 5 8 10 J8 7 9 13 12 14 n Vo PM2 RS MISOO PM3 RW SSO PM4 E1 MOSIO MAX232CWE PTO DO PTDI PT2 D2 PT3 D3 04 5 05 2 2 5 6 7 PSO RXDO 8 PI6 D6 PT7 D7 ESTADO Pan NC PMSJE2 SCKO 12 13 14 PM4 PTO PS2 RXD1 PIS PS3 TXD1 PT6 PADOO 7 76 PAD DADOS VREGEN 47 PADO4 PMI 74 PADOS PMO 75 PADO6 PJ6 69 PADO7 PJ7 68 BKGD RESET PAT 42 PES PA2 43 PES 44 PAG 45 PAS 46 PAS 47 7 48 16 PBI 17 2 18 19 20 PBS 21 22 7 23 PEO 40 39 38 37 PE4 27 PE7 24 5 70 18 C17 PRO 01 01 PPI 3 2 2 PP3 1 80 PPS 79 PP7 78 SHARED IO LCD SPI D R2 R3 10K 10K 12A256B 9 1N4148 210 RESET VR1 BYPASS CAPACITORS 3 580840 LM2937 5 GND i C14 c5 VDDPL TITLE m NMIN 12A256B VSS 051303 052103 BEND 8 0 Examples These examples may be typed in interactively or cut and pasted into the terminal window if you are using MaxForth Alternatively they can be translated to the language that you are using to program the microcontroller with 8 1 Playing with the LEDs There is a green and red
3. 2 pressa wait till done then press b 4 download the MaxForth s record with the text protocol by cutting and pasting or dragging and dropping if supported 5 wait till done then press reset with the J4 jumpers removed or in the Application position Quick Tip For an extremely fast download you could try setting the baud rate to 115200 set line delay to zero and flow control to X ON X OFF Using this setup you can download the entire kernel in seconds when needed You could also use this method to download s records to flash for code to be autostarted or run from MaxForth 4 3 On board Development System e Taking advantage of the interactive nature of the board s development system MaxForth you can interact directly with the microcontroller s peripherals by fetching and storing values to the memory mapped configuration registers for the peripheral devices This is an effective way of understanding the peripheral documentation verifying correct initialization sequences running some tests on different configurations and debugging driver code as you develop it By typing in new definitions you can add new macros to the dictionary for interactive use or for creating an automated program Some examples are given later on 4 3 1 Hooking Into Autoboot You can autoboot an application by leaving a vector to it at location OXEFFE The startup boot loader will detect this vector and then jump to the location that the vector is pointing to
4. 0 is red port M outputs 1 is green establish a stack drive port M bits 0 and 1 turn off red LED and turn on green LED 64ms timer enable RTI interrupts enable interrupts go to low power mode save energy interrupt reset RTI interrupt toggle red LED return from interrupt Secondary vector table additions rti tie in org SEFFO dw sir rti Startup tie in RII vector User Manual V 1 Aug 18 2003 15 org SEFFE application vector dw startup To compile this program you can use the freeware assembler as12 on a PC or a Mac The assemblers are with the included files Once the program is compiled you must then convert the output srecord with another freeware program sreccvt This gets it into the right download format Then you download the file and once it is done press the reset button You should see the green LED light and the red LED flash rapidly NOTE If you are using the D Bug12 monitor application then you will not have to convert the s record format but you should org to a different address On a PC you can assemble and convert from a DOS command prompt and then download with a terminal program You can either put the as12 and sreccvt programs right in your working directory or put them elsewhere and then add the path to your autoexec bat file Once you ve established the proper sequence you can automate it by putting it into a batch file On a
5. 90 CONSTANT ATDODRO INIT A D 7 ATDOCTLA C 10 bit resolution prescaler greater than 6 40 ATDOCTL3 8 conversions per sequence CO ATDOCTL2 C power up fast flag clear and interrupts off REQUESTO 80 ATDOCTL5 C 8 conversions right unsigned one shot channel 0 CHANNELO f ATDOSTAT C 80 AND DISPLAY READING ATDODRO GETAD INIT A D REQUESTO BEGIN CHANNELO UNTIL DISPLAY READING 8 3 Adding a Sensor The SHT11 from Sensirion is a smart sensor combining temperature and relative humidity sensors with an onboard conversion and a two wire communication facility all in a very tiny package In the following example it is hooked up to PORT T of the microprocessor One line is used to provide clock and the other line is used as a bidirectional line for communication SHT11 interface for MaxForth Rob Chapman Aug 13 03 The SHT11 sensor chip provides 14 bit resolution on temperature and 12 bit resolution on relative humidity The four pins connect to 1 is the serial clock PT3 is the data line and is bidirectional so care must be taken not to drive it high just low so there will be no 5 GND for clock and PT3 for data conflicts It can be driven low but is pulled high by pull up resistor HEX Registers 242 CONSTANT DDR data direction register for port T 240 CONSTANT PTT port t outputs 244 CONSTANT PER port t enabl
6. When MaxForth is installed it has a vector at that location To get to the serial loader from MaxForth type in FLASH and hit enter To get back to the serial loader from an application jump to location OXFO2E in memory The application area can be erased using the serial loader without the boot loader being removed from memory MaxForth occupies the space from 0x4000 0x7FFF and 0xC000 0xC911 At location OxEFFE is the start vector for MaxForth which is what the bootloader looks for when booting MaxForth can be replaced by erasing it and writing a new application in its place making sure that the startup vector for the new application is at OXEFFE If you want to hook into the MaxForth autoboot system then there are several places where you can do this quick entry allow setting of COP and other write once registers on the micro boot entry MaxForth has been setup and can be augmented auto vector last possible chance before Forth is started up User Manual V 1 Aug 18 2003 7 Table 1 Noted Memory Locations for Startup Hooks Name Value Notes quick_tag OxOFEC store a tag quick vector OxOFE8 CFA of word to call boot tag OxOFEO store a tag boot vector OxOFEA CFA of word to call boot start 0x0400 lower limit in flash for check ing for an auto vector tag on a 1K boundary boot end OxF000 upper limit of flash for auto vector tag checking 1 A55A 2 A44A for first autostart or A55A fo
7. second serial port SCI1 J3 is the jumper for LCD contrast J4 is for selecting boot to Serial Loader or application such as MaxForth J5 is the analog input header J6 is the I O and other peripheral interface signals J7 is the jumpers for future memory expansion User Manual V 1 Aug 18 2003 8 J8 is the LCD connector or SPI or Timers shared I Os J9 is the BDM OUT that supports motorola DBUG12 POD mode J10 is the BDM in interface DB2 has the same pinout as J6 for Dsub 44 pin The connector is not installed Additionally the red LED is controlled by port M bito PMO the green LED is controlled by port M biti PM1 Resistor POT R4 provides the voltage to the LCD that is used to adjust the LCD contrast RS1 reset switch User Manual V 1 Aug 18 2003 6 0 Board Layout BCNOI Ji elejelele A OUOU 0000 Q no c7 D e Oo e DE z ete Coe 2 VRI e ee n7 LM2937 e 0 J7 DB2 000000000000000000 00
8. the application position and the D Bug12 monitor application is loaded D Bugl12 4 0 0618 Copyright 1996 2002 Motorola Semiconductor For Commands type Help gt or if the J4 jumpers are set to the application position and MaxForth is loaded Max FORTH V5 1F license agreement is required And when you depress the ENTER key it should respond with type for help or or Max FORTH prompt When you see that message it means the communication is established and you are ready to interact with the board and microcontroller By pressing the reset button RS1 you should get the same boot prompt as when you powered it up Pressing the reset button will leave the contents of most of the RAM intact which might be useful for debugging purposes whereas if you power cycle the board then all RAM contents will be lost User Manual V 1 Aug 18 2003 4 3 0 Memory Map The memory map consists of RAM ROM and registers The interrupt vectors exist in protected flash space along with the serial loader Since they can t be changed a secondary vector table exists at OxEF80 There is a one to one correspondence with the primary vector table Since these locations can only be written once the entire 512 bytes must be erased to change a vector For prototyping the vector can be set once to point into EEPROM which can be erased more easily When only the serial loader is loaded it relocates RAM to the top of memory and copies itse
9. the on board development system MaxForth through a serial port and HyperTerminal When downloading text files to the board using the text download protocol make sure the delay per line is at least 100 milliseconds You can risk having lines missed if you go to fast but with some setups it is possible to use smaller line delays which has a nice effect on a long download Your mileage will vary 4 1 BDM Connector and Parallel Port Using the HCS12 cable from P amp E Micro or equivalent plug it into the parallel port of your computer through a parallel port cable and the BDM port on the computer board making sure to orientate the triangle on the pin header to pin 1 on the board which is marked by a square solder pad on the bottom of the board Apply power to the board When disconnecting from the board make sure it goes through a power cycle before you try out the downloaded software since a reset is not enough to regain control of the microcontroller after interacting with the BDM port Check the help screens for more details 4 2 S Records and the Serial Loader Using the serial loader you can download s records that have been created by a C compiler or Assembler program that you have acquired separately to flash memory to be run The help menu invoked by typing a is a Erase Flash b Program Flash c Set Baud Rate d Erase EEPROM gt The serial loader works by running out of RAM At bootup the boot pro
10. 32 48 etc To access the top page of flash which also appears in the memory map from 0xCO000 to OxFFFF you would store 15 31 47 etc into the PPAGE register HEX F 30 C These sections of flash are referred to as pages of flash As noted in the memory map Figure 3 on page 5 page E and page F are permanently in the CPU memory map but they can also be accessed through the programming page window For instance if you store 14 into the PPAGE register you will see the same memory image at location 0x4000 as you will see at 0x8000 If you want to install interrupt vectors in the secondary vector table at OXEF80 OxEFFF then you must put page F into the programming window For instance if you want to install an interrupt vector for the real time interrupt RTI which is at OXEFFO you d do the f ollowing HEX F 30 C address of interrupt vector AFFO FL Note that OXAFFO is 0x4000 less than where the actual interrupt vector is to be but that it will appear there If you try to use FL in any other memory area outside of the programming window it will not work As described in the microcontroller manual on flash memory the upper 16 bytes of EEPROM are reserved as control registers for the EEPROM You should avoid setting values in this range OxFFO OxFFF unless you know what you are doing Setting the wrong values in this region has the potential to lock out use of the EEPROM from being erased The EEPROM differs from the flash memory
11. Included Files The following files are included and are available from our website The MaxForth files are only available if you have licensed them as12 Mac OS X version of the Motorola freeware assembler 512 PC version of the Motorola freeware assembler as12 htm documentation for the assembler BootEVB 16 S19 Serial Boot loader srecord file DB12DP256 16 S19 Dbug12 monitor srecord file HCS12Manuals zip contains a copy of the Motorola manuals for the microcontroller from their website Note these are too big to put on a Floppy so they are available at http www ee ualberta ca rchapman MFwebsite HCS12 HCS12Manuals zip NMIN 12A256Bv1 pdf this manual in PDF format Out S19 output of converted srecord rtiled Ist output of assembled source code rtiled s source code example of an interrupt and power saving instruction WAI rtiled s19 srecord output from assembler SRecCvt OSX srecord conversion utility for Mac OS X SRecCvt exe srecord conversion utility for PCs SRecCvtRG pdf srecord conversion utility documentation Licensed files fuzzytest f an example file for testing the fuzzy logic support mf51fhcs12 map contains a map of all the bits and pieces in MaxForth for the current release but may change in future releases Use with caution MF51FHCS12 819 a copy of the MaxForth kernel in Motorola S record form that can be downloaded when experimenti
12. LED attached to port M bits 1 and 0 respectively You can easily turn these on and off from MaxForth using the following code Note that constants are defined for the registers for convenience HEX 250 CONSTAN 252 CONSTAN WWN NEF EF DDRM DDRM DDRM DDRM de de se tu se tu se tu fine port M address fine data direction register for port m t bit 0 as an output and all others as inputs rn on the red led connected to bit 0 t bit 1 as an output and all others as inputs rn on the green led connected to bit 1 t bits 0 and 1 as outputs all others as inputs rn on both leds 8 2 Reading from the A D port For this example we will consider the simplest way to get an A D reading get A D reading initialize A D request channel 0 display eading This involves setting up the A D registers so it is ready to go requesting a read of a channel waiting for that channel to complete converting and finally reading and displaying the value Each of these boxes on the diagram will become a word except for Done HEX A D peripheral registers 82 CONS AN A DOC 83 CONS AN A DOC L2 L3 User Manual V 1 Aug 18 2003 12 84 CONSTANT ATDOCTL4 85 CONSTANT ATDOCTL5 86 CONSTANT ATDOSTAT
13. Mac using OS X you assemble and convert using a unix terminal window You can either keep the programs local or put them into a common directory For instance you could do the following sudo cp as12 usr bin Password rehash This puts the as12 program into your usr bin directory so that you can call it anywhere The same procedure can be done for sreccvt The rehash command just makes the new command available right away To assemble the program 12 rtiled s gt rtiled lst This will produce two outputs The Ist file is a listing of the assembled program while the s19 file is the output srecord The srecord file must then be converted to the correct format for downloading sreccvt m 00000 fffff 32 lp rtiled s19 SRecCvt v1 0 11 Converting S Record File rtiled s19 S Record File Conversion Complete If you want to see the output you can view it from the command line more Out S19 S2240FC000CF4000180B030252180B020250180B7F003B180B80003810EF3E20FD180B800057 2240FC02037B6025088017A02500BFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF63 2240FEFEOFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFCOICFFFFFFFFFFFFFFFFFFFFFFFFCOO07D S9030000FC Download the program by first selecting a to erase the flash and then b followed by the above srecord D Bugl2 Bootloader v1 0 0 a Erase Flash b Program Flash C Set Baud Rate d Erase EEPROM User Manual V 1 Aug 18 2003 16 a Er
14. NMIN 12A256B Single Board Computer User Manual V 1 Table of Contents 2 0 Getting 3 0 Memory 4 0 Programming the 4 1 BDM Connector and Parallel 4 2 S Records and the Serial Loader 4 2 1 Downloading 4 3 On board Development System 4 3 1 Hooking Into Autoboot ONN 5 0 Connections and 6 0 Board 1 7 0 5 8 0 lt 8 1 Playing with the 8 2 Reading from the A D port 8 3 Adding 5 8 4 Implementing an 8 4 1 Real Time Interrupt 8 4 2 Interrupts Calling 8 5 Flash 00 NN NOO Aug 18 2003 1 0 Overview The NMIN 12A256B single board computer provides you with plug and play access to a powerful microcontroller The
15. ase Flash b Program Flash c Set Baud Rate d Erase EEPROM 2 Reset the board If all goes well the green LED should be on and the red LED should be blinking Make sure you change the J4 jumpers for the application to run 8 4 2 Interrupts Calling Forth As for calling a Forth word from an interrupt this is doomed to fail at some point since not all Forth words including the virtual machine are interruptible without some extra context savings This all adds overhead and goes against keeping interrupts as short as possible If you keep your interrupts simple and in assembler then they have a greater chance of working and meeting system time constraints 8 5 Flash Programming There is 256K of flash memory available on chip but since the microcontroller has only 16 bits of address space or 64K you must access the flash through a programming window Flash memory may only be written when it is in the region 0x8000 OxBFFF which is referred to as the program memory page window This region is a 16K window which can be used to access all of the 256K of flash memory To change which 16K region of memory is accessed there you need only change the PPAGE 0x30 register Since there is only 256K of flash but the register is 8 bits the memory windows will be unique for a small range only and then wrap after that For example putting 0 into PPAGE 0 30 will access the lowest 16K of the 256K flash memory but so will 16
16. computer board provides power regulation RS232 and RS422 serial support and an LCD connector The microcontroller includes the following built in capabilities eem MC9S12A256 Microcontroller Figure 1 Peripheral interfaces on the MC9S12A256 microcontroller 1 1 Noted microcontroller features 16 bit HCS12 CPU Multiplexed External Bus Interface for memory expansion Interrupt control for all onboard peripherals including priority manipulations Breakpoints for stepping through code without needing an emulator Single wire BDM Background Debug Mode for downloading and debugging low current oscillator PLL COP watchdog real time interrupt clock monitor 8 bit and 4 bit ports with interrupt functionality Programmable rising or falling edge triggers 256K Flash EEPROM 4K byte EEPROM 12K byte RAM 8 channel 10 bit 5V Analog to Digital Converters 16 bit counter timer with 8 programmable input capture or output compare channels Two 8 bit or one 16 bit pulse accumulators 8 PWM channels Two asynchronous Serial Communications Interfaces SCI up to 115K baud Three Synchronous Serial Peripheral Interface SPI Inter IC Bus compatible with 12 Bus standard lines with 5V input and drive capability Operation at up to 50MHz for core and up to 25MHz bus speed for peripherals Single Chip and Expanded Modes Low power modes User Manual V 1 Aug 18 2003 2 The computer board s power consumption is about 60 mA 1 2
17. e for pull ups Debugging PT7TRIG pulse pt7 low for debugging with scope DDRT CQ 80 OR DUP DDRT C enable PT5 output PTT C AND 7F AND DUP PTT C set it low 80 OR PTT C Clock KO1 K10S Data 5 1 2 KO 2 NOT KO K1 K10 K1 KO set it high CQ OR PTT C PTT C AND PTT C 0 DO K10 LOOP User Manual V 1 Aug 18 2003 13 DO A DDRT C 8 NOT AND PTT C Protocol 8 bit command and 16 bit data SHT C n Dl 9 K10S K1 1 D1 DO K10S 10 5 0 DO KO 2DUP AND IF Dl ELSE DO THEN Kl 2 LOOP 2DROP D1 K01 KO DAT READY PTT 8 AND O GET 8 n n 80 DO 2 C 8 AND IF 1 OR THEN LOOP GET DAT 0 GET 8 KO DO K10 D1 GET 8 K01 KO Exchanges RS 1E SHT CMD Initial setup INIT SHT 2 PLACES for printout format 2 DDRT C clock is output always FF PERT C pull up enabled DECIMAL Tests for temperature in Celsius and relative humidity RH Values obtained from chip are in a raw format and need to be massaged Formula for temperature 40 01 rawTE Formula for linear RH 4 rawRH 0405 2 8 10 6 rawRH Formula for true RH linRH TE 25 01 00008 rawRH TEMP 3 SHT CMD BEGIN DAT READY UNTIL GET DA
18. gram in flash checks to see if there is an application by checking for a vector at OXEFFE If there isn t then it copies the serial loader program from flash to RAM and then runs the program The serial loader program must run out of RAM to be able to program flash memory If you download an application reboot and nothing happens you can recover to the serial loader by setting the jumpers on the J4 connector with a jumper or equivalent and pressing the reset button You will be taken back to the serial loader where you can erase your errant application and try again e E e J 4 Application J 4 Serial Loader Figure 4 Jumper positions on the J4 connector for booting into the serial loader or an application If there are no jumpers then the default will be the Application This is important if you intend to use channel 0 and 1 of the A D input since leaving jumpers in the Application position will prevent those inputs from being used User Manual V 1 Aug 18 2003 6 4 2 1 Downloading S Records The serial loader uses a simple text transfer protocol to transfer data from the host computer to the board Depending on your host program and its defaults the setting may be not right Try it first and if it doesn t work modify some of the settings To install a fresh copy of MaxForth and erase all the flash do the following 1 getto the serial loader from Forth by FLASH or by resetting with the J4 connector set like in Figure 4
19. in two other aspects Its erase size is 4 bytes while the flash is 512 bytes This makes the EEPROM easier to reprogram in small amounts In MaxForth you can program a byte location irregardless of its value as it will be erased first by EEC if necessary In flash memory the minimum programming size is an aligned 2 bytes and the location must be OxFFFF to begin with To program EEPROM use EE EEMOVE and EEWORD To program flash use FL FLMOVE FLERASE and FLWORD EDP is used by EEWORD and FDP is used by FL WORD User Manual V 1 Aug 18 2003 17
20. lf to it to run only out of RAM This allows the changing of page F through the flash window at 0x8000 The MaxForth system takes up space in page E and page F of flash leaving pages 0 to page D available for use None of the EEPROM is used so it is all available for use for user applications Serial Loader MaxForth id EFE primary vectors 0xD000 loader fX TT secondary vectors 0XF 000 COXEFS0 system 0xC000 0xC000 free space 0x8000 0x8000 system 0x4000 nr 0x1000 0 1 oo system free space 0x0400 0x0400 registers registers 0x0000 0x0000 Figure 3 After booting the RAM memory map either belongs to the serial loader or the MaxForth application 4 0 Programming the Board When the board is reset it executes the program pointed to by the vector at location OxFFFE In a loaded board this will be the boot loader which will either start the serial loader or MaxForth When MaxForth starts it checks to see if there is an autostart application present and runs it or else it just runs MaxForth There are several ways in which to program the board 1 download an s record through the BDM connector and the PC parallel port using a programmer User Manual V 1 Aug 18 2003 5 such as P amp E Micro s BDM programmer 2 download s records using the embedded serial loader and a serial port with HyperTerminal or equivalent 3 interact directly with the microcontroller and download source code to
21. ng with flash a utility for clearing vectors from EEPROM and flash SHT11 F an example of interfacing to a temperature and humidity sensor TESTA24 F an example to test ATO4 NOTE Throughout the manual Ox is used to precede hex addresses in the text for clarity but it is not used in the MaxForth examples because the numeric base is changed by typing HEX or DECIMAL 2 0 Getting Started Computer Power Serial Cable Figure 2 Computer hooked up to board with a serial cable You will interact with your board by connecting it to a PC using a serial cable and running a terminal program such as HyperTerminal or an equivalent setup You need to set it to 9600 BAUD one stop bit no parity and 8 User Manual V 1 Aug 18 2003 3 data bits Connect an RS232 serial cable between your PC s COM port and the serial port on the board To power up the board you need a 7 to 12 volt plug in transformer plugged into the power jack PJ1 AC DC both polarities accepted Alternatively you could use Linux or a Mac On the Mac ZTerm is a powerful terminal program available as shareware from the Internet When everything is ready and you plug in the power you should receive a prompt in the terminal program If you have the J4 jumpers set to the serial loader position D Bugl12 Bootloader v1 0 0 a Erase Flash b Program Flash C Set Baud Rate d Erase EEPROM or if the J4 jumpers are set to
22. r continuous last autostart 4 3 2 Tags The patterns 0xA44A and 0xA55A are referred to as tags and are used during the autoboot process to find vectors to be executed during the bootup process Only the lowest A44A and A55A tag will be executed with A44A going first This applies to the boot entry and autovectors The quick entry if used only uses A55A 4 3 3 Quick Entry Quick entry lets you get in on the boot process and set COP or any other write once registers before MaxForth starts up The tag contains a bit value that is checked first and if present then the CFA stored at the vector preceding it is executed HEX A55A FEC EE COP RUN CFA FE 4 3 4 Boot Entry E hook into quick entry vector Boot entry lets you take over or execute something after MaxForth has been initialized This is a good time to modify the dictionary linkage to add extra words from flash The vector follows the tag HEX A44A FEO EE STARTUP CFA F 4 3 5 Auto Vector E4 hook into boot start vector As well at any 1K boundary in RAM EEPROM or flash you can lay down a tag followed by a vector HEX 1000 AUTOSTART STARTUP 5 0 Connections and Jumpers hook into auto start vector The jumpers and I O headers from the board are as follows J1 is the primary serial port SCO that is used for the serial bootloader dbug12 monitor and MaxForth J2 is the
23. rals Interrupts can even be forced to happen to provide for a way of testing or syncing To set up an interrupt you d f ollow these steps 1 write an interrupt service routine which will turn off the source of the interrupt when invoked by the interrupt This routine must end with the assembly instruction rti 2 the address of this routine in the right location in the secondary vector table 3 enable the peripheral 4 enable interrupts 8 4 1 Real Time Interrupt Example The real time interrupt is a simple interrupt to enable and service so it is a good one to start with This following example is written in assembler and be compiled on a computer and downloaded with the serial loader RTI interrupt vector Startup sets up port M and initializes th on the green LED and then does Rob Chapman 2003 real tim Jun 20 turns interrupt RTI nothing the RTI just changes th Registers Used CRGFLG equ 37 RTICTL equ 3B CRGINT 38 DDRM 252 PTM 250 equ equ equ Startup code org C000 startup lds movb 54000 503 DDRM 02 PTM 7F RTICTL 80 CRGINT movb movb movb cli lowpower wai bra lowpower Service interrupt routin Sit movb 580 ldaa 01 staa rti for real tim red LED every 64ms RTI interrupt flag RTI control register RTI interrupt control port M data direction register
Download Pdf Manuals
Related Search
Related Contents
AE497W Manual - Alan-Albrecht Service KATALOG - Dr. Schutz Group TRITACARNE Venturer PVD730 Portable DVD Player User Manual Installation Manual Manuel d'installation Bedienungsanleitung Crestron electronic MT-1000C User's Manual Olympus VG-150 PNC-TN8410-97-274:0.86MB metodo de instalacion de un stent en un manguito de confinamiento. Manhattan 177009 mice Copyright © All rights reserved.
Failed to retrieve file