Blame | Last modification | View Log | Download | RSS feed
ifndef __regmc1inc ; avoid multiple inclusion__regmc1inc equ 1savelisting off ; no listing over this file;****************************************************************************;* *;* AS 1.42 - File REGMC1.INC *;* *;* contains SFR and Bit Definitions for ST7MC1xx *;* *;* Source: ST7MC Data Sheet, Rev. 13, April 2009 *;* *;****************************************************************************;----------------------------------------------------------------------------; Memory AddressesRAMSTART label $0080 ; Start Address Internal RAMswitch SUBSTR(MOMCPUNAME,STRLEN(MOMCPUNAME)-1,1)case "2"RAMEND label $01ff ; End " " "case "4"RAMEND label $37fcase "6"RAMEND label $47fcase "7","9"RAMEND label $67felsecaseerror "Huh?"endcase;----------------------------------------------------------------------------; Interrupt VectorsPWM_ART_vect label $ffe0 ; PWM ART InterruptADC_vect label $ffe2 ; ADC Interrupt, shared with...AVD_vect label $ffe2 ; Voltage Detector InterruptLINSCI_vect label $ffe4 ; LINSCI InterruptsTA_vect label $ffe8 ; Timer A Peripheral InterruptsMTC_C_D_vect label $ffec ; Event C or Event DMTC_R_Z_vect label $ffee ; Event R or Event ZMTC_U_vect label $fff0 ; Event U or Current Loop or Sampling OutEI2_vect label $fff2 ; External Interrupt Vector EI2EI1_vect label $fff4 ; External Interrupt Vector EI1EI0_vect label $fff6 ; External Interrupt Vector EI0MCC_RTC_vect label $fff8 ; Main Clock Controller Time Base Interrupt, shared with...CSS_vect label $fff8 ; Safe Oscillator Activation InterruptMCES_vect label $fffa ; Motor Control Emergency Stop or Speed error InterruptTRAP_vect label $fffc ; TRAP (software) Interrupt VectorRESET_vect label $fffe ; RESET Vector;----------------------------------------------------------------------------; GPIOinclude "gpio.inc"__defgpio "PA",$0000__defgpio "PB",$0003__defgpio "PC",$0006__defgpio "PD",$0009__defgpio "PE",$000c__defgpio "PF",$000f__defgpio "PG",$0012__defgpio "PH",$0015;----------------------------------------------------------------------------; LINSCIinclude "linsci.inc"__deflinsci $0018;----------------------------------------------------------------------------; ITCISPR0 label $0024 ; Interrupt Software Priority Register 0I0_0 bit ISPR0,0 ; Vector $fffaI1_0 bit ISPR0,1I0_1 bit ISPR0,2 ; Vector $fff8I1_1 bit ISPR0,3I0_2 bit ISPR0,4 ; Vector $fff6I1_2 bit ISPR0,5I0_3 bit ISPR0,6 ; Vector $fff4I1_3 bit ISPR0,7ISPR1 label $0025 ; Interrupt Software Priority Register 1I0_4 bit ISPR1,0 ; Vector $fff2I1_4 bit ISPR1,1I0_5 bit ISPR1,2 ; Vector $fff0I1_5 bit ISPR1,3I0_6 bit ISPR1,4 ; Vector $ffeeI1_6 bit ISPR1,5I0_7 bit ISPR1,6 ; Vector $ffecI1_7 bit ISPR1,7ISPR2 label $0026 ; Interrupt Software Priority Register 2I0_8 bit ISPR2,0 ; Vector $ffeaI1_8 bit ISPR2,1I0_9 bit ISPR2,2 ; Vector $ffe8I1_9 bit ISPR2,3I0_10 bit ISPR2,4 ; Vector $ffe6I1_10 bit ISPR2,5I0_11 bit ISPR2,6 ; Vector $ffe4I1_11 bit ISPR2,7ISPR3 label $0027 ; Interrupt Software Priority Register 3I0_12 bit ISPR3,0 ; Vector $ffe2I1_12 bit ISPR3,1I0_13 bit ISPR3,2 ; Vector $ffe0I1_13 bit ISPR3,3EICR label $0028 ; External Interrupt Control RegisterIS1 bfield EICR,6,2 ; ei2 SensitivityIPB bit EICR,5 ; Interrupt Polarity for Port CIS2 bfield EICR,3,2 ; ei1 SensitivityIS3 bfield EICR,1,2 ; ei0 SensitivityIPA bit EICR,0 ; Interrupt Polarity for Port D;----------------------------------------------------------------------------; FlashFCSR label $0029 ; Flash Control/Status Register;----------------------------------------------------------------------------; Window WatchdogWDGCR label $002a ; Window Watchdog Control RegisterWDGA bit WDGCR,7 ; Activation BitWDGWR label $002b ; Window Watchdog Window Register;----------------------------------------------------------------------------; MCCMCCSR label $002c ; Main Clock Control / Status RegisterMCO bit MCCSR,7 ; Main Clock Out Enable BitCP bfield MCCSR,5,2 ; CPU Clock PrescalerSMS bit MCCSR,4 ; Slow Mode Selection BitTB bfield MCCSR,2,2 ; Time Base ControlOIE bit MCCSR,1 ; Oscillator Interrupt EnableOIF bit MCCSR,0 ; Oscillator Interrupt FlagMCCBCR label $002d ; Main Clock Controller: Beep Control RegisterADSTS bit MCCBCR,3 ; A/D Converter Sample Time StretchADCIE bit MCCBCR,2 ; A/D Converter Interrupt EnableBC bfield MCCBCR,0,2 ; Beep Control;----------------------------------------------------------------------------; Analog/Digital Converterinclude "adc10.inc"__defadc10 $002eSLOW bit ADCDRL,3 ; Slow Mode;----------------------------------------------------------------------------; Timerinclude "timer.inc"__deftimer "TA",$0030TATIMD bit TASR,2 ; Timer A Disable;----------------------------------------------------------------------------; System IntegritySICSR label $0040 ; System Integrity Control/Status RegisterPAGE bit SICSR,7 ; SICSR Register Page SelectionAVDIE bit SICSR,6 ; (Page 0) Voltage Detector Interrupt EnableAVDF bit SICSR,5 ; (Page 0) Voltage Detector FlagLVDRF bit SICSR,4 ; (Page 0) LVD Reset FlagCSSIE bit SICSR,2 ; (Page 0) Clock Security System Interrupt EnableCSSD bit SICSR,1 ; (Page 0) Clock Security System DetectionWDGRF bit SICSR,0 ; (Page 0) Watchdog Reset FlagVCOEN bit SICSR,5 ; (Page 1) VCO EnableLOCK bit SICSR,4 ; (Page 1) PLL LockedPLLEN bit SICSR,3 ; (Page 1) PLL EnableCKSEL bit SICSR,1 ; (Page 1) Clock Source Selection;----------------------------------------------------------------------------; Motor ControllerMTIM label $0050 ; (Page 0) Timer Counter High RegisterMTIML label $0051 ; (Page 0) Timer Counter Low RegisterMZPRV label $0052 ; (Page 0) Capture Zn-1 RegisterMZREG label $0053 ; (Page 0) Capture Zn RegisterMCOMP label $0054 ; (Page 0) Compare Cn+1 RegisterMDREG label $0055 ; (Page 0) Demagnetization RegisterMWGHT label $0056 ; (Page 0) An Weight RegisterMPRSR label $0057 ; Prescaler & Sampling RegisterMIMR label $0058 ; Interrupt Mask RegisterPUM bit MIMR,7 ; PWM Update Mask BitSEM bit MIMR,6 ; Speed Error Mask BitRIM bit MIMR,5 ; Ratio Update Interrupt Mask BitCLIM bit MIMR,4 ; Current Limitation Interrupt Mask BitEIM bit MIMR,3 ; Emergency Stop Interrupt Mask BitZIM bit MIMR,2 ; Back EMF Zero-crossing Interrupt Mask BitDIM bit MIMR,1 ; End of Demagnetization Interrupt Mask BitCIM bit MIMR,0 ; Commutation / Capture Interrupt Mask BitMISR label $0059 ; Interrupt Status RegisterPUI bit MISR,7 ; PWM Update Interrupt FlagRPI bit MISR,6 ; Ratio Increment Interrupt FlagRMI bit MISR,5 ; Ratio Decrement Interrupt FlagCLI bit MISR,4 ; Current Limitation Interrupt FlagEI bit MISR,3 ; Emergency stop Interrupt FlagZI bit MISR,2 ; BEMF Zero-Crossing Interrupt FlagDI bit MISR,1 ; End of Demagnetization Interrupt FlagCI bit MISR,0 ; Commutation / Capture Interrupt FlagMCRA label $005a ; Control Register AMOE bit MCRA,7 ; Output Enable BitCKE bit MCRA,6 ; Clock Enable BitSR bit MCRA,5 ; Sensor ON/OFFDAC bit MCRA,4 ; Direct Access to Phase State RegisterV0C1 bit MCRA,3 ; Voltage/Current ModeSWA bit MCRA,2 ; Switched/Autoswitched ModePZ bit MCRA,1 ; Protection from Parasitic Zero-Crossing Event DetectionDCB bit MCRA,0 ; Data Capture BitMCRB label $005b ; Control Register BCPB bit MCRB,6 ; Compare Bit for Zero-Crossing DetectionHDM bit MCRB,5 ; Hardware Demagnetization Event Mask BitSDM bit MCRB,4 ; Simulated Demagnetization Event Mask BitOCV bit MCRB,3 ; Over Current Handling in Voltage ModeOS bfield MCRB,0,3 ; Operating Output Mode Selection BitsMCRC label $005c ; Control Register CSEI_OI bit MCRC,7 ; Speed Error Interrupt Flag / MTIM Overflow FlagEDIR_HZ bit MCRC,6 ; Encoder Direction Bit / Hardware Zero-Crossing Event BitSZ bit MCRC,5 ; Simulated Zero-Crossing Event BitSC bit MCRC,4 ; Simulated Commutation Event BitSPLG bit MCRC,3 ; Sampling Z Event at High Frequency in Sensorless ModeVR bfield MCRC,0,3 ; BEMF/Demagnetisation Reference ThresholdMPHST label $005d ; Phase State RegisterIS bfield MPHST,6,2 ; Input Selection bitsOO5 bit MPHST,5 ; Channel On/Off bitsOO4 bit MPHST,4OO3 bit MPHST,3OO2 bit MPHST,2OO1 bit MPHST,1OO0 bit MPHST,0MDFR label $005e ; D event Filter RegisterMCFR label $005f ; Current feedback Filter RegisterRPGS bit MCFR,7 ; Register Page SelectionMT_RST bit MCFR,6 ; Reset MTC RegistersCFF bfield MCFR,3,3 ; Current Feedback Filter BitsCFW bfield MCFR,0,3 ; Current Window Filter BitsMREF label $0060 ; Reference RegisterMPCR label $0061 ; PWM Control RegisterMREP label $0062 ; Repetition Counter RegisterMCPWH label $0063 ; Compare Phase W Preload Register HighMCPWL label $0064 ; Compare Phase W Preload Register LowMCPVH label $0065 ; Compare Phase V Preload Register HighMCPVL label $0066 ; Compare Phase V Preload Register LowMCPUH label $0067 ; Compare Phase U Preload Register HighMCPUL label $0068 ; Compare Phase U Preload Register LowMCP0H label $0069 ; Compare Phase 0 Preload Register HighMCP0L label $006a ; Compare Phase 0 Preload Register LowMDTG label $0050 ; (Page 1) Dead Time Generator EnableMPOL label $0051 ; (Page 1) Polarity RegisterMPWME label $0052 ; (Page 1) PWM RegisterMCONF label $0053 ; (Page 1) Configuration RegisterMPAR label $0054 ; (Page 1) Parity RegisterMZRF label $0055 ; (Page 1) Z event Filter RegisterMSCR label $0056 ; (Page 1) Sampling Clock Register;----------------------------------------------------------------------------; Debug Moduleinclude "dm.inc"__defdm $006b;----------------------------------------------------------------------------; PWM ARTinclude "pwm_art.inc"__defpwmart $0074;----------------------------------------------------------------------------; OpAmpOACSR label $007f ; OPAMP Control/Status Registerrestoreendif ; __regmc1inc