Home

CF2 Getting Started Guide - Persistor Instruments Inc

image

Contents

1. 3 Configurations 3 Docs Examples O html 8 C3 pdf C3 Release Notes Examples 8 C3 A DExamples C5 All Examples Index Project amp BigIDEA C Examples 8 3 CF1CTM SQW Gen C3 CommLogger 8 Dungeon C3 Expansion Inputs H O fench amp C3 HeloBios H O HelloCFx 8 C3 HowFast C3 Maxi46Examples PatchinfoExample 3 PicoDAQ E C3 R5232 Examples 8 Cj TestArgs 8 O TestExec Persistor MotoCross Support The snapshot below gives a high level overview of the installation into the Persistor directory Use this to familiarize yourself with the general E C Program Files Persistor MotoCross Support ES File Edit View Favorites Tools Help Name PII CFX DevTools ReadMe txt MOTOCROSS HLP Sf Motocross exe Application Wicense txt Text Document amp html ico Icon ij CFxDocumentationIndex htm HTML Document File Folder File Folder File Folder Type Text Document Help File layout and structure of the MotoCross development tools and as a map for quickly locating the files and directories referenced in this Getting Started Guide Location Location Location E E C3 TRU amp C3 Virtual EEPROM 3 Watchdog Y2K Demo Headers Drivers legacy sys Libraries D Source Drivers legacy XMLSettingsPanels we Project B u32 Headers Libra
2. 2 IO IRQ GPIO B10K 5 42 MODCLK Alternate Clock I O CLK GPIO B10K 6 43 RSRXD UART RX EIA IN UART RSIP5KG 44 RSTXD UART TX EIA OUT UART RSO 45 RXD UART Rx CMOS IN UART 7 46 TXD UART TX CMOS OUT UART Bo 47 RSRTS UART RTS EIA OUT UART RSO 48 RTS UART RTS CMOS OUT UART AP1M 49 RSCTS UART CTS EIA IN UART RSIP5KG 50 IRQ3 CTS UART CTS CMOS IN UART B 7 1 DATA4 is pulled low with 1K during reset 2 CLKIN is optional and not connected Contact the factory for information on using CLKIN with an external precision clock source 3 SHDN is an output signal controlled by the power management circuitry Your peripheral circuitry can monitor this signal but only with inputs having less than 2uA leakage current When low all of the CF2 circuitry is powered off Do not attempt to assert or load this line 4 WAKE is input to the power management circuitry and is pull high with 1M to the internal VBAK voltage External circuitry coordinated with CF2 driver software may use this line to pull the CF2 out of suspend mode 5 These lines must be left floating or asserted high at reset 6 This line must be floating or asserted high at reset for normal operation It may be pulled low during reset to disable the onboard PLL clock oscillator and insert an external clock Contact the factory for application notes 7 RXD and CTS are inputs to the 68332 but are normal
3. As you may have read elsewhere the CF2 supports the ANSI C Standard Library This fact should put an experienced C programmer well on their way to writing more meaningful and useful programs for the CF2 However it is unlikely that you bought the CF2 solely to write programs with the C Standard Library You probably want to take advantage of the CF2 s Stationery choices I O features low power operation and more of its many specialty subsystems Stationery Whenever you are creating a new project you are New Project x given several different choices for Stationery In the tutorial we used the PicoDOS Stationery We will now list the different types of Stationery and give a brief Select project stationery description PicoD0S ToPico PicoDOS This is a standard PicoDOS executable E Variations written using C BIOS CFxLibrary ToPico This is an application that serves as a Picodi foundation for building your custom version of PicoDOS You can use this Stationery to add new commands to PicoDOS and even remove any that you don t want or need For example you could add a command to turn on and initialize your own custom electronics You could also remove the FORMAT command if you wanted to prevent someone from accidentally formatting a card in the field G PERSISTOR 17 CF2 Getting Started Guide f Instruments Inc Variations BIOS This stationery is for an advanced user that wishes to write BIOS functions CfxLi
4. BUS B 8 2 BERR Bus Error OUT BDM BUS BP10K 3 GND Ground PWR BDM PWR 4 BKPT Break Point IN BDM P10K 5 VBAK VREG VBBK PWR PWR 10 6 FREEZE Freeze OUT BDM A 7 RESET Reset I 0 BDM BUS BoP1K 8 DSI BDM Input IN BDM A 9 VREG 3 3 V Power IN BDM PWR 10 DSO BDM Output OUT BDM A 11 VLIN 3 3v Regulator OUT PWR 12 SHDN Shutdown OUT PWR 3 13 VBAT Main Battery IN PWR 14 VBBK Backup Battery IN PWR 15 PCS2 SPI Chip Sel 2 I O QSPI GPIO Bo 9 16 SCK SPI Clock 1 0 QSPI GPIO Bo 9 17 PCS3 SPI Chip Sel 3 I O QSPI GPIO Bo 9 18 MOSI SPI Data Out I O QSPI GPIO Bo 9 19 PCS1 SPI Chip Sel 1 I O QSPI GPIO Bo 9 20 MISO SPI Data In I O QSPI GPIO BoP1M 21 PCSO SPI Chip Sel 0 I O QSPI GPIO Bo 9 22 TPU1 TPU Chan 1 I O TPU GPIO C 23 TPU2 TPU Chan 2 I O TPU GPIO C 24 TPU3 TPU Chan 3 I O TPU GPIO C 25 TPU4 TPU Chan 4 I O TPU GPIO C 26 TPU5 TPU Chan 5 I O TPU GPIO C 27 TPU6 TPU Chan 6 1 0 TPU GPIO C 28 TPU7 TPU Chan 7 I O TPU GPIO C 29 TPU8 TPU Chan 8 IO TPU GPIO C 30 TPU9 TPU Chan 9 I O TPU GPIO C 31 TPU10 TPU Chan 10 I O TPU GPIO C 32 TPU11 TPU Chan 11 I O TPU GPIO C 33 TPU12 TPU Chan 12 I O TPU GPIO C 34 TPU13 TPU Chan 13 I O TPU GPIO C 35 TPU14 TPU Chan 14 I O TPU GPIO 36 XCLK Don t Connect 37 TPU15 TPU Chan 15 I O TPU GPIO C 38 WAKE Ext Wakeup IN PWR 4 39 IRQ5 Int Req 5 I O IRQ GPIO B10K 5 40 IRQ7 Int Req 7 I O IRQ GPIO B10K 5 41 IRQ2 Int Reg
5. EJ er e AM aa ar Back j search C Folders CHuistory z Uz X A Ea chose the CF2 PicoDOS Address O FirstCF2Project x es stationery and gave it the name FirstCF2Project CodeWarrior created a new folder and populated it with the project file FirstCF2Project mcp a starter C source file cfxmain c a project data folder FirstCF2Project Data and a bin folder to hold compiled binary code CodeWarrior also automatically opened the project and added it to the list of recent projects so you can quickly open it again from the File menu bin File Folder 3 14 2002 12 53 PM e FirstCF2Project Data File Folder 3 14 2002 11 50 AM icfxmain 3KB C Source File 11 28 2001 9 21 AM AEE FirstCF2Project 47 KB CodeWarrior Project 3 14 2002 12 53 PM FirstCF2Project Select an item to view its description xl 4 object s 49 1 KB KE My Computer Q PERSISTOR 16 CF2 Getting Started Guide When you chose Project Make CodeWarrior checked all of the file dependencies compiled all of the C source files then linked the C code with the libraries If it had found any errors it would have displayed an error window with a list of problems for you to fix by double clicking on the error message If you made no changes to the sample file created by the stationery you should have gotten no errors If you move into the bin directory under your project you will see the files created by Codewarrior dur
6. Keep pin 39 grounded and type WREN at the PBM prompt and hit Enter You will then be asked by the PBM to release pin 39 and confirm Disconnect the ground on pin 39 and type Y and Enter Now that PBM writes are enabled WREN you can ask the PBM to boot to PicoDOS Type BOOT and hit Enter You will be given a list of boot addresses with numbers Type 9 and hit enter This instructs the PBM to boot PicoDOS at power up and NOT the application in Flash The next time you apply power you should see the PicoDOS prompt I don t want to load my program into Flash I would like to have it available to run as a file on the Compact Flash card kind of like DOS program used to run Can I do this with PicoDOS Yes Sometimes you may have a need for keeping several CF2 applications stored on a Compact Flash card You would then be able to run them by just typing their names Load a RUN file version of your application using Motocross When the load is complete you will see a G appear on the screen Now add an S to the G so it forms GS and type one space and enter an 8 character filename Hit Enter when done If you type DIR and Enter you will get a directory listing In the list you should see the name you typed with an extension of PXE for PicoDOS eXEcutable To run your application just type the filename without the extension and hit Enter I loaded my program into Flash How do I make it run whenever I turn on my
7. MotoCross are registered trademarks of Persistor Instruments Inc RecipeCard and SandwichCard are unregistered trademarks of Persistor Instruments Inc All other names brands and trademarks are the property of their respective owners M PERSISTOR 2 CF2 Getting Started Guide Table of Contents Standard Terms and Conditions of USC cccscsecseeeseeneeeeeceeneeneeneeeeeaseaseaseasenseasensensennensenaes 2 Trademark NOEICe 5 oc van Xe comcast END P EN en IM p LA ED Aus 2 Table of Contents Leer eieeileileiieeseeneu neu ne anna nuu a uu au uuu u uu uRe uasa usa usa u sau seu sau u sunu 3 General Information eeieeeeeieeeee unen nennen neu neunuunu usua auum u uuum u uu uRa uasa u seus u sunu nun 4 Iiaidrere Dreufojate rH 4 What s imcthe dr TUUTTTEST 4 Additional Equipment Required ssssssesssesseeseeen nemen amen nnn nnne nnn 4 Warnings and Precautions eeeessesesseseaseusasuuu uasa AR RR EAR RRRRGRRSASRRSASRRSASRRIASRRSASR RSSRSuRaA 5 Software Installation e ceeeeeeeesee suene enun nunmehr una nune heu sauna nausea suus u ausu uuu 6 Quad Ecc 6 A Note to CodeWarrior Pro 6 USCIS cccceccce scence eee e eee e nennen nna sena sena sena see ssa sea se a nnn 6 Install COd Warhion PUITS 7 Install PicoDEV with MOFOCIOSS Po sss Saa rcs ara nma Fa cs a Ad Erbe VEU EXP GU a ea PR Rd 8 Setup the Source Trees ie
8. different folder click Browse and select another folder Destination Folder Browse C Program Files Metrowerks CodeW arrior lt Back SH a Cancel using the Metrowerks CD installer NOTE If you have an existing CWPalm version 8 or 9 installation that compiles Palm OS 68K programs you can skip right to the Install MotoCross section If you re using CodeWarrior solely for CF2 development you need only select the options checked in the screen captures below which will require about 40MB of disk space Keep an eye on the dialog s Space Required text If it varies a lot from the screen snapshots carefully review your selections If you have trouble it s perfectly safe to reinstall CodeWarrior in part or whole and that generally will get you going Start by inserting the CodeWarrior CD On most PCs you will automatically be presented with the installation dialog On some others you will have to double click on the CD icon and setup exe to get things started Click your way through the first half dozen or so introductory and license information dialogs Begin to pay careful attention when you get to the Choose Destination Location dialog For a painless introduction to CF2 development you really do want to accept the default location offered by the installer C Program Files Metrowerks CodeWarrior At the Setup Type screen select the Custom Install option At the Select Components screen uncheck everyt
9. of projects to meet the specific needs of your application The format described above works well for most projects but just like the arrangement of files on your PC desktop it s really just an organizational convenience Renaming the Target Before you try to compile the test program we have created you should first rename the target that we will create You can see that the default name in the box at the top of the project window is Alt F7 gt TgtSet gt Rename gt gt This is done as a reminder for you to rename the project To rename the project click on the tab at the top of the project window titled Targets In the project window under Targets double click on Alt F7 TgtSet Rename This will bring up the Target settings dialog box Target Settings Panels In the Target Settings Panel on the left you should see a tree of items already expanded for Target Settings Access Paths Target Settings Target Name fist you The top one is titled Build Extras EN n M Target and under it you will Runtime Settings Prelinker None ts x File Mappings ANS see an item labeled Target Source Trees Postlinker MxCPU32 Post Linker Settings Left clicking on this 68K Target pCi crt x 3 Language Settings will bring up the Target ELSE Lannie Projectibin Settings panel on the right side P IM of the dialog box In the Ta rget B Rie MEN Save project entries using relative paths settings area on
10. some of the manufacturers of SPI compatible devices and their product offerings This is by no means complete but it does give you an idea of the expansion possibilities just working the serial bus yO Ne A SPI zys Devices x Allegro MicroSystems American Microsystems Analog Devices Atmel Burr Brown Catalyst Dallas Semiconductor Exar Exel Microelectronics Fujitsu Microelectronics Harris Semiconductor Linear Technology Maxim Micrel Semiconductor Microchip Technology Micro Linear Motorola National Semiconductor Ramtron Signal Processing Tech SGS Thomson Siemens Sipex Texas Instruments Xicor Q 14 21 m 2 3 I 4 43 ip gt i O z v 7 an SIl o z sr Ie x bAT FR g 16 III Z a PURI E a E NEHREREP E e uuu e d ed E d H E o o TL ae S LL J S Ce INI o o a A S S H H z adJ II E Ep E EJ TI Fs i HL l o a a ALLL S Ej s k Eu k E E 2 2 LS 2 n p T 00 00 27 CF2 Getting Started Guide TPU Time Processor Unit The TPU is actually a separate RISC controller integrated into the 68332 with timer optimized hardware that runs an assortment of microcoded time sliced state machines functions Each of the 16 TPU channels is associated with an I O pin and each can independently run separate functions and even link to each other under program control Fifte
11. square posts Anything else is likely to permanently deform the connectors and cause your system to fail or behave erratically We did this here with a scope probe tip 0 037 diameter and a customer did it with a miniature DMM probe 0 044 diameter We both spent many frustrating hours searching for the source of bizarre problems The deformation damage is quite visible but only with the help of a microscope and no this would not be covered under the warranty Backup battery The CF2 does not require a backup battery to operate when used with supervisor 5 20 or later However if you intend to use the low power suspend modes of the CF2 or if you will use dynamic CompactFlash card changes CCC from PicoDOS then you WILL need a backup battery QSPI The CF2 s 68332 and MSP430 supervisor communicate over the SPI bus using MISO MOSI and SCK Do not allow your SPI peripherals to drive MISO when they are not selected _ amp PERSISTOR 5 CF2 Getting Started Guide CompactFlash Compatibility Persistor Instruments sells and supports Silicon Systems brand Industrial Grade CompactFlash for the CF2 for several reasons Wear leveling which is performed inside Silicon Systems cards in a manner transparent to the CF2 Wear leveling is mandatory for reasonable card life in DOS Windows compatible FAT file systems where a few crucial system sectors experience vastly disproportionate erase write wear Silicon Systems holds patents on their wear levelin
12. the right 68K Processor 68K Disassembler change the Target Name to Global Optimizations something else We will choose E Linker Fi rst 68K Linker Factory Settings Import Panel Esport Panel Now left click on 68L Target in Eum Gases Genie the expanded tree on the left OK Cancel side of the dialog box This will bring up new information about the output file on the right side of the dialog box Change the name under File Name to something else This is the name of the output file that will be generated We will choose the name First here as well but the name can be different from the Target Name Click OK to close the Target Settings dialog box M PERSISTOR 15 CF2 Getting Started Guide Compiling The PicoDOS project stationery contains a simple bit of C code that prints out the serial number of your CF2 as well as information regarding the program build and the versions of the BIOS and PicoDOS that are burned into your CF2 s flash You may wish to look at the file cfxmain c before compiling it Once you are comfortable with the code you can compile the code by selecting Project Make from the menu or by simply pressing F7 If everything is installed correctly this should build a binary executable that the MotoCross program can then load into your CF2 During the Make or build operation the files and groups in your project window will update with information about the size of the cod
13. 018 1700418 130016 150016 130014 30014 110012 re ter 30010 BOTTOM 30010 7008 VIEW 7008 5006 5006 3004 3004 1002 1002 Q1 5 hb bh hU U UU U NJ NN NN jS RRB 0000000000000000000000000 CompactFlash Card C666666060666006606006660666 ARR U UU U U N N N NN ES RS I OO NJ UTE UJ QD NI UI U 10 NJ UI UJ 10 NJ UI UO ONUR RS 232 Timer DIO QSPI POWER 0 285 NOTE All pins are 0 025 0 Barina gold aated phosphor bronze square posts all centered on a 0 100 grid CompactFlash Card BOTTOM AE R W E39 CLKIN CLKOUT CS8 amp CS10 ADDR17 5 DATA15 5 DATA14 ADDR15 5 DATA13 DATA12 ADDR13 5 DATA11 55 DATA10 ADDR11 5 ADDRO 5 ADDR7 ADDR5 5 4 44 te te cour sour E35 SThd E vIndl ZTNdL OTNdL sna E35 ond 595 pnd M PERSISTOR 29 CF2 Getting Started Guide e Common CF2 Problems and their Solutions Problem Solution I programmed my application in Flash but now I want to load a new version of it and I cannot I know I need to get to PicoDOS but I don t know how What do I do Buried within the CF2 is software that sits below PicoDOS This is the Persistor Boot Monitor or PBM You can get to PBM when you apply power to the CF2 This can be accomplished by grounding pin 39 or depressing the PBM button on most RecipeCards before applying power Once power is applied you will jump to the PBM A 60 second countdown will start You can ignore the countdown for now
14. 40 m 2 Maxi46 h B cfxmain c 160 140 m 3 ADS8344 h 30 files 8K 9K 4 v PDX 1 Dirent h PicoDOS POSIX like Directory Access Defines 2 Dosdrive h PicoDOS DOS Drive and Directory Definitions 3 Fcntl h PicoDOS POSIX like File Access Definitions 4 Stat h PicoDOS POSIX like File Status Definitions 5 Termios h PicoDOS POSIX like Terminal I O Definitions 6 Unistd h PicoDOS POSIX like UNIX Function Definitions vi System 1 Mxcfxstd h Persistor Prefix File for MotoCross and CodeWarrior 2 Mxcpu32 h Persistor Prefix File for MotoCross and CodeWarrior 3 Cfxmcu h Processor Module Map 4 Cfxpatch h Persistor BIOS and PicoDOS Patches 5 Mc68338 h Persistor CF1 68CK338 Module Map 6 Mc68332 h Persistor CF2 68332 Module Map 2 Application Files This is the folder where you can store all of your application source files You will notice that it already contains a file called cfxmain c This is a starter file that we have provided to help make it easier for you to begin development It contains the all of the standard ANSI header file includes as well as all of the device specific includes that you will need to work with the CF2 The actual location of these files is in the directory C Piisoft which was created when you installed the PicoDEV CD M PERSISTOR 14 CF2 Getting Started Guide Once you become familiar with CodeWarrior and CF2 development you can begin to tailor the organization
15. CF2 At the PicoDOS prompt type BOOT APP This instructs the CF2 to run your application out of Flash whenever power is applied I loaded my program into Flash How can I tell PicoDOS to run the program in Flash If you want to just run a program in Flash from PicoDOS all you have to do is type APP at the PicoDOS prompt Should I format my Compact Flash on my PC or should I format using PicoDOS Because of some nuances with formatting on PCs today we recommend formatting Compact Flash cards using PicoDOS When I apply power to my CF2 I can t get a PicoDOS prompt to appear How do I fix this This could be one of several different problems Make sure that you are running a communications program we will assume Motocross and that the CF2 is connected to an available COM port on the PC Make sure that Motocross is using the correct COM port the one the CF2 is connected to Make sure that the baud rates are the same for the CF2 and Motocross CF2 default baud rate is 9600 8N1 Check to see that power is getting to the CF2 You may have a program running in the CF2 that prevents PicoDOS from running The solution to this is explained in an earlier problem solution above What voltage should I use for CF2 development Keeping the voltage low whenever you are developing is a good way to help minimize the damage that can occur if you were to momentarily short a pin while you probe the board We develop w
16. Configuration Data Files Segments Targets iii cfxad c Generic SPI A D QPB Driver for g T fe ide Das M PicoDOS ES CFX Support 80K K gt m iv Drivers Je SE v Max146 c File for working with the Ha Source 4K 336 m MAXIM MAX146 12 bit SPI A D Piia a Se xhunna c es converter Bod 3200 Mex vi ADS8344 c File for working with the Eig Drivers IK 264 m Burr Brown ADS8344 16 bit SPI A D Es MESE converter Libraries 76K K m d Libraries Bi C MxCFx Runtime lib 3838 8 oof f C_2i_MxCPU32_StdC lib 51808 7236 xi i C MxCFx Runtime lib C 2L MxCPUS2 Math lib 18620 754 xi ii C_2i_MxCPU32_StdC lib en EEO ir E EJ eaders iii C_2i_MxCPU32_Math lib B ch 0 0 m iv CfxPatch Lib H cfsbios h D m e Headers PB chpicoh 0 4 BEAD 0 0 of This folder contains links to the header files B hodh 0 m used in development for the CF2 If you een 0 need to look up any function prototypes or Eg PDX POSIX like 0 M typedefs used with any of the Persistor API BB dirent h D o m functions or PicoDOS you can find those en A ie files here Once again you can open the M stath D 0 om files by simply double clicking on them i sor E E i Cfx h CFx Target selection HE System 0 0 af ii i i B mxcfxstd h 0 D m ii Cfxbios h Persistor BIOS and I O B ME o i Definitions BB chsmcuh D 0 m iii Cfxpico h Persistor PicoDOS Definitions BB cfspatch h 0 0 m iv Drivers ec MEN 1 Cfxad h Ci 3 Application Files 160 1
17. DR9 ADDR8 ADDR7 ADDR6 ADDR5 ADDR4 ADDR3 ADDR2 ADDR1 CLKOUT pu 1M 1M DATA9 1M DXIAS yy 14 DATA11 DATA10 DATA13 DATA12 DATA15 DATA14 ADDR1 1 ADDR19 ADDR16 8 CLKOUT 19 ADDR18 0 22 CF2 Getting Started Guide Pin Descriptions R W CE CLKIN CLKOUT 01 ADDR18 CS8 vt CS10 ADDR17 TIT ADDR16 The CF2 interfaces to your circuitry using three DATA1S ERG DATA14 ADDR15 fE DATA13 EO DATA12 ADDR13 ERC ADDR12 standard double row 0 1 headers Many CF2 based pATAii WD parA10 T apprit ADDR10O systems will only need to access the signals on the DATA9 U CIT anors 2x25 pin C connector which brings out pins on both sides of the board OEM versions may specify pins on only one side or the other The 2x10 A and B connectors bring out the address and data bus along with control signals for system expansion 44 uv cac Bee W The first ten pins of connector C form a standard BDM Background Debugger Mode connector block at the top of the CF2 and these are identified by a solid white silk screen In addition every fifth pin of connector C is marked with white to help quickly identify the proper pin In the table of connections for connector C we have BOLDED the connections which are identified by the silk s
18. EDs whose operation temperature is 25 C to 85 C Storage Temperature Humidity Physical Specifications 40 C to 85 C 0 to 95 non cond PARAMETER SI US Weight lt 1 0 OZ With CF Card lt 1 2 OZ Length 63 5 mm _ 2 5in Width 35 5 mm 1 4 in With CF Card 51 0 mm 2 0 in Thickness 17 8 mm 0 70 in Electrical Characteristics PARAMETER CONDITIONS MIN TYP MAX UNITS 25 C to 4 759 C at 40mA 3 6 20 V 25 C to 30 C at 75mA 3 6 20 V VBAT Operating Voltage 25 C to 4 759 C at 75mA 3 6 12 8 V 25 C to 2 309 C at 250mA 5 0 8 4 V 25 C to 75 C at 250mA 5 0 6 0 V VREG Operating Voltage 3 1 3 3 3 6 V 16MHz constant CompactFlash Write 100 125 mA 16MHz CompactFlash Idle 55 70 mA 8MHz CompactFlash Idle 32 40 mA 4MHz CompactFlash Idle 20 25 mA REG Operating SMOD 320KHz CompactFlash Idle 4 10 mA LPSTOP CompactFlash Idle 300 500 uA LPSTOP CompactFlash Idle no CF card 240 400 uA Suspend 6 20 uA VBBK Operating Voltage 2 7 3 0 VREG V Backup Suspend 2 8 20 uA VBBK Operating Current VREG VBBK 01 1 UA System Clock 0 16 16 MHz System Crystal 100 ppm 25 C 39 996 40 000 40 004 KHz 21 CF2 Getting Started Guide Block Diagram and Signal Connections VBAT VBBK VLIN VREG VBAK GND SHDN WAKE XCLK RSTXD RSRXD RSRTS RSCTS IRQ7 IRQS RTS CTS IRQ2 MODLC
19. Fie Object To begin launch CodeWarrior Select File New PI CFIACF2 for Pico DOSA Stioney Ie A New window will appear allowing you to select rcc aca from a list of stationery You will see options for Location several types of projects Choose CF1 amp CF2 for C Documents and Settings Ad Set PicoDOS4 Stationery pes Project E Type the desired name in the Project name box we ll use FirstCF2Project You will also see a field in the dialog box that shows the Location of the project Another way to set the project name and the location at the same time is to click on the Set button to the right of the Location field This will bring up a standard dialog box that will allow you to AE navigate to a location and type the name of the such RE e amp mrkE project When you click OK on that dialog box you will go back to the New project dialog box You will then notice that both the Project name and Location are filled in for you After you have entered a Project name just click OK to go to the next step File name FirstCF2Project The next New Project window is for you to specify Save as type Project Fies mp z Cance which type of CF2 project you want to create You V Create Folder should choose PicoDOS for a first project Select PicoDOS by left clicking on it to highlight it When you have done that click the OK button os xi Select project stationery Once th
20. Functions Because many CF2 applications involve the transfer of data between the CF2 and a host computer as well as any other mating systems there is often a need for error checking and data integrity tests These functions provide a built in mechanism for performing checksum verification and cyclic redundancy checks Chip Select Drivers One of the more interesting and distinguishing features of the CF2 is the ease with which you can add memory mapped peripherals The functions in the API subsection provide relatively high level mechanisms for mapping and configuring the two bus chip select lines that are available for your use Examples are also provided which make use of these functions for mapping in new I O Time Processing Unit TPU The CF2 uses the Motorola MC68CK332 processor as its main brain The 332 contains several hardware sub modules that are specifically tailored to the common tasks in embedded computing One of these sub modules is the Time Processing Unit or TPU The TPU has 16 channels One TPU channel is reserved for internal use by the CF2 The other 15 channels are available for your use Here is a list of TPU Time Functions Input Capture or Input Transition Counter Period or Pulse Width Accumulation Output Compare Pulse Width Modulation Software UART One of the most powerful features of the TPU is the ability for a channel to be configured as half of a UART A single channel can be an asynchronous receiver or transm
21. K RXD TXD PCS3 PCS2 PCS1 PCSO SCK MOSI MISO TPU15 TPU14 TPU13 TPU12 TPU11 TPU10 TPU9 TPUS TPU7 TPU6 TPUS TPU4 TPU3 TPU2 TPU1 DS BERR BKPT FREEZE RESET DSI DSO VLIN o d v 5 a VBAK LT1521 A SHDN SENSE iOuF Lov NC GNDGNDGND P wb 10uF 3 e OV SHDN R2OUT MAX c 3222 jn C24 OFF C2 ON vec IOPIN RESET MSP430 PN Supervisor XOUT APPS LFCLK 40kHz i 512KB x 16 1MBSRAM 4a Woy 512KB x 16 PCS2 PE6 PF5 IRQ5 PEO DSACKO PF3 IRQ3 PF2 IRQ2 PE1 DSACK1 PFO MODCLK PF4 IRQ4 RXD PQS7 TXD PQS6 PCS3 PCS1 PQS5 PCS2 PCSO PQS4 PCS1 SCK PQS3 PCS0 SS MOSI PQS2 SCK MISO PQS1 MOSI PQSO MISO EXTAL T2CLK TPU15 TPU14 TPU13 BERR BKPT FREEZE BKPT DSCLK RESET FREEZE QUOT bo Wy py fs DSI RESET DSO IFETCH DSI IPIPE DSO VSTBY VCC PF7 IRQ7 MC68LK332 SIZO CPU32 TPU UART QSPI DATA15 DATA14 DATA13 DATA12 DATA11 DATA10 DATA9 DATA8 DATA7 DATA6 DATAS DATA4 DATA3 DATA2 DATA1 DATAO CS8 ECLK CS10 R W ADDR19 ADDR18 ADDR17 ADDR16 ADDR15 ADDR14 ADDR13 ADDR12 ADDR11 ADDR10 AD
22. PERSISTOR CF2 Getting Started Guide Instruments inr www persistor com Copyright 2002 2005 Persistor Instruments Inc All Rights Reserved Revision 2 0 July 2005 Standard Terms and Conditions of Use Life Support and Safety Equipment PERSISTOR INSTRUMENTS INC PII PRODUCTS ARE NOT DESIGNED TESTED OR INTENDED FOR USE IN EQUIPMENT THAT MAY BY FAILURE MISUSE OR PROPER USE CAUSE DEATH INJURY OR LOSS OF PROPERTY Designers of such equipment assume full responsibility for protection against and the liability for damages arising from the failure of PII products Specifications Product specifications are subject to change without notice PII reserves the right to improve or change the specifications at any time Limited Warranty PII warrants hardware which is manufactured or certified by PII to perform within the published specifications at the time of purchase for a period of one year from the time of purchase The buyer assumes the responsibility for confirming products purchased from PII perform within the published specifications when placed in the buyer s application This warranty does not cover damage or depreciation due to operating conditions or environments or damage due to abuse accident or customer modification Damage due to static dissipation or corrosive environments are specifically excluded PII warrants software which is produced by PII to perform within the published specifications at the time of purch
23. Win95 98 2000 NT Metrowerks CodeWarrior for Palm OS Version 8 or 9 _ amp PERSISTOR 4 CF2 Getting Started Guide Warnings and Precautions We really don t want to dampen the excitement of exploring your new board but there s some stuff you really ought to know Even the old timers may find something new to worry about with this 3 3 volt system and its lowest power suspend mode Just take a minute to skim this short section and save the possible embarrassment and expense of having to admit you leaped before looking The CF2 is a 3 3 volt system and cannot tolerate any voltages above 3 6 volts on any of its I O or BUS lines except for the RS 232 signals RSTXD RSRXD RSCTS RSRTS Even momentary connection to 5 volt signals will likely result in permanent damage to the board s components Do not attempt to get around this by running the board at 5 volts as the RAM and especially the flash will suffer stress damage Suspend Mode When the CF2 goes into suspend mode all of the I O and BUS pins except for the RS232 WAKE and SHDN look like very low impedance current sinks with about a 1 3 1 8 volt forward drop CF2 I O or BUS lines being driven from off board peripherals will try very hard and succeed at pulling these levels low which is probably not what you want Any I O lines being pulled high to an external V source will be pulled down to this forward voltage drop Both of these situations will consume lots of current which de
24. ase for a period of 90 days from the time of purchase Products sold by PII but which are not manufactured or certified by PII are not warranted by PII Remedy for Warranty Failures PII will as PII chooses repair or replace a defective hardware or software product under the following conditions the item is returned within the warranty period a reproducible symptom of the defect can be described the defective item is not found to be damaged by misuse or abuse Limitation of Warranty TO THE FULLEST EXTENT OF LAW PII MAKES NO OTHER WARRANTY EXPRESSED OR IMPLIED INCLUDING ANY PRESUMED EXPRESSED OR IMPLIED WARRANTY AS TO THE SUITABILITY OF THE PRODUCT FOR ANY PARTICULAR PURPOSE TO THE FULLEST EXTENT OF LAW PII SPECIFICALLY EXCLUDES ANY IMPLIED WARRANTY OF TITLE OR NON INFRINGEMENT THIS WARRANTY GIVES YOU SPECIFIC LEGAL RIGHTS AND YOU MAY HAVE OTHER LEGAL RIGHTS WHICH VARY FROM STATE TO STATE Limitation of Liability TO THE MAXIMUM EXTENT ALLOWED BY LAW IN NO EVENT SHALL PII OR ITS SUPPLIERS BE LIABLE FOR ANY DIRECT INDIRECT INCIDENTAL OR CONSEQUENTIAL DAMAGES INCLUDING WITHOUT LIMITATION INJURY OR DEATH LOST OR INADEQUATE DATA OR INFORMATION LOST REVENUES OR PROFITS LOST USE OR BUSINESS INTERRUPTION REPLACEMENT OR RENTAL COSTS ARRISING FROM THE FAILURE OF OR INABILITY TO USE PII PRODUCTS IN NO EVENT SHALL PII S LIABILITY FOR ANY DAMAGES EXCEED THE PURCHASE PRICE OF THE PRODUCT Trademark Notice Persistor PicoDOS and
25. brary Use this to build a library LIB If you wish to write software that you would like to distribute to others but without having to share the source code itself you will want to write a library You would only need to distribute the LIB file and a header file to the user Pico4i Same as PicoDOS except that it defaults to a 32 bit integer This is a standard under UNIX and so here it serves as an aid for anyone who is porting code over from the UNIX LINUX environment Subsystems The CF2 as an embedded controller is very diverse and agile It can do almost anything There are many different sections of APIs for accessing each of the internal capabilities The following is a list of the major subsystems that you will find described in further detail in other pieces of documentation ATA Device Drivers The CF2 API has a suite of functions that allow you to manipulate ATA storage devices usually CompactFlash from within your programs Although most developers will never have a need to use these in light of the standard file routine compatibility they are nonetheless provided for your programming convenience CompactFlash Low Level Drivers The CompactFlash Low Level drivers cover programming needs specific to CompactFlash card management and use It is unlikely that you would ever use these but they are provided as an additional abstraction layer between the hardware and the ATA device drivers Checksums and Cyclic Redundancy Check
26. creen Pin type designations are taken from the MC68CK332 Technical Summary and where appropriate suffixed with the value of onboard pullup resistors or special notes Static Sensitive CMOS All of the CF2 pins connect to static sensitive CMOS circuitry You must take precautions to guard against damage to these parts from static electricity Key to type abbreviations A Output signals that are always driven Ao Type A that can operate in open drain mode Aw Type A output with weak pull up during reset B Three state output that includes circuitry to pull up output before high impedance is established to ensure rapid rise time Bo Type B that can operate in open drain mode C TPU I O lines are always driven when outputs PXX Has an onboard pull up resistor of value xx PXxG Has an onboard pull down resistor of value xx RSI RS 232 EIA level input RSO RS 232 EIA level output A Signal Description Dir Func Type A Signal Description Dir Func Type 1 ADDR1 Address Bus 1 Out BUS A 2 ADDR19 Address Bus 19 Out BUS A 3 ADDR3 Address Bus 3 Out BUS A 4 ADDR2 Address Bus 2 Out BUS A 5 ADDR5 Address Bus 5 Out BUS A 6 ADDR4 Address Bus 4 Out BUS A 7 ADDR7 Address Bus 7 Out BUS A 8 ADDR6 Address Bus 6 Out BUS A 9 ADDR9 Address Bus 9 Out BUS A 10 ADDR8 Address Bus 8 Out BUS A 11 ADDR11 Ad
27. ded system In this API section we have attempted to provide an intuitive management scheme for these many and diverse options Queued PicoBUS Another Persistor Exclusive The Motorola QSPI bus is a powerful way to add peripherals such as A D converters and various other sensors to an embedded system Until now there hasn t been an intuitive managed yet performance oriented software layer to control this bus Our Queued PicoBUS QPB has solved this problem The QPB API allows you to configure and manage your SPI devices Furthermore our internal library of device configurations is growing all the time We may already have done some of the groundwork for the device you want to use Real Time Clock Instead of a separate Real Time Clock the CF2 uses a Texas Instruments MSP430 microcontroller to manage time and control power When the CF2 is awake it uses a 1PPS signal from the MSP430 to maintain time in the 68332 with a custom TPU function This allows the CF2 to quickly respond to time requests A suite of API functions gives you access to setting and reading the system clock Serial Controller Interface Driver The serial controller interface SCI is the main line of communication with the outside world during development It consists of a low level driver for the onboard UART and line drivers Once again all of the ANSI C functions are built on top of this driver but if power conservation is your game you may need to use some of these low le
28. dress Bus 11 Out BUS A 12 ADDR10 Address Bus 10 Out BUS A 13 ADDR13 Address Bus 13 Out BUS A 14 ADDR12 Address Bus 12 Out BUS A 15 ADDR15 Address Bus 15 Out BUS A 16 ADDR14 Address Bus 14 Out BUS A 17 ADDR17 Address Bus 17 Out BUS A 18 ADDR16 Address Bus 16 Out BUS A 19 CLKOUT System Clock Out CLK A 20 ADDR18 Address Bus 18 Out BUS A B Signal Description Dir Func Type B Signal Description Dir Func Type 1 DATA1 Data Bus 1 I O BUS AwP1M 2 DATAO Data Bus 0 1 0 BUS AwP1M 3 DATA3 Data Bus 3 1 0 BUS AwP1M 4 DATA2 Data Bus 2 1 0 BUS AwP1M 5 DATA5 Data Bus 5 1 0 BUS AwP1M 6 DATA4 Data Bus 4 1 0 BUS Aw 1 7 DATA7 Data Bus 7 1 0 BUS AwP1M 8 DATA6 Data Bus 6 1 0 BUS AwP1M 9 DATA9 Data Bus 9 I O BUS AwP1M 10 DATAS Data Bus 8 1 0 BUS AwP1M 11 DATA 11 Data Bus 11 I O BUS AwP1M 12 DATA10 Data Bus 10 I O BUS AwP1M 13 DATA 13 Data Bus 13 I O BUS AwP1M 14 DATA12 Data Bus 12 1 0 BUS AwP1M 15 DATA 15 Data Bus 15 1 0 BUS BP10K 16 DATA14 Data Bus 14 1 0 BUS AwP1M 17 CS8 Chip Select 8 Out BUS A 18 CS10 Chip Select 10 Out BUS AwP1M 19 R W Read Write Out BUS AP10K 20 CLKIN 40Khz Clock In CLK 2 Instruments Inc _ amp PERSISTOR 23 CF2 Getting Started Guide C Signal Description Dir Func Type C Signal Description Dir Func Type 1 DS Data Strobe OUT BDM
29. e above steps are completed you will be presented with a Project Slalionery CodeWarrior Project window There are several groups within the project window These are merely organizational tools and do not S Vatistions reflect any on disk structure for the project When first opened these groups are collapsed and you can click on their expander controls the boxes on the left to view the files in the groups You may open any of the files by double clicking on them What follows is a list of groups files contained within them and a brief explanation Cancel 1 CFx Support This group contains files crucial to compiling projects for the CF2 as well as documentation files Other files include a special version of the C standard library a math support library for the CF2 a special startup library that sets up your C program to run in the CF2 environment and header files You will generally never make changes to this group or to the files in this group a CfxDocumentationIndex htm If double clicked on launches the CF1 CF2 Documentation Index which is an HTML file created during installation b MotoCross exe The Pii communications program for Windows You use MotoCross to communicate with and load software to the CF2 M PERSISTOR 13 CF2 Getting Started Guide c Source i CFxPicoPreMain c startup code for the Ioj x project erm aves ii CfxRunRamAppCfg c Persistor CFx PicoDOS Program
30. e and data required for each module as shown These numbers reflect the worst case usage and the smart linker will generally reduce these number by quite a bit Map files created by CodeWarrior and MotoCross give complete details on memory usage and mapping If you don t already have MotoCross running you can launch it by double At s Bx clicking the MotoCross exe file under Ts ejat CFx Support in your project window Select Transfer Load then navigate i a ane hae CF2 gt to your project s bin directory and CF2 gt q select the file with the run Program efxmain c Mar 14 2002 10 47 29 Extension This fs made sasie TOP you Persistor CF2 SN 1104 BIOS 2 29 PicoD0S 2 29 if you click on the drop down item 1 Arguments x argv 0 G Files of type and select RAM Application RUN from the list of CF2 choices Once you have selected the file click on the Open button to begin the transfer In just a few seconds ESSI MotoCross will load the file into the CF2 and leave you in its terminal window where you ll see something like what is shown CAPTURE OFF 7 This prompt indicates that the code was loaded into your CF2 and the G which was automatically sent by MotoCross is an abbreviation for the GO command that will launch your program At this point if you press Enter your program will execute What Happened Congratulations you have orem oxi just compiled and run File Edit view Favorites Tools Help
31. en of the TPU channels are available for your applications and one is reserved for system use by PicoDOS Below are Motorola s descriptions for the TPU functions included by default in the CF2 If these are not quite to your liking you can choose from over two dozen prewritten functions or even write your own TPU microcode Discrete Input Output TPU Function DIO The discrete input output DIO function allows the user to configure a time processor unit TPU channel as an input or output As an input the channel can be read at any time or sampled at a periodic rate As an output the channel can be driven high or low upon command by the CPU Frequency Measurement TPU Function FQM The FQM function counts the number of pulses that are presented to a channel pin within a user specified time window as a 16 bit number Either rising or falling edges can be used as the beginning of a pulse In single shot mode pulses are accumulated for a single window time In continuous mode pulses are automatically accumulated in repetitive windows New Input Capture Input Transition Counter TPU Function NITC The NITC function can detect rising and or falling input transitions When a transition is detected the current TCR timer value or a parameter RAM value is captured The channel continues to detect and count input transitions until it has counted the maximum programmable number stored in the parameter MAX COUNT The NITC function can count the program
32. es an editor and a compiler in one program It also gives us a way to manage the individual files that makes up the program that you are writing see Project Window Project Window The project window is a tabbed dialog box that holds information about the files and settings of the project loaded by the IDE The tabs are Files the files that make up the project e g C files headers and library files Segments object code and Targets settings about the project s Target A project can have more than one Target A Target contains specific settings If you are new to CodeWarrior you may only build projects with one Target However as you gain experience and become more advanced multiple Targets will become a powerful way to build applications 68K Target This refers to the actual 68XXX code that is generated by the compiler a program destined for the CF2 in our case Stationery Just like paper stationery serves as a foundation for writing letters Stationery in CodeWarrior is the term for starter code for applications Several different kinds of Stationery are provided to get you started with your application The following tutorial assumes that you have followed the correct installation procedure for both CodeWarrior and MotoCross It also assumes that you understand the software development process of writing and compiling C programs e PERSISTOR 12 CF2 Getting Started Guide Your First Project aixi Project
33. feats the purpose of suspend mode Static Sensitive CMOS Every component on the CF2 is CMOS and susceptible to immediate damage or worse premature field failures if you don t take precautions to guard against damage from static electricity Develop with a current limited power supply You can save yourself a lot of grief by running the board from a bench supply current limited to about 100mA Jumpers test probes and programming bugs make it very easy to send the CF2 into some horrible current sucking latchup mode and current limiting can help keep a spurious slip from destroying your board Develop at low voltage The CF2 onboard voltage regulator can handle 20 volt inputs but nothing else on the board can Just like current limiting developing at around 4 volts is a good way to keep a simple slip of the hand from destroying your board RecipeCards and SandwichCards may have lower power supply voltage limits than the CF2 Floating Inputs Most of the I O lines on the CF2 do not have onboard pull up resistors and most of these are left in their default input state at reset CMOS floating inputs draw current in a somewhat unpredictable fashion nowhere near enough to do any damage but enough to defeat the gains of some of the power saving modes You should either pull unused I O lines to VREG or GND or force them to be outputs Don t Stick Probes in the Header Sockets The header strips used in the RecipeCards are meant to accept 0 025
34. g technology The CF2 will not work with all brands of CompactFlash Version 1 4 of the CompactFlash specification released in mid 1999 allows optional pull down data bus The CF2 ties directly to the data bus Pull down resistors on a Motorola CPU32 based controller can keep the processor from starting and we have seen this with LexarMedia cards PicoDOS takes special measures to minimize the occurrence but it still can happen on dirty power ups For cost sensitive applications Persistor also resells standard retail outlet SanDisk CompactFlash cards but these are not recommended for important data acquisition projects and are not covered by Persistor Instruments warranty Software Installation Overview Persistor s PicoDEV tools support CF2 68K cross development using the Palm OS version of the Metrowerks CodeWarrior compiler suite This section describes the three installation steps required to prepare your Windows PC for building CF2 programs 1 Install CodeWarrior for Palm OS Version 8 or 9 2 Install PicoDEV Tools for Persistor CF2 3 Specify Source Trees for your CF2Development In order to program your CF2 two separate software installations are required on your Windows PC Metrowerks CodeWarrior for Palm OS is the required C programming shell and compiler for your programming projects A Note to CodeWarrior Pro 6 Users Although CodeWarrior Pro 7 and beyond no longer support 68K programming we do support CF2 prog
35. hile automatically dropping to less than 2mA whenever the serial line idles This particular example is 180 lines of C code over 100 of which are just comments and formatting RS 232 Wakeup Call Both the RXD and CTS signals connect to interrupt request pins on the 68332 to allow wakeup from deep sleep modes on any UART activity To wake from the 10uA SUSPEND mode add the simple circuit at right 2 4 RS 232 Level TPU UART borrowing spare EIA drivers All of the CMOS level UART signals are brought out to allow driver replacement and the RTS CTS signals can be used for EIA level flow control or reassigned to work as RXD and TXD signals for a second UART built from a pair of TPU channels running the TPU UART functions Programming Note For this circuit to work you must add the following line of code to your program to force the CF2 to stop asserting the TXX RTS signal PIORead 48 tri state TXX drive signal for external control G PERSISTOR 26 CF2 Getting Started Guide QSPI Connections The 68332 has a powerful Queued Serial Peripheral Interface that allows simple hardware expansion to over five hundreds different SPI compatible devices The circuit at right demonstrates glueless expansion adding yet another UART using a MAX3100 which is not shown 11 A D channels with 12 bit resolution 16 voltage output 10 bit D A channels and 32 individually programmable bi directional digital I O pins The table below lists
36. hing except CodeWarrior IDE CodeWarrior Manuals and CodeWarrior for Palm Support Click your way through the remaining installer screens After completing the installation the Programs selection in your Start Menu will now contain an option for Metrowerks CodeWarrior IDE r S CodeWarrior Development Studio for Palm OS R Platform Profession 4 amp 4 Setup Type Choose the setup type that best suits your needs Click the type of Setup you prefer 1 Full Installation Description 2 Custom Install E Selecting this installation type will allow you to choose which components will be selected and installed Back Cancel r 4 CodeWarrior Development Studio for Palm OS R Platform Profession 4 amp 1 Select Components Choose the components Setup will install metrowerks demere Stare naro 4 Select the components you want to install and clear the components you do not want to install Description Includes a set of Reference Manuals and the Metrowerks Tutorial for Palm OS in HTML and PDF format to assist in development work using the CodeWarrior IDE 7 Command Line Tools amp 7 CodeWarrior Examples Palm DS SDK CodeWarrior for Palm Support Other SDKs 184744 K 42371780 K lt Back Cancel Space Required on C Space Available on C CF2 Getting Started Guide Install PicoDEV with InstallShield Wizard MotoCross Af
37. ils on the operation of the CF2 The combination of a CF2 and RecipeCard allow you to get started on your experiment goals without putting a lot of front end effort into wiring up the hardware In many cases this will be all you need for the initial prototype proof of concept or feasibility studies Complete schematics part lists and design notes for Persistor RecipeCards are available in the data sheets for the RecipeCards What s in the Kit Your CF2 Starter Kit should contain the following items 1 Persistor CF2 The particular model supplied will depend upon the starter kit ordered PERCF2I5 has 512K of RAM installed PERCF21M has 1MB of RAM installed 1 RecipeCard Once again the particular model supplied will depend upon the starter kit ordered The RecipeCard minimally provides connections for power and the primary UART R212 3 X 5 with 12 bit A D R216AU 3 X 5 with 16 bit A D 1 SCI 2 TPU UARTs MRCP 1 4 X 6 with 16 bit A D 1 SCI 1 TPU UARTs 1 CompactFlash card We may change the size and type as market conditions require 1 Communication cable Type supplied depends on the particular RecipeCard included 1 Power cable With tinned wire ends 1 CF CD PicoDEV development CD contains documentation MotoCross post compiler and terminal application CF2 function libraries and programming examples Additional Equipment Required A current limiting power supply Please read the Warnings and Precautions section A PC running
38. ing the Make If you have been following along with our example all the files will be name first and each will have a different extension The two most important files in the group are e First RUN This is a CF2 executable program which runs from CF2 RAM You will usually load the RUN during the initial testing of your programs You can also load RUN files and save them as executable programs on a CompactFlash card Programs saved in this way can be run by simply typing their name at the PicoDOS prompt To save a file to the CompactFlash card load the program the way we did above When MotoCross presents you with the G for GO simply add S and the name you want to give the program When you hit enter PicoDOS will save the file on the CompactFlash card with a PicoDOS executable extension PXE e First APP This is a CF2 executable program that runs from the CF2 s on board Flash memory Loading a APP file will place the program directly into Flash memory You can run the APP by typing APP at the PicoDOS prompt You can also set PicoDOS to automatically load and run the APP when PicoDOS starts You do this at the PicoDOS prompt by typing BOOT APP lt The RHX and AHX files are also applications but in Motorola S Record hex format The RMP and AMP files contain text listing the functions and global variables exactly as they are used on the CF2 You can open and read these maps directly from CodeWarrior Beyond Standard C Libraries
39. ith a current limited supply We keep the voltage at 4 volts and the current limited to about 100 150 mA 30 CF2 Getting Started Guide
40. itter This will be one of the most _ amp PERSISTOR 18 CF2 Getting Started Guide used functions of the TPU You can add an extra UART to your CF2 application simply by setting aside two TPU channels for the task Persistor Instruments has a new RecipeCard that provides extra communications drivers and interface jacks to aid in prototyping TPU UART applications R216AU For a more detailed description of the TPU please see the included PDF documentation from Motorola Flash Memory Functions The CF2 has 1MB of non volatile flash memory built in This is used to hold both the BIOS libraries and PicoDOS as well as other system internals However there is about 768K free for non volatile application storage or data storage Because flash memory has special requirements and does not support random access unlike conventional RAM we have developed a suite of functions that perform the writing and erasing tasks on the flash as well as other maintenance chores and diagnostic utilities If you wish to develop programs that will make use of the Flash you will need to familiarize yourself with this section in the User s Manual Interrupt and Exception Vector Wrapper Functions We recognize that many applications in embedded computing are time sensitive or could be best serviced by a hardware or software interrupt mechanism These functions provide you with a simple easy to understand method for creating your own interrupt handlers We also provide fu
41. ly driven by the RS232 driver chip You can disable the RS232 driver under software control to allow the CF2 to run the UART at CMOS levels 8 DS comes out of reset as an active driving bus output but is not used by the CF2 except when connected to a BDM debugger When your program gets control you can define this line as a BUS signal for decoding an input signal though you must not drive into it until you redefine it or an output signal The convenient location and the fact that it is less useful as a general purpose control line since it flails at reset makes this an ideal pin for diagnostics and timing or profiling your functions with a scope using the fast I O macros 9 All of the QSPI PicoBUS signals revert to inputs at reset which means they may assume any state and that could be trouble for attached SPI devices which could interpret reset flailing as commands which in turn could have the SPI device do something the CF2 would not like You should add 10K to 100K pull ups to the CS lines of your SPI devices to prevent trouble 10 VBAK is provided to supply power to external circuitry in shutdown or off modes On the older CF1 this pin was PASS a no connect which may have been used to pass a signal from a top mounted expansion board to another bottom mounted board M PERSISTOR 24 CF2 Getting Started Guide Power Connections The CF2 has very flexible power management support circuitry to simplify integration with you
42. med maximum number of transitions continually or it can count the programmed number of transitions once then cease channel activity until reinitialized Output Compare TPU Function OC The output compare OC function can generate a single output transition a single pulse or a continuous 50 duty cycle pulse train upon receiving a link from another channel The first two actions require the CPU to initiate each output edge or pulse The third action generates a continuous square wave without CPU intervention Programmable Time Accumulator TPU Function PTA The programmable time accumulator PTA function measures either period high time or low time of an input signal over a programmable number of periods The number of periods over which the 32 bit measurement is made is selectable over the range 1 to 255 Pulse Width Modulation TPU Function PWM This output function generates a pulse width modulated waveform in which the period and or the high time can be changed at any time by the CPU PWM uses two modes of operation level and normal In level mode a 0 or a 100 duty cycle waveform can be generated In normal mode waveforms with duty cycles between 0 and 100 can be generated Queued Output Match TPU Function QOM The QOM function generates complex pulse trains without CPU intervention using a sequence of output matches An output match causes a programmable pin response when a user defined value is matched by the value of a f
43. menu 3 Click select Source Trees from the IDE Preference Panels left 4 Click the Import Panel button from the Source Trees pane lower right Navigate to C Program Files Persistor MotoCross Support CFX XMLSettingsPanels IDE You should see the two primary configurations Source Trees CF2 IDEGlobalPref xml Source Trees CF1 IDEGlobalPref xml 5 Choose Source Trees CF2 IDEGlobalPref xml 6 Click the OK button back in the Source Trees pane M PERSISTOR 8 CF2 Getting Started Guide f Installed Files Metrowerks CodeWarrior The screen snapshot below shows the critical PicoDEV files and directories that were installed into the CodeWarrior directory 3 C Program Files Metrowerks CodeWarrior Bin Plugins Linker C31 File Edit View Favorites Tools Help ay Folders amp Metrowerks amp CodeWarrior amp Bin amp Plugins inker El C3 MotoCross Support Speca a cri amp c cpu32 E C3 Headers Libraries amp Stationery amp C3 CF1 amp CF2 for CWPalm8 amp C3 CF1 amp CF2 for CWPro6 ae CF 1 Legacy Projects CF2 for CWPalm9 Address C Program Files Metrowerks Code Warrior Bin Plugins Linker x v vl Go Name X MxCPU32Postt inker dll 3 C Program Files Persistor Address C Program Files Persistor Go Folders O Persistor amp C3 MotoCross Support pecia 2 crx Oc c2 amp bin cri c2
44. nctions that install your new interrupt handlers written either in C using our prototyping and definition tools or written directly in assembly language into the Vector Table of the 68332 LED Signal Functions The CF2 has two dual color LEDs mounted near the sides of the CompactFlash header They can be used as simple indicators of program status as a visual watchdog or whatever else you can think of This set of simple almost self explanatory functions control the state and behavior of these LEDs making it easy for your programs to provide the most minimal of visual feedback Pin I O Drivers Functions and Macros These functions and macros allow you to control and manipulate the behavior of the CF2 s general purpose I O lines Some of the I O pins on the CF2 have alternate functions related to other subsystems This section contains functions that allow you to manipulate these alternate functions and correctly manage the use of the I O pins on connector C on the CF2 Furthermore there is a set of macros that provide ultra high speed access allowing you to perform basic pin operations in under a microsecond with certain restrictions Periodic Interrupt Timer Another hardware feature of the Motorola MC68CK332 is the Periodic Interrupt Timer or PIT The PIT allows the 332 to trigger an interrupt on a set period The period can be adjusted in increments of 100 microseconds from 100us to 25 5ms and in increments of approximately 51ms from 51ms t
45. nections ssssssssssesssssssss ese emen mense emnes 22 dre LM 23 Power Connections ue eireireieeeeseu neu nn anna aman eens auam u auam u uuu Rau sauna suu su sunu unn 25 VART Connections i iod accen E EVEN Eva x E a EEVRRAIAN XY RN EAR EV REED E YN RIA Ta E EVAY Dew vs 26 OSPI CONNECTIONS ERE PETLEEMER EAA AMA 27 TPU Time Processor UNE a reeniras EnEn ek Ra xR a3 Yaadac KENE NEEE krex ri ak ke v Ei e IR YiRSYR Ra Kgak 28 CF2 Dimensions xxn ex ERE RR XREUERRRRXRX ME ERES REA REN IAERRRRE dada cele ERREUR XR UE RR XM KO eR RA 29 PCB Pad PIACEMENT Aw rr rE RI I IN ON NI UIE nune nae nana nna IG I nnn nnn nnn nnn nnn nnn 29 Common CF2 Problems and their Solutions ee eee eere eene nennen nnn nnn 30 M PERSISTOR 3 CF2 Getting Started Guide General Information Introduction Thank you for your recent purchase of a Persistor CF2 We welcome your comments and suggestions for improving our documentation This getting started guide describes how to setup and install the various components that make up your Persistor CF2 Starter Kit This printed manual covers just the essentials of getting started with the CF2 After you have installed all of the software the Persistor directory will contain much more documentation in the form of PDFs for the various components You will also have access to an HTML file that will have descriptions of the PicoDOS API as well as more deta
46. nputs having less than 100nA leakage and less than 100pF capacitance When low all of the CF1 circuitry is powered off DO NOT attempt to assert or load this line 38 WAKE IN This is the input to the power management circuitry and is pulled high with 1M to the internal VBAK voltage External circuitry coordinated with CF2 driver software may use this line to pull the CF2 out of suspend mode _ amp PERSISTOR 25 CF2 Getting Started Guide UART Connections 68LK332 The 68332 has a Serial Controller Interface e SCI that provides standard UART o PQS7 TXD functions at rates from 64 to 500 kbaud PF4 IRQ4 with advanced error detection circuitry The SCI supports full or half duplex operation double buffering optional parity generation and detection and wakeup on idle line or address detection The CF2 has an onboard MAX3222 dual EIA driver to interface directly to any standard RS 232 terminal or device Either or both the receive and transmit drivers can be disabled under software control to conserve power or allow connection to alternate RS 485 or RS 422 drivers BIOS UART Support The CF2 BIOS software handles port configuration polled or buffered receive and transmit and flow control with several dozen high level C functions One of the example projects that installed with the Persistor CD demonstrates how to stream incoming RS 232 data to a file on the CompactFlash card at any standard BAUD rate w
47. o around 13s The CF2 API also provides a chore management system for the PIT allowing you to perform more than one chore written in standard C with no special considerations other than speed on each interrupt and to shield the programmer from the necessity of writing low level interrupt handlers PicoDOS Library Functions Providing that PicoDOS is resident in flash in your particular application which is normally the case you can access most of the core functionality of PicoDOS from within your applications Also provided is a subsystem called the CMD processor that provides a deep and valuable framework for setting up a command line interface to your program The CMD Processor allows your program to accept commands from a user interactively over the serial port parse their arguments and dispatch the appropriate function This can be a huge time saver if you want your program to be interactive For an example of using the CMD processor create a new project with CodeWarrior and select the ToPico stationery M7 PERSISTOR 19 CF2 Getting Started Guide Power Management Drivers One of the more crucial features of the CF2 is its low power consumption with non executing power down modes as low as 5 pA The CF2 really is a low power panacea for the embedded system designer This driver section gives you access to all the different power modes and power conservation functions the CF2 has to offer There are many ways to reduce power in an embed
48. r electronics The onboard 3 3 volt linear regulator with reverse battery protection and thermal current limiting that floats on the CF2 board to allow you to bypass augment or reassign it to other circuitry Normally you simply wire your positive supply to the VBAT input then jumper VLIN the regulator output to VREG An onboard power supervisor ensures that the CF2 will receive an orderly reset and that the memory and real time clock will be preserved in the event of a power disruption A separate power managing controller lets the CF2 drop into a SUSPEND mode where the system draws less than 10 microamps It can wake and resume after a programmed delay or on detection of WAKE signal or CompactFlash cardchange event Cc Signal IN Description 3 GND IN This is the negative return for all the CF2 power signals and digital ground for all the CF2 logic 13 VBAT IN This is the unregulated DC input voltage to the onboard LT1521 linear regulator The LT1521 will allow the CF2 to work with inputs from 3 6 volts to 20 volts and provides reverse power protection to 20 volts This input connects to a 1uF filter capacitor Leave this input unconnected if you are not using the onboard regulator 11 VLIN OUT This is the regulated 3 3 volts from the onboard LT1521 linear regulator The LT1521 has a rated output of 300mA maximum but the actual continuous current will vary with temperature and input voltage The regulated output doe
49. ramming using CodeWarrior Pro 6 for customers migrating from the CF1 If your PC is already setup for CWPro6 with CF1 tools you will need to skip the Install CWPalm step and manually remove the legacy CF1 components as follows You will still be able to program the CF1 but this will use newer tools compatible with both CF1 and CF2 that get installed in the Install PicoDEV step 1 Using Windows Explorer navigate to the CodeWarrior directory This should be something like C Program Files Metrowerks CodeWarrior 2 Remove the MotoCross Support folder 3 Move into the folder labeled Stationery Remove all of the folders that begin with CF1 or MotoCross M7 PERSISTOR 6 CF2 Getting Started Guide Install CodeWarrior Your first step toward CF2 development requires installing Metrowerks CodeWarrior for Palm OS The minimum requirements are 1 Windows 95 98 ME NT 2000 XP 2 Pentium recommended 80386 or 80486 3 64MB RAM 4 220 MB available hard disk space 5 CD ROM for installation CF2 development requires that you install CodeWarrior a 4 CodeWarrior Development Studio for Palm OS R Platform Profession 4 amp 4 metrowerks terresre Start mero lt Choose Destination Location Select folder where Setup will install files Setup will install CodeWarrior Development Studio for Palm OS R Platform Professional Edition v3 0 in the following folder To install to this folder click Next To install to a
50. re the CF2 is not offset in any direction from the connectors The CompactFlash card is not required for CF2 operation For our first hook up however install the card Install the primary communication cable between the RecipeCard and your PC Make sure you are using the primary communication jack and cable See What Are You Using above if you are unsure Launch MotoCross from the Persistor options under the Start Menu on your PC You should get a blank monitor window If you wish to use another monitor program set it to direct connection 9600 baud no parity 8 data bits and 1 stop bit Use a current limited power supply For this first sign on you need no more than 4 volts and your power supply should be limited to about 40mA Be sure to read the section of Warnings and Precautions Apply your current limited power to the power cable Black is ground and red is positive You should see the CF2 sign on in the monitor window something like this Persistor CF21M SN 03117 PicoDOS V3 10r1 PBM V2 27 C 1998 2004 Persistor Instruments Inc www persistor com If your CF2 does not sign on immediately remove the power and recheck your connections The PicoDOS prompt C gt is a standard DOS like drive identifier You should see the drive letter C as a part of the prompt when a CompactFlash card is installed When no CompactFlash card is present in the CF2 when power is applied PicoDOS displays a warning that many func
51. ree running counter QOM generates multiple output matches using a queue of offset times and pin responses in parameter RAM Serial Input Output Port SIOP This function uses two or three TPU channels to form a uni or bi directional synchronous serial port that can be used to communicate with a wide variety of devices Features such as baud rate and transfer size are user programmable Asynchronous Serial Interface TPU Function UART The UART function uses two TPU channels to provide a 3 wire RxD TxD and GND asynchronous serial interface All standard baud rates and parity checking can be selected The CPU interface to UART consists of a command register which defines the operation number of data bits baud rate parity a status register which gives information about the data register empty or full and errors framing and parity and a data register which holds the data to be transmitted or data that has been received M7 PERSISTOR 28 CF2 Getting Started Guide CF2 Dimensions 2 500 PARABRRRWWWWWNNNNNPRP RPP 1 850 o WUUHRONUURMONUUOUHEONUUOUHONULUR in c9900000000000000000000000 o OOOOOOOOOOOOOOOOOO0O0O000000 3 0 050 0 0507 SHARNOMARNOBARNOMARNO 1002 1002 eeeooeeeoeoeeeegoeoegoooS0G e 3004 O 5006 5006 e MB Ze o UR CM kA 7995 TOP 7005 9 10 9 10 ij TOP VIEW ASBis VIEW 28912 130014 130014 150016 i5 OO 16 170018 170018 e 19 OO20 19 OO 20 eo DATA BUS ADDRESS BUS olo osx N 4 19 QO 20 19 QQ 20 170
52. ries Don t put your files or projects in either the Persistor or Metrowerks directories The Persistor folder above right shows a more exploded view of its contents CodeWarrior is very fussy about the relative locations of its various components and the pre configured Persistor stationery makes similar location relative assumptions If things get moved around expect your compilations to start failing All of your work should be done in completely separate directories with whatever convention you find best For our projects we typically use C piisoft CF2 You can even have projects scattered over many directories or drives The main point is Don t put your files or projects in either the Persistor or Metrowerks directories They will be lost when you install updated versions of CodeWarrior or PicoDEV and this is likely to happen at some point The only things that should go into the Metrowerks directories are installations from Metrowerks You should also assume that files in the Metrowerks directory will get deleted during update installations CF2 Getting Started Guide Hookup and Sign On Introduction to RecipeCards and SandwichCards Common Persistor terms used in the CF2 documentation are RecipeCard and SandwichCard A RecipeCard is typically 3 X 5 and provides a socket set for mounting powering and communicating to the CF2 A SandwichCard is designed to be placed in the center of a sand
53. s not connect directly to any onboard components and is normally wired to VREG through an off board connection This output connects to a 10uF tantalum filter capacitor 9 VREG IN This is the regulated 3 3 volts to the CF2 electronics It is normally wired to VLIN but may be driven by any 3 3 volt supply VREG connects to an on board 10uF tantalum filter capacitor It also connects to the MAX6367 power supervisor which resets the CPU and switches over to VBBK when the input drops below 2 85 to 3 volts VCF This on board only power signal feeds the CompactFlash header through a 02 shunt It also has its own 10uF tantalum filter capacitor 14 VBBK IN This is the 3 volt backup battery supply input It feeds into the MAX6367 power supervisor which then supplies it to the MSP430 coprocessor and the onboard SRAM when the main voltage drops below 3 volts 5 VBAK OUT This onboard only power signal comes from the MAX6367 power supervisor and is the input to Vcc of the MSP430 and SRAM The voltage MAX6367 feeds this with VREG if VREG is over 3 volts or VBBK if VREG is less than 3 volts 7 RESET I O This open drain bidirectional signal resets the CF2 electronics This is pulled to VREG with a 1K resistor Both the MAX6367 power supervisor and the MSP430 coprocessor can assert this signal 12 SHDN OUT This is an output signal controlled by the power management circuitry Your peripheral circuitry can monitor this signal but only with i
54. s tenet ce RR ERAN HRAS cane teed ORTI EN ene DUREE AGEREM MEE KP E RO RR ec 8 acis ec EM 9 Hookup and Sign On qu ccceeeeeeeeeeee eee esse ee eee eee eee uuu uu eee 10 Introduction to RecipeCards and SandwichCards cccecceeeeee eee cence eee eee eee e eens teen ees 10 What Are You USING screen Y nad ina ba bata RR a ERBEN A I CERRO wae ER ER RRIER KNEE AEN AONNE RN E VREMES 10 HOOK iUo p bs 11 CF2 C Programming Tutorial eseeseseeseseseusuueauuuu nana u RR RR AR RR EAR RRSASRRRASRRSASRRRRRaRRuRA 12 OUI FIRST PLOJCCU tise PE 13 Renaming the Target i e iei te Re e exe Re ER nade ER KG Menten RD OPERE TG ER P E Ra ott cane 15 eem 16 What Happened oisi eves used e ia cvv cx v ex YA K RIVE AR V YVA oA sede VEZEYAR YER REA SEX EEEX 16 Beyond Standard C Libraries 25 2 e EHE ERR ceva geen RE RKXRRAREER A EXE ETUR RE OPERA cela anewland entender e 17 scu ERREUR E INU TLMTT 17 Subsystemis ceste uevek e EDEN SRL XVYARETRC OVER A REV RC YER V YYVRIKYVN COE NUEVYN EXTA IE EETPENN E YAT TYTRRCERTEE 18 Specifications em 21 Absolute Maximum Ratings ccccce cece ee emen sense es men sees enne 21 Physical Specifications icr secano EHE ERE E REA ERE e SERRA EAR EE DH RE E READER KENIA nea 21 Electrical Characteristics cerei teer ee aor d xt gnam rne eyed d iva axo vx ra daa x O PAY ad aia teen ve 21 Block Diagram and Signal Con
55. ter you ve installed CodeWarrior insert the PicoDEV CD On most PCs you will automatically be presented with the installation dialog On some others you will have to double click on the CD icon and setup exe to get things started Work your way through the setup screens accepting the default options until the installation is complete The suggested directory for the software to be installed is C Program Files Metrowerks CodeWarrior In order for everything to work properly we strongly suggest that you accept this path for the installation Welcome to the InstallShield Wizard for CF2 PicoDEV Tools Version 2 28 The InstallShield Wizard will install CF2 PicoDEV Tools Version 2 28 on your computer To continue click Next G Cancel The Programs selection in your Start Menu will now contain an entry named Persistor containing the PicoDEV documentation index and the application MotoCross for PicoDEV Setup the Source Trees MotoCross uses a powerful feature of CodeWarrior called Source Trees to steer projects to the proper directories for locating target components The first time you use CodeWarrior with MotoCross you must tell it where to look for the correct CFX build model by importing one of the pre configured XML Source Tree panels After that source tree operation becomes completely transparent 1 Start CodeWarrior from the Start Programs menu 2 Select Preferences from the main CodeWarrior IDE Edit
56. tions are disabled and reverts to the CF2 prompt like this CompactFlash card missing most features disabled CF25 Eject the CompactFlash card and type reset r e s e t and then the enter key You should see Persistor CF21M SN 03117 PicoDOS V3 10r1 PBM V2 27 C 1998 2004 Persistor Instruments Inc www persistor com CompactFlash card missing most features disabled CF2 gt Q PERSISTOR 11 CF2 Getting Started Guide From either prompt in PicoDOS you can type the VERsion command Type ver You should see system details like this CF 21M SN 03117 PicoDOS 3 10r1 BIOS 3 2101 PBM 24 27 SPV 5 20 P TPU P 01 TLE 1 03 Typing help lt will always give you a list of the available PicoDOS commands So will h or CF2 C Programming Tutorial Before we get started with the tutorial we should mention a few things First this tutorial assumes that you understand a little about the Metrowerks IDE There is no substitute for going through the CodeWarrior IDE Users Guide you can find this under the Help menu in CodeWarrior But if you want to get a jump start on developing just go through this next example where we will tell you exactly what to do However before you begin this tutorial we must first explain a few terms that you will see IDE This stands for Integrated Development Environment An IDE is a program that contains all of the various elements needed for software development The Metrowerks IDE provid
57. vel calls to configure the UART in a specific way to help meet your design needs We have attempted to cover all of the bases in this driver from normal operation to the lowest power modes System Clock and Wait State Management One of the easiest ways to conserve power in an embedded controller is to turn down the speed Power consumption in a processor varies almost linearly with speed and we provide functions for you to adjust the system clock anywhere from 160KHz to 16MHz and beyond Right there you can reduce your power consumption by an order of magnitude Furthermore these functions provide a great level of control regarding the wait states and access speeds of the various bus peripherals If you are interested in measuring and characterizing the performance of your CF2 you may wish to see our example program called Hurry Up and Wait This program provides a great example of how to change the system clock and the number of wait states used with each peripheral Utility Functions Lastly there are functions that don t seem to fit anywhere else These functions include a hexdump function that can be extremely useful during development and other useful but difficult to classify functions _ amp PERSISTOR 20 CF2 Getting Started Guide Specifications Absolute Maximum Ratings VBAT to GND VREG and VBBK to GND Digital Signals to GND Operation Temperature 20V 3 9V 0 3V to VREG 0 3V 40 C to 85 C Except for the L
58. wich between a RecipeCard and a CF2 Persistor Instruments publishes a design guide that allows third parties to manufacture RecipeCards and SandwichCards which are bus compatible and addressable by the CF2 If you are interested in producing cards that add functionality to the CF2 platform please contact Persistor for a SandwichCard Design Guide What Are You Using It is possible to order various CF2 starter kits which contain different RecipeCards each provided with specific information For your first hookup and run of the CF2 you will need to make sure you can identify the power cable and the primary communication cable As of this writing all Persistor brand RecipeCards use the same power cable The primary communication cable may vary however Here is a guide to make sure you have the correct primary communication cable Persistor RecipeCard Primary Comm Cable Secondary Comm Cable PRCPDAQ CAB COM RCP none R212 CAB COM RCP none R216AU CAB COM RCP CAB COM2 RCP MRCP CAB COM2 RCP CAB COM2 RCP The CAB COM RCP is a ribbon cable with a 2X5 square pin header on the RecipeCard end and a DB 9F connector on the PC end The CAB COM2 RCP has a 3 5mm stereo plug on the RecipeCard end M7 PERSISTOR 10 CF2 Getting Started Guide 1 Instruments Inc Hook Up Follow these steps to get your CF2 to sign on 1 2 3 4 5 6 7 Use a static safe work area Insert the CF2 into the sockets for it on the RecipeCard Make su

Download Pdf Manuals

image

Related Search

Related Contents

Aretes sur carriere  Manual de operación  Targus AWE05US Stand  WIFI-RS232 User Manual(v1.5)  A-LSQ-E Product User`s Manual Firmware 5.00 and up Last Update  Maplewood ConnectEd User Guide  Sonance 260 Home Theater System User Manual    グリルなべCQD-A300    

Copyright © All rights reserved.
Failed to retrieve file