AN1154 STMicroelectronics, AN1154 Datasheet

no-image

AN1154

Manufacturer Part Number
AN1154
Description
8031-PSD DESIGN TUTORIAL
Manufacturer
STMicroelectronics
Datasheet
This tutorial takes you step-by-step through the development cycle of a M88x3Fxx based design, from
design entry, to programming the device. The first part of this tutorial shows how a M8813F1x can be used
in conjunction with a handful of other ICs to implement an automatic gain control (AGC) design. The
tutorial also shows how this design would be implemented using a discrete part solution, and Appendix E
summarizes the various benefits of using a M88x3Fxx device over the discrete solution.
The members of the M88 FLASH+PSD family of programmable system devices are Flash-based
peripherals for use with embedded microcontrollers (MCUs), and are In-System-Programmable (ISP).
These PSDs are designed to interface easily with a variety of 8-bit MCUs, and to provide them with
memory, logic, and I/O.
Embedded designs are typically bound by cost, size, and power consumption. The market for products
using embedded MCUs is extremely competitive. Time-to-market and quality features-per-dollar define
success. In using a M88 FLASH+PSD device, you will reduce your cost, time-to-market, power
consumption, board space, design complexity, and chip count.
As you read this document, you will learn how the M88 FLASH+PSD can enhance your MCU, and meet
its needs for Flash memory, EEPROM, SRAM, configurable I/O pins, programmable logic (both sequential
and combinatorial), decoded address space, address expansion, backup power, code integrity, code
security, and ISP. All of these features are to be found in one cost-effective M8813F1x device, and allow
the use of a low cost, minimal feature, ROM-less MCU device.
In addition to giving a step-by-step design entry tutorial, this document usefully highlights three aspects of
the M88 FLASH+PSD solution:
– ISP using concurrent memory or JTAG
– Micro
– The logic simulation capabilities of PSDsilosIII
A typical MCU design with Flash memory consists of:
For systems that use SRAM for ISP, the Flash-programming algorithm must first be downloaded to SRAM
and then the MCU executes from SRAM during ISP. Any power interruption or system glitches that occur
will corrupt the system. Therefore, a boot PROM is a necessity for applications that demand high system
reliability. However, a boot PROM adds cost to the system, and is difficult to update once in service. Flash-
based PSDs address these concerns and combine all of the elements necessary to enable the MCU to
download easily to main Flash memory, and boot memory, while in-system.
January 2000
an MCU
the main Flash memory
and
– a boot PROM or SRAM to implement an ISP download to the main Flash memory
– over an UART channel, or some other communication link.
Cell technology
8031 / M88 FLASH+PSD Design Tutorial
APPLICATION NOTE
AN1154
1/83

Related parts for AN1154

AN1154 Summary of contents

Page 1

... However, a boot PROM adds cost to the system, and is difficult to update once in service. Flash- based PSDs address these concerns and combine all of the elements necessary to enable the MCU to download easily to main Flash memory, and boot memory, while in-system. January 2000 APPLICATION NOTE 8031 / M88 FLASH+PSD Design Tutorial AN1154 1/83 ...

Page 2

... AN1154 - APPLICATION NOTE The ISP method just described requires MCU participation. The M88 FLASH+PSD also offers another ISP method, which uses a JTAG interface, and requires no MCU participation. This means that a completely blank PSD can be soldered into place, and the entire chip can be programmed, in-system, using ST’s JTAG FlashLink cable and PSDsoft development software ...

Page 3

... Please refer to Appendix F for information related to system memory mapping, ISP issues using a UART, and memory paging considerations. Desired Level Interrupt 80C31 Boost MCU Trim Amplifier Closed 4 Gain Loop AGC Control Setting Env Filter Out Base Band Signal PGA Envelope Out LO RF Receiver AN1154 - APPLICATION NOTE 4 State Machine A/D Converter AI03141 3/83 ...

Page 4

... AN1154 - APPLICATION NOTE Figure 2. Block Diagram for the Discrete Solution 4/83 AI03139 ...

Page 5

... PSD’s CPLD. The I/O pins are individually configured to match the functions implemented in the original design. Using JTAG, the entire M8813F1x device can be programmed. Also, the PSD JTAG pins can be multiplexed with other I/O. These JTAG features are beyond the capabilities of the EPM7064S. AN1154 - APPLICATION NOTE CC falls 5/83 ...

Page 6

... AN1154 - APPLICATION NOTE Figure 3. Block Diagram for the Integrated PSD Design 6/83 AI03140 ...

Page 7

... Utilizes standard JTAG and non-standard extensions (to speed programming); the JTAG port can be multiplexed with other I/O, and the memory and logic memory available AN1154 - APPLICATION NOTE The Matching M8813F1x Function Same Same Same memory access. ...

Page 8

... AN1154 - APPLICATION NOTE THE M88 FLASH+PSD FUNCTIONAL BLOCKS The M88x3Fxx provides five system-level functional blocks, and allows the user to define and configure these blocks to meet the design specification. MCU Bus Interface The MCU Bus Interface adapts the address, data, and control lines of a particular MCU to the PSD. ...

Page 9

... It accepts the .obj file as input, allows viewing and editing of the .obj file, and programs the PSD device. C Code Generation This is a new feature of PSDsoft that automatically generates C code functions and headers for controlling Flash PSD devices. These functions and headers are ANSI-C compatible. The generated files (.c and .h) AN1154 - APPLICATION NOTE 9/83 ...

Page 10

... AN1154 - APPLICATION NOTE may be edited to suit the particular application, then compiled and linked with the rest of the code. Afterwards, the linker output of the cross-compiler (usually in Intel HEX or Motorola S-record format) is merged with the configuration file of the PSD device in the Address Translate utility of PSDsoft. ...

Page 11

... Use PSDsoft to download the project .obj file to the MagicProIII®, PSDpro, or FlashLink JTAG programmer to program the device. A compatible third party programmer can also be used. Contact representative near you for a list of compatible programmers. AN1154 - APPLICATION NOTE 11/83 ...

Page 12

... AN1154 - APPLICATION NOTE M88 FLASH+PSD TUTORIAL EXAMPLE This section uses the tutorial design example to illustrate the steps involved in implementing the functionality discussed earlier. The files required, which were generated for the tutorial design, can be found in the \PSDSOFT\TUTORIAL\TUTOR8XX\TUTOR directory. At this point, you may wish to start the PSDsoft program, so that you can follow along with the tutorial example ...

Page 13

... Click on the Browse button, which brings up the “Open” dialog box, as shown in Figure the \PSDSOFT\TUTORIAL\TUTOR8XX\TUTOR directory, select the tutor8XX.ini file, and click on the Open button (this closes the “Open” dialog box). Figure 7. Open Project – Open Dialog Box 3. Click on the OK button (this closes the “Open Project” dialog box). AN1154 - APPLICATION NOTE AI03145 13/83 ...

Page 14

... AN1154 - APPLICATION NOTE The PSDabel File For detailed information on PSDabel, and how it relates to the M88 FLASH+PSD, please read the comments in the file tutor8XX.abl in Appendix A. Also, refer to ST’s Application Note AN1171 and the PSDsoft PSDabel-HDL Reference Manual . For more information on the system memory map for this tutorial design, see Appendix F. To open the tutor8XX.abl design file, as shown in Figure 8, click on View- > ...

Page 15

... Retain redundancy box checked. For a better description of the various options available, please refer to the PSDabel–HDL Reference Manual . Figure 9. ABEL Compiler Options 3. Select the “Optimization Options” tab, and set up the options, as shown in Figure 10. Use Default should be the only item selected. AN1154 - APPLICATION NOTE AI03147 15/83 ...

Page 16

... AN1154 - APPLICATION NOTE Figure 10. ABEL Compiler Options – Optimization Options 4. Click on the OK button when you have finished setting up the options. 5. Click on Compile->Compile, as shown in Figure 11. Or, click on the “Compile” button on the tool bar. 16/83 AI03148 ...

Page 17

... After compilation, you can display the optimized PLD logic equations that will be used by the Fitter by pulling down the VIEW menu and selecting the Compiled Equations, as shown in Figure 12. This opens the tutor8XX.eq2 file. Figure 12. View->Compiled Equations AN1154 - APPLICATION NOTE AI03149 AI03150 17/83 ...

Page 18

... AN1154 - APPLICATION NOTE Simulating Your Design Using ABEL Simulation You can do a very simplistic functional simulation of the blocks that make up the PLD using the simulator that is included with PSDabel important to note that only the functions that are generated within the ...

Page 19

... Figure 14. ABEL Compiler – Simulation Options 4. If you select Simulation Results in the View menu, PSDabel will automatically start the simulation process, and display the simulation results based on the logic equations and test vectors in the .abl file, as shown in Figure 15. AN1154 - APPLICATION NOTE AI03152 19/83 ...

Page 20

... AN1154 - APPLICATION NOTE Figure 15. Simulation Results PSDsoft Configuration The M88 FLASH+PSD has a programmable MCU bus interface, and is able to interface directly to many microcontrollers. Using PSD Configuration, you can specify how to interface to the MCU you have chosen for your design. You can also configure functions specific to the PSD device you are using. This tutorial design is based on the Intel 80C31 microcontroller, which has an 8-bit multiplexed bus with RD, WR, and PSEN as the control signals, and an active-high level address latch enable (ALE) ...

Page 21

... Click on the “Other Configuration” tab, as shown in Figure 17, and ensure that the Enable Standby Voltage Input (PC2) box is checked under “Standby Voltage”, Edge is selected under “Mode of Loading Micro Cell by MCU”, and all other boxes are unchecked. AN1154 - APPLICATION NOTE AI03154 21/83 ...

Page 22

... AN1154 - APPLICATION NOTE Figure 17. Other Configuration 4. Click on the “JTAG Configuration” tab, as shown in Figure 18, and ensure that none of the boxes are checked (because checking the boxes would enable the JTAG port to be operational 100% of the time). Since, in this tutorial, we are multiplexing the JTAG pins with other signal functions desired that JTAG functions only be operational when the JEN signal is active (see the Figure 3 schematic). Enter the value ‘ ...

Page 23

... Click on the “Sector Protection” tab, as shown in Figure 19, and ensure that none of the boxes are checked. The appropriate sector box should only be checked desired that the selected sector be write protected. These bits can be changed, later, through the JTAG port or the device programmer. AN1154 - APPLICATION NOTE AI03156 23/83 ...

Page 24

... AN1154 - APPLICATION NOTE Figure 19. Sector Protection 6. When you are finished with the global configuration settings, click on the OK button. This saves the configuration. The M88 FLASH+PSD configuration is now completed. If you ever wish to view the configuration file, first ensure you are in Configuration Mode (see step 1 of this section). Next, pull down the View menu and select Configuration Report, as shown in Figure 20, and then select File-> ...

Page 25

... Click on the Options Menu, and select the “Fitter Options” tab to specify one of the four fitting options, as shown in Figure 21. For the tutorial, choose Keep Current under “Pin Assignment”, and ensure that the “Enable Product Term Expansion” and “Perform Register Synthesis” boxes are checked. AN1154 - APPLICATION NOTE AI03158 25/83 ...

Page 26

... AN1154 - APPLICATION NOTE Figure 21. Fitter Options 2. Click OK to save the Fitter options. Then, pull down the PSDsoft menu in the PSDsoft window and choose PSD Fitter, as shown in Figure 22, or click on the “Logic Synthesis and Fitting” box in the “PSDsoft Design Flow” window. ...

Page 27

... If the fitting is not successful, you may have to view the tutor8XX.eq2 file in PSDabel to see which logic function caused the fitting problem, and to modify the tutor8XX.abl file accordingly. To view the optimized equation file ( tutor8XX.eq2 ), see step 7 in the section entitled “Compiling the Tutor Design” on page 15. AN1154 - APPLICATION NOTE AI03160 AI03161 27/83 ...

Page 28

... AN1154 - APPLICATION NOTE 6. Re-compile the modified tutor8XX.abl file. Repeat Steps until a successful fit has been found. Re-enter the Fitter program, and proceed to Step 7. 7. Examine the Fitter Report File by pulling down the VIEW menu, as shown in Figure 24. The report file shows the results of the fitting process, and the pin assignment for the M88x3Fxx. If you want a fitting other than the one generated, return to the tutor8XX ...

Page 29

... Header: This is for specifying the folder in which you would like to place the C header files (.h) generated by PSDsoft. (Click the Browse button to help in filling in this section). Typically, a folder in your MCU cross-compiler environment is chosen. You cannot change the name of the headers AN1154 - APPLICATION NOTE AI03163 AI03164 ...

Page 30

... AN1154 - APPLICATION NOTE file(s) at this point since these header files may referenced by name within other header files or the C functions that are also generated by PSDsoft. Once all of the headers and functions are copied to their designated folders, you may edit the header file names any way you wish, as long as you change their names in the respective “ ...

Page 31

... The addresses within in the generated tutor8XX.obj file are special “direct” addresses – meaningful to a programming device. They are not “system” addresses, that an MCU would use, or that the DPLD decodes. That is what is meant by “Address Translate” translation of “system” addresses that the AN1154 - APPLICATION NOTE AI03165 31/83 ...

Page 32

... AN1154 - APPLICATION NOTE MCU and its compiler/linker knows about set of “direct” addresses that a device programmer knows about. To perform the address translation, take the following steps: 1. Pull down the PSDsoft menu, and choose PSD Fitter. Then, pull down the Fitter menu and choose Address Translate, or select “ ...

Page 33

... M88 FLASH+PSD. Please see the next section on how to simulate the tutorial design. File Start Address File Stop Address 0000 4000 8000 C000 8000 C000 8000 C000 0000 2000 - - AN1154 - APPLICATION NOTE File Name 3FFF Common.hex 7FFF Common.hex BFFF Page_0.hex FFFF Page_0.hex BFFF Page_1.hex FFFF Page_1.hex BFFF Page_2.hex FFFF Page_2 ...

Page 34

... AN1154 - APPLICATION NOTE M88 FLASH+PSD Chip Simulation PSDsilosIII is ST's version of SIMUCAD’s SILOSIII simulator software. It provides chip-level simulation and design verification using the Verilog Hardware Description Language (Verilog-HDL). Appendix B lists the stimulus file ( tutor8XX.stl ) for this tutorial. Many of the internal nodes on the M88x3Fxx are available for tracing. Descriptions of the signals that can be traced by the simulator are listed in Appendix C ...

Page 35

... Click on LogicSim, as shown in Figure 31, to invoke the PSDsilosIII simulator Figure 31. LogicSim The following events happen automatically result of clicking on the LogicSim button: – The PSDsilosIII simulator starts – The simulator loads the project tutor8XX.spj , PSDsoft.run , and a window displaying the tutor8XX.stl file, as shown in Figure 32. AN1154 - APPLICATION NOTE AI03167 AI03168 35/83 ...

Page 36

... AN1154 - APPLICATION NOTE Figure 32. Logic Simulator Input 5. Click on the Go button. This automatically opens an “Output” window for viewing the results of the simulation, as shown in Figure 33. Figure 33. Logic Simulator Output Running the Analyzer Now that the logic simulation is complete, the results can be displayed with the PSDsilosIII Data Analyzer by performing the following steps: 1. Pull down the Window menu and select Data Analyzer, as shown in Figure 34 ...

Page 37

... To open the explorer, ensure that you have simulated the design by following the steps in the section entitled “Running the Logic Simulator”, on page 34. Next click on the Window->Open Explorer menu selection or the Explorer button and the explorer window will appear, as shown in Figure 36. The Explorer shows all viewable signals. AN1154 - APPLICATION NOTE AI03171 AI03172 37/83 ...

Page 38

... AN1154 - APPLICATION NOTE Figure 36. Explorer Signals can be added to the Data Analyzer window using the Explorer by holding the “CTRL” button down, and clicking on all the signals that you want to add to the Data Analyzer window. Once you have chosen all the desired signals, right-click on one of the signals, and select Add Signals to Analyzer. Next, click anywhere in the Data Analyzer window, and the signals you added will appear at the bottom of the window, as shown in Figure 37 ...

Page 39

... Pull down the Functions menu and select Program; or click the Program button on the tool bar that is available when the PSD Programmer is invoked. The “PSD Programmer – Program Confirmation” dialog box appears, as shown in Figure 39, which enables you to program the Flash, EEPROM or PLD/ ACR (PSD Configuration) regions of the device. AN1154 - APPLICATION NOTE AI03175 39/83 ...

Page 40

... AN1154 - APPLICATION NOTE Figure 39. PSD Programmer – Program Confirmation 2. Select “All”, as shown in Figure 39. 3. Place the PSD device into the programmer, checking that it is correctly orientated, and snap the lid down on the device carrier. Then, click on the OK button. As programming takes place, the MagicProIII programmer checks each location, after it is programmed, to make sure it matches the contents in the ...

Page 41

... Go to the Options menu in the PSD Programmer environment, and select Hardware Setup. Once the “PSD Programmer – Hardware Setup” dialog box appears, select FlashLink, in the “Hardware Section”, as shown in Figure 42. Figure 42. FlashLink 2. Next, you will see that the Auto Select option becomes active, as well as Loop Test, as shown in Figure 43. AN1154 - APPLICATION NOTE AI03178 AI03179 41/83 ...

Page 42

... AN1154 - APPLICATION NOTE Figure 43. Auto-select and Loop Test Auto Select means that PSDsoft will automatically detect to which PC parallel port your FlashLink cable is connected (even if the other end of the FlashLink cable is not connected to the target system). Just click OK, and the FlashLink cable will be detected. Optionally, you can return to the Hardware Setup menu to run a Loop Test on the FlashLink cable ...

Page 43

... This opens the “JTAG Chain Setup” dialog box, as shown in Figure 45. Figure 45. JTAG Chain Setup Dialog Box 2. In the “Chain Information” box, click Browse. This brings up the “Open” window, as shown in Figure 46. Select the Tutor8XX.obj file in the \PSDSOFT\TUTORIAL\TUTOR8XX\TUTOR\ directory, and click Open. AN1154 - APPLICATION NOTE AI03181 AI03182 43/83 ...

Page 44

... AN1154 - APPLICATION NOTE Figure 46. JTAG Chain Setup – Open Window Your “JTAG Chain Setup” window should now appear as shown in Figure 47. Figure 47. JTAG Chain Setup Window If the device name (M8813F1x in this case) does not automatically appear in the “Device Name” window, select the appropriate device. ...

Page 45

... Figure 48. JTAG Chain Setup Window – After an Add 4. Right-click anywhere on the line that just appeared (line 1), and select Properties, as shown in Figure 49. AN1154 - APPLICATION NOTE AI03186 45/83 ...

Page 46

... AN1154 - APPLICATION NOTE Figure 49. JTAG Chain Setup Window – Selecting Properties 5. This opens the “JTAG Chain Setup Properties” dialog box. Ensure that the “Set Pins/Flow Control” tab is selected, and set up the window with the following selections (based on Figure 3 of this tutorial). The proper selections are shown in Figure 50. Under “ ...

Page 47

... Click on the Apply button (which saves the information you have entered, so far, and greys the “Apply” button out). Then, click on the “JTAG Attributes” tab. Your “JTAG Chain Setup Properties” window should now appear as shown in Figure 51. AN1154 - APPLICATION NOTE AI03188 47/83 ...

Page 48

... AN1154 - APPLICATION NOTE Figure 51. JTAG Chain Setup Properties – JTAG Attributes The “Device Name”, “Instruction Register Length:”, and “JTAG Device ID:” are all greyed out because this information is automatically entered whenever you select a M88x3Fxx device. If you want to enter information about a non-PSD device, which included in your chain, here is the place to do it. If you add another device, you need to enter valid information in the “ ...

Page 49

... Figure 52. JTAG Chain Setup Properties – User Code 8. Now, you should be back to the “JTAG Chain Setup” window. Right click on the same line as you did in step 4, only this time, choose Erase, as shown in Figure 53. AN1154 - APPLICATION NOTE AI03190 49/83 ...

Page 50

... AN1154 - APPLICATION NOTE Figure 53. JTAG Chain Setup Erase 9. You should now see the “Operation: Erase” dialog box, as shown in Figure 54. Ensure that All is checked under the “Regions” block, and click OK. Figure 54. Operation Erase 10.Your “JTAG Chain Setup” window should now appear as shown in Figure 55. Click Go to start the exchange on the FlashLink cable. If the “ ...

Page 51

... Program. Select Ok when the window, as shown in Figure 56, appears. Figure 56. Operation Program Your “JTAG Chain Setup” should now appear as shown in Figure 57. Select Go, and the PSD will be programmed with the information in the tutor8XX.obj file. AN1154 - APPLICATION NOTE AI03193 AI03194 51/83 ...

Page 52

... AN1154 - APPLICATION NOTE Figure 57. JTAG Chain Setup – After Program 12.After you have programmed the device, click Reset at the bottom of the window. This resets the target circuit board that is connected to the FlashLink cable. This is needed after the Flashlink programs the PSD because the MCU will have lost its “mind” at this point. ...

Page 53

... Lastly, before leaving the “JTAG Chain Setup” window, you may wish to create a Serial Vector Format (.svf) file for use with a third-party programmer so, click the Create SVF button, and Browse through your directory tree to find a place where you want to place the .svf file. AN1154 - APPLICATION NOTE AI03196 AI03197 ...

Page 54

... AN1154 - APPLICATION NOTE ISP AND THE M88 FLASH+PSD The M88 FLASH+PSD may be programmed in-system, with or without participation from the MCU. For ISP with the MCU, please see Appendix F for UART download information and considerations. For ISP without MCU participation, see the Section entitled “JTAG: FlashLink“ on page 41. For FlashLink JTAG programming within the PSDsoft environment please see the application note, AN1153 ...

Page 55

... Port A I/O // Control outputs are MCU I/O mode outputs Control0..Control2pin 23, 22, 21;"Some generic control signals // Assign the latched/demultiplexed address to Port A, pins pa4 to pa0. WSIPSD PROPERTY ’Address_Out Aout[4:0]:Addr_Out[4:0]’; // Port B I/O Bus Interface signal declarations Port pin declaration AN1154 - APPLICATION NOTE 55/83 ...

Page 56

... AN1154 - APPLICATION NOTE PGA_Din2..PGA_Din0pin 5, 6, 7;"Data bits used to program the PGA "Implemented with MCU I/O mode Measured_Level3..Measured_Level0 pin istype ’reg’;"Upper 4 bits of the A/D converter (ADC) WSIPSD PROPERTY ’DataBus_IMC D[7:4]:Measured_Level[3:0] PortB’; // Port C I/O // Note that pins pc0, pc1, and pc5-6 are multiplexed output/JTAG signals. pc3, pc4, and pc6 // are JTAG signals that are not multiplexed ...

Page 57

... DLEVEL = [Desired_Level3..Desired_Level0];"Desired gain level set by MCU MLEVEL = [Measured_Level3..Measured_Level0];"Measured gain level latched by IMCs STATE_MACHINE = [STATE1..STATE0 .x.;"Don’t care symbol C = .c.;"Clock symbol page = [pgr1,pgr0]; address = [a15..a0];"De-muxed microcontroller address signals AN1154 - APPLICATION NOTE DEFINITIONS ************************** 57/83 ...

Page 58

... AN1154 - APPLICATION NOTE EQUATIONS "************************** // Generate active high chip selects for the main Flash segments. Each segment is 16K bytes // for the M88x3Fxx devices. fs0 = ((address >= ^h8000) & (address <= ^hBFFF) & (page == 3) & !swap) # ((address >= ^h0000) & (address <= ^h3FFF) & (page == X) & swap); ...

Page 59

... Boost the gain when the Measured signal level is less than the desired one. meqd = (MLEVEL == DLEVEL); Boost = !meqd & !Trim; // Generate the chip select !RTCcsn = ((address >= ^h0a00) & (address <= ^h0aff)); // Loading of the various registers AN1154 - APPLICATION NOTE GPLD/ECSPLD equations 59/83 ...

Page 60

... AN1154 - APPLICATION NOTE MLEVEL.ld = !clkin; // State machine which controls the conversion start of the ADC, the interrupt to the MCU, // and the strobing of the IMCs STATE_MACHINE.ck = clkin; STATE_MACHINE.re = !reset; state_diagram STATE_MACHINE; state 0: Start_Conv = 0; Intrn = 1; if (begin_cycle == 1) then 1 else 0; state 1: Start_Conv = 1; goto 2; state 2: Start_Conv = 0; ...

Page 61

... An area where the user may wish to add to the file in order to // test more functions // * The actual stimulus of the design // ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ +++ // Parameters declarations for the address offsets for the CSIOP address space // ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ +++ //Port A parameter Port_A_Dir_Reg=’h0906,Port_A_Cntl_Reg =’h0902; parameter Port_A_Dout_Reg=’h0904,Port_A_Din_Reg =’h0900; parameter Port_A_IMC=’h090A,Port_A_Drive_Sel = ’h0908; parameter Port_A_En_Out=’h090C; //Port B AN1154 - APPLICATION NOTE 61/83 ...

Page 62

... AN1154 - APPLICATION NOTE parameter Port_B_Dir_Reg=’h0907,Port_B_Cntl_Reg =’h0903; parameter Port_B_Dout_Reg=’h0905,Port_B_Din_Reg =’h0901; parameter Port_B_IMC=’h090B,Port_B_Drive_Sel = ’h0909; parameter Port_B_En_Out=’h090D; //Port C parameter Port_C_Dir_Reg=’h0914,Port_C_En_Out =’h091A; parameter Port_C_Dout_Reg=’h0912,Port_C_Din_Reg =’h0910; parameter Port_C_IMC=’h0918,Port_C_Drive_Sel = ’h0916; //Port D parameter Port_D_Dir_Reg=’h0915,Port_D_Drive_Sel =’h0917; parameter Port_D_Dout_Reg=’h0913,Port_D_Din_Reg =’h0911; parameter Port_D_En_Out=’h091B; ...

Page 63

... Z8;//Float address bus #40 psen = 0;//Read pulse #100 psen = 1;//Read ends end AN1154 - APPLICATION NOTE 63/83 ...

Page 64

... AN1154 - APPLICATION NOTE endtask // ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ +++ // Define some busses here to make the program easier to read. // ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ +++ //adrout is the latched address output on Port A reg [4:0] adrout; reg Addr_Out4, Addr_Out3,Addr_Out2, Addr_Out1, Addr_Out0; assign {Addr_Out4, Addr_Out3, Addr_Out2, Addr_Out1, Addr_Out0} = adrout; reg [3:0] measured_value; reg Measured_Level3, Measured_Level2, Measured_Level1, Measured_Level0; assign {Measured_Level3, Measured_Level2, Measured_Level1, Measured_Level0} = measured_value ...

Page 65

... MCU I/O mode output, only the direction register needs to be setup. //Only pins pb3 to pb0 will be outputting data, and the rest will be receiving //input write(Port_B_Dir_Reg,’h0f); //All of Port C is output (with the exception of the Vstby input write(Port_C_Dir_Reg,’hfb); AN1154 - APPLICATION NOTE 65/83 ...

Page 66

... AN1154 - APPLICATION NOTE //There is only one output on Port D (RTCcs/), so the direction register is //setup as follows: write(Port_D_Dir_Reg,’h04); //Set up the mask registers so that only the desired portion of the OMCs get //written. Only the desired value (MCELLAB[7:4]), and begin (MCELLBC7) can be //written to. write(Port_AB_OMC_Mask, ’h0f); ...

Page 67

... Generate a 10 MHz system clock used by the state machine, etc. // Note the time scale is set in the psdsoft.run file. clkin=0; forever #100 clkin=~clkin; end //stimulus ends here AN1154 - APPLICATION NOTE 67/83 ...

Page 68

... AN1154 - APPLICATION NOTE APPENDIX C: LIST OF M88 FLASH+PSD SIMULATION SIGNALS Figure 61 gives a list of signals from the Explorer that can be viewed using the Data Analyzer. This list is based on the tutor8XX.abl file, and predefined signals. The list will vary depending on the names in your .abl file, but most of the signals will be the same. ...

Page 69

... AN1154 - APPLICATION NOTE Description VM register Address/Data bus high byte Address/Data bus low byte Port x control register Non-multiplexed 8-bit data bus Port x data in register Port x direction register Port x data out register Port x drive register ...

Page 70

... AN1154 - APPLICATION NOTE Signal/Bus Name mcellabn_pr mcellabn_reg mcellabn_re mcellbcn mcellbcn_clk mcellbcn_pr mcellbcn_reg mcellbcn_re nib_xn out_mcab[7:0] out_mcbc[7:0] pxn pxn_imc pxn_oe pdn pgr7_0 pmmrn pseln rd_bsy sram_oe 70/83 Description Output Micro Cell AB n preset input Output Micro Cell AB n register input Output Micro Cell AB n reset input ...

Page 71

... System-level inputs: Reset~ : INPUT;-- System reset Clock : INPUT;-- System clock -- The following signals are generated for the MCU (U1): AGC_Interrupt~: OUTPUT;-- Interrupt the MCU when the desired and measured signal levels don’t match = H"09E0"; = H"09E2"; = H"0902"; = H"0901"; = H"0921"; AN1154 - APPLICATION NOTE 71/83 ...

Page 72

... AN1154 - APPLICATION NOTE Trim : OUTPUT;-- True when the measured level is greater than the desired one Boost : OUTPUT;-- Opposite of Trim -- The chip select output for the RTC (U5): RTC_CS~: OUTPUT; -- This signals are to/from the ADC (U7): Start_Conversn: OUTPUT; -- Indicates when the ADC should start its analog-to- digital conversion ADC_Out[3..0]: INPUT ...

Page 73

... START_SIG_ADDR); desired_reg[] = A/D[7..4]; desired_reg[].clk = Clock; desired_reg[].clrn = Reset~; desired_reg[].ena = !WR~ & (addr[] == DESIRED_REG_ADDR); gain_reg[] = A/D[2..0]; gain_reg[].clk = Clock; gain_reg[].clrn = Reset~; gain_reg[].ena = !WR~ & (addr[] == GAIN_REG_ADDR); cntrl_port_reg[] = A/D[2..0]; cntrl_port_reg[].clk = Clock; cntrl_port_reg[].clrn = Reset~; cntrl_port_reg[].ena = !WR~ & (addr[] == MCU_IO_OUT_ADDR); page_reg[] = A/D[]; AN1154 - APPLICATION NOTE 73/83 ...

Page 74

... AN1154 - APPLICATION NOTE page_reg[].clk = Clock; page_reg[].clrn = Reset~; page_reg[].ena = !WR~ & (addr[] == PAGE_REG_ADDR); vm_reg[] = A/D[]; vm_reg[].clk = Clock; vm_reg[].clrn = Reset~; vm_reg[].ena = !WR~ & (addr[] == VM_REG_ADDR); measured[] = ADC_Out[]; desired[] = desired_reg[]; PGA_Din[] = gain_reg[]; Control[] = cntrl_port_reg[]; -- Memory Section swap = page_reg7; enable_data_half = page_reg6; fs0 = ((addr[] >= H"8000") & (addr[] <= H"BFFF") & (page_reg & !swap) # ((addr[] > ...

Page 75

... CASE sm IS WHEN s0 => Start_Conversn = GND; AGC_Interrupt~ = VCC; IF (begin_comparrison) THEN sm = s1; ELSE sm = s0; END IF; WHEN s1 => Start_Conversn = VCC s2; WHEN s2 => Start_Conversn = GND S3; WHEN s3 => !AGC_Interrupt~ = Trim # Boost;-- Interrupt when Measured not equal to Desired sm = s0; END CASE; END; AN1154 - APPLICATION NOTE 75/83 ...

Page 76

... AN1154 - APPLICATION NOTE APPENDIX E: COMPARING THE DISCRETE AND INTEGRATED SOLUTIONS This appendix compares the two circuits of Figure 2 and Figure 3 in the following categories: Cost Average Current Usage Board Space Usage Time to market (Only the major ICs are compared here.) COST The 150 ns M8813F1x in the PLCC package can be purchased at a significantly lower price than the total cost of the individual EEPROM, Flash, SRAM, and CPLD devices ...

Page 77

... It is very important to note that the PSD Configuration utility initialises the VM register (located in the CSIOP space at offset E2h), and that it can only be changed by the MCU after it has booted. After the Flash has been programmed or validated, the Flash memory is moved from the 8031 data space to the AN1154 - APPLICATION NOTE 77/83 ...

Page 78

... AN1154 - APPLICATION NOTE 8031 program space by the MCU writing 06h to the VM register (while still executing out of PSD EEPROM). Figure 62 represents the memory map after the Flash memory has been moved to the program space. This is an intermediate step that is a result of writing to the VM register. ...

Page 79

... PAGE 1 PAGE 2 FS3 FS5 FS7 EES1 EES1 EES1 EES0 EES0 EES0 FS1 FS1 FS1 FS0 FS0 FS0 AN1154 - APPLICATION NOTE DATA SPACE PAGE X PAGE 3 FFFF NOTHING MAPPED C000 FS0 NOTHING MAPPED 8000 FS1 4000 EES1 1000 EES0 SYSTEM RAM & I/O 0000 ...

Page 80

... AN1154 - APPLICATION NOTE Figure 65. Final Sys Mem Map for 8031-M8813F1x, move EEPROM to data space WRITE 0Ch TO THE VM REGISTER PAGE 0 FFFF C000 8000 COMMON MEMORY 4000 ACROSS ALL PROGRAM PAGES 0000 CODE PARTITIONING IN THE FLASH MEMORY PAGES Ultimately, the MCU will be executing from Flash memory since the EEPROM is used for boot-up and ISP in this design ...

Page 81

... Now, the system is in normal operating mode. More 8031 action: Check the UART for a host download request of boot memory Set the ENABLE_DATA_HALF bit in the PSD if no boot download request exists Normal application code can now be executed from main Flash memory. AN1154 - APPLICATION NOTE 81/83 ...

Page 82

... AN1154 - APPLICATION NOTE d. RS-232 cable not attached, main Flash is blank or invalid 8031 action: Boot from EES0/EES1 Run a checksum on the Flash memory Check the UART for a pending host download request of main Flash (Figure 62) Wait until any UART traffic is present (Figure 62) e. RS-232 cable attached, main Flash is blank or invalid ...

Page 83

... Australia - Brazil - China - Finland - France - Germany - Hong Kong - India - Italy - Japan - Malaysia - Malta - Morocco - Singapore - Spain - (for application support) (for general enquiries) © 2000 STMicroelectronics - All Rights Reserved STMicroelectronics GROUP OF COMPANIES Sweden - Switzerland - United Kingdom - U.S.A. http://www.st.com AN1154 - APPLICATION NOTE 83/83 ...

Related keywords