Home

IsoMax for ARM • User`s Manual

image

Contents

1. SPIO_SPDR SPIO_SPTOR SPI1_SPDR SPI1_SPTOR SPI_SPDR SPI_SPTOR IMERO_CR1 IMERO IR IMERO_MR2 IMERO_TC IMER1_CR1 IMER1_IR IMER1_MR2 IMER1_TC 6 14 Universal Asynchronous Receivers Transmitters TO TO TO_MSR T1 T1 T1_MS DLL IIR DLL Il y y UARTO_DLM UARTO_LCR UARTO_RBR UART1_DLM UART1_LCR UART1_RBR 6 15 Vectored Interrupt Controller VICDefVectAddr VICIntSelect VICSof VICVec VICVec VICVec VICVec VICVec VICVec VICVec VICVec tInt tAddr1 tAddr13 tAddr3 tAddr7 tCnt11 tCnt 113 tCnt 13 ECnt 17 VICFIOStatus VICIROStatus VICSoftIntClr VICVectAddr10 VICVectAddr14 VICVectAddr4 VICVectAddr8 VICVectCnt110 VICVectCnt114 VICVectCnt14 VICVectCnt18 TO_FC TO_LS TO_SC TIFE T1_LS TL GC Y Y y Ai y A VICIntEnable VICProtection VICVectAddr VICVectAddr11 VICVectAddr15 VICVectAddr5 VICVectAddr9 VICVectCnt111 VICVectCnt115 VICVectCnt15 VICVectCnt19 S S S S S S H E H E K i e PIO_SPINT PIO_SPTSR PI1_SPINT PI1_SPTSR PI_SPINT PI_SPTSR ERO_CR2 ERO_MCR ERO_MR3 H E H E H E H E ERO_TCR ER1_CR2 ER1_MCR ER1_MR3 ey E ER1_TCR UARTO_IER UARTO_MCR TO_THR 5 5 UART1_MCR UART1_THR VICIntEnC1r VICRaw VICVec VICVec
2. X SET STATE INSTALL ANDGATE1 There you have it another complete real time program in three lines of IsoMax M and one additional line to install it A useful virtual machine is made here with one state and one transition This virtual machine acts almost like an AND gate made in hardware For example http www philipslogic com products hc pdf 74hc08 pdf May 3 2006 24 Fig 1 Pin configuration Fig 2 Logic symbol Fig 5 HC logic diagram one gate Note 1 H HIGH voltage level L LOW voltage level 7203004 Fig 6 HCT logic diagram Fig 4 Functional diagram one gate Both P0 31 and P0 30 must be on or high to allow the yellow LED to remain on most of the time So by attaching push buttons to P0 31 and P0 30 simulating micro switches this little program could be used like an interlock system detecting cover closed May 3 2006 25 PROGRAM TEXT EQUIVALENT GRAPHIC MACHINE ANDGATE1 MAKE A MACHINE _ E YELLED OFF ON MACHINE ANDGATE1 P0 31 ON APPEND STATE X ADD A STATE P0 30 ON AND IN STATE x CONDITION YELLED OFF P0 31 ON P0 30 ON AN CAUSES ADD A TRANSITION YELLED ON THEN STATE x TO HAPPEN Now it is worth mentioning the example is a bit contrived When you try to make a state machine too simple you wind up stretching things you shouldn t This example could have acted e
3. STATE Y IN STATE IN STATE Y Y CONDITION CONDITION P0 31 OFF P0 29 OFF CAUSES CAUSES GRNLED OFF GRNLED ON HEN STATE HEN STATE Y Y TO HAPPEN O HAPPEN This code worked fine as long as P0 31 and P0 29 were pressed one at a time The green LED would go on and off without noise or bounces between states Notice however P0 31 and P0 28 being low at the same time is not excluded from the code If both lines go low at the same time the output of our machine is not well determined One state output will take precedence over the other but which it will be cannot be determined from just looking at the program Whichever transition gets first service will win May 3 2006 37 PROGRAM TEXT EQUIVAL MACHINE BOUNCELE ACHINE BO PPEND STAT P0 31 OFF P0 30 ON AND PPEND STA GRNLED ON IN STATE WAITOFF CONDITION P0 31 OFF P0 30 ON AND CAUSES GRNLED ON HEN STATE WAITO O HAPPEN IN STATE GRNLED OFF WAITO CONDITION P0 30 OFF P0 31 ON AND CAUSES GRNLED OFF HEN STATE WAITOFF O HAPPEN Now consider how BOUNCELESS can be improved if the state machines history is integrated into the problem In order to have state history of any significance however we must have multiple states As we did with our ANDGATE3 let s ad
4. DUP IF onfor DUP 50 1 MAX 1 MAX onfor ELSE adjusts DUP IF onfor DUP 50 1 MAX period MIN onfor ELSE DUP IF period DUP 50 1 MAX onfor MAX period ELSE DUP IF period DUP 50 1 MAX 60000000 MIN period THEN THEN THEN THEN SET PWM STATUS THEN THEN 0 UNTIL 9 2 2 Discussion We could run an algorithm based on the analog input to optimize the pwm signal to get the maximum voltage It would be like Enter state and mark onfor Increase over a period until voltage falls below start point and then use half of that as the increase Decrease over a period until voltage falls below start point and then use half of tha tas the decrease use the periodx2 as the settling time before assessment with a minimum of 1 millisecond 9 3 Software UART for GPS General purpose pins can be used to emulate a UART in software This example uses one pin to read the output of a GPS receiver falling edge start bit bit timeout 10 bits The GPS unit runs on 3 3V and requires as a minimum e ground May 3 2006 84 e 33V e 4800 Baud UART receiver P0 16 is used as the input on the ARM as this goes to external interrupt 0 The output is high unless zero bits like a start bit is being sent Each bit at 4800 takes 208us and a whole byte with start and stop bits will take 2ms The data from the GPS is repe
5. 25CC 2618 25D4 2034 25AC FABS 29C8 ES 260C FNEGATE 2590 D gt F 259C F 25BC FSWAP 2610 FNIP 178 FSPO 283C RPG 285 1944 END CODE 11D4 QUERY 27BC 2898 1450 14DC 1528 13F0 27C0 263C 1 A24 w d D Q 27E 248 2774 2880 2884 2780 148 2794 2634 25F8 1DC0 25EC 1CFO 261C 25E0 Di el Q gt TERMINAL COUNT MOD UM DNEGATE 2CONSTANT ZER FSIN E 1DAC E F FEXP FLOG POLY FLITERAL PLACES FVARIABL F FMIN F0 lt F gt D F F el HE el Di We H Fl 2748 1418 1484 14BC 1334 27C8 2828 27CC 31C 27 EC 430 5A8 10 60 2804 2888 277C 480 27 90 185C 18D4 25FC 1E48 2624 25 29 DO 98 E4 2630 262C 2614 2608 2050 25B4 2600 25D8 25A8 25A0 25C0 25B8 2640 2854 1704 B70 C14 27A8 27 6C 1904 TE4 804 7 60 DO 10B8 TRAILING 1 2 D2 MOD UM MOD CONSTANT 2VARIABL FTAN FATAN2 FSORT F S F Fe 2 X LOG2 FLOOR PI FLOAT FCONSTANT F FMAX El y Di EXECUTE EXPECT EO STATE May 3 2006 65 190 180 1C0 198 82C 4B8 598 A84 199C
6. QLEFT RESIZEQ T S RANSFE T stacker YELLED DW MN A H KE UT ror EVALUAT E RUL RANDOM 4888 48A0 48B8 48D0 275C 6BDC 6E28 6CDC 6B88 6A6C 6938 6920 6908 6834 VICVectCnt13 VICVectCnt 16 VICVectCnt 19 WDMOD CELL ISOMAX START T ADDR 67F8 662C 6568 64A0 6398 72E0 7330 HIS TIME CONDITION END STATE ALLOC UU E MICROSECONDS MINUTES ACHINE CHAIN UNI SCHEDULE RUNS 6AC4 72EC START 72F4 7318 7304 7310 7328 72FC 48E8 6380 3E88 40000030 48F8 3B3C 3938 3928 2728 TIMEOUT LERASE ei U EFUZZIFY RAND_MAX O E F D 4890 48A8 48C0 48D8 6DBC 6C34 6D28 6B50 6A9C E 6A10 6930 6918 68C4 6828 66C4 6624 6500 6498 48F4 72DC VICVectCnt14 VICVectCnt17 VPBDIV WDTC MACHINE SCRUB 72F0 72D8 7300 731C 730C 6408 7324 ET TIMEOUT TART TIMER 72F8 1 6390 6388 40000020 4900 48FC 3C4C 3924 273C 1554 pscitxg FORTH 83 May 3 2006 68 6 REGISTERS The ARM micros have quite a few memory mapped registers to control the peripherals A detailed description of the bits and effects on the periph
7. E E dE On OOG C INTERPRET lt RESOLVE CFA B BUF FORGET WORDS ABORT BRANCH ADDR SFF_GRP_sa ENDofTable CANTXSR C1MOD C2CMR C1ICR C2TER C1EWL C2SR C1RID C2RDA C1TFI1 C2TID1 C1TDB1 C2TFI2 C1TDA2 C2TDB2 C1TID3 C2TDA3 EXTINT EXTWAKE I2C_I2CONSET I2C_I2SCLL IOCLRO TODIRO IOPINO IOSETO MEMMAP PCONP PINSEL2 May 3 2006 66 ti CO CO o CO 0 O oo 5 NH U Dm gt o A o s H o oo da om Dm om aa a a w n D CD ei CO 0 CO 0 CO CO o gt gl Q Wu ju oo PLLCFG PLLSTAT PWM _ CRI PWM EMR PWM MH PWI 2 PWI 5 R R PWM_PC PWM_TC RTC_ALDOY RTC_ALMO RTC_AMR RTC CTC RTC_CTIME2 RTC_DOY RTC_MIN RTC_PREI PIO_SPCCR PIO_SPINT PIO_SPTOR PI1_SPCR PI1_SPSR PI1_SPTSR PI_SPDR PI_SPTCR RO_CCR RO_CR2 RO_IR S S S S S S S S E E E a Hy oO Oo oo gt Oo N C oy A od ol oo gt en I c en 00 oo gt D gt C D Y oo gt o LI C RO_MR1 RO_PC RO_TCR R1_CR2 ER IR ER MR ER PC ERI TCR TO_FCR TO_LCR E E E E a T oo E gt I o C 0_MSR TO_THR T1_FCR T1_LCR T1_MSR UART1_THR VICIntEnable VICIROStatus VICSoftInt V
8. MII Bounceless switches filter out any noise on their input buttons and give crisp one edge output signals They do this by toggling state when an input first becomes active and remaining in that state If you are familiar with hardware you might recognize the two gates feed back on each other as a very elementary flip flop The flip flop is a bistable on off circuit is the basis for a memory cell The bounceless switch flips when one input is grounded and will not flip back until the other input is grounded By attaching push buttons to P0 31 and P0 29 the green LED can be toggled from on to off with the press of the P0 31 button or off to on with the press of the P0 29 The P0 31 button acts as a reset switch and the P0 29 acts as a set switch May 3 2006 28 PROGRAM TEXT EQUIVALENT GRAPHIC MACHINE BOUNCELESS MAKE A MACHINE P0 31 OFF ON MACHINE BOUNCELESS APPEND STATE Y ADD A STATE IN STATE Y CONDITION P0 31 OFF CAUSES GRNLED OFF THEN STATE Y TO HAPPE ADD A TRANSITION IN STATE Y CONDITION P0 29 OFF P0 29 OFF CAUSES GRNLED ON GRNLED ON THEN STATE ADD A TRANSITION Y TO HAPPEN You can see here in IsoMax M you can simulate hardware machines and circuits with just a few lines of code Here we created one machine gave it one state and appended two transitions to that state Then we installed the finished machine alon
9. Once again the green LED should change This time the machine starts in the state with the LED off The always TRUE condition makes the transition s action happen and the next state is set to again back to the original state As many times as you run it the May 3 2006 43 machine will change the green LED back and forth Now with the machine program and tested we re ready to install the machine into the machine chain The phrase to install a machine is EVERY n CYCLES SCHEDULE RUNS word So for our single machine we d say ZIPON SET STATE EVERY 5000 CYCLES SCHEDULE RUNS ZIPGRN Now if you look at your green LED you ll see it is slightly dimmed E e E mmm ze i That s because it is being turned off half the time and is on half the time But it is happening so fast you can t even see it 4 16 REDYEL Let s do another of the same kind This time lets do the red and yellow LED and have them toggle only one on at a time Here we go MACHINE REDYEL ON MACHINE REDYEL APPEND STATE REDON APPEND STATE YELON IN STATE REDON CONDITION TRUE CAUSES REDLED OFF YELLED ON THEN STATE YELON TO HAPPEN IN STATE YELON CONDITION TRUE CAUSES REDLED ON YELLED OFF THEN STATE REDON TO HAPPEN
10. INI SSMS EIRQ STATE START STATES COND PARENT MACH O AS EINT2 RTC SPI UART1 TIMERO SWI badints BOOTUP F24 EXT TIME EAC FLSTATE AS C30 B18 A94 A14 E 8B8 27AC 2754 1878 27F0 281C 2868 364 2810 26C 2798 282C 289C 28A0 2784 UNDO VARIABLE CONSTANT D CODE FLWORD a cl 61 gt lt 2SWAP OVER PICK DROP R gt g 0 lt DU lt DITION O O O O O O O S OO O GO O O OO DO GOD O 10 O O oe ooo ee oee Seo EN E E EH EI 0 0 0 01DB0 01D40 01CD4 O1COC E 01B74 019D8 X 01970 0186C 01720 015B0 01490 E 0144C 01408 013C4 0137C 01338 01274 01198 ALL MACHINES Q a Ke Co H D e El DOE GU 00F00 00D30 00CC4 OOBS5C OOAD4 OOA4C 7 009F0 155 2750 33 189C 110 2858 2864 279C 2838 2D4 2874 27A4 3B4 2894 350 ROT ROLL 2DROP DO U lt D lt May 3 2006 64 3C4 D 280C OR 1438 THEN 1504 UNTIL 1498 AGAI 13C8 LOOP 27C4 J 1358 LEAVI 27A0 EMIT 2740 ABS 408 DMI 5F4 SPAC 624 TYPE 2808 1 287C 2 2778 D 284C MOD 498 27F8 NEGATE 18C0 VARIABLE 2638 SF 25F4 FCOS 2628 FATAN 25F0 F2 1138 F 1D5C 25D0 F 2620 F 1F1C ODD POLY F e F F Sol El n
11. IsoMax for ARM User s Manual Virtually Paralle af A Al S 2 nine Architecture l Warranty New Micros Inc warrants its products against defects in materials and workmanship for a period of 90 days If you discover a defect New Micros Inc will at its option repair replace or refund the purchase price Simply call our sales department for an RMA number write it on the label and return the product with a description of the problem We will return your product or its replacement using the same shipping method used to ship the product to New Micros Inc for instance if you ship your product via overnight express we will do the same This warranty does not apply if the product has been modified or damaged by accident abuse or misuse Copyrights and Trademarks Copyright 2002 by New Micros Inc All rights reserved IsoMax for ARM IsoMax and Virtually Parallel Machine Architec ture are trademarks of New Micros Inc Windows is a registered trademark of Microsoft Corporation 1 wire is a registered trade mark of Dallas Semiconductor Other brand and product names are trademarks or registered trademarks of their respective holders Disclaimer of Liability New Micros Inc is not responsible for special incidental or consequential damages resulting from any breach of warranty or under any legal theory including lost profits downtime goodwill damage to or replacement of equipment or property an
12. stop all state machines ASMs and SSMs 5 8 5 Status INTS pending system interrupts MACHINES lists all running SSMs and ASMs STATES lists all the current states for all state machines 5 8 6 Measurement START n time in microseconds END n shows elapsed time since START ENDMAX n a keeps maximum elapsed time at address a STARTMAX sm sm t leave START and state address STATEMAX sm t v store state and time in v is maximum 5 9 ASM Example Stoplight Here is a simple ASM example using timer 1 to treat the onboard leds using LEDS tool to make them May 3 2006 62 run like a stoplight Stoplight demo Rob Chapman Feb 3 05 This example demonstrates using an ASM with the TIMER1 peripheral Each interrupt the timeout length is changed and an LED is set LZ green for 5 seconds yellow for 1 second red for 5 seconds MACHINE STOPLIGHT APPEND STATE GREEN APPEND STATE YELLOW APPEND STATE RED IN STATE GREE light is green till timeout happens CONDITION 1 CAUSES 2 LEDS 1 TIMER1 MRO 1 TIMERI IR change to yellow for one second 1 3 TIMER1 TCR TIMERI TCR since TC doesn t reset with smaller MR THEN STATE YELLOW TO HAPPEN IN STATE YELLOW light is yellow till timeout happens CONDITION 1 CAUSES 4 LEDS 5 TIMER1_MRO 1 TIMER1 IR change to red for 5 s
13. 1s not eraseable 9 1 Using the ADC to Measure Battery Life This example uses the ADC to measure the voltage on a battery periodically so that it can be monitored as it drains with different loads and then the values can be graphed A SSM is used to do the timing and a ASM is used to do the ADC reading 9 1 1 Code Battery life monitor Rob Chapman Sep 29 04 The life of a battery can be moni it toa fixed load and the AINO the state machines while th starts up things and then periodi The main sta a d reader is an asm voltage by getting a timeout and pind 27 tored by connecting and running te machine is a ssm The main state machine cally reads the battery then writing a read command POO LOGE gO GO OG ig to the A D The asynchronous state machine fields the A D interrupt when the reading is finished and queues it COLD HEX Tools CELLS n n O CELL LSHIFT n m n 0 DO 2 LOOP data structures 100 MILLISECONDS TIMEOUT bto battery sample period 101 QUEUE sampleq queue of samples to flash can be bulk written CREATE samplearray 200 ALLOT for formmatting for flash ASM asynchronous state machine for A D MACHINE A D READER APPEND STATE READ AINO IN STATE READ AINO CONDITION 1 CAUSES May 3 2006 76 ADDR FFFF AND 6 0 DO 2 LOOP sampleq PUSH D ADCR shut down a d ff VICVectAd
14. SSMs ASMs INES HT POLL GRAPHER HT IDLE NOT GRAPHING OK LCD TRANSFER DATA TRANSFER OK The ASMs associate with a peripheral like a timer uart or pwm so I m thinking of adding that to the printout so that you know which ASM is assigned where Examples of ASM assignment where USE ASM is like INSTALL but takes an interrupt source TIM ERO USE ASM LCD UAR RANSF ER T1 USE ASM DATA RANSF ER Reseting the interrupt If the user is using a timer then resetting the interrupt will depend on the channel and also on the usage The system cannot know what to reset so the user must reset the interrupt generated by the peripheral However the interrupts on the ARM are handled by a complex beast known as the VIC vectored interrupt control The ASM interface provided basically hides the VIC and its complexity The VIC also has to have its interrupt reset but that is always the same so the system takes care of it This only leaves the user with the peripheral they want to use and its registers to deal with A couple of exampls of ASM s SSM s timeouts and queues are included for reference This is an example of an SSM used to obtain readings from a sensor hum A A A A 11 ms before awake idity and temperature machine MACHINE HT POLL ON MACHINE HT POLL PPEND STATE SHT OFF PPEND STATE SHT WAKING PPEND STATE HT IDLE PPE
15. This version was V0 2 IsoMax May 3 2006 7 was ported from the IsoPod to the HC12 then the HCS12 and now onto the 32 bit environment of the ARM IsoMax runs on both the LPC2129 on the Plug an ARM board and on the LPC2106 on the USB and TiniARM boards The two ARMs offer different hardware configurations for different environments The ARM is a different platform than the IsoPod and the different features are discussed in detail later As IsoMax grows new features and new platforms will be added May 3 2006 2 INTRODUCTION Okay We should be running Back to the basics What is neat about the IsoMax for ARM Several things First it is a very good micro controller The IsoMax for ARM was intended to be as small as possible while still being useable A careful balance between dense features and access to connections is made here Feature density is very high So secondly having connectors you can actually get at is also a big plus What is the use of a neat little computer with lots of features if you can conveniently only use one of those features at a time Virtually Parallel The answer is very important The neatest thing about the IsoMax for ARM is software giving Virtually Parallel Machine Architecture Virtually Parallel Machine Architecture VPMA is a new programming paradigm VPMA allows small independent machines to be constructed then added seamlessly to the system All these ins
16. are the steps 1 You should start with a clean IsoMax by doing SCRUB This will erase the Program Flash and remove any previous autostart patterns 2 In the program file each Forth word should be followed by FLWORD This applies to colon definitions CODE and CODE SUB words constants May 3 2006 48 variables defined words those created with lt BUILDS DOES gt and objects those created with OBJECT 3 If IMMEDIATE is used it must come before FLWORD e you must do IMMEDIATE FLWORD and not FLWORD IMMEDIATE 4 For IsoMax code the following rules apply a MACHINE lt name gt must be followed by FLWORD b APPEND STATE lt name gt must be followed by FLWORD c IN STATE TO HAPPEN or THIS TIME or NEXT TIME must be followed by IN EE d MACHINE CHAIN END MACHINE CHAIN must be followed by FLWORD e ON MACHINE lt name gt is not followed by any EE command Note that we can make FLWORD and IN EE automatic if you want all state machines to be built in Flash and never in RAM 5 When the application is complete you must use SAVE RAM to preserve the state machine variables in Data Flash This does not save kernel variables 6 Finally you can set the autostart vector in Program Flash You need to provide an address on a 400h boundary within unused Program Flash thus after the end of the application program 4 18 1 Autovectors By placing a tag at certain locations the vector after i
17. A 34 4 9 INTER MACHINE COMMUNICATIONS aen eneen 36 4 10 STATE MEMORY nin ee NNN 36 4 11 BOUNGELESS lt uuu anita vases an aa aa ae a a aaa avian 37 412 DELAYS EE 39 4 13 BLINKGRAN enee A H AE a benadeelden 40 4 14 SPEED EE e EE etende 42 7 ta rA E E EE 42 4 16 REGEL ota a ias aia dla 44 4 17 TRINARIES ee e EE 46 4 18 FLASH AND AUTOGSTARTING naco nannnnnnonnnncnononononnonononnononanananannnnnanans 48 Ee WE EE 49 418 2 Dimension dida 50 AE Ud O LE 50 5 SOFTWARE cua sde Oe ite 51 B WORD SYNTAX EE 52 52 QUEUES i Bi COB ice A a EA 54 5 2 1 Queues for supporting data and control flIOWS naan ennen eneen 54 5 2 2 Queues as a component of Data FIOW annen nanne enenserseenenneese ereen 55 52 3 Word Definitions iia EES 55 513 TAM OURS ai 56 5 3 1 Word Definitions AANEREN 56 5 4 Other Definitions nnen eneen venen eneen ve vennennvenvenenvenen 56 55 ASMsand SSMS nternet ln handen eert neta ae 57 May 3 2006 3 Gy Mere Tricks inornata neee nes 60 57 From Loops to AO len le en re la eos a o ata 60 58 TO aten Ee EE 61 5 8 UO DOOL ra AE eA a meas 61 A TTE 62 K8 A O omer rey nee ere imme ER ere eee 62 5 8 4 Asynchronous State Machines cmd ib 62 EE EE 62 5 86 Measurement tes Ananda eine 62 5 9 ASM Example StopligHt siii ic 62 5 10 Word Listing LPC2106 nnee eneen ennneeerenennenneenvenseeeren ennen 64 REGISTERS atammana en benner 69 A a A A ends 69 6 2 AA BUS reede
18. CBC 228 9D4 1564 12BC 171C 121 1954 538 554 19F8 2298 1228 19 391C E US SG E N H CURRENT DP gt I TIB C L ALLOT SPACE Eu CODI CASE LFA NFA AUTOSTART UMP gt S gt E ET Di oo Cc o O 007 E Or CH CC E ls N N eee at A H ob DO D vw AJ Ob Go OH UY D EL Or EH 00 lt lt OI gt E N a lt 4268 428 4298 4308 4320 D QUIT COLD ATO4 AFMR EFF sa CANRXSR C2MOD C1GSR C2ICR C1BTR C2EWL C1RES C2RID C1RDB C2TFI1 C1TDA1 C2TDB1 C1TID2 C2TDA2 C1TFI3 C2TID3 C1TDB3 EXTMODE I2C_I2ADR I2C_I2DAT I2C_I2STAT IOCLR1 IODIR1 IOPIN1 IOSET1 MAMTIM PINSELO LUTerrAd CONTEXT FLD BASI TIB PAD El DUP COMPIL HEX lt BUILDS Al BLANK CONVERT ID LITERAL RECURSE gt RESOLVE El gt BODY PFAPTR UNDO Ss ABORT BRANCH ADCR SFF_sa EFF_GRP_sa LUTerr CANMSR C1CMR C2GSR CIIE C2BTR C1SR C2RFS C1RDA C2RDB C1TID1 IO IS IS 1F8 4210 4228 4240 4258 4270 4288 42A0 42B8 40000018 40000008 40000000 40000010 4310 4328 4340 C2TDA1 C1TFI2 C2TID2 C1TDB2 C2TFI3 C1TDA3 C2TDB3 EXTPOLAR I2C_I2CONCLR I2C_I2SCLH IOCLR IODIR IOPIN IOSET MAMCR PCON PINSEL1 Z G D E Ke
19. Fine for many mechanical issues on the edge of being slow for electronic interfaces These last examples were installed with 5 000 cycles between runs The scan loop repetition was 1000 times a second Fine for many electronic interfaces that is fast enough Now let s change the timing value Redo the installation with the SCHEDULE RUNS command The scan loop repetition is 10 000 times a second EVERY 100 MICROSECONDS SCHEDULE RUNS CHN2 Let s see if we can press our luck EVERY 20 MICROSECONDS SCHEDULE RUNS CHN2 Even running two machines 50 000 times a second in high level language there is still time left over to run the foreground routine This means two separate tasks are being started and running a series of high level instructions 50 000 times a second This shows the IsoMax is running more than four hundred thousand high level instructions per second The IsoMax performance is unparalleled in any small computer available today 4 17 TRINARIES With the state machine structures already given and a simple input and output words many useful machines can be built Almost all binary digital control applications can be May 3 2006 46 written with the trinary operators As an example let s consider a digital thermostat The thermostat works on a digital input with a temperature sensor that indicates the current temperature is either above or below the current set point The old
20. Operate the program to get past the opening set ups and to the terminal screen so it is ready to communicate If necessary visit the chapters on Max Term or NMITerm or Hyperterm if you have trouble understanding how to accomplish any of this Hook the computer end of the serial cable usually a DB 9 connector but may be a DB 25 or other on older PC s to the PC s communication channel selected in the terminal program Cable 1 May 3 2006 6 All three LED s should come on at power up if the power switch is on and power cable connected or at reset but when running only the green led is lit If the LED s do not light unplug the power or switch off the board quickly Now check the screen on the computer When the power is applied before any user program installed the PC terminal program should show IsoMax V1 0 or whatever the version currently is see upgrade policy later at the end of this chapter If the LED s don t light and the screen doesn t show the message unplug the power to the board Go back through the instructions again Check the power connections particularly for polarity The outer ring of the barrel connector should be negative or ground the inner connection should be positive 6 volts If the LED s come on but there is no communication check the terminal program Check the serial connections to make sure everything is plugged in and that you are using an ordinary serial cable
21. P0 28 OFF ADD A TRANSITION THEN STATE x0 TO HAPPEN May 3 2006 35 Notice how similar this version of an AND gate ANDGATE3 is to the previous version ANDGATE2 The major difference is that there are two states instead of one We also added some spice to the action clauses doing another output on P0 28 to show how actions can be more complicated 4 9 INTER MACHINE COMMUNICATIONS Now imagine ANDGATE3 is not an end unto itself but just a piece of a larger problem Now let s say another machine needs to know if both P0 31 and P0 30 are both high If we had only one state it would have to recalculate the AND phrase or read back what ANDGATE3 had written as outputs Rereading written outputs is sometimes dangerous because there are hardware outputs which is cannot be read back If we use different states for each different output the state information itself stores which state is active All an additional machine has to do to discover the status of P0 31 and P0 30 AND ed together is check the stored state information of ANDGATE3 To accomplish this simply query the state this way X0 IS STATE A Boolean value will be returned that is TRUE if either P0 31 and P0 30 are low This Boolean can be part of a condition in another state On the other hand X1 IS STATE will return a TRUE value only if P0 31 and P0 30 are both high 4 10 STATE MEMORY So you see a state machine s current state
22. We have only one state in this example so the last part is easy There is no choice We go back into the same state In machines with more than one state it is obviously important to have this final piece There s really no point in have a state in a machine without a transition into or out of it If there is no transition into or out of a state it is like designing a wait that cannot start cannot end and cannot do anything else either On the other hand a state that has no transition into it but does have one out of it might be an initial state or a beginning state A state that has a transition into it but doesn t have one out of it might be a final state or an ending state However most states will have at least one or more transition entering the state and one or more transition leaving the state In our example we have one transition that leaves the state and one that comes into the state It just happens to be the same one Together a condition and action makes up a transition and transitions go from one specific state to another specific state So there are four pieces necessary to describe a transition 1 The state the machine starts in 2 the condition to leave that state 3 the action taken between states and 4 the new state the machine goes to May 3 2006 22 Looking at the text box with the graphic in it we can see the transitions four elements clearly labeled In the text version the
23. before more data was passed along then data would flow unhindered As it really is often we must wait In a traditional sense this would be a loop checking for a resource to become available before transferring data In an IsoMax state machine a state would have an event for checking the resource availability But what if we wanted to batch up our processing and move a bunch of data at once This requires a memory structure and management tools which are described in this section Queues are a natural extension of data flow in that they are data stopped but ready to go pull data from push data into the queue the queue state machine2 queue depth or length is the number of items in the queue Figure 1 State machine 1 and state machine 2 have a form of elasticity between them If state machine 1 has data for state machine 2 it does not have to wait for state machine 2 to be available Data is pushed into a queue at one end when ready and then pulled out at the other end when ready to be processed As long as the overall flow in is less than the overall flow out then the queue will never fill up or overflow The length of a queue is related to the maximum difference between inflow and outflow at any point in time The length of queue can compensate for irregular data flow For instance say we connect two different serial ports with port A at 9600 and port B at 115200 or 12 times faster Now data flowing from A to B will never ha
24. ef 69 63 External Interrupts est 69 64 GE a eeen ah ebk aal ee 69 6 5 General Purpose Input Output naaar on enenveneenenererneserensnenvens 70 6 6 Memory Accelerator Module naa aannennenennnsersnennsnenenneneeseeneserensnesvens 70 67 Power Eet tende dennen A emcees ak 70 6 8 Pin Connect Blocks a a de o e eed 70 SS Phase Locked LOOP iii a o ee ende 70 6 10 Pulse Width Modulation nana annoneneenennenernesersnenssnenesnesneeenesersnsnnsvens 70 6 11 Real Time Clock EAS 70 6 12 Serial Peripheral Interface AA 71 A A enb ea 71 6 14 Universal Asynchronous Receivers Transmitters A 71 6 15 Vectored Interrupt Controller nnee eeneneneernennenennnernennenennneenn 71 6 16 VPB Divider En 72 A A A 72 MEMORY MAP ooien sint enten ers te ardid 73 Zok AA et de e Carn 73 Mac O ee 75 A Oe A eee Ser eee ee ree eee eerie ee 75 St Smal Flash WASS sinen ac noe ne ae as 75 Examples Linser eeen ae heated Med Nene eten bata Mamas 76 9 1 Using the ADC to Measure Battery Life nnn annen nennen seen eneneen 76 Gelet COGS arate e EA Gee 76 OED LE O E a 77 9 2 Using PWM to Generate High Voltage nos 82 o A eebe 83 922 DEI IN dicas 84 9 3 Software UART for GPS ee We ee 84 9 4 Change serial port speed at Bootup aen enenennenerernesereneneneens 87 May 3 2006 4 1 GETTING STARTED Thank you for buying IsoMax for ARM We hope you will find IsoMax for ARM to be the incredibly useful small controller board we intended it to be and e
25. in the background Now let s go back through the code step by step We ll take it nice and easy We ll take the time explain the concepts of this new language we skipped over previously Here in this box the code for REDTRIGGER pretty printed so you can see how the elements of the program relate to a state machine diagram Usually you start to learn a language by learning the syntax or how and where elements of the program must be placed The syntax of the IsoMax M language is very loose Almost anything can go on any line with any amount of white space between them as long as the sequence remains the same So in the pretty printing most things are put on a separate line and have spaces in front of them just to make the relationships easy to see Beyond the basic language syntax a few words have a further syntax associated to them They must have new names on the same line as them In this example MACHINE ON MACHINE and APPEND STATE require a name following You will see that they do More on syntax will come later May 3 2006 20 PROGRAM TEXT EQUIVALENT GRAPHIC MACHINE REDTRIGGER MAKE A MACHINE BOOLEAN ON MACHINE REDTRIGGER PA7 OFF APPEND STATE RT ADD A STATE IN STATE REDLED ON RT CONDITION PA7 OFF CAUSES REDLED ON THEN STATE ADD A TRANSITION an RT FROM STATE TO STATE TO HAPPEN In this example the fir
26. inputs are set as analog So perhaps the code can be tuned to mitigate any effects of its use In the code the ADC is turned off after use This turning on and off of the ADC could be a source of noise So if we modify the code by commenting out code so that the ADC isn t turned off 0 ADCR shut down a d May 3 2006 78 or turn on and wait we get pretty much the same thing ADC Readings every 100 milliseconds readings time The next thing to try is to change the ADC parameters If we double the time taken to measure a sample we improve a bit to six discrete levels and if we maximize it it doesn t get better ADC Readings every 100 milliseconds readings time Using a scope to read the input there is about 10mv of noise which at 10 bits resolution of 3 3V should be within 2 bits or at most 4 levels Next approach is to let ADC continuously sample and then with a SSM only read some of the samples but that produces the same results So the only way to get back precision is to average By taking an average of May 3 2006 79 12 samples the number of discrete levels is reduce to 3 ADC Readings every 100 milliseconds readings time Using a median of 11 samples we can also reduce the noise Here is the data without any filtering This is the result using a similar set of data ADC Readings every 100 milliseconds readings time May 3 2006 80 ADC Rea
27. similar The figure to the right is a hardware Quadrature design with four states While FSM diagrams are also widely known in programming as an abstract computational element there are few instances where they are used to design software Usually the tools for writing software in state machines are very hard to follow The programming style doesn t seem to resemble the state machine design and is often a slow table driven read May 3 2006 23 process all inputs computation and output scheme IsoMax technology has overcome this barrier and gives you the ability to design software that looks like hardware and runs like hardware not quite as fast of course but in the style or thought process or paradigm of hardware and is extremely efficient The Virtually Parallel Machine Architecture lets you design many little hardware like machines rather than one megalith software program that lumbers through layer after layer of if then statements You might want to refer to the IsoMax MReference Manual to understand the language and its origins 4 2 ANDGATE1 Let s do another quick little machine and install both machines so you can see them running concurrently HEX 40000000 CONSTANT P0 30 pin thirty DECIMAL MACHINE ANDGATE1 ON MACHINE ANDGATE1 APPEND STATE X IN STATE X CONDITION YELLED OFF P0 31 ON P0 30 ON AND CAUSE YELLED ON THEN STATE X TO HAPPEN n
28. style thermostats had a coil made of two dissimilar metals so as the temperature rose the outside metal expanded more rapidly than the interior one causing a mercury capsule to tip over The mercury moving to one end of the capsule or the other made or broke the circuit The additional weight of mercury caused a slight feedback widening the set point Most heater systems are digital in nature as well They are either on or off They have no proportional range of heating settings only heating and not heating So in the case of a thermostat everything necessary can be programmed with the machine format already known and a digital input for temperature and a digital output for the heater which can be programmed with trinaries Input trinary operators need three parameters to operate Using the trinary operation mode of testing bits and masking unwanted bits out would be convenient This mode requires 1 a mask telling which bits in to be checked for high or low settings 2 a mask telling which of the 1 possible bits are to be considered and 3 the address of the I O port you are using The keywords which separate the parameters are in order 1 SET MASK 2 CLR MASK and 3 AFADDRESS Finally the keyword FOR INPUT finishes the defining process identifying the trinary operator in effect DEFINE lt name gt TEST MASK lt mask gt DATA MASK lt mask gt AT ADDRESS lt address gt FOR INPUT Putting the keywords and parameters t
29. to point to another empty location The removal pointer points to the value to be pulled and when PULL is called it is decremented POP uses the insert pointer and STUFF uses the removal pointer and they go the other way The structure of the queue is most efficient for the use of May 3 2006 54 PUSH PULL and Q Also if you ask for n cells in the queue you actually get n 1 This serves as an overflow for the case when you say 0 QUEUE and it also allows the queue to contain n items before it is full as opposed to n 1 items TABLE 4 Queue pointers used by operation action i r e PUSH SZ POP te S PULL S ie STUFF i 8 Q zk P zk Q QSIZE OO For high speed data flow memory could be accessed from a queue engine in hardware for the i r e pointers 5 2 2 Queues as a component of Data Flow By specifying the width and depth of a queue certain values correspond to certain objects TABLE 5 width depth Object 0 0 no connection and no hardware is needed 1 0 wire and is just a connection 2 or more 0 bus 1 1 flip flop 2 or more 1 register 1 2 or more shift register 2 or more 2 or more queue This suggests a general architectural component with specifiable width and depth where the proper subcomponent is chosen based on the above objects for hardware implementations and the user model is just a line on a diagram or segment of script The low level architectural buil
30. 30 This has no effect on the red LED but turns off the yellow LED while grounded Grounding both May 3 2006 26 P0 31 and P0 30 at the same time also turns off the yellow LED and turns on the red LED if not yet set Ea Ub MA 0 30 DO Ground ee ee ee ee ee ee ee ee deu 0 0 0 000000000000 es 0 see Ground Ground Notice how the tightly the two machines are intertwined Perhaps you can imagine how very simple machines with combinatory logic and sharing inputs and feeding back outputs can quickly start showing some complex behaviors Let s add some more complexity with another machine sharing the P0 31 input 4 3 BOUNCELESS We have another quick example of a little more complex machine one with one state and two transitions HEX 20000000 CONSTANT P0 29 pin thirty MACHINE BOUNCELESS ON MACHINE BOUNCELESS APPEND STATE Y May 3 2006 27 IN STATE Y CONDITION P0 31 OFF CAUSES GRNLED OFF THEN STATE Y TO HAPPEN IN STATE Y CONDITION P0 29 OFF CAUSES GRNLED ON THEN STATE Y TO HAPPE Y SET STATE INSTALL BOUNCELESS There you have yet another complete design initialization and installation of a virtual machine in four lines of IsSoMax code Another name for the machine in this program is a bounceless switch Tur Bounceles Lack Pulse Double Throw Switch
31. A null modem cable will not work Try once more If you have no success see the trouble shooting section of this manual and then contact technical support for help before going further Do not leave power on the board for more than a few seconds if it does not appear to be operational Normally at this point you will see the prompt on the computer screen IsoMaxTM Vx x Odds are you re there Congratulations Now let s do something interactive with the board In the terminal program on the PC type in WORDS all in caps as the language is case sensitive and then hit Enter A stream of words in the language should now scroll up the screen Good we re making progress You are now talking interactively with the language in the ARM Now let s blink an LED Port lines control the LED s Type REDLED ON To turn it back off type REDLED OFF Now you should have a good feeling because you can tell your ARM is working It s time for an overview of what your IsoMax for ARM has for features First though a few comments on IsoMax revision level The first port of IsoMaxTM occurred on May 27 2002 We called this version VO 1 but it never shipped While the core language was functional as it then was we really wanted to add many I O support words We added a small number of words to identify the port lines and turn them on and off and shipped the first public release on June 3 2002
32. E O HAPPEN X SET STATE INSTALL ANDGATE2 May 3 2006 31 PROGRAM TEXT EQUIVALENT GRAPHIC MACHINE ANDGATE MAKEA MACHIN P0 31 ON P0 30 ON ONSMACHTNE ANI E APPEND STATE AND APPEND STATI IN STATE x CONDITION P0 31 ON P0 30 ON AND CAUSES YELLED ON ADD A TRANSITION THEN STATE x TO HAPPEN IN STATE X CONDITION P0 31 OFF P0 30 OFF P0 31 OFF P0 30 OFF OR CAUSES ADD A TRANSITION YELLED OFF YELLED OFF THEN STATE X O HAPPEN Compare the transitions in the tw ANDGATE s to understand the trick in ANDGATE1 Notice there is an action included in the ANDGATEI condition clause See the YELLED OFF statement highlighted in bold in ANDGATEI not present in ANDGATE2 Further notice the same phrase YELLED OFF appears in the second transition of ANDGATEZ2 as the object action of that transition TRANSITION COMPARISON ANDGATE1 ANDGATE2 IN STATE IN STATE IN STATE x x x CONDITION CONDITION CONDITION YELLED OFF P0 31 ON P0 31 ON P0 31 OFF P0 30 ON AND P0 30 ON AND P0 30 OFF OR CAUSES CAUSES CAUSES YELLED ON YELLED ON YELLED OFF HEN STATE HEN STATE HEN STATE x O HAPPEN O HAPPEN O HAPPEN The way this trick worked was by using an action in the condition clause e
33. EN STATE HEN STATE WAITON WAITOFF O HAPPEN O HAPPEN 4 12 DELAYS Let s say we want to make a steady blinker out of the green LED In a conventional procedural language like BASIC C FORTH or Java etc you d probably program a loop blinking the LED on then off Between each loop would be a delay of some kind perhaps a subroutine you call which also spins in a loop wasting time Assembler BASIC C JAVA FORTH OOP1 LDX 0 FOR I 1 TO N While 1 BEGIN LOOP2 DEX LOOP2 DEX delay x DELAY BNE LOOP2 BNE LOOP2 LDAA 1 ET PB TRUE out 1 portAl LED ON STAA PORTA LDX 0 LOOP3 DEX GOSUB DELAY delay x DELAY BNE LOOP3 LDAA N Let PB FALSE out 0 portAl LED OFF STAA PORTA JMP LOOP1 NEXT AGAIN Here s where IsoMax will start to look different from any other language you re likely to have ever seen before The idea behind Virtually Parallel Machine Architecture is constructing virtual machines each a little state machine in its own right But this IsoStructure requires a limitation on the machine themselves In IsoMax M there are no program loops there are no backwards branches there are no calls to time wasting delays May 3 2006 39 allowed Instead we design machines with states If we want a loop we can make a state then write a transition from that state that returns to that state and accomplish roughl
34. END STATE LR HISTORY graph last llsec of left right signal APPEND STATE FA CURRE display current fore aft value APPEND STATE FA HISTORY graph last llsec of fore aft values Once started slicing dicing and synchronizing the smaller components everything ran a whole lot smoother and faster So far so good Now will attempt to get nested interrupts running which are in the system but seem to be broken which is what got me into this tool building and refactoring phase in the first place There is no end in sight if the journey is interesting The best thing liked doing in hardware design was the state machines but the hardest part was getting them working just right with the least logic Now find with coding a real time embedded system the state machine factoring gives me the power to create a much finer designed system only with software it is much easier to change lts like having a better harness on the whole program code structure 5 8 Tools 5 8 1 Autoboot RAM START a start address of dictionary in RAM May 3 2006 61 BOOT VECT a start address in flash for image RESTORE word used to restore RAM from ROM at boot BOOTUP tick used to save RAM image to ROM and call tick word after restoring image at boot AUTOBOOT turns off the autoboot flash image With software installed in flash for autoboot each time a reset is done RAM will be refreshed with the contents of ROM and any thing
35. ES 6 L IMER1_CR1 DUP fa period faq PUS 0 IMER1_CC EDS El S a gt H RJ 28 THEN STAT FA P ERIOD TO HAPP IN STATE FA P ERIOD CONDITION 1 CAUS IER1_ CRI s IMER1_CCR IN 0 ES 0 LEDS tart count HEN STAT TILT OFF TO HAPPEN One TILTS QS DUP RIQ DUP el ECIMAL timer me EN tart count IF fa period MOD THEN ER CCR EN fa period two interrupt sources so this SM is a demux TI RI_IR TI QSIZE 0 DO DUP bh 00 MILLIS ECONDS SAMPL ILT E ze stample to RETI EOUT 5 THI r IMI IMER1_ ER1_CCR I R TIMER1_IR INI ILT C3 EDS A0000 O PINS 0 OR PINSELO ILT OFE SET STAT IM ER1 US E AS ILTS I 1 ERI stample to STAR ICR assign the ASM enable counter 1 ERI IR 2D TILIS RPOP LOOP DROP r EOUT stample to 100ms sample period stample to TIMEOUT LR interrupt on eac SYNCING S ET STAT h rising edge of ch 0 clear any pending ints lrg 00 faq 00 to timer 1 interrupt TIMEOUT Other useful tools include I
36. ICVectAddr0 VICVectAddr11 VICVectAddr14 VICVectAddr3 VICVectAddr6 VICVectAddr9 VICVectCnt110 VICVectCnt113 U z z B B G 5 5 a z HHHHHHHH 4358 4370 4388 43A0 43B8 43D0 43E8 4400 4418 4430 4448 4460 4478 4490 44128 44C0 44D8 44F0 4508 4520 4538 4550 4568 4580 4598 45B0 45C8 PLLCON PWM_CCR PWM_CR2 PWM_IR PWM_MRO PWM_MR3 PWM_MR6 PWM_PR RTC_ALDO RTC_ALHOUR RIC_ALSEC RTC_CCR RIC_CTIMEO RTC_DOM RTC_ HOUR PIC MONTH C_SEC PIO_SPCR PIO_SPSR PIO_SPTSR GIL SPDR PI1_SPTCR PI_SPCCR PI_SPINT PI_SPTOR RO_CRO RO_CR3 Do o o Do mp o o om DW T T 45E0 ERO_MCR 45F8 4610 4630 4648 4660 4678 4690 46A8 46C0 46D8 46F0 4708 4720 4738 4750 4768 4780 4798 47B0 47C8 47E0 47F8 4810 4828 4840 4858 4870 ERO_MR2 ERO_PR ER1_CRO ER1_CR3 ER1_MCR ER1_MR2 d o is EA 3 E d E DO an Ft Al AE oo ee U U U U U U U U T1_RBR VICDefVectAddr VICIntEnClr VICProtection VICSoftIntClr VICVectAddr1 VICVectAddr12 VICVectAddr15 VICVectAddr4 VICVectAddr7 VICVectCnt10 VICVectCnt111 VICVectCnt114 gt LA DN E LA I oo d LA VO c w gt oo gt E BWW W WU O Los Ee H CO D wo oO AH e oo o 0 CO CO PWM_PC PWM_TC RTC_ALD
37. IGHT May 3 2006 63 Now we can let it run and then examine the timings MAXS 38 us in state MAXS 41 us in state LOW OK RE EN OK This was done before a complete cycle had been done so yellow is shown first and then the next query shows green The longest state is GREEN and this makes sense since it has the most code This tool can be applied to determine which states need refactoring 5 10 Word Listing LPC2106 IsoMax for ARM Beta 5 WORDS 40001EB8 40001D80 001D24 001CBO 001BD8 001A9C 0019C0 001950 0017FC 0016B8 0014C4 001478 001438 4 4 0013AC 001364 001300 001240 00116C 0013F4 E TSOMAXBETA SSMS ssmmax CURCOND END STATE DTAG STATE NO MACHINES CFA gt NFA USE ASM EINTO RESERVED TIMER1 000F48 OOOEDC 000D08 000088 000B3C OOOABC 000A34 0009D8 oo eee oo OO CO CF 0 0 0 0 0 0 O O OOO Ee AE E ET E A10 285C 32C 2814 FC 134 37C 20VER 2878 2DUP 394 2ROT 288 ROLL 286C gt R 2800 NOT 124 0 gt 27D0 lt 400011 40001 40001 40001 40001 40001 40001 40001 40001 40001 40001 40001 40001 40001 40001 40001 40001 40001 4000 4000 4000 4000 4000 4000 4000 4000 4000 O OCO O O G O O O GO E2C D58 DOO C4C BBC 9F0 998 934 758 5FC 4A8 460 41C 3DC 394 34C 2E8 TCO FF4
38. MER lt n gt TIMER INIT lt timer name gt ERY lt n gt CYCLES SCHEDULE RUNS ALL TASKS Under construction WITH VALUE 7100 stacks the tag 7100 AT ADDRESS 7001 stacks the tag 7001 This will be topmost after ORDER AS TAG tagn tagn Requires tags 7100 7001 Requires the latest word to be a State word If it is removes DUMMYTAG 0 and replaces them with Address Value THIS TIME spfa previously TO HAPPEN Requires CSP HERE Requires the given word to be a State word Then Removes last compiled cell Compiles the CFA of the given State word Compiles PTHIST NEXT TIME spfa Requires CSP HERE Requires the given word to be a State word Then Removes last compiled cell Compiles the CFA of the given State word Compiles PNEXTT SET STATE spfa Given the pfa of a State word on the stack Requires the given word to be a State word Then Fetches the thread pointer and RAM pointer from the State word and stores the thread pointer in the RAM pointer May 3 2006 52 IS STATE spfa Given the pfa of a State word on the stack Requires the given word to be a State word Then Fetches the thread pointer and RAM pointer from the State word Returns true if the current state of the machine is this state IN EE TIMING CONTROL EVERY 6000 stacks the value 6000 CYCLES 9000 stacks the value 9000 SCHEDULE RUNS not defined in sour
39. May 3 2006 44 Notice we have more things happening in the action this time One LED is turned on and one off in the action You can have multiple instructions in an action Test it Type DON SET STATE DYE DYE DYE DYE EDER See the red and yellow LED s trade back and forth from on to off and vice versa m _ E e ai All this time the ZIPGRN machine has been running in the background because it is in the installed machine chain Let s replace the installed machine chain with another So we define a new machine chain with both our virtual machines in it and install it ZIPGRI REDYEL REDON SET STATE ERY 5000 CYC ACHINE CHAIN CHN2 END MACHINE CHAIN ES SCHE DUI E RUNS CHN2 With the new machine chain installed all three LED s look slightly dimmed May 3 2006 45 ges VV WW E a Again they are being turned on and off a thousand times a second But to your eye you can t see the individual transitions Both our virtual machines are running in virtual parallel and we still don t see any slow down in the interactive nature of the IsoMax M So what was the point of making these two machines Well these two machines are running faster than the previous ones The previous ones were installed with 50 000 cycles between runs That gave a scan loop repetition of 100 times a second
40. ND STATE HO HUM PPEND STATE TEMP WAI A IN STATE SHT WAKING CO h DITION sht to TIMEOUT t to START TIMEOUT CAUSES THEN STATE HT IDLE TO HAPE IN STATE TEMP WAIT CO DITION DAT READY CAUSE ET DAT rawtempq PUSH SHT CMD THE IN STATE HO HUM DITION DAT READY CAUSE ET DAT rawhumq PUSH CO G S HOW TERH STATE HO HUM TO HAPPE PEN May 3 2006 57 THEN STATE HT IDLE TO HAPPEN TION ht to TIMEOUT CAUSES 3 SHT CMD ht to START TIMEOUT E i wn gt z IP WAIT TO HAPPE IN STA CONDI E HT IDLE TION graph to TIMEOUT CAUSES graph to START TIMEOUT GRAPH TERH THEN S ATE HI IDLE TO HAPPEN This is an example of an ASM used to control a timer reading a sensor on two channels The sample window is set by a parallel SSM which runs periodically while the ASM handls the asynchronous nature of the timer channel edge interrupts Note the use of the debug tool L EDS to show which state the machine is in when a crash happens and as a bonus it looks pretty when it runs HEX MACHINE 2D TILTS APPEND STATE LR SYNCING APPEND STA
41. NS 6 9 Phase Locked Loop ELO PLLCFG MEMMAP PCONP PINSEL1 PLLCON 6 10 Pulse Width Modulation PWM_CCR PWM_CR3 PWM_MCR PWM_MR3 PWM_PC PWM_TCR 6 11 Real Time Clock RI RI RI TC_ALDO TC_ALMIN TC_AMR R RI RI C_C IME DC DOw DC MIN CS EC PWM_CRO PWM_EMR PWM_MRO PWM 4 PWM DCH RTC_ALDOW RTC_ALMO RTC_CCR RTC_CTIME1 RTC_DOY RTC_MONTH IOCLRI IOPIN IOSETO MAMT IM PINSEL2 PLLFEED PWM _CR1 PWM _IR PWM MS PWM _MR5 PWM _PR RTC_ALDOY RTC CIIR RTC HOUR RTC_PREFRAC IODIR IOPINO IOSET1 PLLSTAT PWM_CR2 PWM_LER PWM_MR2 PWM_MR6 PWM_TC Gi TC_ALHOUR Gi Gi Gi C_ALYEAR re CTE LC DO TC_ILR JJ C_PREINT May 3 2006 70 6 12 Serial Peripheral Interface PIO_S BT PILS 5 S S S SPI_SP S PI_SP 6 13 Timers EI E E P SI EI AA PIO_SPCCR PSR PCCR PSR CCR SR ERO CCR ERO CH ERO_MRO ERO_PC ER1_CCR ER1_CR3 ER1_MRO ER PC SPIO_SPCR SPIO_SPTCR SPI11_SPCR SPI1_SPTCR SPI_SPCR SPI_SPTCR H E ERO_CRO H E ERO_MR1 H E ERO_PR H E ER1_CRO H E ER1_MR1 H E ER1_PR
42. NSTALL SAMPLE TILT r INTS list all interrupts pending If used with DINT and EINT the running interrupts can be determined NO ASM interrupt disconnect the ASM from that interrupt H n print a number in unsigned hex irrespective of base As for the diagrams of state machines for the interested there is a document covering state machine diagrams and fitting them in the bigger picture literally for a project for those that are diagram or visually oriented May 3 2006 59 http www ee ualberta ca rchapman Cmpe401 pdfs BubbleDiagramStratification pdf If your documenter can click into parts of the diagram all the better it can help organize it hierarchially 5 6 More Tricks To stop the Forth Interpreter VARIABLE running 0 running HALT BEGIN running UNTIL HALT This will stop the Forth interpreter from doing anything until a part of your program changes the state of the variable This allows two communicating state machines to signal asynchronously HALT is a simple one line state for the interpreter and your code would be the other The interpreter inputs and outputs characters via queues These are like the variable running but deeper in that one state machine can store multiple times to the queue and another can read multiple times from the same queue without contention This is achieved with two pointers and a single writer The queues for KEY and EMIT are filled either by asynchronous state
43. ORD have been carefully crafted to minimize the amount of flash operations to achieve the best response times The Flash is constrained to 8K and 64K sized and aligned erase blocks called sectors and writes of only 5K 1K 4K or 8K When using quick or boot vectors be careful not to overwrite code you are using If the vector points to a word in flash and that word gets overwritten then each time when you reboot the overwritten word will be run and you will crash This can be escaped sometimes with a control g and reset button pushing but might require using the LPC2000 flash utility to refurbish the flash When you execute COLD or power cycle the processor all of RAM is gone and any links or words are also gone The FDP is reset to 0x8000 If you have stored words in flash with FLWORD and attempt to do it again without first erasing flash you might end up with problems In this case either set FDP to unused flash or erase the part that has been used with FLERASE FLERASE a n the 8K or 64K memory sectors containing address a for n bytes is erased which takes about 400ms Be careful which sectsor you erase as you can render IsoMax inoperable and it will have to be reloaded FLERASE first checks to see if the sector is not already blank before deciding to erase FLMOVE s d n copy n bytes from address s to address d in flash memory n must be 512 1024 4096 or 8192 bytes May 3 2006 73 FLWORD moves the latest word into Flas
44. OW RTC_ALMIN RTC_ALYEAR RTC_CIIR RTC_CTIM RTC_DOW RTC_ILR RTC_PREFRAC Gl ER ES vel EE oo Wu pa UI N CO Oo CH ui A uw oo Im D Wu Wu oo gt al J lt ol oo oo gt Oo gt C Wu Y oo a IG RTC YEAR SPIO_SPDR PIO_SPTCR PI1_SPCCR PI1_SPINT PI1_SPTOR PI_SPCR PI_SPSR PI_SPTSR ER Wu T oO o oO OO Oo CH a On LA E oo gt fen a C H R Li LA A 4 4 A HH T DO E Q Kal E Q D DO P y Q RTO_DL RTO_ITR E D RTO_MCR RTO_SCR RT1_ DL RT1_IIR RT1_MCR UART1_SCR VICFIOStatus VICIntSelect VICRawIntr VICVectAddr VICVectAddr10 VICVectAddr13 El D aaa D pp ql D 0 VICVectAddr2 VICVectAddr5 VICVectAddr8 VICVectCnt11 VICVectCnt112 VICVectCnt115 May 3 2006 4880 4898 48B0 48C8 VICVect VICVect VICVect DFEED 48E 6BFO 6BCC 6C48 6C08 6B48 1 W W END MAC PERIOD 6AEC 6940 6928 6910 6898 6810 6698 6548 Cnt12 Cnt15 Cnt18 HINE CHAIN 2288s Ll ae 5 wv EI Qn T H 64E0 68F4 E 72E8 72E4 7334 63B0 7320 7308 7314 63D4 732C 7174 6370 6378 40000028 OK 4904 3934 3DB8 392C 2738
45. TE LR RISING APPEND STATE LR FALLING APPEND STATE LR PERIOD APPEND STATE FA SYNCING APPEND STATE FA RISING APPEND STATE FA FALLING APPEND STATE FA PERIOD APPEND STATE TILT OFE IN STATE LR SYNCING CONDITION 1 CAUSES 1 LEDS THEN IMER1_CRO DROP toss possibly stale data STATE LR RISING TO HAPPEN IN STA CONDI E LR RISING TION 1 CAUSES 2 LEDS IMER1_CRO start count 0 IMER1_CCR 6 TIMER1_CCR THEN STATE LR FALLING TO HAPPEN IN STA CONDI E LR FALLING TION 1 CAUSES 3 LEDS IMER1_CRO start count DUP lr period gt IF lr period MOD THEN lrq PUSH O TIMER1_CCR 5 TIMER1_CCR THEN STATE LR PERIOD TO HAPPEN IN STATE LR PERIOD CONDITION 1 CAUSES 7 LEDS IMER1_CRO start count lr period THEN IMER1_CCR 28 TIMER1_CCR STATE FA SYNCING TO HAPPEN IN STA E FA SYNCING May 3 2006 58 CONDITION 1 CAUS IMER1_CR1 DROP ES 4 L EDS THEN STAT FA RISING IN STATE I 0 FA RISING CONDITION 1 CAUSES 5 AER1_CR1 IMER1_CC EDS tart count 30 TI e s Ro THEN STAT FA FALLING TO HAPP O HAPPEN ER1_CCR IN STA FA FAL ING CONDITION 1 CAUS
46. VICVec VICVec VICVec VICVec VICVec VICVec Intr tAddr0 tAddr12 tAddr2 tAddr6 tCnt10 tCnt112 tCnt12 tCntl6 May 3 2006 71 6 16 VPB Divider VPBDIV 6 17 Watchdog WDFEED WDMOD WDTC WDTV May 3 2006 72 7 MEMORY MAP Great care has been taken to make as much RAM and ROM available for programming On the LPC2106 there is 32K of flash and 63K of RAM available for user programs On the LPC2129 it is 160K of flash and 14K of RAM IsoMax occupies the first 32K of the first 64K section and 56K of the second 64K section The boot block on the LPC2106 is in the upper 8K of the second 64K section and in the upper 8K of the 4th 64K section on the LPC2129 LPC2106 0x00000 0x07FFF 32K flash used by IsoMaxTM 0x08000 OxOFFFF 32K flash in 8K sectors for user 0x10000 0x1DFFF 56K flash used by MaxForth 0x1E000 Ox1FFFF 8K flash used by bootloader 0x40000000 0x40000887 2K system RAM 0x40000888 0x4000FFFF 62K RAM user space and system stack LPC2129 0x00000 Ox07FFF 32K flash used by IsoMax 0x08000 OxOFFFF 32K flash in 8K sectors for user 0x10000 0x1DFFF 56K flash used by MaxForth 0x1E000 Ox1FFFF 8K flash unused Ox1E000 0x3DFFF 120K flash for user in 64K and 8K sectors Ox3E000 Ox3FFFF 8K flash used by bootloader 0x40000000 0x40000887 2K system RAM 0x40000888 0x40003FFF 14K RAM user space and system stack 7 1 Flash Efficient algorithms for FL FLERASE and FLW
47. al rising edge measurement to gauge the period for that pulse One signal is dealt with then the other changing edge triggers each state in TIMER1_CCR always writing zero in between This worked quite well and could trigger a reading when needed except sometimes the pulse and period would be one period longer cleaned up the glitch by using the previous period and modulus but that got me to digging for the source of the glitch There are a total of 6 interrupts running on the the 2106 4 synchronously 2 asynchronously used the TIMER_TC to time how long it takes to service each interrupt and then keep the maximum time value Then view these values to see how long the interrupts were taking It turns out that occasionally one interrupt TILT VIEWER which did LCD graphing was taking 1 5ms which was longer than the LR or FA periods 1ms So refactored the looping code from inside one state into multiple states which displayed the current value and then graphed the historical value for both signals sequentially and synchronously The tilt viewer state are MACHINE TILT VIEWER View tilt signals on LCD APPEND STATE TILT HIDE don t show the tilt signals APPEND STATE TILT SHOW add LCD window dressing for signals APPEND STATE TILT UPDATE update LCD tilt display periodically APPEND STATE LR CURRE display current left right signal value APP
48. along 4 1 1 REDTRIGGER First let s make a very simple machine Since it is so short it s presented first without detailed explanation entered and tested Then we will explain the language to create the machine step by step T EX 0000000 CONSTANT P0 31 pin thirty one bit ECIMAL U MACHINE REDTRIGGER ON MACHINE REDTRIGGER APPEND STATE RT IN STATE RT CONDITION P0 31 OFF CAUSES REDLED ON THEN STATE RT TO HAPPEN RT SET STATE INSTALL REDTRIGGER There you have it a complete real time program in two lines of IsoMax and one additional line to install it A useful virtual machine is made here with one state and one transition This virtual machine acts like a non retriggerable one shot made in hardware NON RETRIGGERABLE ONE SHOT TIMER Produces a preset timed output signal on the occurrence of an input signal The timed output response may begin on either the leading edge or the trailing edge of the input signal The preset time in this case infinity is independent of the duration of the input signal For an example of a hardware non retriggerable one shot see http www philipslogic com products hc pdf 74hc221 pdf May 3 2006 18 Vec ter Cor Fig 1 Pin configuration Fig 2 Logic symbol Fig 3 IEC logic symbol If P0 31 goes low briefly the red LED turns on and stays on even if P0 31 then changes P0 31 normall
49. around a table of four things IN STATE CONDITION CAUSES THEN STATE TO HAPPEN A A A lt from state gt lt Boolean gt lt action gt lt to state gt In a transition description the constructs IN STATE CONDITION CAUSES THEN STATE and TO HAPPEN are always there with some possible options to be set out later The meat slices between the slices of bread are the hearty stuffing of the description You will fill in those portions to your own needs and liking The language provides the bread with only a few options to be discussed later So here you have learned a bit of the syntax of IsoMax Machines are defined states appended The transitions are laid out in a pattern with certain words surrounding others Procedural parts are inserted in the transitions between the standard clauses The syntax is very loose compared to some languages What is important is the order or May 3 2006 17 sequence these words come in Whether they occur on one line or many lines with one space or many spaces between them doesn t matter Only the order is important 4 1 THREE MACHINES Now let s take a first step at exploring IsoMax M the language by looking at some very simple examples We ll explore the language with what we ve just tested earlier the LED words We ll add some machines that will use the LED s as outputs so we can visually See how we re coming
50. asy to use as possible Tini ARM El 2106 USB Plug in Board If you are new to IsoMax for ARM we know you will be in a hurry to see it working That s okay We understand Let s skip the features and the tour and discussion of Virtually Parallel Machine Architecture VPMA and get right to the operation Those points can come later Once we ve got communications then we can make some lights blink and know for sure we re in business Let s make this ARM work for us We ll need PC running a terminal program Then we ll need a serial cable to connect from the PC to IsoMax for ARM which hopefully you ve already gotten from us Then we need power such as from a 6VDC wall transformer which hopefully vou ve already gotten from us If not you can build your own cable and supply your own power supply Instructions are in the back of this manual in Connectors If we have those connections correct we will be able to talk to IsoMax for ARM interactively May 3 2006 5 DC Wall Transformer These connections are made on the serial DB9 on the ARM and the barrel connector for accepting the 6 VDC power Once you have your serial cable and wall transformer ready follow these steps Start with the PC Install and run the MaxTerm program for DOS or NMITerm for Windows Set the terminal program for communications channel COM1 COM2 etc you wish to use and set communications settings to 115200 8N1
51. ated every second and takes 3 4 of a to send the data So the way to sync up is to wait for the dead space of greater than xms perhaps 10ms or more but less than 200ms Then wait for EINTO to go low This asynchronous trigger will start a periodic state machine which samples the input every 208us centered 100us after the fall for the first start bit Every 10 bits gathered are then processed as a byte and then the next byte is waited for If stop bit is low then resync should be done start bit 1 1 push data wait for stop bit wait for 0 discard high data 208us sample N An alternative is to record time of edges and then calculate byte This is a good method for synching up faster and instream instead of waiting for dead space This requires rising May 3 2006 85 and falling edge triggers tho This requires two state machines One to record edge o record 1 record found start search for start good data push data transitions and one to make sense of the data It also requires a hardware resource which does edge detection Times are read from a global hardware timer and queued by the first state machine with a level tagged along with the data The second state machine periodically checks the queue and parses out the timestamps and levels to recreate a data stream which can be sampled in software To synchronize a start bit and stop bit pair of transitions are searched for This is more
52. ates Up until now our machines have had a single state Machines with a single state in general are not very versatile or interesting You need to start thinking in terms of machines with many states This is a gentle introduction starting with a familiar problem Another change is in effect here We have previously first written the code so as to make the program small in terms of lines We used this style to emphasize small program length From now on we are going to pretty print it so it reads as easily as possible instead MACHINE ANDGATE3 ON MACHINE ANDGATE3 APPEND STATE X0 APPEND STATE X1 May 3 2006 34 IN STATE XO CONDITION P0 31 ON P0 30 ON AND USES YELLED ON P0 28 ON STATE CA T H X1 O HAPPEN IN STATE x1 CONDITION P0 31 OFF P0 30 OFF OR USES YELLED OFE P0 28 OFF N STATE X0 O HAPPEN CA H T X0 SET STATE INSTALL ANDGATE3 PROGRAM TEXT EQUIVALENT GRAPHIC MACHINE ANDGATI MAKE A MACHINE ON MACHINE A APPEND S1 I P0 31 ON P0 30 ON AND APPEND S1 YELLED ON IN STAT xo P0 28 ON CONDITION P0 31 ON P0 30 ON CAUSES YELLED ON P0 28 ON THEN STATE x1 ADD A TRANSITION aye0 31 OFF P0 30 OFF TO HAPPEN IN STATE X1 YELLED OFF CONDITION P0 28 OFF P0 31 OFF P0 30 OFF OR CAUSES YELLED OFF
53. ce file ALL TASKS not defined in source file COUNTDOWN TIMERnot defined in source file TIMER INIT not defined in source file INPUT OUTPUT TRINARIES DEFINE lt word name gt 1111 Creates a new word in the Forth dictionary CREATE SMUDGE and stacks the pair tag 1111 PROC not defined in source file END PROC not defined in source file TEST MASK 7002 stacks the tag 7002 DATA MASK 7004 stacks the tag 7004 FOR INPUT 1111 tag n tag n tagn If tags 7001 7002 7004 are stacked compiles Address Test Mask byte and Data Mask byte then changes the code field of the latest word to XCPAT Requires pair tag 1111 XCPAT Fetches the data byte from the stored Address masks it with the Test Mask and xors it with the Data Mask If the result is zero equal stacks TRUE else stacks FALSE AND MASK 7008 stacks the tag 7008 XOR MASK 7010 stacks the tag 7010 CLR MASK 7020 stacks the tag 7020 SET MASK 7040 stacks the tag 7040 FOR OUTPUT 1111 tagntagntagn If tags 7001 7008 7010 are stacked compiles Address And Mask byte and Xor Mask byte then changes the code field of the latest word to AXOUT If tags 7001 7020 7040 are stacked compiles Address Clr Mask byte and Set Mask byte then changes the code field of the latest word to SROUT Requires pair tag 1111 May 3 2006 53 5 2 Queues Queues are for when you don t have time to wait If data could be used
54. conds raw time SECONDS n t convert n to seconds of raw time MINUTES n t convert n to minutes of raw time SET TIMEOUT t timeout set the new timeout time and start it RETIMEOUT timeout restart a timeout based on a multiple of the start time where period is exact START TIMEOUT timeout start a timeout from right now or for aperiodic timeouts TIMEOUT t1 name declare a timeout timer for use in state machines TIMEOUT timeout return flag indicating a timeout is done or not 5 4 Other Definitions These are extra definitions present on the ARM IsoMax DINT disable all interrupts EINT enable all interrupts S a download program for text and s records with no echoback Exit with QUIT skips a variable for the number of times that the SSM machine has been blocked because a SM was taking longer than a SSM period to execute stackerror a variable set when the stacks used by a machine are not empty when done emitv a vector for intercepting emited values If emit character is changed to zero then no character is emitted Used by S pasm a points to the beginning of the ARM exception vectors where asynchronous state machines are placed May 3 2006 56 5 5 ASMs and SSMs This release adds and updates some tools MACHINES lists all the active machines syncnronous SSM and asynchronous ASM STATES lists all the active states Example usage STATES Active states MACH
55. d any costs of recovering reprogramming or reproducing any data stored in or used with New Micros Inc products Internet Access Web site http www newmicros com This manual http www newmicros com store product_manual IsoMax for ARM zip Email technical questions nmitech Onewmicros com Email sales questions nmisales newmicros com Also see Manufacturer information near the end of this manual Internet IsoMax Discussion List We maintain the IsoMax discussion list on our web site Members can have all questions and answers forwarded to them It s a way to discuss IsoMax M issues To subscribe to the IsoMax list visit the Discussion section of the New Micros Inc website This manual is valid with the following software and firmware versions IsoMax V1 0 If you have any questions about what you need to upgrade your product please contact New Micros Inc Table of Contents 1 GETTING STARTED cuina 5 2 INTRODUCTION eet dara il 9 37 QUK AECH EE 11 4 PROGRAMMING eenen enenvenrnenensenvenrenenvenvenseen 16 4 1 THREE MACHINES 5500 reien usteet ees d bhmaneraterttma ENEE Eege 18 tol REDTRIGGER dt GENEE 18 4 2 ANDGATE diia id Eet 24 4 3 BOUNGELESS 00i e EE AE Eege E tdi 27 4 4 SYNTAX AND FORMATTING annen ne neve nensenenennenenenneneneneenenenennn 30 4 5 MULTIPLE STATES MULTIPLE TRANSITIONS anneer enen 31 4G ANDGATE2 2 45 eege 31 d AND aaa aL ane 33 dp ANDGATE35 t netrand are dr
56. d one more state The new states are WAITON and WAITOFF and run our two transitions between the two States At first blush the new machine looks more complicated probably slower but not significantly different from the previous version This is not true however When the scheduler calls a machine only the active state and its transitions are considered So in the previous version each time Y was executed two conditionals on two transitions were tested assuming no true condition In this machine two conditionals on only one transition are tested As a result this machine runs slightly faster Further the new BOUNCELESS machine is better behaved In fact it is better behaved than the original hardware circuit shown It is truly bounceless even if both switches are pressed at once The first input detected down either takes us to its state or inhibits the release of its state The other input can dance all it wants as long as the one first down May 3 2006 38 remains down Only when the original input is released can a new input cause a change of state In the rare case where both signals occur at once it is the history the existing state which determines the status of the machine STATE WAITOFF STATE WAITON IN STATE IN STATE WAITOFF WAITO CONDITION CONDITION P0 31 OFF P0 30 ON AND P0 30 OFF P0 31 ON AND CAUSES CAUSES GRNLED ON GRNLED OFF H
57. ding blocks are queues and machines 5 2 3 Word Definitions QUEUE n name create a queue in memory with n cells and name 0Q q remove all items from a queue by equating insert and removal pointers Q q n return number of items in a queue PUSH n q append n to end of queue May 3 2006 55 PULL q n return first value in queue POP q n return last value in queue STUFF no prepend to beginning of queue P q n get a copy of last value in queue Q q n get a copy of first value in queue QLEFT q n return number of cells left in queue QSIZE q n return the size of a queue as allocated at compile time RESIZEQ n q change queue size by moving end pointer cannot be made bigger than original space ROTATEQ n q rotate n items from head of queue to end of queue TRANSFERQ qa gb n transfer n items from head of qa to tail of qb 5 3 Timeouts Timeouts are a resource used to measure time periods either for a single or cyclic purpose The base time unit is one microsecond and on a 32 bit architecture this give a range of up to 71 minutes As many timeouts that are needed may be declared Note that if you change the period with PERIOD or with SCHEDULE RUNS then this changes the time base so all timeouts will be invalid 5 3 1 Word Definitions GET TIME t return current raw time value MICROSECONDS n t convert n to microseconds raw time MILLISECONDS n t convert n to millise
58. dings every 100 milliseconds averaged 12 readings time Calculating a median can be a little more expensive than an average since sorting is involved Finally if we accumulate the readings for an AAA NiMh battery with a 10 ohm load we can see the flat voltage mostly out to about 1 1V and then it knees and drops off sharply close to 4 hours AAA NiMH with a 10 ohm Load ps 1207 2413 3619 4825 6031 7237 8443 9649 10855 12061 13267 14473 15679 seconds May 3 2006 81 And with a 1 ohm load we hit the knee at about 33 minutes AAA NiMH with a 1 ohm Load Wa Cem Wig x e e a E SCH S gengen a a A vE Zz 146 291 436 S81 726 871 1016 1161 1306 1451 1596 1741 1886 2031 2176 2321 seconds And if we do the same with a NiCD battery we see that the life is quite a bit shorter or about 10 minutes AAA NiCd with a 1 ohm Load voltage 1 58 115 172 229 286 343 400 457 514 571 628 685 742 799 856 913 970 1027 seconds 9 2 Using PWM to Generate High Voltage In this example the circuit is set up on a bread board and then ground and P0 7 are wired back into the May 3 2006 82 headers on the ARM Interface Board out In this example we use a few discrete components to build a voltage magnifier by turning a coil into a temporary current source In the above circuit PWM output 2 is used to drive the gate of the Q1 to short out L1 and B1 generating a current in L1 When Q1 shuts off the current in L1 cont
59. dr done by IsoMax EN STATE EAD AINO TO HAPPEN SSM main state machine MACHINE BATTERY MONITOR APPEND STATE MEASURE APPEND STATE DONE IN STATE EASURE CONDITION bto TIMEOUT CAUSES 200E01 ADCR ain0 14 poweron 1200E01 ADCR ain0 14 poweron start sampleg 0 FF gt IF samplearray 80 0 DO sampleq PULL 10 LSHIFT sampleq PULL OR OVER CELL LOOP DROP FDP NOT IF 20000 FDP Flash full CR ELSE samplearray FDP 200 FLMOVE 200 FDP THEN THEN bto RETIMEOUT THEN STATE EASURE TO HAPPEN IN STATE EASURE CONDITION FDP 8200 gt CAUSES finished REDLED ON HEN STATE DONE TO HAPPEN The ASM is plugged into the vectored interrupt controller EAD AINO SET STATE A D READER CFA VICVectAddr0 32 VICVectCntl0 The SSM just installs and a period is chosen requires a bit set to b nabled and a vector to be initialized bto START TIMEOUT start the ball rolling MEASURE SET STATE INSTALL BATTERY MONITOR install main state machine as ssm 10 MILLISECONDS PERIOD 10 times shorter than timeout 40000 VICIntEnable enable A D interrupts Viewing For reading all values stored in flash and queue RESET MONITOR reset the m
60. e connectors The following list gives a brief description of each connector and the signals involved for each of the boards Table 1 TiniARM Plug an ARM and Interface Board header functions Board Connector Functions Tini ARM J1 Power Reset Serial I O general purpose I O for port 0 J2 JTAG connector or shared GPIOs J3 PC connector or shared GPIOs Plug an ARM Jl Power Reset Serial I O general purpose I O for port 0 J2 JTAG connector or shared GPIO J3 DC connector or shared GPIO J4 CAN BUS network port J5 General I O for ports 0 and 1 ARM Interface J1 Default pin 2 amp 3 select on board or on plug in board Board regulators Pin 1 amp 2 select the off board regulators Q1 amp Q2 on the Interface board to power the Plug an ARM This is an optional when there is no regulators on the ARM module JIA receptor for plug in board connector J1 J2 used to connect DTR to allow remote resets J3A no connections J3V used when plug in board has no regulator see J7 J4A CAN BUS network port JSA receptor for plug in board connector J5 J6 power reset and UARTO J7 used when plug in board has no regulator see J3V J8 access to all pins on JIA J9 access to all the pins on JSA J10 contains all signals from J8 and J9 Jil connect a jumper to boot into boot loader The ARM Interface Board will accept the Tini ARM in the JIA connector or a Plug an ARM in JIA and J5A connecto
61. e ll add a state with a name The syntax to do this is to say APPEND STATE followed by another made up name of our own Here we add one state RT like this May 3 2006 21 APPEND STATE RI States are the fundamental parts of our virtual machine States help us factor our program down into the important parts A state is a place where the computer s outputs are stable or static Said another way a state is place where the computer waits Since all real time programs have places where they wait we can use the waits to allow other programs to have other processes There is really nothing for a computer to do while its outputs are stable except to check if it is time to change the outputs One of the reasons IsoMax can do virtually parallel processing is it never allows the computer to waste time in a wait no backwards branches allowed It allows a check for the need to leave the state once per scheduled time per machine To review we ve designed a machine and a sub component state Now we can set up something like a loop or jump where we go out from the static state when required to do some processing and come back again to a static wait state The rules for changing states along with the actions to do if the rule is met are called transitions A transition contains the name of the state the rule applies to the rules called the condition what to do called the action and where to go to get into another state
62. e machine chain instead There are no backwards branches in this code It has no Program Counter Capture PCC Loops It runs straight through to termination It would work This however is another trick you should avoid Again why This code does one of two actions every time the scheduler runs The actions take longer than the Boolean test and transfer to another thread The system will run slower because the same outputs are being generated time after time whether they have changed or not While the speed penalty in this example is exceedingly small it could be considerable for larger state machines with more detailed actions A deeper reason exists that reveals a great truth about state machines Notice we have used a state machine to simulate a hardware gate What the AND gate outputs next is completely dependent on what the inputs are next An AND gate has an output which has no feedback An AND gate has no memory State machines can have memory Their future outputs depend on more than the inputs present A state machine s outputs can also depend on the history of previous states To appreciate this great difference between state machines and simple gates we must first look a bit further at some examples with multiple states and multiple transitions 4 8 ANDGATE3 We are going to do another AND gate version ANDGATE3 to illustrate this point about state machines having multiple states This version will have two transitions and two st
63. econds THEN STATE RED TO HAPPEN IN STATE RED light is red till timeout happens CONDITION 1 CAUSES 1 LEDS 5 TIMER1_MRO 1 TIMER1_IR change to green for 5 seconds THEN STATE GREE TO HAPPEN RUN STOPLIGHT 3 TIMER1_TCR 1 TIMER1_MRO 60000000 1 IMER1_PR 1 second base IMER1_MCR 1 TIMER1_IR O LEDS YELLOW SET STATE TIMER USE ASM STOPLIGHT 1 TIMER1_TCR RUN STOPLIGHT Note when using a long prescale count the interrupt can be serviced and over with before the mr count is reset When changing the MR to a smaller value the counter doesn t get reset to zero even though the MCR is set to make it do so Work around is to either use multiple MRs or reset counter POO IG a A manually One of the more useful tools for tight real time software is a measuring tool to see how long things usually states take to execute This can help to refactor a system to make it very efficient The measurement tools can be applied to find out which state takes the longest to execute and how long that is by adding in the following code before RUN STOPLIGHT Measurements CREATE slmax 0 0 STOPLIGHT STARTMAX STOPLIGHT STOPLIGHT slmax STATE OMAXS 0 slmax IAXS slmax U us in state H slmax CELL H STATE RUN STOPL
64. egulators then There are a few options in the power train from the power jack to the ARM chip so we will step through them from the power jack Power is supplied by a plug in power adaptor with center positive and between 6 and 12 volts Switch SW1 enables power to flow to the rest of the board or not Jumper J1 depends on the plug in board If the plug in board has voltage regulators then J1 should be set to OFFBR voltage regulators are OFF BoaRd with respect to the Interface Board position routing input power to the plug in board and not to the Interface Board In the ONBR position power is routed to the on board regulators providing 5V and 3 3V with the two red LEDs lighting With J1 in the ONBR position J7 choses the VDD voltage for the plug in board With J1 in the OFFBR position J7 should not have any connection just put the jumper on the middle pin only J3V is only jumpered if the plug in board uses the second connector and has no on board regulators Otherwise J3V should be open That about sums up the Interface Board except for DB9 and SW2 DB9 is where you connect your serial cable from a COM port on your PC SW2 is the reset button which lets you start from a known position This is sometimes necessary when playing with the I O components and you need to return to a known state The TiniARM and Plug an ARM differ in two main ways the amount of I O pins and the May 3 2006 13 on chip resources Table 2 Resource compariso
65. erals is beyond the scope of this manual so for more information seek out the user manuals for the particular micro IsoMax carries a superset of the registers even though not all registers are present The 2106 will have an extra UART while the 2129 will have A D CAN bus and an external memory controller Accessing a register that does not exist on a micro will cause an exception These registers are grouped by peripheral and act like constants They can be used with the memory operators 0 CO and C to alter or read the contents just like normal memory 6 1 A D Converter ADCR 6 2 Can Bus AFMR EFF_GRP_sa CANTXSR 1MOD COO er oe ee ao 6 3 External Interrupts EXTINT 6 4 12C Interface I2C_I2ADR 12C_12SCLH ADDR SFF_sa SFF_GRP_sa ENDofTable LUTerrAd CANRXSR CANMSR C2MOD C1CMR C2GSR C1ICR C2IER C1BTR C2EWL C1SR C2RFS C1RID C2RDA C1RDB C2TFI1 C1TID1 C2TDA1 C1TDB1 C2TFI2 C1TID2 C2TDA2 C1TDB2 C2TFI3 C1TID3 C2TDA3 C1TDB3 EXTMODE EXTPOLAR I2C I2CONCLR I2C I2CONSET I2C I2SCLL I2C I2STAT EFF sa LUTerr C2CMR C2ICR C2BTR C2SR C2RID C2RDB C2TID1 C2TDB1 C2TID2 C2TDB2 C2TID3 C2TDB3 EXTWAKE I2C_I2DAT May 3 2006 69 6 5 General Purpose Input Output IOCLR IODIRO IOPIN1 IOCLRO IODIR1 IOSET 6 6 Memory Accelerator Module MAMCR 6 7 Power Control PCON 6 8 Pin Connect Block PI
66. ess involves a read modify write back operation The 512 bytes that are to be modified are read from the flash into a buffer The 16 bytes to be modified are copied into the relative block within the buffer The 512 byte buffer is written back to the flash May 3 2006 75 9 Examples Some of these examples deal with the user flash memory which is divided into regions one common to both the LPC2106 and the extra LPC2129 regions e 32K from 0x8000 to OxFFFF erase 8K bytes write 512 bytes For smaller writes see Small Flash Writes on page 75 e 128K bytes extra on the LPC2129 8K bytes from 0x1_E000 to 0x1_FFFF erase 64K bytes write 512 bytes 64K bytes from 0x2_0000 to 0x2_FFFF erase 64K bytes writes 512 bytes 56K bytes from 0x3_0000 to 0x3_DFFF erase 8K bytes write 512 bytes Note that because IsoMax is in 0x1_0000 to 0x1_DFFF and not protected it is less simple to erase the 8k block from 0x1_E000 to 0x1_FFFF To do this you need to copy out the IsoMax code erase the 64K block from 0x1_0000 and then copy IsoMax back There are two problems with this e Where to put 56K of code temporarily last flash bank e and how to do the whole thing without using any code from that 56K block while its region is erased The easiest way is to just download IsoMax from the LPC2000 utility The last 8K block 0x1_E000 to 0x1_FFFF on the LPC2106 and 0x3_E000 to 0x3_FFFF on the LPC2129 contains the boot loader code and
67. et s add a place for those variables now and initialize them LOOPVAR lt BUILDS 1 DUP DOES gt DUP 0 IF DUP CELL SWAP TRUE ELSE 1 FALSE THEN 100 LOOPVAR CNT IN STATE BG1 CONDITION CNT May 3 2006 40 CAUSES GRNLED OFF HEN STATE BG2 IN STAT BG2 CONDITION CNT CAUSES GRNLI Fa HEN STATE TO HAPPEN D ON BG1 O HAPPE PROGRAI MACHINE BL ON MACHINE BL D A P S S A E INKGRN BG1 BG2 PVAR CNT EQUIVALENT GRAPHIC GRNLED ON Above the two transitions are pretty printed to make the four components of a transition stand out As discussed previously as long as the structure is in this order it could just as well been run together on a single line or so per transition like this IN STA E IN STA E BG1 CONDI BG2 CONDI ION CN CAUS ES GRNLED OFF TH EN STATE BG2 TO HAPP ION CN CAUS ES GRNLED ON TH T STAT BG1 TO HAPPE May 3 2006 41 Finally the new machine must be installed and tested BG1 SET STATE INSTALL BLINKGRN The result of this program is that the green LED blinks on and off Every time the
68. extra compiled in RAM is gone To modify this behaviour use AUTOBOOT to turn off the autobooting and then a warm image will be kept through reset but the files will have to be downloaded each time a power cycle is done The other option is to compile your code on top and then save itto ROM using QUIT BOOTUP After a reset this will leave a freshly compiled image in RAM from ROM but it doesn t run any of the software so it is just like it was after compiling This is handy if you usually work on one file for a while and all the files before it are handy to keep in ROM Then you can just press the reset button and drag and drop the one file you are testing with embedded test code and you don t even have to leave the editor application 5 8 2 Text CELL n returns the number of bytes in a cell H n prints n as an unsigned hex number C gets ASCII value of next character s s create a count prefixed string with 5 8 3 Debugging LEDS n 0 7 selects one of 8 led states 0 all off 1 green 2 yellow 3 yellow green 4 red 5 red green 6 red yellow 7 red yellow green badints a incremented for each nonassigned interrupt in the VIC 5 8 4 Asynchronous State Machines WDT SWI DBRX DBTX TIMERO TIMER1 UARTO UART1 PWMO I2C SPI PLL RTC EINTO EINT1 EINT2 1 interrupt number for ASMs USE ASM i sm assign a state machine to an interrupt n NO ASM i turn off interrupt NO MACHINES
69. g with the two previous machines All run in the background freeing us to program more virtual machines that can also run in parallel or interactively monitor existing machines from the foreground nn Us CPU vm Di a En g P0 29 z Ed E ees Os A CPU J10 a May 3 2006 29 mn Ub maa UD JN ee ee ee ee ee e e e A dem e o ee ee ee ee ee oa o o O Notice all three virtual hardware circuits are installed at the same time they operate virtually in parallel and the IsoMax is still not visibly taxed by having these machines run in parallel Further all three machines share one input so their behavior is strongly linked 4 4 SYNTAX AND FORMATTING Let s talk a second about pretty printing or pretty formatting To go a bit into syntax again you ll need to remember the following Everything in IsoMax is a word or a number Words and numbers are separated spaces or returns Some words have a little syntax of their own The most common cases for such words are those that require a name to follow them When you add a new name you can use any combinations of characters or letters except obviously spaces and backspaces and carriage returns So when it comes to pretty formatting you can put as much on one line as will fit up to 80 characters Or you can put as little on one line as you wish as long as you keep your words whole However some words will require a name to follow them so those names w
70. gram in IsoMax You create state machines that can run in a virtually parallel architecture Step Programming Action Syntax 1 Name a state machine MACHINE lt name gt 2 Select this state ON MACHINE lt name gt 3 Name any states appended on the machine APPEND STATE lt name gt APPEND STATE lt name gt NANE 00 May 3 2006 4 Describe transitions from states to states IN STATE lt state gt CONDITION lt Boolean gt CAUSES lt action gt THEN STATE lt state gt TO HAPPEN 5 Test and Install as required What do you have to write to make a state machine in IsoMax You give a machine a name and then tell the system that s the name you want to work on You append any number of states to the machine You describe any number of transitions between states Then you test the machine and when satisfied install it into the machine chain What is a transition A transition is how a state machine changes states What s in a transition A transition has four components 1 which state it starts in 2 the condition necessary to leave 3 the action to take when the condition comes true and 4 the state to go to next time Why are transitions so verbose The structure makes the transitions easy to read in human language The constructs IN STATE CONDITION CAUSES THEN STATE and TO HAPPEN are like the five brackets
71. h where the FDP is at and assumes that the flash is set to FF so no erase is needed Only the needed sectors are written to cover the word length If the dictionary is not aligned after say a C then it is first aligned up to a 4 byte boundary before copying to flash The smallest section of writing for flash is 16 bytes so after a word is moved to flash FLWORD aligns to the next 16 byte boundary FDP a flash dictionary pointer used by FLWORD to transfer definitions from RAM to flash This pointer is reset by COLD FL n a store n into flash location a FL works on any location in flash but it takes up to 400ms IAP a a This calls the IAP code in the boot block with a being the address of the command and response buffer The buffer is filled with the command and parameters for the IAP call and in return is filled with the response This is used by the flash programming words May 3 2006 74 8 Hands On 8 1 Setup A good way to prototype small hardware projects directly with the ARM boards is by adding headers to the development board for J8 J9 and J10 Electronic components can directly plug into the headers and save wire wrapping or soldering This approach was used for the simple battery monitor example 8 1 1 Small Flash Writes While the smallest segment that can be written to flash is 512 bytes it is possible to only modify 16 of those bytes at a time as long as they are on a 16 byte boundary and are all OxFF The proc
72. hman to keep moving is a simple management issue the same obviousness is not obvious in software Why The structures in most languages discourages anything but spinning on a condition until it clears Like the watchman fixated on the one problem and stopping his rounds backwards branches in languages allow a program to become stuck on some bit until it changes There are several choices 1 Only do one thing and settle for that hire one single minded watchman for each control multiprocessing Hire one single minded watchman and hire an executive to interrupt him if he becomes fixated and move him along multitasking Hire one watchman who isn t so single minded and can never be allowed to stop moving along on his rounds Isostructure May 3 2006 51 5 1 WORD SYNTAX STATE MACHINE lt name of machine gt ON MACHINE lt name of machine gt APPEND STATE lt name of new state gt AT ADDRESS lt a gt AS TAG APPEND STATE lt name of new state gt WITH VALUE lt n gt NESTATETEBNESMATEt dhexhameat CONDAMEFONO HABBANean computation CAUSES lt compound DEFINE lt word name gt TEST MASK lt n gt DATA MASK lt n gt AT ADDRESS lt a gt FOR INPUT DEFINE lt word name gt SET MASK lt n gt CLR MASK lt n gt AT ADDRESS lt a gt FOR OUTPUT DEFINE lt word name gt PROC forth code END PROC DEFINE lt word name gt COUNTDOWN TI
73. ill have to be on the same line In the examples you will see white space blanks used to add some formatting to the source text MACHINE starts at the left and is followed by the name of the new machine being added to the language ON MACHNE is indented right by two spaces APPEND STATE X is indented two additional spaces This is the suggested but not mandatory offset to achieve pretty formatting Use two spaces to indent for levels The transitions are similarly laid out where the required words are positioned at the left and the user programming is stepped in two spaces May 3 2006 30 4 5 MULTIPLE STATES MULTIPLE TRANSITIONS Before we leave the previous Three Machines let s review the AND machine again since it had a little trick in it to keep it simple just one state and one transition The trick does simplify things but goes too far and causes a glitch in the output To make an AND gate which is just like the hardware AND we need at least two transitions The previous example BOUNCELESS was the first state machine with more than one transition We ll follow this precedent and redo ANDGATE2 with two transitions 4 6 ANDGATE2 MACHINE ANDGATE2 ON MACHINE ANDGATE2 APPEND STATE X IN STATE X CONDITION P0 31 ON P0 30 ON AND CAUSES YELLED ON HEN STATE X O HAPPEN IN STATE X CONDITION PO 31 OFF P0 30 OFF OR CAUSES YELLED OFF HEN STAT
74. inting to the ASM and enable disable the interrupts Alternatively one channel could be used and the interrupt number could be swapped in and out as well as managing enables disables The former method is chosen 8 data bit samples LAA recognize start bit expect stop bit In reality the state for waiting for the middle of the bit can be dropped since the software is not as fast as hardware by the time the start bit is detected and then the timer is set up for the data bits enough time has elapsed that it can be used as a reference point for the next 9 bit samples In the above figure the smaller red waveform is the asynchronous serial data while the taller blue waveform is P0 4 as controlled by TOGS in the states to signal each state This makes a god way of capture state machine behaviour which depends on timing When the start bit is found the P0 4 line is toggled twice to mark for easy capture on an oscilloscope In some of the states the timer interrupt is the trigger in others the external interrupt is used and in one state both interrupts are active demonstrating both the power of the ARM s vectored interrupt controller and its harnassing by the IsoMax state machine paradigm For my software asynchronous receiver I use P0 16 as EINTO triggering on a low level and taking that as the start bit When I get this interrupt my state machine moves into sample mode and uses a second interrupt Omer to sample the data bits to make a b
75. inues to flow and enough voltage develops across the coil to forward bias the diode D1 and allow the current to charge C1 The load resistor R is used to simulate a load The output voltage is across C1 9 2 1 Code PWM for Voltage Magnification Rob Chapman Oct 1 04 COLD Using a simple circuit a single battery can be used to generate a much higher voltage DECIMAL VARIABLE period 60000 period 1000 Hz from 60Mhz clock VARIABLE onfor 30000 onfor 50 duty Tools n BL WORD 1 C COMPILE LITERAL IMMEDIATE get ASCII code HEX INIT PWM PINSELO 8000 OR PINSELO enable PWM to control P0 07 400 PWM_PCR enable pwm2 output period PWM_MRO set the period with match 0 onfor PWM_MR2 set the on for time B PWM_TCR reset and enable PWM next 3 grouped 2 PWM_MCR reset counter on match on 0 9 PWM_TCR get the party started DECIMAL DUTY f onfor S gt F period S gt F F STATUS CR 6066 period S gt F F F gt D D Hz onfor S gt F 60E 3 F F gt D D ns DUTY 100E F F Li SET PWM period PWM_MRO onfor PWM MR2 5 PWM LER alter pwm May 3 2006 83 ADJUST CR J 10 duty 10 period S status Q to quit H BEGIN KEY DUP Q IF 0 ELSE quit by setting key to zero DUP S IF STATUS ELSE show status
76. is as much as an output as the outputs P0 28 ON and YELLOW LED ON are less likely to have read back problems and faster to check The current state contains more information than other outputs It can also contain history The current state is so versatile in fact it can store all the pertinent history necessary to make any decision on past inputs and transitions This is the deep truth about state machines we sought May 3 2006 36 9 2 THE FINITE STATE MODEL BASIC DEFINITION The behavior of a finite state machine is described as a sequence of events that occur at discrete instants designated t 1 2 3 etc Suppose that a machine M has been receiving inputs signals and has been responding by producing output signals If now at time t we were to apply an input signal x t to M its response z t would depend on x t as well as the past inputs to M From SWITCHING AND FINITE AUTOMATA THEORY KOHAVI No similar solution is possible with short code threads While variables can indeed be used in threads and threads can again reference those variable using threads and variables leads to deeply nested IF ELSE THEN structures and dreaded spaghetti code which often invades and complicates real time programs 4 11 BOUNCELESS To put the application of state history to the test let s revisit our previous version of the machine BOUNCELESS Refer back to the code for transitions we used in BOUNCELESS
77. license required boots from RS 232 UART1 port J5 J5 RS 232 Connector for UARTI J7 J7 Pin 1 amp 2 select USB transmitting or Pin 2 amp 3 select RS 232 for UART receiving J8 connect a jumper to boot into boot loader J9 grounds PWRCTL pin on USB chip J10 jumpers to connect up USB to UART1 The LPC2106 USB board has a real nice feature that allows it to run from a USB cable By jumpering the top left two pins on header J4 IsoMax will use the second UART for u a e o e e o Jumper to select USB for I O interactive I O This UART is connected to a USB interface chip and creates a COM port for the PC A USB cable connects the board to the PC and also provides power to the board so that no power supply is required The LEDs are available for user programs Since there are two ports on this board one serial port can be used for development leaving the other one available for interfacing to smart peripherals like GPS or LCDs May 3 2006 15 4 PROGRAMMING Under construction IsoMax is a programming language based on Finite State Machine FSM concepts applied to software with a procedural language derived from Forth underneath it The closest description to the FSM construction type is a One Hot Mealy type of Timer Augmented Finite State Machines More on these concepts will come later QUICK OVERVIEW What is IsoMax IsoMax is a real time operating system language How do you pro
78. lows the machine down being executed every time the machine chain runs Most of the time states wait A state is meant to take no action and have no output They run the condition only to check if it is time to stop the wait time to take an action in a transition The actions we have taken in these simple machines if very short More complex machines can have very complex actions which should only be run when it is absolutely necessary Putting actions in the conditional lengthens the time it takes to operate waiting machines and steals time from other transitions Why was it necessary to have two transitions to do a proper AND gate To find the answer look at the output of an AND gate There are two possible mutually exclusive outputs a 1 or a 0 Once action cannot set an output high or low One output can set a bit high It takes a different output to set a bit low Hence two separate outputs are required 4 7 ANDOUT May 3 2006 33 Couldn t we just slip an action into the condition spot and do away with both transitions Couldn t we just make a thread to do the work periodically Yes perhaps but that would break the paradigm Let s make a non machine definition The output of our conditional is in fact a Boolean itself Why not define ANDOUT P0 31 ON P0 30 ON AND IF YELLED ON ELSE YELLED OFF THEN Why not forget the entire machine and state stuff and stick ANDOUT in th
79. machines ASM triggered by the UART interrupt or by KEY and EMIT if the sio needs servicing and interrupts are off This way it works with interrupt on or off Currently there are no interrupts feeding the sio and you can verify this by reading VARTO IER So by putting the interpreter into the HALT state no uart accesses will hamper your code which runs as an SSM or ASM HALT is a word created to halt the interpreter or from the user point of view lock up The interpreter is the main thread of code running from bootup but with IsoMax it is not the only threads of code able to run IsoMax runs the state machines that you program as a thread of code from an interrupt So while the interpreter is running continuously or halted the state machines will still run Just stopping the interpreter prevents it from grabbing input or creating output The interpreter can be unhalted by changing the value of the blocking variable running in a state machine When you INSTALL a state machine in IsoMax you are making it part of a set of state machines that are EXECUTEd every PERIOD by an interrupt from timer O match register 3 You can disable and enable interrupts with DINT and EINT In IsoMax for ARM the other interrupts for the other peripherals on the ARM are available to execute state machines as well This really lets loose the power of the micro yet orchestrates it perfectly Probably the missing info is where HALT gets called from It must be t
80. n be the controller on a larger PCB board It can be flipped over and plugged into a carrier board to attach to all signals A double male right angle connector will convert J1 from a female to a male for such application however the LED s may no longer be visible and the mating force of the connectors can sufficiently hold the board in place for most applications Using a cabled or adapter it can be plugged into a 24 pin socket of a stamp type controller to upgrade an existing application IsoMax brings an amazing amount power to a very small space at a very reasonable cost You ll undoubtedly want to have a few ARMs on hand for your future projects May 3 2006 10 3 QUIKTOUR Start by comparing your board to the diagrams below Most of the important features on the board are labeled There are two compact ARM boards which plug into an ARM Interface Board for development Plug an ARM and TiniARM DB9 sw1 m s En geen sl MT ei EDs a Ji sl S CPU J4A gt E W r Se ol NE mul oo LEDs ARM Interface Board Power RS232 P0 4 31 sua J9 Du E P0 4 20 RS232 EE J2 p x L JTAG Plug an ARM gt E a Em Te User development LEDs CAN area PO n P1 17 25 And there is the larger all in one ARM board with a USB port LPC2106 USB DB9 g PJ1 PF USB1 SW2 g XTAL 8 ma El i LEDs CPU J10 4 User development area May 3 2006 11 The features most important to you will be th
81. n between TiniARM and Plug an ARM resource Tini ARM Plug an ARM pins 18 1 0 on Jl addition 18 I O on J5 flash memory 128KB total 256K total RAM 64KB total 16KB total code read protection none The IPA can be put in a lesser state by writing 0x87654321 at flash address 0x1FC uarts two one CAN bus none one port two controllers A D none 4 10 bit inputs External memory none yes controller a bootloader IsoMax and user share this space There s not too much else on the boards other than the RS232 interface chip the crystal regulators JTAG and PC ports with the Plug an ARM including a CAN Bus port as well The TiniARM with regulators weighs 6 grams and the Plug an ARM with regulators weighs 10 grams This puts a lot of computing power in a light weight package easily May 3 2006 14 included n robotic or other embedded applications Board LPC2106 USB board Table 3 LPC2106 USB Board header functions Connector Functions J1 all I O ports J2 select DBG mode J3 debug port for use with JTAG 20 Pin Connector or shared I O Port J4 debug port for use with JTAG 14 Pin Connector or shared I O Port Pin 3 amp 4 select IsoMax FORTH boots from RS 232 UARTO Port DB1 J4 Pin 1 amp 3 select and J7 Pin 1 amp 2 select IsoMax FORTH license required boots from USB UART1 port J4 Pin 1 amp 3 select and J7 Pin 2 amp 3 select IsoMax FORTH
82. ogether produces the following lines of IsoMax code Before entering hexadecimal numbers the keyword HEX invokes the use of the hexadecimal number system This remains in effect until it is change by a later command The numbering system can be returned to decimal using the keyword DECIMAL HEX DEFINE TOO COLD TEST MASK 01 DATA MASK 01 AT ADDRESS OFB1 FOR INPUT DEFINE TOO HOT EST MASK 01 DATA MASK 00 AT ADDRESS OFB1 FOR INPUT DECIMAL Output trinary operators also need three parameters In this instance using the trinary operation mode of setting and clearing bits would be convenient This mode requires 1 a mask telling which bits in the output port are to be set 2 a mask telling which bits in the output port are to be cleared and 3 the address of the I O port The keywords which proceed the parameters are in order 1 SET MASK 2 CLR MASK and 3 AT ADDRESS Finally the keyword FOR OUTPUT finishes the defining process identifying which trinary operator is in effect May 3 2006 47 el EFINE lt name gt AND MASK lt mask gt XOR MASK lt mask gt AT ADDRESS lt address gt FOR OUTPU EFINE lt name gt CLR MASK lt mask gt SET MASK lt mask gt AT ADDRESS lt address gt FOR OUTPU el A single output port line is needed to turn the heater on and off The act of turning the heater on is unique and different from turning the heate
83. onitor storage 8000 BEGIN DUP NOT WHILE DUP 2000 FLERASE 2000 REPEAT 8000 FDP VIEW dump out all the samples and reset DECIMAL 8000 BEGIN DUP DUP NOT WHILE FFFF AND CR 2 REPEAT DROP sampleg BEGIN DUP Q WHILE DUP PULL CR REPEAT DROP RESET MONITOR CR SIZE show size of samples FDP sampleq Q r 9 1 2 Results The code was downloaded to the PlugAnARM and it runs immediately A battery was attached and loaded with a low ohmage resistor Results were viewed at different times in testing out the code This graph illustrates the noise on the AINO input which should be quite quiet since it is connected to a direct May 3 2006 71 source of voltage but as can be seen there are 8 discrete levels read reducing the precision of 10 bits to 7 bits By combining the readings bit accuracy can be regained but at a cost of either time or sample rate ADC Readings every 100 milliseconds readings time In the ARM LPC user manual it states that if the input pin is set to a digital function instead of the analog function then the accuracy will be off But unless the setting has been changed from reset the default is to have that input be analog so we can rule out that source of noise by simply checking the value in the PINSEL 1 HEX PINSEL1 U 15400000 OK And indeed it is the reset value and the four analog
84. r off however Two actions need to be defined therefore even though only one I O line is involved P0 28 was selected for the heater control signal When P0 28 is high or set the heater is turned on To make P0 28 high requires P0 28 to be set without changing any other bit of the port Therefore a set mask of 02 indicates the next to least significant bit in the port corresponding to P0 28 is to be set All other bits are to be left alone without being set A clear mask of 00 indicates no other bits of the port are to be cleared When P0 28 is low or clear the heater is turned off To make P0 28 low requires P0 28 to be cleared without changing any other bit of the port Therefore a set mask of 00 indicates no other bits of the port are to be set A clear mask of 02 indicates the next to least significant bit in the port corresponding to P0 28 is to be cleared All other bits are to be left alone without being cleared Putting the keywords and parameters together produces the following lines of IsoMaxTM code HEX DEFINE HEATER ON SET MASK 02 CLR MASK 00 AT ADDRESS OFBO FOR OUTPU DEFINE HEATER OFF SET MASK 00 CLR MASK 02 AT ADDRESS OFBO FOR OUTPU DECIMAL Only a handful of system words need to be covered to allow programming at a system level now 4 18 FLASH AND AUTOSTARTING Here s everything you need to copy an application to Flash and to autostart it Here briefly
85. r this example Let s say you must hire a night watchman at a dam Now things run pretty slowly at your dam so there are four or five critical things which must be monitored and they need to be adjusted of within half an hour to 45 minutes of getting out of whack or they ll become critical So what do you do You train the night watchman to make rounds every 15 minutes As long as he gets to all the things that must be checked and adjusted within the 15 minutes everything is safe He s probably fast enough the round will only take a very short amount of the 15 minutes and he can go eat donuts and drink coffee with the rest of his time As long as he gets out there and checks everything sees what conditions are out of whack and takes corrective action then moves on every 15 minutes it s all fine But if the watchman sees one thing go out of whack and adjusts it and waits there for it to come back into range which could take as long to come back as it did to go out what happens to the other 4 things Maybe nothing Or maybe they go out of whack too and he doesn t get there for an hour because he s been focused on the one thing he first saw was wrong If you ve got single focus watchman what do you have to do You have to have multiple watchman each doing a single task Or you have to get an executive who interrupts transports the single minded watchman and transports him from check point to check point Now while the need for the watc
86. rs When plugging an ARM board in be sure to always May 3 2006 12 orientate the board so the LEDs are away from the DB9 connector or just make sure pin 1 of each connector mates to pin 1 by checking for a square solder pad This makes a nice platform for development and programming of ARM boards which can then be plugged in the target without the development environment The J8 J9 and J10 connectors are best filled with female headers This way you can directly plug in wires and components making small circuits without any soldering or wirewrapping and even jumper to an external breadboard for rapid prototyping just like writing interactive code The examples section makes use of this idea Alternatively you can use male headers which are quite handy to wire wrap Having J10 as well as J9 and J8 allows more connection points for each pin Jumper J11 is used select the boot loader program inherint on each micro If the jumper is present then you need to use the LPC2000 Flash Utility to do anything with the board such as reload the IsoMax image or load other images With the jumper off it s handy to keep it on just one post so that it s there for next time the plugged in board will boot into IsoMax M There are a number of options to accommodate a wide range of user choices in plug in boards Voltage regulation for the ARM is either done on the plug in board or on the interface board If the plug in boards have onboard voltage r
87. s some merit Initially had two state machines one for each signal running from the same interrupt source but on May 3 2006 60 different channels was getting a lot of noise and bad signals but knew it wasn t the signal so ai needed a new refactoring of the solution Architecturally merged two state machines into one so that they can run sequentially to reduce contention Also since there is only one interrupt vector TIMER1 it maps better to a single state machine The states from the Left Right state machine and the Fore Aft state machine now combine to become the 2D TILTS state machine This also makes it easier to coordinate common states like powerup idle and powerdown The tilt sensor states are MACHINE 2D TILTS capture and measure tilt signals APPEND STATE LR SYNCING find a rising edge on first signal APPEND STATE LR RISING record a rising edge APPEND STATE LR FALLING record pulse length APPEND STATE LR PERIOD X record period length APPEND STATE FA SYNCING repeat for other signal APPEND STATE FA RISING APPEND STATE FA FALLING APPEND STATE FA PERIOD APPEND STATE TILT OFE Y no measurements can be powered off The syncing state waits for a rising edge and then discards the reading The rising and falling states record and subtract the times to get the pulse width and then the period state takes a fin
88. scheduler runs the machine chain control is passed to whichever state BG1 or BG2 is active The LOOPVAR created word CNT is decremented and tested When the CNT reaches zero it is reinitialize back to the originally set value and passes a Boolean on to be tested by the transition If the Boolean is TRUE the action is initiated The GRNLED is turned ON or OFF as programmed in the active state and the other state 1s set to happen the next control returns to this machine 4 14 SPEED You ve seen how to write a machine that delays based on a counter Let s now try a slightly less useful machine just to illustrate how fast the IsoMax can change state First reset your machine to get rid of the existing machines 4 15 ZIPGRN MACHINE ZIPGRN ON MACHINE ZIPGRN APPEND STATE ZIPON APPEND STATE ZIPOFE May 3 2006 42 IN STATE ZIPON CONDITION TRUE CAUSES GRNLED OFF THEN STATE ZIPOFF TO HAPPEN IN STATE ZIPOFF CONDITION TRUE CAUSES GRNLED ON THEN STATE ZIPON TO HAPPEN ZIPON SET STATE Now rather than install our new machine we re going to test it by running it by hand interactively Type in ZPON SET STATE ZIPGRN Bess Gem A ZIPGRN should cause a change in the green LED The machine runs as quickly as it can to termination through one state transition and stops Run it again Type al nn NM B ZIPGRN
89. se four elements are printed in bold In the equivalent graphic they are labeled as FROM STATE BOOLEAN ACTION and TO STATE The FROM STATE is rr The BOOLEAN is a simple phrase checking P0 31 OFF The ACTION is reDLED on The TO STATE is again zr So to complete our state machine program we must define the transition we need The syntax to make a transition then is to fill in the blanks between this form IN STATE lt name gt CONDITION lt Boolean gt CAUSES lt action gt THEN STATE lt name gt TO HAPPEN Whether the transition is written on one line as it was at first IN STATE RT CONDITION P0 31 OFF CAUSES REDLED ON THEN STATE RT TO HAPPEN Or pretty printed on several lines as it was in the text box IN STATE RT CONDITION P0 31 OFF CAUSES REDLED ON HEN STATE O HAPPEN The effect is the same The five bordering words are there and the four user supplied states condition and action are in the same order and either way do the same thing After the transition is added to the program the program can be tested and installed as shown above State machine diagrams the graphic above being an example are nothing new They are widely used to design hardware They come with a few minor style variations mostly related to how the outputs are done But they are all very
90. solid than the first method in that it could sync up within a data byte instead of a cycle which depended on no data The first option is just use a timeout and collect bit samples no decoding necessary to get the byte A variation is to use an ASM and a hardware resource for the timer instead of an SSM and a timeout Running the SSM clock at a decent rate for 104us timeouts with good accuracy will put a premium on cycle time For example if the PERIOD is set to anything greater than the 104 us timeout then the timeout will be too long If the PERIOD is set to 100 us then the resolution is poor and if there is jitter data bits could be read wrong Since the timeouts are periodic there won t be slippage in time with respect to the data for such a PERIOD If PERIOD is set to less than 50 us it will likely start to run into overrun conditions The external interrupt 0 is a level sensitive interrupt It is enabled with the bit O of the register EXTINT This enables the resource as an interrupt The interrupt goes to the VIC where it is channel number 14 0x4000 Since SSM uses timer O we will use timer 1 for timing the bit samples The channel number is 5 0x20 Making use of the VIC we can set the state machine up and then for the different states select the channel number to use as a trigger The VIC s flexibility offers us two solutions for tying in the ASM We could use two May 3 2006 86 channels one for each interrupt with both po
91. st program line we tell IsoMax we re making a new virtual machine named REDTRIGGER Any group of characters without a space or a backspace or return will do for a name You can be very creative Use up to 32 characters Here the syntax is MACHINE followed by the chosen name MACHINE Kei EDTRIGGER That s 1t We now have a new machine This particular new machine is named REDTRIGGER It doesn t do anything yet but it is part of the language a piece of our program For our second program line we ll identify REDTRIGGER as the machine we want to append things to The syntax to do this is to say ON MACHINE and the name of the machine we want to work on which we named REDTRIGGER so the second program line looks like this ON MACHINE pi EDTRIGGER Right now we only have one machine installed We could have skipped this second line Since there could be several machines already in IsoMax M at the moment it is good policy to be explicit Always use this line before appending states When you have several machines defined and you want to add a state or transition to one of them you will need that line to pick the machine being appended to Otherwise the new state or transition will be appended to the last machine worked on All right We add the machine to the language We have told the language the name of the machine to add states to Now w
92. t will be executed at one of three times before startup Quick after startup Boot or before MaxForth runs Autovector Quick tag is OXAS5A OxFFFO Quick vector is CFA at OxFFF4 Boot tag is OXA55A at OxFFF8 Boot vector is CFA at OxFFFC Autovector range 0x8000 to 0x10004 at 0x400 boundaries OxA55A followed by CFA default is at 0x 10004 This simple program prints out a message when MaxForth starts up COLD HEX FDP B000 FLERASE HI HELLO FLWORD HEX A55A FFFO FL HI CFA FFF4 FL HI HELLO OK HELLO IsoMax V1 0 May 3 2006 49 Flash is erased first and then the startup program HI is stored in it The boot vector is used as the startup hook The first HELLO is from testing the code and the second one is from pressing the reset button which prints the start prompt as well 4 18 2 Dimensions Data stack and return stack are 64 cells deep The floating point stack is 8 deep Overflowing or underflowing any stack may result in unpredictable operation 4 18 3 Updates WORDS text uses any following text as a search substring for selectively displaying only words which contain the text If there is no following text then all words are displayed This is useful for listing subsets or finding particular words May 3 2006 50 5 SOFTWARE IsoMax is an interactive real time control computer language based on the concept of the State Machine Conside
93. talled machines run in a virtually parallel fashion IsoMax facilitates fine grained parallelism Machine Architecture In an ordinary high level language such as C Basic Forth or Java most anyone can make a small computer do one thing well Programs are written flowing from top to bottom Flow charts are the preferred diagramming tools for these languages Any time a program must wait on something it simply loops in place Most conventional languages follow the structured procedural programming paradigm Structured programming enforces this style Getting two things done at the same time gets tricky Add a few more things concurrently competing for processor attention and most projects start running into serious trouble Much beyond that and only the best programmers can weave a program together running many tasks in one application Most of us have to resort to a multitasking system Windows and Linux are the most obvious examples of multitasking systems For a dedicated processor a multitasking operating system adds a great amount of overhead for each task and an unpleasant amount of program complexity May 3 2006 9 The breakthrough in IsoMax is the language is inherently multitasking without the overhead or complexity of a multitasking operating system There s really been nothing quite like it before Anyone can write a few simple machines in IsoMax M and string them together so they work Old constrained
94. ve a problem and a queue between the two state machines for the two ports can be quite small or maybe even just a variable However in the other direction B can bring data in at a rate 12 times faster than A can process it So a queue between the state machien for port B and the one for port A would have to be big enough to hold on to a burst of data And the maximum average throughput on B would be 12 5 In the case that bursts of 16 came in then the queue would have to be 16 or more cells long to hold the stopped data 5 2 1 Queues for supporting data and control flows Queue structure insert remove end data space for circular queue geess Vv Vv insert remove end data cells last data cell A PUSH gt QUEUE gt PULL POP lt lt STUFF The first cell is the insert pointer the second cell is the removal pointer and the third cell is the end pointer Both insert and removal pointers are respectively moved down in memory by PUSH and PULL POP and STUFF move them up in memory When either pointer gets to the pointer for end or the end pointer if going the other way they are set to the end pointer or just after the pointer to the end pointer When the queue is zeroed both pointers are set to the same location Since it contains nothing the insert pointer always points to a location where values can be written Once a value has been written with PUSH then it is
95. very time the May 3 2006 32 scheduler ran the chain of machines it would execute the conditions clauses of all transitions on any active state Only if the condition was true did any action of a transition get executed Consequently the trick used in ANDGATEI caused the action of the second transition to happen when conditionals only should be running This meant it was as if the second transition of ANDGATE2 happened every time Then if the condition found the action to be a wrong output in the conditional the action of ANDGATE ran and corrected the situation The brief time the processor took to correct the wrong output was the glitch in ANDGATEI s output Now this AND gate ANDGATE2 is just like the hardware AND except not as fast as most modern versions of AND gates implemented in random logic on silicon The latency of the outputs of ANDGATE2 are determined by how many times ANDGATE2 runs per second The programmer determines the rate so has control of the latency to the limits of the CPU s processing power The original ANDGATEI serves as an example of what not to do yet also just how flexible you can be with the language model Using an action between the CONDITION and CAUSES phrase is not prohibited but is considered not appropriate in the paradigm of Isostructure An algorithm flowing to determine a single Boolean value should be the only thing in the condition clause of a transition Any other action there s
96. ways of thinking must be left behind to get this new level of efficiency IsoMax is therefore not and cannot be like a conventional procedural language Likewise conventional languages cannot become IsoMax like without loosing a number of key features which enforces Structured Programming at the expense of Isostructure In IsoMax all tasks are handled on the same level each running like its own separate little machine Tasks don t come and go like they do in multitasking any more than you d want your leg to come and go while you re running Each machine in the program is like hardware component in a mechanical solution Parts are installed in place each associated with their own place and function Programming means create a new processor task fashioned as a machine and debug it interactively in the foreground When satisfied with performance you install the new machine in a chain of machines The machine chain becomes a background feature of IsoMax until you remove it or replace it The combination of VPMA software and diverse hardware makes the ARM very versatile It can be used right side up by J1 with a controller interface board providing an area for prototyping circuitry It can be used as a stand alone computer board deeply embedded inside some project Perhaps in a mobile robot mounted with double sided sticky tape or tie wraps although this would be less than a permanent or professional approach to mounting It ca
97. xactly like an AND gate if two transitions were used rather than just one Instead a trick was used to turn the LED off every time in the condition then turn it on only when the condition was true So a noise spike is generated a real and gate doesn t have The trick made the machine simpler it has half the transitions but it is less functional Later we ll revisit this machine in detail to improve it Notice both machines share an input but are using the opposite sense on that input ANDGATE1 looks for P0 31 to be ON or HIGH The internal pull up will normally make P0 31 high as long as it is programmed for a pull up and nothing external pulls it down Grounding P0 31 enables REDTRIGGER s condition and inhibits ANDGATEI s condition Yet the two machines coexist peacefully on the same processor even sharing the same inputs in different ways To see these machines running enter the new code if you are still running REDTRIGGER reset toggle the DTR line on the terminal for instance Alt T twice in MaxTerm or cycle power and download the whole of both programs Initialize REDTRIGGER for action by turning REDLED OFF as before Grounding P0 31 now causes the same result for REDTRIGGER the red LED goes on but the opposite effect for the yellow LED which goes off while P0 31 is grounded Releasing P0 31 turns the yellow LED back on but the red LED remains on Again initialize REDTRIGGER by turning REDLED OFF Now ground P0
98. y has a pull up resistor that will keep 1t on or high 1f nothing is attached J8 2106 En CPU J10 J1 EEEN P0 31 Ground So attaching push button from P0 31 to ground or even hooking a jumper to ground as shown will cause P0 31 to go off or low and the REDLED will come on Now if you want type these lines shown above in If you are reading this manual electronically you should be able to highlight the text on screen and copy the text to the clipboard with Cntl C Then you may be able to paste into your terminal program On MaxTerm the command to down load the clipboard is Alt V On other windows programs 1t might be Cntl V Now install the ReDTRIGGER by installing it in the now empty machine chain RT SET STATE INSTALL REDTRIGGER May 3 2006 19 2106 CPU J10 J1 P0 31 Ground Jumper Ground P0 31 with a jumper or press the push button and see the red LED come on Remove the ground or release the push button The red LED does not go back off The program is still running even though all visible changes end at that point To see that well need to manually reset the LED off so we can see something happen again Enter REDLED OFF If we ground P0 31 again the red LED will come back on so even though we are still fully interactive with IsoMax able to type commands like REDLED orF in manually the REDTRIGGER machine is running
99. y the same thing Also in IsoMax M there are no delay loops The whole point of having a state is to allow being in the state to be the delay Breaking this restriction will break the functionality of IsoStructure and the parallel machines will stop running in parallel If you ve ever programmed in any other language your hardest habit to break will be to get away from the idea of looping in your program and using the states and transitions to do the equivalent of looping for you A valid condition to leave a state might be a count down of passes through the state until a 0 count reached Given the periodicity of the scheduler calling the machine chain and the initial value in the counter this would make a delay that didn t wait in the conventional sense of backwards branching 4 13 BLINKGRN Now for an example of a delay using the count down to zero we make a machine BLINKGRN Reset your IsoMax so it is clean and clear of any programs and then begin MACHINE BLINKGRN ON MACHINE BLINKGRN APPEND STATE BG1 APPEND STATE BG2 The action taken when we leave the state will be to turn the LED off and reinitialize the counter The other half of the problem in the other state we go to is just the reversed We delay for a count then turn the LED back on Since we re going to count we need two variables to work with One contains the count the other the initial value we count down from L
100. yped in and intepreted from the command line or it could be run at the end of startup say for a small window to hit a key upon reboot to gain control of a serial port As for PERIOD the synchronous state machines SSM are run from a single clock edge like hardware state machines The period of the clock can be set to as low as 100 or 50 microseconds depending on what you need to do Any lower than this and it takes the processor more time to execute the code than a period and the interpret never gets to run The default period is 1 millisecond The settable time modifers are MINUTES SECONDS MILLISECONDS and MICROSECONDS These are also use with the timeouts The SSMs are clocked by Omer match register 3 To run a state machine as an SSM you use INSTALL To run an ASM it is a little more involved and is covered in the manual For the next release there should be some simplification and VIC automation to make it at easy as INSTALL Another way to disconnect the interpreter from the UARTs is to point the sio pointers at a set of fake registers in RAM You could even use the RAM registers to communicate with the interpreter by simulating the UART register bits This could be done from a state machine To have three uarts you can simulate a low baudrate using a general IO pin and toggling it to simulate a UART 5 7 From Loops to States This is a refactoring experience that occurred while building one of the examples which ha
101. yte The problem I ran into is that when P0 16 is set to GPIO PINSEL 1 is xxx0 I can read the incoming serial data fine but when I switch P0 16 to EINTO function PINSELI is xxx1 then P0 16 always reads as zero even if it is a one What s the logic in that So in order to use P0 16 as an interrupt and as a data pin I have to switch between pin modes using PINSELI LEDS and TOGS are useful debugging aids and can be removed in the final code LEDS allows one to track state transitions and see the state machine operate in real time to check sequential behaviour The TOGS is useful for capturing behaviour on a oscilloscope to observe timing 9 4 Change serial port speed at Bootup BAUD UARTO LCR C DUP HEX 80 OR UARTO LCR C OVER UARTO DLL C SWAP gt lt UARTO DLM C UARTO LCR C OK GB UARTO LCR C DUP HEX 80 OR UARTO LCR C UARTO DLL C UARTO DLM Cf gt lt OR SWAP UARTO LCR C OK May 3 2006 87 GB 21 OK 21 BAUD OK GB 21 OK DECIMAL OK GB 33 OK 60E6 16E F FDUP 1152001 FDUP 9600E F F 390 6250 390 BAUD KEY OK BOOT 390 BAUD ISOMAXBI BOOT BOOTUP OK ETA OK r OK E F F 32 5521 OK May 3 2006 88

Download Pdf Manuals

image

Related Search

Related Contents

MODELO SW470 - Chamberlain    取扱説明書  Apple Mac mini CI7-2.3G  E面目  Consulter le document    Controladores - Schneider Electric  

Copyright © All rights reserved.
Failed to retrieve file