Home
WicePlus C Compiler
Contents
1. File Edit View Project Debug Tool Option IDE Window Help Ei a x ob DAAE A HALES B22 CH Pez usemenuc 0302 c z x define testt e BE C3 EM78P156E D WicePlus TestCodestusert Eco ec P EA Beats ACC 00 CONT 00 3 Source Files UE dmt nis R10 00 RO A 00 00 B acr ud RE ATE R11 00 R1 TCC 00 A Header Fs 7500x05 UT RI2IDO EAPCIDD EG List Files R13 00 R3 0000 0000 3 Map Files void main R14 00 R4 0000 0000 i R15 00 R5 00 int i R16 00 R6 00 Lade RI 00 i 34 szx l Rie 00 itt i switch i EEG Source file BI case 2 RIB 00 i RIC 00 continue RID 00 is gt default RIE 00 m e 7 Bitteview lt s Is x T o 1 2 3 4 5 e 7 8 9 B c D E E B0 2X 00 00 00 00 00 00 00 00 OG OG OG OG 00 00 OG 00 EE 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 xi j Name value Kind Address p 5 x Watch Lid gt Build Information Find in Files Message By C Line 14 No mapping Assembly Address kl nnt 2J Ln 14 Col 12 DOS NUM Fig 3 11 Editing Source File Directly from Project window 240 Getting Started WicePlus C Compiler User s Guide Chapter 3 3 6 Compile the Project With your source file s embedded into the project you are now ready to compile your project using the following commands from Project menu m Click Compile command to compile the active f
2. Assignment Operators Symbol Function Expression equal expri expr2 Bitwise Operators Symbol Function Expression amp bitwise AND expri amp epxr2 bitwise OR expr1 expr2 s bitwise NOT expr gt gt right shift expri gt gt expr2 lt lt left shift expri lt lt expr2 bitwise XOR expri expr2 38 C Fundamental Elements WicePlus C Compiler User s Guide Pz Chapter 4 Equality Relational and Logical Operators Less than expr expr X y Less than or equal expr lt expr X lt y gt Greater than expr gt expr X gt y gt Greater than or equal expr gt expr X 2y Equality expr expr X y l Inequality expr expr xl y amp amp Logic AND expr amp amp expr X amp amp y Il Logic OR expr expr x ly Logic NOT lexpr Ix Compound Assignment Operators y y X X Y y y x X y lt lt y y lt lt xX y lt lt X gt gt y y gt gt X Y gt gt X amp y y amp X y amp x y y x y x y yx yl x 4 10 2 Prefix of Operators Highest unary unary type cast indirection amp address sizeof 96 nm lt lt gt gt lt lt gt gt amp amp amp gt gt lt lt amp Lowest WicePlus C Compiler User s
3. Project 434 The Project window holds the Source 3 Ca Header List and Map files s Target E CATempiTest CompilerHe Microcontroller D E Header Files Where t C TempTest CompilerMHe List Files i CATemp Test CompilerHe Source Files c are the assembly source files that are added into the current project Header Files h are the reference files required by source program List Files st are the list files Fig 2 2 Project Window The Title Bar of the Project window shows your current microcontroller and project filename 2 2 2 The Editor Window E 3 The Editor window is a 3424 me MB nyBittoce p1 0 multi windowed editing tool 3427 myBitTest b2 0 420 mypitfest pi 0 for creating viewing and 3438 myBitTest b5 0 MB myBitTeot 57 0 debugging source files 3433 MOS nymitIeotib2al E JB mybieteet p4 1 The Editor s major features 3437 myBitTest b6 1 433 n6 0 1 are 3440 R60 1 0 3441 n 5 SM R60_1 RE0_0 E m Unlimited file size 3444 MC o m Multiple files can be S447 uiDram0 0x20 B c opened and displayed at E a 3 1 EE oS Ba the same time Fig 2 3 Editor Window W Insert overstrike mode for editing m Undo Redo WicePlus C Compiler User s Guide WicePlus Interface e 3 Chapter 3 Clipboard support text can be cut copied moved and pasted onto the clipboard using a keystroke m Drag and drop text
4. 7 0 oo TT TTL EL BE myBit2 is at 0x03 bit 0 oxo4 CETT TET TA myBit3 is at 0x04 bit 5 oxos LT TT TTT ox06 LT TTT TTT myBit4 is at 0x05 bit 6 of rpage 1 WicePlus C Compiler User s Guide C Fundamental Elements e 48 a Chapter 5 5 5 Data LCD RAM Indirect Addressing indir variable name gt Q lt address gt ind ind number gt Declare the variable at which indirect data RAM or LCD ram is located The lt ind number gt has to be indicated if address is assigned If the MCU has Data RAM use ind 0 indirect RAM 0 If the MCU has an LCD RAM use ind 1 indirect RAM 1 Example indir int nDatal default is ind 0 so nDatal is at Data Ram indir int nData2 0x30 ind 0 nData2 is at Data Ram because using ind 0 indir int nData3 0x01 ind 1 nData3 is at LCD Ram because using ind 1 Data RAM LCD RAM 1 S2 S3 S4 S5 T S0 S1 S2 S3 S4 S5 0x30 myData3 WicePlus C Compiler User s Guide Hardware Related Programming e 49 Chapter 5 vn 5 6 Allocating C Function to Program ROM return value function name gt lt parameter list gt lt address gt page lt page number gt You can place function at the dedicated address of the program ROM and use page instruction to allocate which page in the program ROM you wish to assign Example void myFunl int x int y 8
5. d i 3 EU 0033 OutPutCtrlProcess 0034 ADCProcess 0035 ToneProcess 0036 TimeProcess 0037 a af x r 2 je 4 5 617 e 9 Ja JB P E IF a Ad z j a T ET ress ES Gen Register g e ai d E do a E E E d x E ds di REGDATA 0x0000 REGISTER 0x00 TCC Ox0D48 REGISTER 0x01 Bank Window Bix oo 00 00 00 00 00 00 00 00 00 OG 00 00 OG 00 OG E ica BEGISTERL hoa Bix oo 00 00 00 00 00 00 00 00 00 00 00 00 00 00 OG 5 IETED nvna z B2 2 00 00 00 00 00 00 00 00 00 00 00 OG 00 O0 00 OG dut 2 E id x Data d o i 2 3 Ja 5 e Jr Je 9 Ja B c p E F I 4 s14 sis sie sr SIE SS Se 00 21 OD 20 00 BF 04 03 IE 4F 02 05 3 RAM Window B oo 00 00 00 21 DS 00 00 79 02 FD 05 00 EO 9B 00 E Bas 00 E2 00 00 EB 4D 95 48 EC 72 D 57 3F B3 DD BO Bo 3 Jen 00 7F 10 EF ES BF 1A B 89 SF 5D CF 13 B6 0l hd ad Gj founter FileName Line bee Test 569 ShinsCus Main c 22 Output Window Bul Infomation X Find in Fibs Message Cline 32 Startof Assembly Address 000118 Status Bar LCD RAM Window Watch Window Fig 2 1 WicePlus Main Window Layout 2 eWicePlus Interface WicePlus C Compiler User s Guide Chapter 3 2 2 WicePlus Sub Windows The sub window may be displayed or hidden by clicking on the pertinent window commands from the View menu see Section 4 3 3 3 2 2 4 The Project Window Project Filename cpj
6. 0 WicePlus C Compiler User s Guide C Fundamental Elements e 41 Chapter 4 pg 4 15 For Statement for expr1 expr2 expr3 statement For statement is equivalent to the following statement exprl while expr2 statement expr3 exprl is executed first Normally expr1 will be the initial condition While statement is executed in the same manner Example for i 0 i lt 10 i value value i 4 16 Break and Continue Statements break continue The break statement exits from the innermost loop or switch block The continue statement on the other hand will skip the remaining part of the loop and jump to the next iteration of the loop Continue is useful in loop statements but it cannot be used in switch loops Example break exampl see switch for i 0 i lt 10 i flag indata port if flag 0 continue outdata port 42 C Fundamental Elements WicePlus C Compiler User s Guide Pz Chapter 4 4 17 Goto Statement goto label label goto statement is used to jump to any place of a function It is useful to skip from a deep loop Example for i 0 i lt 10 itt for j 0 J lt 100 j for k 0 k lt 100 k flag crccheck buffer if flag 0 goto error outbuf buffer error clear up buffer 4 18 Function Function is
7. MOV 0X38 A WicePlus C Compiler User s Guide C Fundamental Elements e 56 Chapter 5 Write your code inline assembly or C here restore C system asm BS 0x04 6 switch to ram bank 3 to restore correctly BS 0X04 7 MOV A OX3C use 2 byte C type C system restore OV OX10 A MOV A OX3B OV 0X11 A MOV A OX3A OV OX12 A MOV A 0X39 OV 0X13 A MOV A 0X38 OV 0X14 A restore ACC R3 R4 R5 following backup C system _asm SWAPA OX3D Users have to confirm whether in ram bank 3 MOV 0X5 A or not If not have to switch to ram bank SWAPA OX3E 3 to restore correctly MOV 0X3 A SWAPA OX3F MOV OX4 A SWAP OXIF SWAPA OXI1F Example 2 int nBuf 5 void intcall INTERRUPT2 l void 00x08 low int 0 backup ACC R3 R4 R5 _asm WicePlus C Compiler User s Guide Hardware Related Programming e 57 Chapter 5 void intcall INT ERRUPT2 void int 0 _asm save registers OV OV OV OV OV OV OV OV OV 335333333 338 OV a oe I r oe I r oe I r oe I r oe nBu nBu nBu nBu Ox1 nBuf 0 0 0 0 do what you asm restor OV OV OV OV OV OV OV OV OV 335333333 338 Ov Example 3 void _intcall HX HX MX mh xX 0 a a want to do as interrupt occurred registers a Buf 0x10
8. include lt EM78 h gt include project h include ad c It may meet errors Example 2 unsigned int uaa in headfile h main in testcode c file uaa 0x21 extern unsigned int uaa in kkdr c file void 30 C Fundamental Elements WicePlus C Compiler User s Guide Chapter 4 uaa 0x38 Uaa 0x43 void uaa 0x29 4 3 2 define define identifier define identifier token_list define identifier parameter_list token_list define identifier token list The define directive is used to define a string constant which will be substituted into source code by the preprocessor It makes the source program more legible Example define MAXVAUE 10 define sqr2 x y x x ty y WicePlus C Compiler User s Guide C Fundamental Elements e 31 Chapter 4 7 4 3 3 if Helse Zelif endif if constant expression else elif constant_expression endif The fif directive is used for conditional compilation It should be terminated by endif else can be used to provide an alternative compilation If necessary the program can use elif for an alternative compilation which should only be used for valid expressions Example define RAM 30 if RAM lt 10 define MAXVALUE 0 elif RAM lt 30 define MAXVALUE 10 felse define MAXVALUE 30 dendif 4 3 4 ifdef ifndef ifdef identifier
9. nig Col6 Dos FR Getting Started e 25 Chapter 3 Fig 3 14 Output Window Showing Compilation Errors Modify source files to correct the errors and repeat assembling and linking operations 3 7 Dumping the Compiled Program to ICE Se s S With the source files deprived of its errors and ed successfully compiled download your compiled a program to ICE using the Dump to ICE command Add Files to Project from Project drop down menu or its Delete files from project corresponding shortcut key F3 P 8 JAER Compile AltF X Rebuild All Alt F9 Fig 3 15 Dump to ICE Command 3 8 Debugging a Project With the compiled program successfully El Go F5 Free Run F10 downloaded to ICE you are now ready to debug i Ka Reset F6 the files Be sure the ICE is properly connected to your computer P Step Into F m Full debugging commands are available from the 1p septs F8 Go To Cursor F4 Debug Menu shown with its corresponding shortcut keys in the drop down menu at right A dl Toggle Breakpoint number of the frequently used debugging icons are also available from the WicePlus Program Toolbar HUF B NR Fig 3 16a Toolbar for Debugging Commands Show All Breakpoints y Clear All Breakpoints Fig 3 16b Debugging Commands Drop Down Menu M Toggle Breakpoint Click with cursor positioned on the line where a breakpoint is going to be set or removed di
10. test m 6 a RN ES Rebuild Al AMF9 EMTOPZSON E259 DXWiceFlus TestCodes E EM SOCEM Dump to ICE F3 5 Fig 3 4 Project Menu 8569 1CE569 EM78611 ICE78611 EM78801 ICE801 EM78803 ICE803 A 7 Fig 3 5 New Dialog Showing Project Tab for Creating New Project Derived from File Menu WicePlus C Compiler User s Guide Getting Started e 19 Chapter 3 vn 3 Select Projects tab from the NEW dialog Assign a name for the new project in the Project Name box suffix prj will auto append to the filename 5 Locate the folder where you want to store the new project You may use the Browse icon to find the appropriate folder 6 Select the target microcontroller for your project from the Micro Controller list box 7 Click OK button after confirming all your choices and inputs The new project is created with the defined project name and microcontroller you have selected is displayed on top of the Project window a sors mig Target X DNWicePlusTe tCodezmerzenu c Microcontroller he Project 3 DNWicePluciTestCodezmerzenutest Ist Filename cpj Fig 3 6 Project Window 3 4 Add and Remove Source Files from to Project You can either insert existing source files into the new or existing project or create new ones with WicePlus text Editor and insert them into the project 3 4 1 Create and Add a New Source File for the Project If your source file is yet to be created you can take advantage of t
11. 100 MOV longVar2 A MOV A longVar1 1 MOV longVar2 1 A MOV A longVar1 2 MOV longVar2 2 A C Statement Example Description WicePlus C Compiler User s Guide Conversion Table e 59 Appendix A For loop for i20 i lt 5 i INC 96i MOV A 90x05 SUB A 0x14 JBS 0x03 0 JMP Li 100 7 7 100 While statement while cnt 1 L1 MOV A cnt XOR A 0X01 JBS 0X03 2 JMP L1 100 4 4 100 Do while statement while cnt 1 MOV A cnt MOV A 0x01 XOR A 0x01 JBS 0x03 2 JMP L1 100 4 4 100 Do while statement do Var_c2 while var_c1 L1 INC var c2 DJZ var c1 JMP L1 100 3 3 100 If else statement 60 e Conversion Table unsigned int cnt MOV A cnt JBS 0x03 2 JMP ENDIF L1 MOV A 0X05 SUB A cnt JBC 0x03 0 JMP ENDIF 100 10 10 100 WicePlus C Compiler User s Guide Switch statement unsigned int cnt switch cnt break default break MOV A cnt MOV 0X14 A MOV A 0X14 XOR A 0x01 JBC 0X03 2 JMP case 2 MOV A 0X14 XOR A 0X02 JBC 0X03 2 JMP case 2 MOV A 0X14 XOR A 0X3 JBC 0X03 2 JMP case 3 JMP default Case 1 JMP ENDSWITCH Case 2 JMP ENDSWITCH Case 3 JMP ENDSWITCH Case 4 default ENDSWITCH Appendix A 106 18 17 100 Function main int i i fun 3 return int fun in
12. CLRA L1 ADD A OX1C DJZ 0X18 JMP L1 MOV c A 100 9 9 100 66 Conversion Table MOV A a MOV 0x1C A MOV A b CLR 0x18 L1 SUB Ox1G A JBC 0x03 0 INC 0x18 JBC 0x03 0 JMP OxSBB MOV A 0x18 MOV c A 100 11 11 100 WicePlus C Compiler User s Guide Pz Appendix A Compound MOV A e 100 2 2 100 assignment ADD f A all variables are int SUB f A data type AND f A XOR f A OR f A BC 0x03 0 100 2 2 100 RRC f BC 0x03 0 100 2 2 100 RLC f WicePlus C Compiler User s Guide Conversion Table e 67 a Appendix B Appendix B Frequently Asked Questions FAQ Q What is the maximum number of the function parameters A It depends on the RAM bank size about 32 or 31 bytes Q In a function what is the maximum depth of the function call A It depends on the hardware stack depth or size Q What is the maximum array dimension as well as maximum array element A It depends on the RAM bank size about 32 or 31 bytes Q Is there any error message when the code exceeds the ROM size A Yes the linker will report an allocation error Q In a high level interrupt subroutine can user allocate the address in the ROM e g using page data type putting asm org xxx before a subroutine etc A No This may cause unpredictable error Q Is static used in the same way as in ANSI C A Ye
13. f e d XOR A d type OR A 94d MOV f A f e COMA e 100 2 2 100 MOV f A f amp e MOV A e 100 2 2 100 f e AND f A f e XOR f A OR f A f e gt gt 1 100 3 3 100 BC 0x03 0 RRCA e MOV f A f e lt lt 1 MOV A e 100 3 3 100 MOV 0x14 A BC 0x03 0 RLCA 0x14 MOV f A f gt gt 3 BC 0x03 0 100 6 6 100 RRC f BC 0x03 0 RRC f BC 0x03 0 RRC f f 3 BC 0x03 0 100 6 6 100 RLC f BC 0x03 0 RLC f BC 0x03 0 RLC f f gt gt 4 SWAPA 0x06 100 3 3 100 AND A 0x0F MOV 0x06 A 64 e Conversion Table WicePlus C Compiler User s Guide SWAPA 0x06 AND A 0xF0 MOV 0x06 A 100 3 3 100 Appendix A SWAP 0x06 RRC 0x06 RRCA 0x06 AND A 90x03 MOV 0x06 A 100 5 5 100 SWAP 0x06 RLC 0x06 RLCA 0x06 AND A 0xCO MOV 0x06 A 100 5 5 100 MOV A e MOV 0x14 A SWAP 0x14 RLCA 0x14 AND A QOXxEO OR A 96d MOV f A 100 7 7 100 f f amp const 1 const 2 WicePlus C Compiler User s Guide MOV A 0x06 AND A const 1 OR A const 2 MOV 0x06 A 100 4 4 100 Conversion Table e 65 Appendix A Arithmetic expression all variables are int data type MOV A e ADD A d MOV f A 100 3 3 100 MOV A d SUB A 6e MOV f A 100 3 3 100 INC f 100 1 1 100 DEC f 100 1 1 100 MOV A a MOV 0X1C A MOV A b MOV 0X18 A
14. BO 4 D5 FB 7B 76 B2 64 A3 4D 6A ED 1D IC E B 5 1E 2F 8B E3 32 D8 59 FC A2 5B FC BF A B06 3F 2D Ci 06 04 AA 6D 9E 52 FF 15 DD m B 7 a3 C6 AD D6 33 C4 36 C 89 B3 18 5D Sl B08 B2 7D DA 77 E4 9D AE 7F 62 B3 53 35 The Data RAM window is accessible only if RAM is available form the target microcontroller currently in use The Data RAM window shows the contents of the data RAM WicePlus C Compiler User s Guide Fig 2 7 Data RAM Window WicePlus Interface e 5 mydatafO cT CS 1 Cop ei EZ ShiftDelete Paste Add to Token pool Last Position West Position BookMarks gt Index BookMark La Go To Index Bookkarks 5B BO 7C 08 EA 62 10 EC 9D 75 6E 5E B6 EF 96 31 9F 89 Fi 06 58 94 CA 24 Chapter 3 2 2 7 LCD RAM Window iim m 9 s10 Sti Ea Se ooFe o cl C2 C3 Se oocooooo IS g a e ss ON dn ooor re or 0 1 0 1 1 1 1 om oe OF Kee xi Tso st 82 3 4 s5 s6 0 a pa a a a n mor ODS ree 7 s8 1 0 0 1 1 1 1 il 1 1 1 1 i 1 1 1 0 eee OO eee oOOoOFF OF Oe norm oe eo eee REP OR ee 12 13 814 s15 s16 817 s18 s19 s20 s21 22 823 0 c m m ez m Oo o P ofS oleje mor oor OF moor oor o moon ee oss o re o more ror or ooooror o mn ooor os oe ror ao Fig 2 8 LCD RAM Window If supported by the target micr
15. Fundamental Elements line 1 line 2 WicePlus C Compiler User s Guide 4 2 Reserved Words Chapter 4 The reserved words for WicePlus C Compiler are made up of both the ANSI C conformity reserved words and the EM78 Series unique reserved words The following table summarizes all the applicable reserved words for this compiler ANSI C Conformity Words const default goto switch typedef sizeof break do if short union extern case else int signed unsigned char enum long static void continue return struct while EM78 Series Unique Words indir page io iopage _intcall rpage low_int asm bit bank WicePlus C Compiler User s Guide C Fundamental Elements e 29 Chapter 4 4 3 Preprocessor Directives Preprocessor directives always begin with a pound sign The directives are recognized and interpreted by the preprocessor in order to compile the source code properly 4 3 1 include include file name The preprocessor will search the working directory to find the file include file name gt The preprocessor will search through the working directory first to look for the file If the file cannot be found in the working directory it will search the file from the directory specified by the environment variable EMC INCLUDE include tells the preprocessor to add the contents of a header file into the source program Example 1
16. Guide C Fundamental Elements e 39 Chapter 4 4 11 lf else Statement if expression statement else statement Tf statement executes the block of codes associated with it when the evaluated condition is true It is optional to have an else block which will be executed when the evaluated condition is false Example if flag 1 timeout 1 flag 0 lse timeout 0 4 12 Switch Statement switch expression case const expr statements case const expr statements default statements Switch statement is flexible to be set with multiple branches depending on a single evaluated value Example switch I case 0 functionO case 1 functionl case 2 function2 default funerror 40 C Fundamental Elements break break break WicePlus C Compiler User s Guide p Chapter 4 4 13 While Statement while expression statement While statement will check the expression first if the expression is true it will then execute the statement Example while value 0 value count 4 14 Do while Statement do i statement while expression Do while will first execute the statement and then check the expression If the expression remains true then it proceeds to the statement until the expression becomes FALSE Example do value count while value
17. SWAPA 0x03 00000C 007E MOV Ox3E A 00000D 0943 BC 0x03 5 O0000E 0983 BC 0x03 6 ODDO0F 1401 JMP 0x001 000010 1004 RETL 0x04 000011 1002 RETL 60x02 000012 1017 RETL 60x17 B review 000013 1800 MOV A 0x00 opp pepp epee B 2X 00 00 00 00 00 00 00 00 00 00 00 O0 00 00 00 00 B 3X 00 00 00 00 00 00 00 00 00 00 00 OG 00 00 00 OG EEL kx Name Value Kind Address IE L lx Wath A Watch cbuzld All WicePlus TestCodes usermenu asm D error s 0 warning s 0 Warnings 0 Errors N Build Information Find in Files Mesage Lal Coli Fig 3 13 Output Window Showing Successful Compilation If error is detected during compilation pertinent error message will also display in the Output window with Build tag Double click on the error message to link to the source of error text line in the corresponding source file displayed in the Editor window If the corresponding source file is not currently opened it will open automatically Rebuild All D WicecPlus TestCodes usermenu 18 Double click to link to the D WicePlus TestCodes usermenu asm 1 error s 0 warning s gt Build Information Find in Files gt Message 4 error illegal continue statement source of error gay WicePlus C Compiler User s Guide
18. dump and execute program step by step Mi including subroutines F7 27 3 Reset reset the ICE F6 28 ai Insert Remove Breakpoint insert remove toggle for breakpoints 29 Be Remove All Breakpoints remove all breakpoints 30 EJ Stop stop running 2 5 Document Bar Active file 8 Et f r C 806B h LOM CHAR C h C 8068 Ist Fig 2 22 WicePlus Main Window Document Bar The Document bar displays the file icons representing each of the opened files in the Editor window Click the icon of the pertinent file that you wish to activate place in front of the Editor window to perform editing Highlighted filename is the active file function is similar with taskbar buttons under Windows 16 e WicePlus Interface WicePlus C Compiler User s Guide Ga Chapter 3 2 6 Status Bar Keyboard mode Cursor position y Ready Ln8 Col5 Dos OVR KAP NUM SCRL ICEeSA running indicator Text file OS format R W flag A WicePlus running indicator will be shown in the Status bar while your project is being compiled The Cursor position indicates the cursor location within the text Editor window R W flag indicates the active file Read Write status If Read only Read will display otherwise the field is empty Keyboard mode displays the status of the following keyboard keys m Insert key OVR is dimmed when overtype mode is off highlighted when on m Caps Lock key CAP is dimmed when upperca
19. manipulation highlighted text can be dragged and dropped between any of the IDE windows 2 2 3 The Special Register Window When value REET changes it is shown in red The Special Register window shows the updated contents of the registers and I O control register depending on the MCU type 0084 0001 1000 0001 0111 CF FF IF 00 00 00 00 00 00 FO Fig 2 4 Special Register Window 2 2 4 The General Registers Ram Bank Window BD 6D 70 38 F eB 51 7E 32 F4 8F FE BA B2 FC D2 C3 EF CE 18 3C Fig 2 5 General Registers Ram Bank Window The General Registers Ram Bank window shows the updated contents of the common ram bank registers 4 eWicePlus Interface WicePlus C Compiler User s Guide Chapter 3 2 2 5 The Watch Window BANK D 0x21 Fig 2 6 Watch Window In the Watch window you can add variables that are declared in C The Watch window will show the defined C variable information such as name contents bank and address The step to add a variable to watch window 1 Reverse the variable in such case is aa s 2 Click right button of mouse and a menu popup id 3 Select Add to Watch item 2 2 6 Data RAM Window 4d 0 1 j2 3 5 Js 8 9 J B Bon 24 6 amp 1B 4B OB 9F 4C CB C2 D9 30 34 B 1 60 D8 48 B 51 FE 46 66 10 F5 39 D3 B 2 7E 9F E3 EF C9 DF 64 55 81 DB 36 58 X Bo 5 60 2B 35 BE 71 C4 81 F5 89 82 28 BB
20. the basic block of the C language It includes function prototype and function definition 4 18 1 Function Prototype return type lt function name parameter list gt A function prototype should be declared before the function can be called It contains the return value function name and parameter types Example Function Prototype unsigned char sum unsigned char a unsigned char b WicePlus C Compiler User s Guide C Fundamental Elements e 43 Chapter 4 7 4 18 2 Function Definition return type lt function name parameter list statements Example Function Content unsigned char sum unsigned char a unsigned char b return a b 44 e C Fundamental Elements WicePlus C Compiler User s Guide Chapter 5 Chapter 5 Hardware Related Programming 5 1 Register Page rpage variable name 2 address rpage register page number gt The data type is used to declare a variable at a certain register page Users have to declare clearly which register page is including rpage 0 Example unsigned int myRegl 00x03 rpage 0 myRegl is at address 0x03 of register page 0 Although the specific register only have one register page the register page number cannot be ignored unsigned int myReg2 0x05 rpage 1 myTest is at address 0x05 of register page 1 If the specific register have more than one regist
21. 0 FAQ WicePlus C Compiler User s Guide
22. 03 5 IOW 0x6 MOV A 0xFF BS 0x03 5 IOW 0x6 MOV A 90x55 IOW 0x7 Appendix A 100 8 8 100 RAM bank unsigned int myData1 00x20 bank 0 unsigned int myData2 90x21 bank 0 unsigned int myData3 30x21 bank 1 myData1 1 myData2 2 myData3 3 using EM78569 MOV A 90x01 BC 0x04 6 BC 0x04 7 MOV 0x20 A MOV A 00x02 MOV 0x21 A MOV A 90x03 BS 0x04 6 BC 0x04 7 MOV 0x21 A 100 10 10 100 Bit data type bit myBOR6PO 0x06 O0x00 rpage 0 bit myB2R6PO 0x06 0x02 rpage 0 MyBOR6P0 1 myB2R6P0 myBOR6P0 BS 0x06 0 BC 0x06 2 JBC 0x06 0 BS 0x06 2 133 4 3 100 Indirect addressing indir unsigned myData1 0x30 ind 0 indir unsigned myData2 0x05 ind 1 myData1 0x55 myData2 OxAA WicePlus C Compiler User s Guide using EM78806B MOV A 0x55 MOV 0x1B A MOV A 0x30 MOV 0x18 A MOV A 90x00 MOV 0x19 A MOV A 0x00 MOV Ox1A A MOV A 0x1B CALL INDIR MOV A Q0xAA MOV 0x1B A MOV A 0x05 MOV 0x18 A MOV A 90x00 MOV 0x19 A MOV A 0x01 0x1A A A 0x1B INDIR 146 35 24 100 Conversion Table e 63 Appendix A INDIR BC 0x05 0 MOV 0x1B A MOV A 0x1A JBS 0x03 2 JMP 0x081 MOV A 0x18 IOW 0x9 MOV A 0x1B IOW OxA RET LCDRAM MOV A 0x18 MOV 0x0A A MOV A 0x1B MOV 0x0B A RET Bitwise operation f e amp d MOV A e 100 3 3 100 all variables are f e d AND A d unsigned int data
23. 0x33 myFunl is put at 0x33 at ROM page 0 default page void myFun2 int x int y 00x33 page 1 myFun2 is put at 0x33 at ROM page 1 Progrom ROM Progrom ROM 0x033 0x Function befor 0x33 of pageO allocation 0x433 0x0433 0x33 of page1 0x33 at page1 Function after allocation WicePlus C Compiler User s Guide C Fundamental Elements e 50 Pz Chapter 5 5 7 Putting Data in ROM const variable name Some data cannot be altered during program execution Hence you need to store such data into the program ROM to save limited RAM space The Compiler uses the TBL instruction to incorporate such data into the program ROM Example const int myData 1 2 3 4 5 const char myString 2 3 Hi m ABC m Program ROM myData mysString WicePlus C Compiler User s Guide Hardware Related Programming e 51 Chapter 5 5 8 Inline Assembler The compiler has an in line assembler which allows you to enhance the functionality of your program 5 8 1 Reserved Word The reserved words for the inline assembler are asm write assembly code here All the assembly instructions in upper or lower case of the EM78 series are supported 5 8 2 Use of C Variable in the Inline Assembly The Compiler allows you to access the C variable in the inline assembly as follows mov a variable name gt move variable value to ACC mov
24. 78P15GE ICE456E Connect Port 378 vi Select MCU Port address Enable to check ICE setup memory condition Check ICE Memory r Emcusb VO Wait Times 10 oe Cancel Fig 3 1 WicePlus Program Connect Dialog 180 Getting Started WicePlus C Compiler User s Guide Chapter 3 3 2 2 Code Option Dialog Code Option SUTO C 0 OSC1 O Crystal 1 RC SUTI C 9 OSC2 O Low Extemal CLOCK 2 1 High Internal OSCl p SUTO SUT Set up Time osc2 C 0 0 0 72 ms RESETENABLE Enable 0 1 45m Taxget Power using ICE 1 0 36 ms WATCHDOG Enable 1 1 18 ms RC OUT P 4 Fig 3 2 WicePlus Program Code Dialog The Code Option dialog is displayed next Check all items to confirm the actual status of the ICE and make appropriate changes as required Then click OK button 3 3 Create a New Project To create a new project you need to configure your project with the following steps view Project ar in Ctr O 1 From the Menu bar click on File or Project menu and choose New command from the Fig 3 3 File Menu resulting pull down menu 2 The New dialog shown below will then display if you have clicked the New command from the File menu Otherwise New Project dialog will display m Save Fig 3 5 if the New command is derived from Se Project menu 3 Add Files to Project mp Delete files from project Micro Controller Project Name 4 B Compile AlttF
25. Redo cancel the last undo restore the undone editing action Open Hide Workspace display hide toggle for Project window Open Hide Output display hide toggle for Output window Find find string from within entire active file Ctrl F Find Down find string from cursor position toward the end of file Find Up find string from cursor position toward the beginning of file Find from Files find string from inactive files Bookmark bookmark the line at cursor position Jump Down to Bookmark jump to next bookmark from cursor position toward the end of file Jump Up to Bookmark jump to next bookmark from cursor position toward the beginning of file Clear Bookmarks clear all bookmarks Print print the active file Ctrl P About about compiler version and other information Compile compile the active file in the Editor window Alt F7 Rebuild All compile all files in the project Alt F9 WicePlus C Compiler User s Guide WicePlus Interface e 15 Chapter 3 v ren Free Run auto dump and execute program with the breakpoints g ignored F10 23 El Go auto dump and execute program with the effect of the is breakpoints F5 24 PQ Run to Cursor auto dump and execute program then stop at the EN cursor position while ignoring the breakpoint F4 25 FP Step Over auto dump and execute program step by step excluding the subroutines F8 26 ln Step Into auto
26. WicePlus C Compiler for EM78 Series Microcontrollers USER S GUIDE ELAN DE CORP ar 2007 Trademark Acknowledgments IBM is a registered trademark and PS 2 is a trademark of IBM Windows is a trademark of Microsoft Corporation ELAN and ELAN logo tam are trademarks of ELAN Microelectronics Corporation Copyright 2007 by ELAN Microelectronics Corporation All Rights Reserved Printed in Taiwan The contents of this User s Guide publication are subject to change without further notice ELAN Microelectronics assumes no responsibility concerning the accuracy adequacy or completeness of this publication ELAN Microelectronics makes no commitment to update or to keep current the information and material contained in this publication Such information and material may change to conform to each confirmed order In no event shall ELAN Microelectronics be made responsible for any claims attributed to errors omissions or other inaccuracies in the information or material contained in this publication ELAN Microelectronics shall not be liable for direct indirect special incidental or consequential damages arising from the use of such information or material The software WicePlus described in this publication is furnished under a license or nondisclosure agreement and may be used or copied only in accordance with the terms of such agreement ELAN Microelectronics products are not intended for use in life supp
27. a lt variable name move address of variable to ACC Example 1 asm Save procedure of rpage iopage and bank register mov a 0x0 mov nbuf a mov a 0x04 mov nbuf l a bs 0x03 7 bs 0x03 6 Switch to other rpages Restore procedure of rpage iopage and bank mov a nbuf register mov 0x03 a mov a nbuf I mov 0x04 a WicePlus C Compiler User s Guide C Fundamental Elements e 52 Pz Chapter 5 Example 2 int temp temp 0x03 we suppose temp is at 0x21 of bank 0 asm mov a temp move value 0x03 to ACC _asm mov a temp move address 0x21 to ACC Example 3 unsigned int temp a 0x20 bank 0 unsigned int temp s Q0x21 bank 0 define status 0x03 void main asm mov temp a a mov 0x20 a mov a status gt mov a 0x03 mov temp s a gt mov 0x21 a 5 9 Using Macro You can use macro to control the MCU and shorten the program length Example define SetIO portnum value asm mov a value asm iow portnum WicePlus C Compiler User s Guide Hardware Related Programming e 53 Chapter 5 vn 5 10 Interrupt Routine To handle Interrupts two things have to be taken into account 1 Interrupt Save Procedure the procedure to save some registers before executing a service routine For instance ACC R3 should be saved in the EM78P458 as Interrupts occur Only inline assembly is allowed under Interrupt Save Procedure 2 Inter
28. a a nBuf 1 Ox11 a a nBuf 2 0x12 a a nBuf 3 0x13 a a nBuf 4 0x14 a INTERRUPT3 l void Q0x08 low int 0 backup ACC asm void intcall INTI long ans long LongMult long a LongMult 0x1234 return a b multiple WicePlus C Compiler User s Guide R3 R4 R5 ERRUPT3 void int 0 0x5678 long b operation of long data type is NOT allowed C Fundamental Elements e 58 Py Appendix A Appendix A Conversion Table A 1 Conversion between C and Assembly Codes The assembly code was generated by the WicePlus Conversion Rate Assembly Code Compiler s Code Size General User s Code Size 100 Integer Variable intVart OxFF MOV A 0xFF 10096 2 2 100 MOV intVar1 A intVar2 intVar1 MOV A intVar1 100 2 2 100 MOV intVar2 A Character Variable charVar1 OxFF MOV A Oxff 100 2 2 100 MOV charVar1 A charVar2 intVar1 MOV A charVar1 100 2 2 100 MOV charVar2 A Short Variable shortVar1 0x1234 MOV A 0x34 100 4 4 100 MOV shortVar1 A MOV a 0x12 MOV shortVar1 1 A shortVar2 shortVar1 MOV A shortVar1 100 4 4 100 MOV shortVar2 A MOV A shortVar1 1 MOV shortVar2 1 A Long Variable longVar1 0x123456 MOV A 90x56 10096 6 6 100 MOV longVar1 A MOV A 0x34 MOV longVar1 1 A MOV A 0x12 MOV longVar1 2 A longVar2 longVar1 MOV A longVar1 100 6 6
29. be 2 bytes only 4 6 Enumeration enum identifier enum idenftifier enumeration list int value enum enumeration list Enumeration defines a series of named integer constants With the definition the integer constants are grouped together with a valid name For each name enumerated you can specify a distinct value Example enum tagLedGroup LedOff LedOn LEDStatus WicePlus C Compiler User s Guide C Fundamental Elements e 35 Chapter 4 4 7 Structure and Union struct union type name struct union identifier struct union identifier member declaration list struct union member declaration list member declaration list member declaration member declaration list member declaration member declaration member declaration specifiers declaration list member declaration specifiers member declaration specifier member declaration specifiers member declaration specifier The structure groups related data and each data in the structure can be accessed through a common name Unions are groups of variables that share the same memory space Example 1 struct st unsigned int b0 1 unsigned int b1 1 unsigned int b2 1 unsigned int b3 1 unsigned int b4 1 unsigned int b5 1 unsigned int b6 1 unsigned int b7 1 struct st R5 0x05 struct R5 is related to 0x05 Example 2 struct tagSpeechInfo short rate long size SpeechInfo union tagTes
30. dow 2 3 WicePlus Menu Bar and its Commands 6 eWicePlus Interface WicePlus C Compiler User s Guide iim Chapter 3 File Edit View Project Debug Tool Option IDE Window Help Test Fig 2 10 Menu Bar 2 3 1 File Menu Her New Z Open Ctrl 0 Clea Open Save Ctrl 5 Close Save As G Save All Save Open Project Save As Save Project Close Project Save All amp Print Ctrl P Open Save Close Print Preview Project Print Setup Print Recent Files Print Preview Recent Projects Exit Print Setup Recent Files Fig 2 11 File Menu Recent Projects Exit 2 3 2 Edit Menu Undo Redo Cut Copy Paste Select ALL Go to Line Find Find in Files WicePlus C Compiler User s Guide Create a new project or source file Open an existing document or project Close the active document or project Save current active document Save current active document with new filename Save all opened documents Open Save Close the active project Print active file Preview printed format of active file Define printer settings View the record of the recently used file View the record of the recently used project Exit from WicePlus Program Cancel the last editing action Repeat the last editing action Same as standard clipboard function Select all contents of the active window Move cursor to the defined line number within the active wi
31. ectly from nose GSA Compile AltF Project Window had f Rebuild All AltF9 1 From the Project window select the Dump to ICE F3 file s you wish to delete Then press the Delete key from your keyboard Fig 3 9b Deleting Project Files from Project menu WicePlus C Compiler User s Guide Getting Started e 23 Chapter 3 3 5 Editing Source Files from Folder Project 3 5 1 Open Source File from Folder for Editing You can also open an existing source file in the Editor window for a last minute editing before adding it into the new project To do this 1 From the Menu bar click on File or Project menu choose Open command from the resulting pull down menu 2 From the resulting Open dialog Fig 3 8b above click on the source file and the file is automatically opened in the Editor window File Edit View Project O New Ctr O iz Open Close Fig 3 10 Open amp Edit Source File from File Menu To edit source files that are already added into the Project see next Section 3 5 2 Open Source File from Project for Editing Double click to open amp edit file opened for editing You can edit source files that are already inserted in the project To do so double click the source file you wish to edit from the Project window and the file will open in the Editor window EMC WicePlus EM78P153S not connect usermenu c HEG
32. ent Bar Show hide Document bar Fig 2 13 View Menu 2 3 4 Project Menu New New Create a new project Open Open Open an existing project Save Save Save the active project aie together with all related files MICE e Poet Close Close the active Project Delete files from project window Compile Alt F7 Add Files to Add the existing source file 4 Rebuild All AIHF9 Project into project Dump io ICE F2 Delete Files from Remove source file from Project project Fig 2 14 Project Menu Compile Compile the active file in the Editor window Rebuild All Compile all files Dump to ICE Dump the program code to ICE WicePlus C Compiler User s Guide WicePlus Interface e 9 Chapter 3 2 3 5 Debug Menu EL Go F5 0 Free Run F10 C4 Rest F6 3 Step Into F TP Step Over F8 H Go To Cursor F4 Continue step into Shift F7 Run from Selected Line 24 Sto AM Toggle Breakpoint F9 Shcw All Breakpoints Add Label to Watch di Clear All Breakpoints Trace Back Trace Forth Fig 2 15 Debug Menu Go to Cursor Continue step into Run from Select Line Stop Toggle Breakpoint Show All Breakpoints Clear All Breakpoints 10 e WicePlus Interface Go Run program starting from the current program counter until a breakpoint is matched Free Run Run program starting from the current program counter until the OK button of the Stop Running dialog is clicked Reset Perfor
33. er page user should point out in which register page th variable is located struct st unsigned int b0 1 unsigned int bl 1 unsigned int b2 1 unsigned int b3 1 unsigned int b4 1 unsigned int b5 1 unsigned int b6 1 unsigned int b7 1 i struct st myReg3 0x06 rpage 0 WicePlus C Compiler User s Guide C Fundamental Elements e 44 CONT RO A V R1 TCC R2 PC R3 R4 rpage 0 rpage 1 iopage 0 ioage 1 R5 IOC5 R6 IOC6 R7 IOC7 R8 IOC8 R9 IOC9 RA IOCA RB IOCB RC IOCC RD IOCD RE IOCE RF IOCF 5 2 I O Control Page iopage Chapter 5 io variable name Q lt address gt iopage io control page number gt Declare the variable at the register page it is located Users have to declare clearly that the io variable is located at which iopage though there is only one io control page Example io unsigned int myIOC1 0x05 myIOC1 is at address iopage 0 0x05 of io control io unsigned int myIOC2 0x05 my1OC2 is at address WicePlus C Compiler User s Guide iopage 1 0x05 of io control page 0 page 1 Hardware Related Programming e 45 Chapter 5 vn CONT RO A V R1 TCC R2 PC R3 R4 rpageO rpage 1 iopage 0 ioage 1 R5 IOC5 R6 IOC6 R7 IOC7 R8 IOC8 R9 IOC9 RA IOCA RB IOCB RC IOCC RD IOCD RE IOCE RF IOCF 5 3 Ram Bank var
34. ew WicePlus is a project oriented integrated development environment IDE system that is used to edit user application programs and generates emulation layout files for ELAN s EM78 series 8 bit microcontrollers Project Window Editor Window Special Registers Window ied Main c File Edit View Project Debug Tool Option IDE Window Help zial Menu Bar lg 8 f mI A E SG ees Maine Toolbar UIS include Function h 0014 Document Bar EE Source Files 0015 union B Byte ChannelStatus E cont EE ret M 0016 0 38 Henr d 0017 void main 0x100 page 0 Ri 48 7 B Emn0p560 h 0018 0 R2 010E Table h 0019 unsigned int ikk R3 0001 1111 Page Pa 5 Globalh 0020 ikk Notice Beep 4 R4 1111 1111 E Define h Sure InitClrRam RS EF R500 R5 00 Function h s 6 16 16 ieee 0023 InitStartValue SI P x 3 test st 0024 aid 0025 BeepTone PowerUp Tone B nad BY 0026 while 1 9 R9 FE Ra BF 0027 RIA IF RA 16 RAFF RA 00 0028 ENI i4 Itt tg gl p ggg g For RIBO ka RB 00 RB OO 0029 WDTC Clear watch dog counter RIC o1 RC 00 RCID RC 00 uM Poe M RID Ds RD oo RD 20 RD OG eyProcess 0032 RadioProcess
35. he New dialog by clicking New command from the File menu to create your new source file and use the WicePlus text editor to compose its content 200 Getting Started WicePlus C Compiler User s Guide Chapter 3 1 Click the File tab of the NEW dialog and select the type of source file you want to create from the EMC Source File list box i e c default for assembly file 1 for header file Create a New File Projects 2 EMC Source File c v Add new file to project EMC Source File s 1 EMC Header File h EMC Rom File rom File Name test 3 File Location D WicePlus TestCodes 3 Fig 3 7 New Dialog Showing Project Tab for Creating a New Source File 2 Check Add to Project check box default if you want to automatically add the new file into your project Otherwise clear the check box 3 Assign a filename for the new source file in the File Name box 4 Locate the folder where you want to store the new source file in your disk You may use the Browse icon to find the appropriate folder 5 Click OK button after confirming your inputs You will be prompted to start writing the newly defined source file in the Editor window WicePlus C Compiler User s Guide Getting Started e 21 Chapter 3 3 4 2 Add Existing Source Files to the New Project If your source file is ready you can immediately insert it into your new project 1 From the Menu bar click on Project menu Choose Add Fi
36. he WicePlus Program ssseesseereeseeseesrseresrersersrerreesrtsresereseessrseresresseeer 18 3 2 1 Connect bicis P cr E 18 322 Codes Option Dial g aiio to iii diede tou teen tre ard eia qu us 19 WicePlus C Compiler User s Guide Contents e 1 Contents v ren PESE com dun qom at 19 3 4 Add and Remove Source Files from to Project serene 20 3 4 1 Create and Add a New Source File for the Project ssssss 20 3 4 2 Add Existing Source Files to the New Project eese 22 343 Deleting Source Files from PEtOJect uec impetere eoe RA IR PERDE I IER E UEUs 23 3 5 Editing Source Files from Folder Project eee 24 3 5 1 Open Source File from Folder for Editt g eee nene 24 3 5 2 Open Source File from Project for Editing nets 24 3 0 Soom le te Projectes EVE te RORIS EROR UM m REIR Er Ia Reti bU 25 3 7 Dumping the Compiled Program to ICE one e deseen 26 3 8 DEINE 26 3 8 1 Breakporpts Setup queso dotes ae dba undi rd iu Renditen eas 27 4 C Fundamental Elements 28 4l Snnt 28 22 R setved Words Rer 29 4 3 Preprocessor Directives m 30 TL FS 30 4 32 Femme svare enken 31 4 3 3 Hit Helse Helt tendit um ecce eee eter e ee Ee teen 32 4 34 ifdef ifndef RF ER 32 4 4 Literal Constants rorrrornnnnnnnnnrnrronennreenannnnrnrrensensnennnnnnrne
37. iable name lt address gt bank bank number gt Declare the variable at which RAM bank it is located The lt bank number gt has to be indicated including variable is declare at at Bank 0 Example unsigned int myDatal 0x22 bank 0 Test is located at default ram bank 0 unsigned int myData2 0x22 bank 1 myTest is at address 0x22 of ram bank 1 unsigned short myshort 0x20 bank 0 myshort is at address 0x29 and 0x2A of ram bank 2 unsigned long myLong 00x24 bank 1 myLong is at address 0x24 0x27 of ram bank 1 WicePlus C Compiler User s Guide C Fundamental Elements 46 a Chapier 5 5 4 Bit Data Type bit variable name gt lt address gt bitsequence bank bank number gt rpage page number gt Bit data type occupies only one bit WicePlus C Compiler User s Guide Hardware Related Programming e 47 Chapter 5 Example bit myBitl bit myBit2 0x03 rpage 0 bit myBit3 80x04 85 rpage 1 location of myBitl is assigned by linker if doesn t declare bit sequence the default location is at bit 0 Therefore myBit2 is at bit 0 of 0x03 of rpage 0 myBit3 is at bit 5 of 0x04 rpage 1 bit myBit4 0x05 06 rpage 1 myBit4 is at 0x05 bit 6 of rpage bit myBit5 0x22 Q03 bank 1 rpage 0 1 myBit5 is at 0x22 bit 3 of ram bank 1 rpage 1
38. ifndef identifier The ifdef directive is used for conditional compilation of definitions for the identifier The ifndef directive is used when conditionally compiling codes with the specified symbol not defined Both these two directives must be terminated by endif and can be optionally used with else Example define DEBUG 1 ifdef DEBUG define MAXVALUE 10 felse define MAXVALUE 1000 endif 32 C Fundamental Elements WicePlus C Compiler User s Guide Pz Chapter 4 4 4 Literal Constants 4 4 1 Numeric Constant Decimal Default Hexadecimal constant Digit prefix with 0x Numeric constants can be presented in decimal and hexadecimal depending on the prefix modifier Binary and octonary numerics are not supported Example 12 34 Decimal Ox5A OxB2 Hexadecimal 4 4 2 Character Constant character Character constants are denoted by a single character enclosed by single quotes ANSI C Escape Sequences as shown below are treated as a single character ANSI C Escape Sequence V0 Null 00 a Bell Alert 07 b Backspace 08 f Form Feed OG n New Line OA r Carriage Return oD t Horizontal Tab 09 v Vertical Tab 0B Backslash 5C V Question Mark 3F V Single Quote 27 V Double Quote 22 Example at uret x00 WicePlus C Compiler User s Guide C Fundamental Elements e 33 Cha
39. ile only generates asm m Click Rebuild All command to compile all files in the project regardless of whether they were modified or not New Open Save Close Add Files to Project Delete files from project Dump to ICE F3 Fig 3 12 Assemble amp Link Commands Rebuild All will generate objective bbj file list st file binary cds file The compiled files are automatically saved in the same folder where your other source files are located Status of the assembly operation can be monitored from the Output window as shown below EMC WicePlus EM78P156E not connect usermenutest Ist File Edit View Project Debug Tool Option IDE Window Help sa MEAS AT WAGES usermenuc Bx 03020 Gx usermenutest ist SF ev Jalx IEE accim coNr o R10 00 RO A W 00 00 RII 00 RI TCC 00 R12 00 R2C 00 R13 00 R3 0000 0000 R14 00 R4 0000 0000 R15 00 R5 00 R16 00 R6 00 RI 00 R18 00 R19 00 RIA 00 RIB 00 RIC 00 RID 00 g RIE 00 a lt gt SDN x P00000 1413 JMP 0x013 000001 073E SWAPA Ox3E ee EE 000002 0043 MOV 0x03 A fone 000003 073F SWAPA Ox3F 7 E DAWivePlos TestCodestusermenu c SAKE B das MOV ner aT 000005 075F SWAP OxlF B DAWticePlustTestCodestnsermenutestlst noe od ARA BELE EG Map Fikes 000008 OOSF MOV Ox1F A 000009 0704 SWAPA 0x04 00000A 007F MOV Ox3F A 0000058 0703
40. ions 1 Uninstall WicePlus1 xxx User have to remove the previous WicePlus version completely So during uninstalling process users have to choose remove option After uninstalling users have to install WicePlus2 Out new C Compiler is involved in WicePlus2 2 Delete system inc and sysdef inc in user s project For example users created a version 1 project prgl c in the path of D develop So there are two Tiny C compiler system files system inc and sysdef inc in the same folder Users have to delete these two files in the path of D develop 3 Assign rpage iopage bank clearly In version 1 rpage 0 iopage 0 and bank 0 can be omitted if you want to declare a variable in these registers But in version 2 users can t ignore rpage 0 iopage 0 and bank 0 Users must declare variable clearly in these 0 state Although MCU has just one rpage iopage or bank variables declared in these position must be assigned which page or bank 4 We provide a good efficient C compiler Users can read converse table in page 57 5 Compiler will dynamic to occupy general common register Compiler will tell users which common registers have to save and backup in interrupt service routine Please reference to sec 5 10 3 We hope we provide an ideal tool for developing product If you have any problems about C compiler please mail us with these IP myjian emc com tw EM55000Series IDS Reference Manual 3 Nov 00 an Contents C
41. les to Project command from the resulting pull down menu and then the Open dialog is displayed New Insert Files into Project Open BESTE QI O TestCode z emekEM Save 0 156 0302 c e 0304 C atuo sviteh page c c 0302 c c 0307 C c CheckRAM c Close ce 0303 2 c 0308 2 c USERMENU C g 0303 3 c 0309 1 c c 0303 156 c c 0309 2 ce 0304 2 g 0803 156 C Add Files to Project Delet Hes Inomr prafe RAMU Compile AltF f SX AUT Source Files c ES Rebuild All AlHFO Dump to ICE F3 Fig 3 8a Add Files to Project Fig 3 8b Open Dialog Command 2 Browse and select the file or multiple files you intend to insert into the new project 3 Click OK button after confirming your choice 22 Getting Started WicePlus C Compiler User s Guide Chapter 3 3 4 3 Deleting Source Files from Project DAWicePlusYTestCodesYusermenutest cpj ti 2 You may also click on the 3 EM78P156E D WicePlus TestCodes usermenutest cpj Delete Files from Project 43 Source Files DAWicePlusTestCodestusermenu c command from the Project EAB D WicePlus TestCodes 0303 2 c T 1 Pep pull down menu to delete files List Files from project 5 DAWicePlus TestCodestusermenutest st 3 Map Files New Open Save Close B Fileview Add Files to Project Delete files from project Fig 3 9a Deleting Project Files Dir
42. m ICE reset register contents are displayed with initial values Step Into Execute instructions step by step with register contents updated simultaneously Step Over Execute instructions as Step Into see above but the CALL instruction will execute as step over Run program starting from the current program counter up to the location where the cursor is anchored applies to ICE debug mode only Execute instructions as Step Into but continuously Users can see the change of registers It is not the same as Go Run program starting from the line where the cursor is Stop running status Set or remove a breakpoint Show all breakpoints set up data in the Output window Clear all breakpoints WicePlus C Compiler User s Guide Chapter 3 2 3 6 Tool Menu Connect Connect Define printer port connection with ICE default Check ICE memory is 378H Get checksum from project Check ICE Check available memory Memory from ICE Compute execution time Get Checksum Get Code 1 FFF size Obtain checksum from the Move data from file to sram from Project compiled program Speed up Debug Fig 2 16 Tool Menu Get Code 1FFF size Obtain the occupied program rom size and empty size Compute Execution Time Compute the execution time between two breakpoints WicePlus C Compiler User s Guide WicePlus Interface e 11 2 3 7 Option Menu en ICE Code Setting ICE Code Setting Set code opti
43. n Clear All Breakpoints Remove all already set breakpoints Go Run program starting from the current program zi counter until breakpoint is matched and breakpoint F5 address is executed Cu Reset Perform hardware reset register contents are displayed with initial values ICE will RJ return to its initial condition F6 260 Getting Started WicePlus C Compiler User s Guide Chapter 3 y F7 P F8 F10 Step Into Execute instructions step by step with register contents updated at the same time Step Over Same as Step Into command see above but the CALL instruction is executed as Go command Free Run Run program starting from the current program counter until the Stop button of the Stop Running dialog is clicked All defined breakpoints are ignored while the program is running Stop Stop running During debugging the contents of Program Counter Registers and RAMs are read and displayed each time the program is stopped to provide important interim information during program debugging 3 8 1 Breakpoints Setting Breakpoints To assign a breakpoint position cursor on the line ae 7 Bias where a breakpoint is going to ENSE EE Een ges e be set then double click Observe the line highlighted in brown BEI ACC CONT 00 RIO 09 ROGN 0000 RIL OD Rice 00 Ai 0 RAC 00 Riz 0 R3 0000 c000 PM m ra Doom Rb W E REO 2600 E mmm mu c gm
44. ndow Find the defined strings in the active window Find the defined string in the active and inactive files WicePlus Interface e 7 Chapter 3 Undo BooknRwts Cut CopyMraktz Bookmarks Select ALL Ge fo Her Bookmarks Find Find in Files Replace 8 eWicePlus Interface Gm Cancel the last editing action Rop amp an hk thet ledetat parton position deae al Hankmdrkkpressign an fndetivalue 0 9 to the bookmarks Le nl ge A Oo OW rke command below love cu RAI if the he defined lin DUber witht Kart active Win index Find the defined strings in the active window Find the defined string in the active and inactive files Same as standard find and replace editing functions WicePlus C Compiler User s Guide a Chapter 3 2 3 3 View Menu TA Project Project Show hide Project window Special Register Special Registers Show hide Special Register General Registers Bank window v Data Ram General Registers Show hide General Register ae Bank Bank window fex Output Data RAM Show hide Data RAM Watch window if supported by the Toolbars gt LCD Data Show hide LCD Data Steins Ber window if supported by the target chip v Document Bar Output Show hide Output window Watch Show hide Watch window Assembly Code Show hide Assembly Code in from Editor window Toolbars Show hide Standard Build or both toolbars Status Bar Show hide Status bar Docum
45. nsnnsnennnnnnrnnnenssnennnennnnnsenenee 33 AAA Numeric Constant re 33 44 2 Crerar eaii asea Eaei Eee S 33 44 3 Sting Constantes n ene 34 A S Data ERE EE EE EEE NE AE 35 4 6 FETUS OD T 35 MEME suivie UMON EN TOS 36 P ca qc P 37 4 9 PUM incana Hn 37 4 10 Operator iiie Pt 38 4 10 1 Types of Supported Operators essesseeseseeeseessesressreerssressersrerressersresrrnsesee 38 4 102 Prex ANN 39 AIr Bel Statement enrera aea E AEE EER AE 40 4 12 SWIIG ST ansarar e ETa A aa br M eE EON due pia A Veg t 40 ELGEN 10 SEE EEE E OL I 41 SAP MIS nies REE TU T 41 4 15 Por emet Jude eda side iadne 42 4 16 Break and Continue Statements iss 2sensrcsesccocsesastensszenticadaansnrscaadonednientzcansedadoiest 42 4 17 CN SPT dead EEA EERE EEREN EENS 43 SANE BD eu METRUM ENE 43 4 18 1 Function Prototype cuc em o beo a Cea ie tau bodes bil Iob ten SEC sisside 43 2 e Contents WicePlus C Compiler User s Guide am Contents 4 18 2 Function Defimton uuussssmammsmminieleesiumneuligemieuedsmeidn 44 5 Hardware Related Programming 44 Dol Register Page page E 44 5 2 TO Control Pag SA 45 EE gt RR EEE EE 46 5 4 Bit Data Type m 47 5 5 Data LCD RAM Indirect Addressing seeeeeseeseeseseseesersesererreesrrsrrsrresressrseresresseeere 49 5 6 Allocating C Function to Program ROM reonvrnavnnnvanevrnaa
46. ocontroller in use the LCD RAM window will show the contents of the LCD RAM Cx denotes LCD signal COM x Sx denotes LCD signal Segment x To modify the contents of the LCD RAM element double click on the chosen element grid block The color of the elements will change to pink 1 from no color 0 and vise versa Any related messages will be shown in the Output window 2 2 8 Output Window Fig 2 9 Output Window The Output window displays messages indicating the results including errors of the project compiling just performed such as assembler linker trace log history and debugging The window consists of four tab sub windows namely Build Information Find in Files and Message where Build displays assembler linker related messages and trace logs Double click on the error message to link to the corresponding program text line where the source of error occurs The pertinent source file is automatically opened in the Editor window if it is not currently active Information displays debugging related ROM and RAM Bank memory usage information Find in Files allows you to find identical string selected from an active file in other active or inactive files in your folder Lines containing the identical string will display on the Output window complete with its source filename and directory Message displays the debugging related changes to the LCD RAM win
47. ompile a time to know these message Character C in the line 0x10 means C compiler occupied in other functions Compiler will dynamic to use these in WicePlus 2 ESS SS REESE RAM Data Register Data IO Data 0123456789 A4BCDEF 0123456789 BCDEF 0123456789 ABCD B 2X bddddddddddddddd Ux gt OT OE umm BO 37 dddddddddddddddd 0x10 Sos ddddddd BL 2x dddddddddddddddd BL 3x dddddddddddddd a ras a Call Depth gt gt gt 5 Depth Interrupt Function JV Build Information Find in Files Message 7 4 Trace log Forth 27 00 57S Dos ii WicePlus C Compiler User s Guide Hardware Related Programming e 55 Chapter 5 Example 1 Void intcall INTERRUPT1_1 void Q0x08 low int 0 backup ACC R3 R4 R5 _asm MOV OX1F A SWAPA 0X4 BS 0X4 6 switch to ram bank 3 BS 0X4 7 MOV OX3F A SWAPA 0X3 MOV OX3E A SWAPA 0X5 MOV OX3D A PAGE 0X0 or Use BC to switch program page 0 if the MCU doesn t support page instruction void _intcall INTTERRUPT1 void int 0 backup C system _asm MOV A 0OX10 use 2 byte C data type C system backup OV OX3C A now save 0x10 0x19 to 0x3C 0X3B OX3A 0X39 MOV A 0X11 0X38 0X37 in bank 3 because switch to ram MOV OX3B A bank 3 in intcall INTERRUPT1 1 MOV A OX12 MOV OX3A A MOV A 0X13 MOV 0X39 A MOV A 0X14
48. on for the Variable Radix selected microcontroller Font Variable Radix Select between decimal or Environment setting hex option P obe m Font Define font for Editor E A EE windows fonts for other View Setting Fig 2 17 Option Menu Environment Setting windows are fixed To set WicePlus environment variable for example whether list file is created or not whether map file is created or not and the number of editor window Debug Option Setting To set debugger variables options View Setting GUI view setting such as preke R column on and off in Editor File Name in Project Window CE epe uem 2 3 8 IDE Menu 4 C C Select C language editing Assembly Select Assembly language Assembly editing Fig 2 18 IDE Menu 2 3 9 Window Menu New Window Open a new or split Editor window Cascade Rearrange all Editor window 12 e WicePlus Interface WicePlus C Compiler User s Guide active files so that they appear overlapping in sequence with their respective title bar fully visible tun Chapter 3 New Window Open a new or split Editor window Tile Horimatdd Rearrange all Hj liter Widow adido Witehonzbnatalivy appear Tile Vertical Rearrange all opened Editor windows vertically Arrange Icons Arrange all opened file filenames in a single line formation minimized into multiple file icons at the bottom of the Editor window Close All Close all opened files WicePlus C Compiler User s G
49. ontents 1 Introduction 1 INEST au Writs cosets tess ap wc dacs NE EE 1 1 2 Syst m Re Lu ape 1 121 Host COR c EE 1 1 3 Software Installationen cet tI pesi td et ecteso esi nai daba RAE SR Euer de ue 1 T4 AN STCOIBDSEBIUS So coeptae oc Semen eer Pn Reenter rer ee ern caterer ee 1 2 WicePlus Inferface 2 2L OVETVIEW EEE EE ENER 2 22 WicePl s SUD WO WS niessessies ansia es ut E EE sao 3 22 1 The uc co M A EE EE eames 3 222 The Editor NN Feed 3 2 2 3 The Special Register WIDHONW ioo psc oen a teas octets iputa 4 2 2 4 The General Registers Bank Window eee 4 225 Tbe Wateh WIDIOW seres 5 220 Data RAM WISOON Lien utens epe indt ocio a o aee au ee ade 5 227 LCD RAM Window isiccasasiacessidnveascasicenisa scene EN ERROR EET item 6 225 Output WINdOW Lee 6 2 3 WicePlus Menu Bar and its Commands svumesmmnssnnmuredmdren min 6 231 Fe Mee 7 202 Edt MEDU P 7 XE Ail c 9 254 F re 9 POSEEN Wi SIUE HN 10 2230 Tool M EEEE 11 P walls dressene 12 235 DE Maar 12 230 ME UA 12 2 310 Help MENU occa eA ees EE aaeeeiai eisi 14 p SLOT a eia Per aE EEEE EEEa E EEE a EES 14 2 4 1 Toolbar Icons and Functions eeeseeseeseeeeseseesesseesreseresersresreesresrsereseeseeneeesee 15 25 Doc ment Bar tm 16 20 Status EEE EEE 17 3 Getting Started 18 SUI Hardware POWBE D REE EE a aae ee ere 18 3 2 Starting t
50. ort appliances devices or systems Use of ELAN Microelectronics product in such applications is not supported and is prohibited NO PART OF THIS PUBLICATION MAY BE REPRODUCED OR TRANSMITTED IN ANY FORM OR BY ANY MEANS WITHOUT THE EXPRESSED WRITTEN PERMISSION OF ELAN MICROELECTRONICS Emm ELAN MICROELECTRONICS CORPORATION Nd Headquarters Hong Kong USA No 12 Innovation Road 1 Elan HK Microelectronics Elan Information Hsinchu Science Park Corporation Ltd Technology Group Hsinchu Taiwan 30077 Rm 1005B 10 F Empire Centre 1821 Saratoga Ave Suite 250 Tel 886 3 563 9977 68 Mody Road Tsimshatsui Saratoga CA 95070 Fax 886 3 563 9966 Kowloon HONG KONG USA http www emc com tw Tel 4852 2723 3376 Tel 1 408 366 8223 Fax 4852 2723 7780 Fax 1 408 366 8220 elanhk emc com hk Shenzhen Shanghai Elan Microelectronics Elan Microelectronics Shenzhen Ltd Shanghai Corporation SSMEC Bldg 3F Gaoxin S Ave Ltd Shenzhen Hi Tech Industrial Park 23 Bldg 115 Lane 572 Bibo Roac Shenzhen Guandong CHINA Zhangjiang Hi Tech Park Tel 86 755 2601 0565 Shanghai CHINA Fax 86 755 2601 0500 Tel 86 021 5080 3866 Fax 86 021 5080 4600 DEVELOPMENT NOTE How do users control Tiny C complier inWicePlus2 Basic New version Tiny C compiler is almost the same with previous version So users can run the project built in these two versions But users have to pay attention to something differences in these two vers
51. pter 4 4 4 3 String Constant character list String constants are series of characters enclosed in double quotes and which have an implied null value 0 after the last character Example Hello World Elan Micro 4 5 Data Type The size and range maximum and minimum values of the basic data type are as shown below Type Range Storage Size Byte void N A None signed char 128 127 1 unsigned char 0 255 1 signed int 128 127 1 unsigned int 0 255 1 signed short 32768 32767 2 unsigned short 0 65535 2 signed long 2147483648 2147483647 4 unsigned long 0 4294967295 4 bit 0 1 1 Bit When an arithmetic operator such as and is used with different data types conversion of right aligned variables to left aligned data type is done before the operator takes effect We suggest users use the same data type to develop program 34 e C Fundamental Elements WicePlus C Compiler User s Guide Chapter 4 Example Int Il I2 Short S1 S2 S3 Long Il I2 S1 S1 S2 L1 Li L2 0x11 0x22 I1 I2 gt change to S1 short I1 short I2 If forgot to add short before I1 and I2 the final result in S1 will be 1 byte only 0x1111 0x02 S1 S2 change to L1 long S1 long S2 If forgot to add long before S1 and S2 the final result in L1 will
52. reo a a cH F f A RIO kW lA 0 KAM ro RBO RICO RCO Rom FD MD REW RE OO RIF ORF 00 a You can also click on the Insert Remove Breakpoint icon hand shape on the toolbar to set a breakpoint ua ss Fink Fes Mee x Sa C Lias 17 Mo mapping Acenily Addo Ent Cdi pos NUM Fig 3 17 Active Source File with a Defined Breakpoint Likewise the defined breakpoint is cleared if you double click on it again or the hand icon is clicked the second time while the cursor positioned on the defined breakpoint To clear all existing breakpoints click Clear All Breakpoints command from Debug menu WicePlus C Compiler User s Guide Getting Started e 27 Chapter 4 Chapter 4 C Fundamental Elements 4 1 Comments For a single line comment All data in the line after the comment symbol twin slash mark will be ignored For Multi line comments All data in the line located within the comment symbols slash mark asterisk will be ignored Comments are used to help you understand the program code It can be placed anywhere in the source program The compiler will ignore the comment part from the source code thus no extra memory is required in the program execution Example This is a single line comment This is the comment This is the comment 28 e C
53. rupt Service Routine is the action to be taken for Interrupt 5 10 1 Interrupt Save Procedure void intcall function name l void lt interrupt vector address gt low int interrupt vector number gt It should be noted that 1 for low level interrupt must be added after function name 5 10 2 Interrupt Service Routine void intcall function name void int interrupt vector number The interrupt vector number means that if there are many interrupt vectors in the MCU the sequence 0 1 2 3 is provided to separate each interrupt vectors The compiler will automatically combine the saved procedure and the service routine in the interrupt vector number That is MCU will jump from insterrupt save procedure to interrupt service procedure WicePlus C Compiler User s Guide C Fundamental Elements e 54 Pz Chapter 5 5 10 3 Reserved Common Registers Operation Sixteen common registers 0x 10 0x 1f are reserved for certain operation When an interrupt occurs it is strongly recommended that users to backup some common registers After Compiled WicePlus will tell users which registers have to backup from information window Output window In the picture below users can see there are five C characters in the line of 0x10 These positions are 0x10 0x11 0x12 0x13 0x14 So users have to save these 5 common registers and restore them in interrupt service routine That is users have to c
54. s Q Is there any error message in case user defines too many variables in the const that exceeds the ROM space A Yes the linker will report an allocation error Q How do I declare the variable in h file and using not only in one c file A for example declare in h file like that extern io unsigned int DIRPORTO and you have to write like below just only one c file like that io unsigned int DIRPORT6 90x06 iopage 0 Q Should I change any program page or bank WicePlus C Compiler User s Guide FAQ e 69 Appendix B vn A If you just develop your program in C language you don t have to change any program page register page and ram bank and so on But If you use inline assembly in your program you have to save and restore about page or bank Q May I know how many stacks I have called A Yes In C developed environment after compiling user can know how many function call depth in Information Output Window Q Does C compiler just occupy 0x10 0x1F general purpose ram A Well almost C compiler just occupies 0x 10 0x1F general purpose register But If there are some arguments in call functions compiler will use some others ram in 0x20 0x3F bank 0 bank 3 So we suggest users use global variables to replace arguments in call function Users always have to note that there are some ram spaces used in interrupt save procedure and interrupt service procedure If you don t use these ram space again 7
55. se character mode is off highlighted when on m Num Lock key NUM is dimmed when the numeric keypad calculator mode is off highlighted when on m Scroll Lock key SCRL is dimmed when cursor control mode is off highlighted when on WicePlus C Compiler User s Guide WicePlus Interface e 17 Chapter 3 vn Chapter 3 Getting Started 3 1 Hardware Power up With the E8 ICE properly connected to target board PC and power source switch on ICE power and observe its red power LED lights up If the target board derives its power from ICE the yellow LED lights up as well Then launch your WicePlus IDE software when ICE and target board power up is confirmed to function normally 3 2 Starting the WicePlusPLUS Program To start WicePlus Program click on the WicePlus icon from desktop or from Windows Start menu When starting from the Start menu click Programs then look for WicePlus group and click on WicePlus icon 3 2 1 Connect Dialog Once the program is started the main window of the program will initially display the Connect dialog to prompt you to set the proper connection between your existing target microcontroller and printer port default is 378H You may also enable the Check ICE Memory check box to check the condition of the ICE memory I O Wait Time depicts the I O response speed Increase the value for slower speed and decrease for faster speed Click OK button when done Connect Micro Controller EM
56. t char Test 2 long RWport Test 36 C Fundamental Elements WicePlus C Compiler User s Guide Pz Chapter 4 4 8 Array declarator array declarator array declarator constant expression array declarator constant expression Array is a collection of same type data and can be accessed with the same name Example int arrayl 3 10 char port 4 const int myarr 2 0x11 0x22 0x11 0x22 will be put at program rom 4 9 Pointer declarator type qualifier list declarator A pointer is an index which holds the location of another data or a NULL constant All types of pointer occupy 1 byte Example int pt WicePlus C Compiler User s Guide C Fundamental Elements e 37 Chapter 4 P 4 10 Operators 4 10 1 Types of Supported Operators The supported operators for the C expression are as follows Arithmetic operators Increment and decrement operators Assignment operators Logical operators Bitwise operators Equality and relational operators Compound assignment operators The table below shows the detailed description of each of the operators Arithmetic Operators Symbol Expression addition expri expr2 subtraction expri expr2 multiplication expr1 expr2 division expr1 expr2 96 modulo expr1 96 expr2 Increment Operators Symbol Function Expression increase by 1 expr decrease by 1 expr
57. t in return in 1 WicePlus C Compiler User s Guide using EM78806B MOV A 0x03 BANK 20 MOV in A CALL FUN MOV A 0x10 BANK 20 MOV 95i A RET FUN MOV A 0x14 BANK 0 MOV temp1 A MOV A in MOV 0x14 A MOV 0X10 A MOV A 0X01 ADD 0X10 A MOV A temp1 MOV 0X14 A RET 136 19 14 100 Conversion Table e 61 Appendix A Const array const int myConst 5 1 2 3 4 5 main int i i myConst 3 return using EM78569 MOV A 0x3D MOV 0x19 A MOV A 0x1F MOV O0x1A A PAGE Q0x0F CALL 0x280 PAGE 90x00 BC 0x04 6 BC 0x04 7 MOV 0x20 A BC 0X03 0 RLCA 0x1A TBL PAGE 0x0F JMP 0x2FE MOV A 0x19 TBL RETL 0x01 RETL 0x02 RETL 0x03 RETL 0x04 RETL 0x05 162 21 13 100 Register page 62 e Conversion Table unsigned int myR5PO 90x05 rpage 0 unsigned int myR5P1 90x05 rpage 1 unsigned int myR5P2 90x05 rpage 2 myR5P0 0x12 myR5P1 0x34 myR5P2 0x56 using EM78P468N MOV A 0x12 BS 0X03 6 MOV 0x05 A MOV A 0x34 BS 0x03 6 BC 0x03 7 MOV 0x05 A MOV A 0x56 BC 0x03 6 BS 0x03 7 MOV 0x05 A WicePlus C Compiler User s Guide 100 11 11 100 I O control page io unsigned int mylO6PO 90x06 rpage 0 io unsigned int mylO6P1 90x06 rpage 1 io unsigned int mylO7P1 90x07 rpage 1 mylO6PO 0x00 mylO6P1 OxFF mylO7P1 0x55 using EM78569 MOV A 00x00 BC 0xx
58. te Multiple source file programs page 26 Compiler will dynamic to occupy general common register WicePlus will tell users which common registers 0x10 0x1F have to be save and backup in interrupt service routine sec 5 10 3 4 e Contents WicePlus C Compiler User s Guide a Chapter 2 Chapter 1 Introduction 1 1 Overview The EM78 Series C Compiler is a supplementary language translator that allows user to write his application in C language User s source code can then be translated via this compiler into assembly source code to generate the binary machine code 1 2 System Requirements 1 2 1 Host Computer The EM78 Series C Compiler requires a host that meets the following specifications m IBM PC Pentium 100 or higher is recommended or compatible computers Win2000 WinME NT or WinXP m At least 10 MB or more free hard disk space m At least I6MB of RAM 32MB or more is recommended m Mouse and USB connectors are highly recommended 1 3 Software Installation The compiler is included in WicePlus the EM78 Series Integrated Development Environment IDE When installing WicePlus the compiler will also be installed 1 4 ANSI Compatibility Compliance with the ANSI standard is limited to free standing C to accommodate the unique design characteristics of the EM78 Series microcontrollers WicePlus C Compiler User s Guide Introduction e 1 Chapter 2 Chapter 2 WicePlus Interface 2 1 Overvi
59. uide WicePlus Interface e 13 Chapter 3 2 3 10 Help Menu User Manual User s Manual Open the WicePlus User s Q Ker Manual P About Shows the current version of P E AS ERO WicePlus program and other information including a read me file on recent changes of the WicePlus About C Wice EMC C Compiler for ICE WicePlus Yersion 2 beta Copyright 2006 ELAN Microelectronics lac All rights reserved Web http vww emc com tw View What s New Fig 2 20b About Dialog 2 4 Toolbar 1 2 3 4 5 6 7 8 9 1011 12 13 14 15 16 17 18 19 W X85 6 os I REA RR RR Fig 2 21a WicePlus Main Window Standard Toolbar 20 21 22 23 24 25 26 27 2829 30 31 32 SHH tiempo me m Fig 2 21b WicePlus Main Window Build Toolbar 14 e WicePlus Interface WicePlus C Compiler User s Guide 2 4 1 Chapter 3 Toolbar Icons and Functions Corresponding hot key is enclosed in parenthesis 1 2 10 11 12 13 14 15 16 17 18 19 20 21 amp LI Open open an existing file Ctrl O Save save current active document Ctrl S Cut remove the selected string to clipboard Shift Del Copy copy the selected string to clipboard Ctrl C Paste paste the string from clipboard Ctrl V Undo cancel the last editing action Alt Backspace
60. vennavevnvenvvnnenvennavevnranennene 50 5 7 Putting Data mi KOM uussrmsgpensemgekmjeneneageieugnudt 51 5 8 ilime JA SSOHIDIPT sisie iesieta ien daste ni essaies 52 POMMES CeBIT an a S 52 5 8 2 Use of C Variable in the Inline Assembly 5 ettet 52 5 9 Using iu er eta 54 5 10 Inrzaciie dtes assisa iein 54 5 10 1 Interr pt Saye PRE dg ead ass issii 54 5 10 7 Interrupt Service Routine poni oi cabe ters ai eiu e palos esi Rides 54 5 10 3 Reserved Common Registers Operation esee 55 WicePlus C Compiler User s Guide Contents e 3 Contents Appendix A Conversion Table A Conversion between C and Assembly Codes 59 B Frequently Asked Questions FAQ 68 User s Guide Revision History Doc Version Revision Description Date 1 0 User s Guide initial version 2005 07 27 13 Add usage of long data to Note at section 4 5 Data type 2005 08 31 1 2 Add Data type int and unsigned int 2006 07 27 2 0 Users have declare clearly in rpage 0 iopage 0 and bank 0 2006 02 12 2 1 1 Add PAGE 0X0 in interrupt save subroutine 2006 03 27 2 pl gm m e Write more detail about backup and restore instruction in example and note 5 10 Add inline assembly multiple instruction MUL for EM78569 EM78367 and EM78369 Optimized c a b lt lt 1 unsigned int a b c Add note about using include xxx c sec 4 3 Illustra
Download Pdf Manuals
Related Search
Related Contents
HSBRX63T-144 シリーズ 取扱説明書 Fisher-Price T8377 Instruction Sheet HX2 User`s Guide - Honeywell Scanning and Mobility manuel d`instructions Expediente de Contratación LC-Power LC-1370Bmi Manual de instrucciones separadores ES Copyright © All rights reserved.
Failed to retrieve file