Home
AN1778
Contents
1. 4 Click on OK and the PC will connect to the MPC555 Look for Started Successfully in the debug session dialogue box Choose Close If the MPC555 needs to be reconnected start the debug session again by selecting Debug from the File menu 5 From the Window drop down menu select the Command window There should be a window with a SingleStep gt prompt This interface will be used to write to and read registers on the microcontroller It is particularly useful because it can execute script files that can contain series of commands and programs that are run on the microcontroller The microcontroller can also return output to this window The Command window will be used to create and measure the example signals Use SDS debug to initialize the MPC555 microcontroller by writing to registers that set bus speeds and timers Write a file using a text editor and save this code so that it can be used again without re entering it all 1 Copy the following into a text editor References in brackets are to tables in the MPC555 User s Manual Any line that begins with is comment and does not have to be in the initialization file Set IMB to full speed can only be set back to the default half speed with a hard reset on power up Table 12 6 write 1 0x307 80 0x0 Turn on the time base for interrupt generation Table 6 16 write w 0x2fc200 0x0001 The slew rate and weak pull up pull down on so
2. into the clock prescaler The new value is loaded into the counter the next time the counter equals one or when disabled PREN bit 0 Divide ratios are as follows 0000 16 0001 No counter clock output 0010 2 12 15 PSL 0011 3 1110 14 1111 15 AN1778 MOTOROLA 15 Application Note PWM Period Register MPWMSMPERR PWM Pulse Register MPWMSMPULR Following the register description and the information in Table 2 set bit 1 high to enable the counter and write 0010 to bits 12 to 15 to set the divider to 2 for the fastest counter possible The faster the counter the faster the waveforms that can be produced All other bits should be 0 Converting these binary bits to hex use Decimal to Binary to Hexadecimal Conversion Table if necessary 0x8002 must be written to register 0x306816 MCPSMCR e Type this line into the SDS command window write w 0x306816 0x8002 Next the individual PWM channels must be programmed The MPWMSMPERR sets the number of divisions per period of the waveform for example resolution of a single period Special consideration must be taken when choosing the resolution of the wave to be produced because it involves a compromise The resolution of the wave is inversely proportional to the maximum frequency that can be produced Higher resolution requires more cycles of the reference clock per period and therefore a lower overall frequency See PWM Reference Clock The contents of th
3. 100 ns per count e Type this line to set up the MDASM counter write w 0x306036 Ox0eff To ensure that the counter starts properly reset it To reset the counter load all Os into the modulus latch register This is a read write register containing the 16 bit value of the counter used by the MDASM e Type this line to reset the MDASM counter write w 0x306032 0x0000 With the clock now running the MDASM can be set up to detect the waveform periods and reference them to this counter AN1778 22 MOTOROLA Application Note Using the MPC555 as a Frequency Counter Configuring The MDASM must be initialized to the kind of function that the user MDASM Channels wants it to perform There are two waveforms of 5 MHz and 2 5 MHz to measure The user will measure the periods to calculate their frequencies and compare Similar to the pulse width modulator in the last example each MDASM channel has its own configuration registers In this case only one channel is used Each MDASM channel is configured and read using four registers e Data A register Contains a value for the counter when the last event occurred e Data B register Can contain the previous value of Data A or an independent measurement e Duplicate status control register Reserved Do not use e Status control register Contains a read only bit reflecting the status of the MDASM pin as well as read write bits related to its control and configur
4. Enable PWM signal generation The EN bit defines whether the MPWMSM generates 5 EN a PWM signal or is used as an I O channel 0 PWM generation is disabled pin can be used as I O 1 PWM generation is enabled pin is output only 6 7 Reserved Clock prescaler This 8 bit read write register stores the twos complement of the 8 15 CP desired modulus value for loading into the built in 8 bit clock prescaler The value loaded defines the divide ratio for the signal that clocks the MPWMSM period counter Table 4 gives the clock divide ratio according to the CP values AN1778 18 MOTOROLA Application Note Using the MPC555 as a Signal Generator Bits 8 through 15 of this register determine the clock divider to be used Table 4 describes the use of these four bits Table 4 MMCSMCR CP and MPWMSMSCR CP Values Prescaler Value CP in Hex MIOS Prescaler Clock Divided By FF FE 2 FD 3 FC 4 FB 5 6 7 8 FA F9 02 254 2 8 2 01 255 2 8 1 00 256 2 8 Now generate a 5 MHz signal on channel 0 and a 2 5 MHz signal on channel 2 If the intermodule bus is operating at 20 MHz and that is divided by 2 to get a MIOS counter at 10 MHz then set channel 0 to divide the MIOS counter by 1 remembering that it takes two MIOS counts per PWM period Likewise to get 2 5 MHz on channel 2 divide the MIOS counter by 2 e Type this line for channel 0 5 MHz write w 0x306006 0x54ff e And this o
5. KKK KK KKK KKK KKK K KKK KKK Set up the SRAM chip select and option register brl amp orl single read 4M address space 0 wait states EVB555 uses 1M for external SRAM 1M for PRU 1M for optional HCE board 1M for optional ETK SRAM see table 10 7 amp 10 8 of the MPC555 User Manual base address is 0x00C00000 write 1 O0x2fcl0c Oxffc00000 write l1 0x2fc108 0x00C00003 These three switches can be used with the write and read commands e b byte read write e w 16 bit half word e 32 bit word 5 Create a new short cut for the SDS SingleStep program obdmp58 exe and use the sds73 mpc555 directory as the Start In directory under the short cut tab This completes the setup of the SDS software for the MPC555 EVB Once the software is installed the user is ready to attach the BDM interface Supplied with the SDS SingleStep on chip debugger software will be a parallel to serial interface specifically for the MPC5xx series of microcontrollers This interface is necessary to allow your PC to communicate via its parallel port to the BDM port on the EVB Refer to Figure 1 and Figure 2 when following these steps 1 To the parallel port on the PC connect a cable with a male 25 pin D SUB connector on the other end 2 To the male end attach the Macraigor BDM interface ensuring that the D SUB connector is secured firmly MOTOROLA Application Note 3 Attach the ribbon cable at the opposite end of the int
6. MDASM Bus Counter the MMCSM was programmed to run at 10 MHz or to count at 100 ns intervals The subtraction of register B from register A will be the number of MMCSM counts during one complete period of the input waveform e Type this line into the SDS command window read 1 0x306058 Using the I command ensures that the contents of the two MDASM data registers are read at once so that nothing is miscounted due to the time it takes to read the data out of memory on two successive reads SDS will return eight hexadecimal characters in one longword using the snapshot here SingleStep gt read 1 0x306058 0x306058 00306058 ABCBABC9 00028002 The user s values may be different from these since these are values read from a free running counter The longword ABCBABC 9 contains the contents of the two data registers DATA A contains ABCB with ABC9 in DATA B Subtracting register B from register A B 9 in hex the answer is 2 To calculate the frequency multiply by 100 ns and take the reciprocal to get 5 MHz AN1778 26 MOTOROLA Application Note Reference Information e Move the jumper wire to connect J1 P1 pin 36 to J2 P2 pin 21 and read the contents of the register again as described earlier The difference between the data registers should now be 4 MHz or 2 5 MHz Obtaining the values from the data registers of the MDASM completes the exercises in this application note In these exercises communication h
7. MIOS1 is the implementation of the MIOS architecture used in the MPC555 The MIOS1 is composed of these submodules e One MIOS bus interface submodule MBISM e One MIOS counter prescaler submodule MCPSM e Two MIOS modulus counter submodules MMCSM e 10 MIOS double action submodules MDASM e Eight MIOS pulse width modulation submodules MPWMSM e One MIOS 16 bit parallel port I O submodule MPIOSM e Two MIOS interrupt request submodules MIRSM The evaluation board for the MPC555 is designed to allow the user to attach logic analyzers and debugging equipment to the MPC555 The EVB also augments the MPC555 with additional external memory and FLASH as well as port replication It makes the address and data buses available to the developer as well The evaluation board can be connected to other boards by way of its modular active probe interconnect MAPI connector This MAPI specification is a standard expansion card connector containing address and data bus lines as well as other signals and I O The EVB implements a MAPI 400 specification MOTOROLA Application Note Simplified EVB Figure 1 illustrates how the evaluation board is laid out Layout SW102 A pom B 0 Ein SW200 A POWER B CLAMP MODCK FLASH SRAM SW101 STANDBY MPC555 YELLOW PAL SRAM POWER ON POWER GREEN 3 703 RESET SW305 SW304 SW303 SW302 702 RESET CONFIGURATION WORD VPP5 ON 1 VPP12 SW100 0 7 8 15
8. POL EN RESERVED cP RESET s 0 0 0 0 0 0 0 UU wu Uv UU w d Figure 6 MPWMSW Status Control Register MPWMSMSCR 0x30 6006 AN1778 MOTOROLA 17 Application Note Table 3 MPWMSMSCR Bit Settings Bit s Name Description Pin input status The PIN bit reflects the state present on the MPWMSM pin The 0 PIN software can thus monitor the signal on the pin The PIN bit is a read only bit Writing to the PIN bit has no effect Data direction register The DDR bit indicates the direction for the pin when the PWM function is not used disable mode Note that when the PWM function is used the 1 DDR DDR bit has no effect 0 Pin is an input 1 Pin is an output Freeze enable This active high read write control bit enables the MPWMSM to 2 FREN recognize the freeze signal on the MIOB 0 MPWMSM is not frozen even if the MIOB freeze line is active 1 MPWMSM is frozen if the MIOB freeze line is active Transparent mode The TRSP bit indicates that the MPWMSM double buffers are transparent when the software writes to either the MPWMA or MPWMB1 register 3 TRSP the value written is immediately transferred to respectively the counter or register MPWMB2 0 Transparent mode deactivated 1 Transparent mode activated Output polarity control The POL bit works in conjunction with the EN bit and controls 4 POL whether the MPWMSM drives the pin with the true or the inverted value of the output flip flop
9. Selects Counter Bus Bits Resolution Ignored MDASM Mode of Operation DIS Disabled 0001 0010 1 IPWM Input pulse width measurement IPM Input period measurement IC Input capture 0011 0100 OCB Output compare flag on B compare OCAB Output compare flag on A and B compare Reserved 0110 0111 1000 1001 6 16 0101 16 6 1 Reserved OPWM Output pulse width modulation OPWM Output pulse width modulation 1011 1010 1100 13 OPWM Output pulse width modulation OPWM Output pulse width modulation OPWM Output pulse width modulation 1110 1101 1111 11 OPWM Output pulse width modulation OPWM Output pulse width modulation OPWM Output pulse width modulation AN1778 MOTOROLA 25 Application Note Obtaining Measurements in the MDASM Data Register NOTE e Load this line into the MDASM status control register MDASMSCR write w 0x30605E 0x0002 After capturing the data for one of the PWM channels the value from the register can be read and the period and frequency of the wave can be calculated When the MDASM detects a rising edge it will write the value of the MMCSM counter to the DATA A register for the MDASM channel Upon detection of the next rising edge one period later the MDASM will move the first counter value into DATA B register and write the new value to register A In Setting Up the
10. member of Motorola s MPC500 PowerPC RISC reduced instruction set computer Family of microcontrollers Its features include PowerPC core with a floating point unit 26 Kbytes of fast RAM and 6 Kbytes of TPU time processor unit microcode RAM 448 Kbytes of FLASH EEPROM with 5 volt programming 5 volt input output I O system Dual CAN controller area network 2 0B controller modules TouCAN 50 channel timer system dual time processor units TPU3 and modular I O input output system MIOS1 32 analog inputs dual queued analog to digital A D converters QADC64 Manufactured on Motorola s submicron HCMOS CDR1 process technology Packaged in a 272 pin plastic ball grid array Operates at 40 MHz from 40 C to 125 C with dual supply 3 3 volts and 5 volts Dual TPU modules PowerPC is a registered trademark of International Business Machines Corporation TouCAN is a trademark of Motorola Inc in Japan AN1778 MOTOROLA MIOS MPC 555 EVB Overview AN1778 Application Note Introduction The examples outlined in this application note are performed using the modular input output subsystem MIOS The MIOS consists of a library of flexible I O and timer functions including I O port counters input capture output compare pulse and period measurement PWM and angle degree clock Because it is composed of submodules the MIOS is easily configurable for different kinds of applications
11. programming protect 5 NC 6 ON External bus EXTBUS 0 7 ON Reset configuration enabled 8 ON BDM enabled power up in BDM SW101 B BDM VFLS 0 1 SW102 A BDM mode SW200 0101 sets clock speed to 4 MHZ in limp mode SW302 5 reset configuration word MOTOROLA Application Note NOTE Bit numbers are marked on the PC board NOT on the switch up is ON 1 Table 1 Reset Configuration Word SW305 SW304 SW303 SW302 0 7 8 31 00 10 00 00 01 00 00 00 00 00 10 00 00 00 00 00 SW702 Push button hard reset HRESET SW703 ON STBY ON All power supplies are on STBY VppSRAM and KAPWR are left on Powering on the DC power supply should be capable of 12 volts 7 36 volts and 1A To Evaluation Board turn it on 1 Connect the power leads to the EVB using the two clamp connectors shown in Figure 1 in the top right hand corner of the EVB Be sure to observe voltage polarity specifications 2 Turn on the power supply to 12 volts Make sure the yellow standby LED light emitting diode is lit 3 To turn on the evaluation board and start the microcontroller throw the toggle switch SW702 next to the green LED Note that the green LED should light up after the switch is thrown 4 The MPC555 defaults to 20 MHz on the MPC555 EVB DescriptionofLEDs The evaluation board has four LEDs mounted on it two of them red and on the EVB one each green and yellow See the part numbers on the boa
12. 16 23 24 31 Figure 1 Evaluation Board Layout Required To perform the examples included in this application note this Equipment equipment is needed e MPC555 evaluation board with MPC555 microcontroller e 12 volt power supply capable of 1A 7 to 36 volt allowable voltage input range e IBM compatible PC with Software Development Systems SingleStep on chip debugger BDM 5xx for PowerPC MPC5xx software e Macraigor parallel to BDM interface supplied with SDS s debug software AN1778 4 MOTOROLA NOTE Application Note Set Up and Initialization of the Evaluation Board e Oscilloscope e Interconnect jumper to connect two pins This document assumes that the reader is using the SDS SingleStep debug software tool If another software tool is used substitute read and write for the appropriate commands in the examples Set Up and Initialization of the Evaluation Board Initial Switch Positions AN1778 To set up the board for use in background debug mode BDM ensure that all the switches and jumpers are in their correct positions before turning on the board Use the simplified 555 EVB circuit diagram in Figure 1 to find the appropriate switch locations SW100 1 OFF External Tl FLASH program 12 V voltage 0 V FLASH programming is disabled 2 ON Vpp 12 V auto software switchable OFF MPC555 Vpp 5 volts disabled for programming MPC555 internal FLASH w 4 OFF MPC555 can be programmed
13. ASM AN1778 20 MOTOROLA Configuring MPC555 to Measure Waveform Periods Setting Up the MDASM Bus Counter MSB 0 1 2 3 Application Note Using the MPC555 as a Frequency Counter The MDASM channel to be used needs to be configured to measure the period of the signals The number of counts that occurred during the period of the test signal will be read out of the register This will allow the user to calculate the period of the waveform The MPC555 MIOS has a modulus counter submodule MMCSM which can be used as a free running counter to which events can be referenced as they are detected It can be used for complex counting and timing functions The MDASM and the MMCSM work together to measure inputted waveforms For this example the counter will be set to be free running and to roll over automatically when it reaches its maximum value The counter is controlled by the MMCSM status control register shown in Figure 7 with its bit assignments LSB 15 PINC PINL FREN EDGN EDGP CLS z CP RESET 0 0 Figure 7 MMCSM Status Control Register MMCSMSCR 0x30 6036 and 0x30 60B6 AN1778 MOTOROLA 21 Application Note The last four bits of this register are the clock prescaler as shown in Table 6 Table 6 MMCSMSCR Bit Settings Bit s Name Description 0 PINC Clock input pin status This read only status bit reflects the logic state of the clock
14. H and SRAM on the EVB 1 Create a directory called MPc555 under the SDS73 directory 2 Using a text editor create a file containing the following text and name the file sstep ini This sstep ini file is provided for supporting the Motorola MPC555 on the MPC555 EVB for BDM5xx Set JTAG speed for top performance set jtag_speed 1 _reset alias requirements Initialize PC Stack and LR Set MSR RI so that Hardware Breakpoints work Set MSR FP floating point available MOTOROLA Application Note NOTE PC amp START 0x02002 alias _reset SP amp STKTOP LR 0x0 MSR SMSR Set up the board configuration alias _config source cmdpath mpc555 m555 dbg The last section of this file instructs SDS SingleStep to use the file m555 dbg_ to set up the MPC555 EVB with the correct chip selects 3 Save the text file sstep ini inthe mpc555 directory created earlier 4 Next use the following text to create the m555 dbg file and save it in the mpc555 directory also This initialization code sets up several options that will not be used in this application note They are listed here for completeness and for future reference This code is only applicable to the MPC555 EVB A complete list is given in Initialization Code for MPC555 on the MPC555 EVB Any line starting with the pound sign is comment and does not have to be included in the file This file sets up a basic b
15. I ring MAPI 400 100 The PWM channels are on the J1 P1 connector This example uses channels PWM 0 and PWM 2 to allow space between the contacts so that probe tips can be attached without conflict PWM 0 is on pin 30 and PWM 2 is on pin 36 of J1 P1 1 Attach oscilloscope channel 1 to pin 30 of connector J1 P1 2 Attach oscilloscope channel 2 to pin 36 of connector J1 P1 AN1778 12 MOTOROLA Application Note Using the MPC555 as a Signal Generator PROBES 2 PIN 36 F 1 PIN 30 TA a P Figure 3 Underside of MPC555 EVB Programming The PWM can be initialized by setting up the appropriate registers The the PWM MPC555 has eight channels that can be used as modulators Two are used here channels 0 and 2 The PWM channels are controlled by one system register and four registers that are unique to each channel PWM Reference Figure 4 shows how the MPC555 references events in the PWM to the Clock rest of the system AN1778 MOTOROLA 13 Application Note NOTE SYS CLOCK INTERMODULE BUS 20 MHZ DEFAULT SET IMB CLOCK USIU HSPEED 20 MHZ Fsys DEFAULT 1 2 Fsys MIOS COUNTER CLK DIVIDER 2 TO 16 10 MHZ MCPSM i PWM CHANNEL DIVIDER 1 TO 256 MAX IS 1 2 OF MIOS COUNTER 2 COUNTS PERIOD Figure 4 PWM Clock Arrangement The eight pulse width modulators are part of the MIOS submodule on the MPC555 To use the PWM channels the MIOS counter must be sta
16. OUCHTONE 1 602 244 6609 US and Canada ONLY 1 800 774 1848 HOME PAGE http motorola com sps Mfax is a trademark of Motorola Inc Motorola Inc 1998 AN MOTOROLA AN1778 D
17. Order this document by AN1778 D Motorola Semiconductor Application Note AN1778 Using the MIOS on the MPC 555 Evaluation Board By Andrew Lillie and Randy Dees PowerTrain Systems Division Austin Texas Introduction Motorola Inc 1998 The information in this application note is intended to help the microcontroller developer quickly set up the MPC555 evaluation board EVB which was developed jointly by Motorola Inc and ETAS Inc An overview of the MPC555 microcontroller and the MPC555 evaluation board are discussed including an explanation of the evaluation board s major components Further information on the MPC555 can be found in the MPC555 User s Manual at http Awww mcu motsps com lit mpc html It is assumed that the developer will use the SingleStep debug software tool designed by Software Development Systems Inc SDS to communicate with the microcontroller through the background debug mode BDM port Licensing of the software is handled by SDS The major components of this application note are e MPC555 overview e MPC555 evaluation board overview SingleStep is a trademark of Software Development Systems Inc AA MOTOROLA AN1778 Application Note Setting up and initializing the evaluation board Producing two signals using the MIOS pulse width modulator PWM Measuring these two signals using the MIOS dual action submodule Code file information MPC 555 Features The MPC555 is a
18. as been established between the software tool and the evaluation board The user also has verified that parts of the MPC555 are operating correctly Reference Information Decimal to Binary to Hexadecimal Table 9 Hex Conversion Conversion Table Decimal Hexadecimal Binary 0 0 0000 1 1 0001 2 2 0010 3 3 0011 4 4 0100 5 5 0101 6 6 0110 7 7 0111 8 8 1000 9 9 1001 10 A 1010 11 B 1011 12 C 1100 13 D 1101 14 E 1110 15 F 1111 AN1778 MOTOROLA 27 Application Note Initialization Code for MPC 555 on the MPC 555 EVB sstep ini file in the sds73 mpc555 directory This sstep ini file is provided for supporting the Motorola MPC555 on the MPC555 EVB for BDM5xx Set JTAG speed for top performance set jtag_speed 1 _reset alias requirements Initialize PC Stack and LR Set MSR RI so that Hardware Breakpoints work Set MSR FP floating point available alias _reset PC amp START SP amp STKTOP LR 0x0 MSR SMSR 0x02002 Set up the board configuration alias _config source cmdpath mpc555 m555 dbg m555 dbg file in the sds73 mpc555 directory This file sets up a basic board initialization of Motorola ETAS EVB555 evaluation board It can also initialize the MPC555 MSIL MPC555FADS board with changes noted below Version 1 1 Randy Dees September 7 1998 references to the MPC555 User s Manual refe
19. ation The MDASM status and control register address 0x30605E will be used to initialize MDASM channel 11 Figure 8 and Table 7 define the bits in this register MSB LSB 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 RESET 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 Figure 8 MDASM Status Control Register MDASMSCR 0x30 605E AN1778 MOTOROLA 23 Application Note Table 7 MDASMSCR Bit Settings Bit s Name Description Pin input status The pin input status bit reflects the status of the corresponding pin Wired OR In the DIS IPWM IPM and IC modes the WOR bit is not used reading this bit returns the value that was previously written In the OCB OCAB and OPWM modes the WOR bit selects whether the output buffer is configured for open drain or totem pole operation 0 Output buffer is totem pole 1 Output buffer is open drain Freeze enable This active high read write control bit enables the MDASM to recognize the MIOB freeze signal 0 The MDASNM is not frozen even if the MIOB freeze line is active 1 The MDASM is frozen if the MIOB freeze line is active 0 Polarity In DIS mode this bit is not used reading it returns the last value written In IPWM mode this bit is used to select the capture edge sensitivity of channels A and B 0 Channel A captures on a rising edge Channel B captures on a falling edge 1 Channel A captures on a falling edge Channel B captures on a rising edge In IPM and IC modes t
20. dth write w 0x306012 0x0001 PWM 2 Status Control Register write w 0x306016 0x54fe MDASM Setup Counter Initialization write w 0x306036 Ox0eff Reset counter latches write w 0x306032 0x0000 Configure MDASM 11 write w 0x30605e 0x0002 Reading MDASM 1 register A and B read 1 0x306058 How to Contact Software Development Systems Inc can be contacted at Software 333 E Butterfield Road Suite 700 Lombard Ill 60148 Development 1 800 448 7733 sales sdsi com support sdsi com Systems AN1778 MOTOROLA 31 Application Note Motorola reserves the right to make changes without further notice to any products herein Motorola makes no warranty representation or guarantee regarding the suitability of its products for any particular purpose nor does Motorola assume any liability arising out of the application or use of any product or circuit and specifically disclaims any and all liability including without limitation consequential or incidental damages Typical parameters which may be provided in Motorola data sheets and or specifications can and do vary in different applications and actual performance may vary over time All operating parameters including Typicals must be validated for each customer application by customer s technical experts Motorola does not convey any license under its patent rights nor the rights of others Motorola products are not designed intended or authorized for use as comp
21. e period register contain the binary value corresponding to the number of MIOS clocks allocated to the period of the waveform PWM channels 0 and 2 will be programmed with the same period resolution e Type this line for channel 0 write w 0x306000 0x0002 e And the following for channel 2 write w 0x306010 0x0002 This register sets the number in binary of divisions from PWM Period Register MPWMSMPERR that are high This means that the ratio of the pulse register to the period register determines the duty cycle of the produced signal The value in the pulse register must be less than the value contained in the period register AN1778 16 MOTOROLA Application Note Using the MPC555 as a Signal Generator e Type this line for channel 0 for a 50 percent duty cycle write w 0x306002 0x0001 e Do the same for channel 2 write w 0x306012 0x0001 PWM The last eight bits of this register MPWMSMSCR set the clock divider Status Control for the particular PWM channel This divider operates on the MIOS clock Register whose frequency was set in PWM Reference Clock MPWMSMSCR Each PWM channel can use a divider to slow the MIOS counter clock NOTE Remember that this will also affect the period and pulse width registers Figure 6 shows the bit assignments for this register and Table 3 describes the assignments me y 9 a 4 amp amp amp amp tH ht wp a 0 15 PIN DDR FREN TRSP
22. erating at 20 MHz The next step is to set up the MIOS counter The MIOS counter prescaler submodule MCPSM is controlled by the MCPSM status control register The information in Figure 5 explains the bit assignments for the status control register amp 2 8 Se amp 7 8 amp th FP eH SF PREN FREN RESERVED PSL RESET 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 Figure 5 MCPSM Status Control Register MCPSMSCRT 0x30 6816 The bit settings are explained in Table 2 Table 2 MCPSMSCR Bit Settings Bit s Name Description Prescaler enable This active high read write control bit enables the MCPSM counter The 0 PREN PREN bit is cleared by reset 0 MCPSM counter disabled 1 MCPSM counter enabled Freeze enable When set this active high read write control bit makes possible a freeze of the MCPSM counter if the MIOB freeze line is activated Note that this line is active when the MIOS1MCR STOP bit is set or when the MIOS1MCR FREN bit and the IMB3 FREEZE line are set 1 FREN When the MCPSM is frozen it stops counting Then when the FREN bit is reset or when the freeze condition on the MIOB is negated the counter restarts from where it was before being frozen The FREN bit is cleared by reset 0 MCPSM counter not frozen 1 Selectively stops MIOS1 operation when the FREEZE signal appears on the IMB3 2 11 Reserved Clock prescaler This 4 bit read write data register stores the modulus value for loading
23. erface to the evaluation board using the 10 pin 2 row header Berg BDM connector in the top right corner of the board see Figure 1 and Figure 2 NOTE The connector at the end of the ribbon cable is keyed so that it can only fit correctly but it must be pushed down all the way for an adequate connection 4 With the PC connected to the interface and the interface attached to the evaluation board connect the power transformer to an AC outlet RIBBON CABLE gt PARALLEL MTT il ALALLE ha oe TUTTI TLET TTT UTE TH Figure 2 BDM Interface Connection NOTE Remember to connect the interface box power supply and make sure that the ribbon cable connector is correctly aligned with pin 1 on the left Initializing the Hardware With the software installed and the BDM interface sometimes called a wiggler connected and powered turn on the MPC555 evaluation board and make sure the green LED is lit Starting SDS Follow these steps in order to start the SingleStep debug SingleStep Debug 1 Start the SDS SingleStep on chip software A tabbed dialogue will be shown AN1778 10 MOTOROLA Initializing the EVB AN1778 Application Note Initializing the Hardware 2 Under the File tab select the Debug without a file radio button Choose the Processor tab and select MPC555 from the drop down list There is no co processor
24. he EDPOL bit is used to select the input capture edge sensitivity of channel A 0 Channel A captures on a rising edge 1 Channel A captures on a falling edge In OCB OCAB and OPWM modes the EDPOL bit is used to select the voltage level on the output pin 0 The output flip flop logic level appears on the output pin A compare on channel A sets the output pin a compare on channel B resets the output pin 1 The complement of the output flip flop logic level appears on the output pin A compare on channel A resets output pin a compare on channel B sets output pin Force A In OCB OCAB and OPWM modes the FORCA bit allows the software to force the output flip flop to behave as if a successful comparison had occurred on channel A except that the FLAG line is not activated Writing a 1 to FORCA sets the output flip flop writing a O to it has no effect In DIS IPWM IPM amp IC modes the FORCA bit is not used writing to it has no effect FORCA is cleared by reset and is always read as 0 Writing a 1 to both FORCA and FORCB simultaneously resets the output flip flop Force B In OCB OCAB and OPWM modes the FORCB bit allows the software to force the output flip flop to behave as if a successful comparison had occurred on channel B except that the FLAG line is not activated Writing a 1 to FORCB resets the output flip flop writing a O to it has no effect In DIS IPWM IPM amp IC modes the FORCB bit is not used writing t
25. input pin P PINL Modulus load input pin status This read only status bit reflects the logic state of the modulus load pin Freeze enable This active high read write control bit enables the MMCSM to recognize the 2 FREN MIOB freeze signal Modulus load falling edge rising edge sensitivity These active high read write control bits set falling edge and rising edge sensitivity respectively 3 4 EDGN _ 00 Disabled EDGP 01 MMCSMCNT load on rising edges 10 MMCSMCNT load on falling edges 11 MMCSMCNT load on rising and falling edges Clock select These read write control bits select the clock source for the modulus counter 00 Disabled 5 6 CLS 01 Falling edge of pin 10 Rising edge of pin 11 MMCSM clock prescaler 7 Clock prescaler This 8 bit read write data register stores the twos complement of the desired modulus value for loading into the built in 8 bit clock prescaler The new value is 8 15 CP loaded into the prescaler counter when the next counter overflow occurs or when the CLS bits are set to select the clock prescaler as the clock source Table 4 gives the clock divide ratio according to the CP values Set up the MDASM to count on rising edges bits 3 4 and to use the MMCSM clock The clock prescaler is governed by the same values as the PWM prescaler bits listed in Table 4 in the PWM section Set it up to follow the MMCSM clock with a prescaler division of 1 This means that the counter will run at 10 MHz or
26. me pins can be adjusted Here we set the MIOS pins for a fast slew rate default is 200 ns Table 2 3 write 1 0x2fc03c 0x13000000 2 Save this fileas init dbg ina suitable directory 3 To load and execute the file just created type the following in the Command window and hit return SingleStep gt C yourdirectory init dbg This file will prepare the MPC555 to generate and measure signals MOTOROLA 11 Application Note Using the MPC555 as a Signal Generator Attaching the Oscilloscope One of the MIOS features introduced in the MIOS entry here is the pulse width modulator PWM The PWM can be used to generate waves of varying frequencies and duty cycles The first example in this application note explains how to generate signals with frequencies of 5 MHz and 2 5 MHz and an oscilloscope is used to look at the signals and measure their frequencies Attaching two oscilloscope probes to the PWM channels might be the hardest part of this exercise The easiest way to get to the PWM channels is through the MAPI ring connector on the underside of the evaluation board see Figure 3 Although the signals are present on the board s surface high density Mictor connectors are needed that would not be appropriate for this application On the underside of the evaluation board are five brown 100 pin Robinson Nugent connectors labelled J1 P1 through J4 P4 The fifth connector is an extension of the MAP
27. ne for channel 2 2 5 MHz write w 0x306016 0x54fe Other frequencies also can be produced using Table 5 Remember these values only apply for the simple 50 percent duty cycle waveforms that have been created thus far with the MIOS counter at 10 MHz AN1778 MOTOROLA 19 Application Note Table 5 Sample Frequency Settings Hex Bits Frequency OF 20 kHz FO 305 kHz F8 610 kHz FA 833 kHz FB 1 MHz FC 1 25 MHz FD 1 66 MHz FE 2 5 MHz FF 5 MHz Using the MPC 555 as a Frequency Counter Connecting PWM Channels to MDASM Channels NOTE As part of its modular input output subsystem MIOS the MPC555 has a dual action submodule MDASM The MDASM can make pulse width and period measurements Also it can be used to capture waveforms and generate single and continuous pulses We will use the MDASM to measure the period of the two waveforms that were generated earlier using the PWM To measure the output of the PWMs with the MDASM a signal must be sent from the PWM channel in this case channel 0 or channel 2 to the MDASM channel 11 Here the frequency of PWM channel 0 is measured The PWM channels are pins 30 and 36 on J1 P1 on the MAPI connector The MDASM channel is located on pin 21 of MAPI connector J2 P2 e Using a jumper wire connect J1 P1 pin 30 to J2 P2 pin 21 See Figure 3 for MAPI pin locations It is a good idea to keep the oscilloscope connected to be sure that the signal is getting to the MD
28. o it has no effect FORCEB is cleared by reset and is always read as 0 Writing a 1 to both FORCA and FORCB simultaneously resets the output flip flop Reserved Bus select These bits are used to select which of the four possible 16 bit counter buses passing nearby is used by the MDASM 0 Mode select These four mode select bits select the mode of operation of the MDASM To avoid spurious interrupts it is recommended that MDASM interrupts are disabled before changing the operating mode It is also imperative to go through disable mode before changing the operating mode See Table 8 for details AN1778 24 MOTOROLA MDASM Control Register Bits 0000 Application Note Using the MPC555 as a Frequency Counter In programming the MDASM with register Ox30605E notice that bit 0 in Table 7 is a read only status pin that toggles according to the status of the incoming waveform For input period measurement Bits 1 3 5 6 7 8 and 11 are not used Write zeroes to these bits Because the MDASM should not freeze in BDM bit 2 will be left as 0 Bit 4 will be 0 to trigger the MDASM counter on the rising edge Bits 9 and 10 select which 16 bit counter bus the MDASM will use Write 00 to these two bits To perform frequency measurement the input period MOD 0010 in Table 8 must be measured Then convert this time measurement into frequency to compare with what is being sent to the MDASM Table 8 MDASM Mode
29. oard initialization of MPC555 EVB Motorola ETAS evaluation board From Version 1 1 Randy Dees September 7 1998 References to the MPC555 User s Manual reference the September 2 1998 version of the UM KKKKKKKKKKKKKKK KKEKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKK SYPCR turn off the software watchdog timer bus monitor is on in BDM mode so set time out this register is write once after power on reset see table 6 13 of the MPC555 User Manual write 1 0x2fc004 0x0000ff00 enable the following line and disable the previous line to enable the software watchdog with a long time out see table 6 13 of the MPC555 User Manual write 1 0x2fc004 OxFFFFFFO3 KKKKKKKKKKKKKKK KKEKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKK BRO ORO Set up the TI Flash chip select and options brO amp or0 single read access 32 bit access 1M block 5 wait states see table 10 7 amp 10 8 of the MPC555 User Manual base address is 0x00800000 write 1 0x2fc104 Oxf 00050 write 1 0x2fc100 0x00800003 AN1778 MOTOROLA NOTE Connecting the EVB to a PC AN1778 Application Note Installing the Software Tools and Interface EK KK ee KKK KK ee TI Flash KKK KKK KKK KKK KKK KK KKK KKK KKK KKK KEKE Initialize the TI Flash DCR register set up extended pin set 3 blocks and place device into normal read mode write 1 0x800000 0x96 write 1 0x800000 Ox5b write 1 0x800000 OxFF KKEKKKKKKEKKKKKKK BR1 OR1 KKK KKK KKK KKK
30. onents in systems intended for surgical implant into the body or other applications intended to support or sustain life or for any other application in which the failure of the Motorola product could create a situation where personal injury or death may occur Should Buyer purchase or use Motorola products for any such unintended or unauthorized application Buyer shall indemnify and hold Motorola and its officers employees subsidiaries affiliates and distributors harmless against all claims costs damages and expenses and reasonable attorney fees arising out of directly or indirectly any claim of personal injury or death associated with such unintended or unauthorized use even if such claim alleges that Motorola was negligent regarding the design or manufacture of the part Motorola and GA are registered trademarks of Motorola Inc Motorola Inc is an Equal Opportunity Affirmative Action Employer How to reach us USA EUROPE Locations Not Listed Motorola Literature Distribution P O Box 5405 Denver Colorado 80217 1 800 441 2447 or 1 303 675 2140 Customer Focus Center 1 800 521 6274 JAPAN Nippon Motorola Ltd SPD Strategic Planning Office 141 4 32 1 Nishi Gotanda Shinagawa ku Tokyo Japan 03 5487 8488 ASIA PACIFIC Motorola Semiconductors H K Ltd 8B Tai Ping Industrial Park 51 Ting Kok Road Tai Po N T Hong Kong 852 26629298 Mfax Motorola Fax Back System RMFAX0 email sps mot com http sps motorola com mfax T
31. rd in brackets They are 1 Red LD701 Vpp 12 volts available for FLASH programming 2 Red LD700 Vpp 5 volts available for FLASH programming 3 Green LD702 Evaluation board is on and MPC 555 is out of RESET 4 Yellow LD703 DC power is available and the board is in standby mode AN1778 6 MOTOROLA Application Note Installing the Software Tools and Interface Installing the Software Tools and Interface NOTE Installing SDS Debug ona PC AN1778 These instructions describe the installation and use of SDS debug version 7 3 beta or later using a Macraigor wiggler interface Refer to the instructions of the particular tool that is being used For the MPC555 SingleStep version 7 3 beta or above of the software is required A license from SDS is required to run this software This will either be provided on a disk or by email Create the License dat from the email and keep it handy for the installation To install 1 Insert the SDS SingleStep debug CD ROM into the CD drive 2 Choose RUN from the File or Start menu 3 Type D setup and press lt RETURN gt where D is the CD drive 4 Follow the installation instructions and insert the disk containing the license dat file when prompted Select the PowerPC MPC 5xx set of tools Next create and install the configuration files for the MPC555 evaluation board These commands will set up some aliases and chip selects for the external FLAS
32. rence the September 2 1998 version of the UM KKKKKKKKKKKKKKK SYPCR KKEKKKKK KKK KKK KKK KKK KKK KKK KKK KKK KKK turn off the software watchdog timer bus monitor is on in BDM mode so set time out this register is write once after power on reset see table 6 13 of the MPC555 User Manual write 1 0x2fc004 0x0000ff00 enable the following line and disable the previous line to enable the software watchdog with a long time out see table 6 13 of the MPC555 User Manual write 1 0x2fc004 OxFFFFFF03 KAKKKKKKKEKKKKKKK BRO ORO KEKE KKK KKK KKK KK KKK KKK KKK KK KKK KKKK Set up the TI Flash chip select and options brO amp or0 single read access 32 bit access 1M block 5 wait states see table 10 7 amp 10 8 of the MPC555 User Manual base address is 0x00800000 write 1 0x2fc104 Oxfff00050 write 1 0x2fc100 0x00800003 AN1778 28 MOTOROLA Application Note Reference Information EK KK eK KK KKK TI Flash KKKKKKKKKKKKKKKKKKKKKKKKKKKKKAKKKK Initialize the TI Flash DCR register set up extended pin set 3 blocks and place device into normal read mode write 1 0x800000 0x96 write 1 0x800000 0x5b write 1 0x800000 OxFF KKKKKKKKKKKKKKK BR1 OR1 KKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKK Set up the SRAM chip select and option register brl amp orl single read 4M address space 0 wait states EVB555 uses 1M for external SRAM 1M for PRU 1M for optional HCE board 1M for optional ETK SRAM the MPCF555FADS board onl
33. rted Normally the IMB intermodule bus clock is half the system clock but for this example it has to be set to full speed at 20 MHz in the initialization script This was done to maintain consistency if the system clock is set to 40 MHz with a default half speed bus of 20 MHz The IMB can be set to 20 MHz whether the MPC555 is operating at 20 or 40 MHz The MIOS counter prescaler submodule MCPSM divides the system IMB clock 20 MHz for this note to generate the counter clock It is designed to provide all the submodules with the same division of the main clock The clock signal is prescaled by loading the value of the clock prescaler register into the prescaler counter every time it overflows This allows all prescaling factors between 2 and 16 Counting is enabled by asserting the PREN bit in the control register Because the PWM uses the MIOS counter to time itself the maximum frequency that the PWM can generate is half of the MIOS counter clock even if the PWM channel divider is set to 1 This is because the PWM uses 1 count of the MIOS counter per transition of the PWM signal The IMB bus speed register was programmed to full speed in the initialization of the MPC555 If the MPC555 is running at 40 MHz AN1778 14 MOTOROLA Application Note Using the MPC555 as a Signal Generator comment that line out of the initialization code see Initializing the EVB and power on reset the evaluation board so that the IMB bus is op
34. th Power On Reset on power up Table 12 6 write 1 0x307 80 0x0 Turn on the time base for interrupt generation Table 6 16 write w 0x2fc200 0x0001 Sets the slew rate of the MIOS to fast 200 ns default with Pull Up Down resistors off Table 2 3 write 1 0x2fc03c 0x13000000 To return to slow rise fall time on MIOS write 1 0x2fc03c 0x03000000 Other Miscellaneous Initialization Registers for Reference Turn off serialization for benchmarking purposes Note that the ICTRL SPR158 register defaults to 0 on reset SPR158 0x7 To verify echo SPR158 Set clock speed to 40 MHz write 1 0x2f c284 0x0091c000 Set clock speed to 20 MHz write 1 0x2fc284 0x0041c000 Configuring the PAM Channels ALL CHANNELS Status and Control for MCPSM main clock divider for MIOS i e main divider for all PWM s write w 0x306816 0x8002 HHPHHEEEREEEEREEE EERE ERE EEEREEEEPEE EERE EEE SE EEE HE HEH HH FH CHANNEL 0 PWM Period Register Resolution of waveform write w 0x306000 0x0002 PWM Pulse Width Register How many periods from above that are high write w 0x306002 0x0001 PWM Status and control Divider per PWM write w 0x306006 Ox54ff AN1778 30 MOTOROLA Application Note Reference Information HHPHEHHEFEREEEERREEEEREEEEREEE EERE EERE EERE EEE EEE HE HE HEHE HE FF CHANNEL2 PWM 2 Period Register write w 0x306010 0x0002 PWM 2 Pulse wi
35. y requires 1M of address space change to write 1 O0x2fcl0c Oxfff00000 see table 10 7 amp 10 8 of the MPC555 User Manual base address is 0x00C00000 write 1 0x2fcl0c Oxffc00000 write 1 0x2fc108 0x00C00003 EK KK ee KK KK KK BR2 OR2 KKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKK these next lines set up set up chip select 2 for Altera br2 amp or2 this is the board configuration registers 32k block MPC555FADS board only see table 10 7 amp 10 8 of the MPC555 User Manual base address is OxFFFF8000 write 1 0x2fc114 Oxffff8120 write 1 0x2fc110 OxFFFF8001 KKKKKKKKKKKKKKK UMCR KKEKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKK Set IMB to full speed this can only be set back to half speed with a hard reset see table 12 6 of the MPC555 User Manual write 1 0x307f 80 0x0 KKKKKKKKKKKKKKK TBSCR KKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKK Turn on the time base on during BDM freeze see table 6 16 of the MPC555 User Manual write w 0x2fc200 0x0001 KKKKKKKKKKKKKKK PDMCR KKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKK Set the slew rate of the MIOS pins to fast default is 200ns rise fall time also turns off pull up down devices see table 2 3 of the MPC555 User Manual write 1 0x2fc03c 0x13000000 KAKKKKKKKAEKKKKK end Of basic initialization KKK KKAKKKKKK KKK KKK AN1778 MOTOROLA 29 Application Note init dbg script Set IMB to full speed can only be set back to the default half speed wi
Download Pdf Manuals
Related Search
AN1778 a1778 battery phone a1778 model name a1778 firmware a1778 dfu mode a1778 ipsw a1778 specs a1778 recovery mode a1778 iphone 7 hard reset a1778 model iphone a1778 battery a1778 fcc id bcg-e3091a ic 579c-e3091a
Related Contents
Full documentation - Molecular Evolution & Organelle Genomics 231 User`s Manual - Lake Shore Cryotronics, Inc. Fisher ICR-B150 User's Manual Homeowners Guide Fujitsu 1300U2 Computer Drive User Manual Zire 72 Read This First (Brazilian Portugese) J18351 Moisture Trap_newAW Philips Fidelio SBD7500 Speaker Dock User Manual - data USER MANUAL Copyright © All rights reserved.
Failed to retrieve file