Embedded Control Applications IMP9-1 weeklecturetopics 9Embedded Control Applications I - DC motor speed control: Potentiometer   C  PWM - Output of.

Slides:



Advertisements
Présentations similaires
The subjunctive mood If I were you, I’d call him It is absolutely necessary that you be there on time May God save the queen! Normally, in English we would.
Advertisements

Making PowerPoint Slides Avoiding the Pitfalls of Bad Slides.
PERFORMANCE One important issue in networking is the performance of the network—how good is it? We discuss quality of service, an overall measurement.
1 Case Study 1: UNIX and LINUX Chapter History of unix 10.2 Overview of unix 10.3 Processes in unix 10.4 Memory management in unix 10.5 Input/output.
An Introduction To Two – Port Networks The University of Tennessee Electrical and Computer Engineering Knoxville, TN wlg.
Traffic Sign Recognition Jacob Carlson Sean St. Onge Advisor: Dr. Thomas L. Stewart.
 Components have ratings  Ratings can be Voltage, Current or Power (Volts, Amps or Watts  If a Current of Power rating is exceeded the component overheats.
IP Multicast Text available on
Template Provided By Genigraphics – Replace This Text With Your Title John Smith, MD 1 ; Jane Doe, PhD 2 ; Frederick Smith, MD, PhD 1,2 1.
Multisim Tutorial An Introduction to the Interface.
CNC Turning Module 1: Introduction to CNC Turning.
UBC104 Embedded Systems Review: Interrupts & Timers.
TP4
Theme Three Speaking Questions
Notes for teacher. You can just use slides 2-5 if you wish. If you want to do the practical activity (slides 6-8) you will need to: print off Slide 6.
Reflexive verbs and morning routine FR2
AP Examen Pratique commentaires
IGTMD réunion du 4 Mai 2007 CC IN2P3 Lyon
Theme Two Speaking Questions
IDL_IDL bridge The IDL_IDLBridge object class allows an IDL session to create and control other IDL sessions, each of which runs as a separate process.
Cross Cutting Mapping Project
Why is it important to plan ahead for the future?
Reflective verbs or Pronominal verbs
Quantum Computer A New Era of Future Computing Ahmed WAFDI ??????
Statistics & Econometrics Statistics & Econometrics Statistics & Econometrics Statistics & Econometrics Statistics & Econometrics Statistics & Econometrics.
Theme Two Speaking Questions
Les Fruits :.
INVERTER LOAD SPEED CONTROLLER Power demand Speed reference ENGINE 230/400V 50Hz/60Hz PMGPMG 1 f = Hz Speed =var Island Operation of the Adjustable.
F RIENDS AND FRIENDSHIP Project by: POPA BIANCA IONELA.
Top right corner for field-mark, customer or partner logotypes. See Best practice for example. Slide title 40 pt Slide subtitle 24 pt Text 24 pt Bullets.
Phase-Locked Loop Design S emiconducto r S imulation L aboratory Phase-locked loops: Building blocks in receivers and other communication electronics Main.
P&ID SYMBOLS. P&IDs Piping and Instrumentation Diagrams or simply P&IDs are the “schematics” used in the field of instrumentation and control (Automation)
Leadership Styles Mrs. Keith Main Types of Leadership Styles 1.The Autocratic or Authoritarian Leader 2.The Democratic or Participative Leader.
G. Peter Zhang Neurocomputing 50 (2003) 159–175 link Time series forecasting using a hybrid ARIMA and neural network model Presented by Trent Goughnour.
Lect12EEE 2021 Differential Equation Solutions of Transient Circuits Dr. Holbert March 3, 2008.
Essai
High-Availability Linux Services And Newtork Administration Bourbita Mahdi 2016.
C’est quel numéro? Count the numbers with pupils.
Qu’est-ce que tu as dans ta trousse?
Quelle est la date aujourd’hui?
Qu’est-ce que tu as dans ta trousse?
Forum national sur l’IMT de 2004.
C’est quel numéro? Count the numbers with pupils.
9-1 What is Creativity?. 9-2 Creativity is… Person Process Produce Press.
Roots of a Polynomial: Root of a polynomial is the value of the independent variable at which the polynomial intersects the horizontal axis (the function.
Quelle est la date aujourd’hui?
Quelle est la date aujourd’hui?
Understanding Constraints in Primavera P6Primavera P6.
1-1 Introduction to ArcGIS Introductions Who are you? Any GIS background? What do you want to get out of the class?
sortir avec mes copains faire les magasins jouer à des vidéo
Question formation In English, you can change a statement into a question by adding a helping verb (auxiliary): does he sing? do we sing? did they sing.
Manometer lower pressure higher pressure P1P1 PaPa height 750 mm Hg 130 mm higher pressure 880 mm Hg P a = h = +- lower pressure 620 mm Hg.
WRITING A PROS AND CONS ESSAY. Instructions 1. Begin your essay by introducing your topic Explaining that you are exploring the advantages and disadvantages.
What’s the weather like?
Making PowerPoint Slides Avoiding the Pitfalls of Bad Slides.
POWERPOINT PRESENTATION FOR INTRODUCTION TO THE USE OF SPSS SOFTWARE FOR STATISTICAL ANALISYS BY AMINOU Faozyath UIL/PG2018/1866 JANUARY 2019.
Les formes et les couleurs
les formes et les couleurs
C021TV-I1-S4.
les instructions Bonjour la classe, sortez vos affaires
5S Methodology How to implement "5S" and get extraordinary results.
Avoiding the Pitfalls of Bad Slides Tips to be Covered Outlines Slide Structure Fonts Colour Background Graphs Spelling and Grammar Conclusions Questions.
Les Mots Intérrogatifs
University : Ammar Telidji Laghouat Faculty : Technology Department : Electronics 3rd year Telecommunications Professor : S.Benghouini Student: Tadj Souad.
Les opinions Les opinions = Opinions. In this lesson pupils will learn to understand and give their own opinions about singular items.
L’orchestre des animaux
Presented by:  RAMMACHE Soumia  KAISSARI Kawther.
IMPROVING PF’s M&E APPROACH AND LEARNING STRATEGY Sylvain N’CHO M&E Manager IPA-Cote d’Ivoire.
M’SILA University Information Communication Sciences and technology
Transcription de la présentation:

Embedded Control Applications IMP9-1 weeklecturetopics 9Embedded Control Applications I - DC motor speed control: Potentiometer   C  PWM - Output of clear text log messages to the terminal (background communication)

PWM control of a DC motor Embedded Control Applications IMP9-2 -The control of a DC motor is very common task in robotics / mechatronics; the velocity of a DC motor is proportional to the applied DC voltage -The most widely used approach is to produce a Pulse Width Modulated (PWM) signal and turn it into a DC-voltage by filtering out the DC component -Microcontrollers usually do not come with on-chip D/A converters; therefore, a way has to be found to interface the microcontroller to the amplifier which drives the motor (H-bridge amplifier, transistor, etc.)

PWM control of a DC motor Embedded Control Applications IMP9-3 -A PWM signal is a pulse sequence and, as such, it has an amplitude spectrum which can be described by the well-known sinc function (sin(x)/x) f0f0 2f 0 3f 0 1.5f 0 2.5f 0 DC component

PWM control of a DC motor Embedded Control Applications IMP9-4 -The amount of power concentrated at DC depends on the duty cycle (relative pulse width) 10% duty cycle90% duty cycle average

PWM control of a DC motor Embedded Control Applications IMP9-5 -Filtering PWM signal with a low-pass filter reduces it to its DC component – the amplitude of this DC signal is proportional to the duty cycle 50% duty cycle -The cut-off frequency of the filter has to be chosen with respect to the frequency of the PWM signal; a compromise between signal strength and residual ripple has to be found

PWM control of a DC motor Embedded Control Applications IMP9-6 -The inertia of the rotor of a DC motor presents a (mechanical) low-pass filter; many robotics application therefore pass the PWM signal straight to the motor – this works fine, provided the frequency of the PWM signal is sufficiently above the cut-off frequency of the low-pass characteristic of the motor -DC motor speed control using microcontrollers is therefore a straight-forward task -This lecture will outline how a simple speed control of a DC motor can be implemented on a C167

A small DC-motor is to be driven using an edge aligned PWM signal on P7.3 (period: 100 ms). The duty cycle is to be controlled by the analogue voltage applied to ADC channel 4. This voltage should also be logged on a terminal connected to ASC port S0 (57600 bps) PORT 7PORT 3 5V 0V M PWM control of a DC motor P7.3 PORT 5 0V P5.4 RxD TxD Embedded Control Applications IMP9-7

PWM control of a DC motor -All required software components have already been developed (PWM, ADC, serial communication routines); it is therefore just a matter of “putting the bits together” -Keeping functionally distinct parts of the program in separate modules (i. e. separate source code files) will greatly improve its readability and maintainability -The functions defined in one module are then made available to other modules via a header file which declares all public symbols (functions, globals, etc.) Embedded Control Applications IMP9-8

Modular programming: Exporting shared symbols Embedded Control Applications IMP9-9 File: main.c /* externally defined functions */ #include “adc.h” /* main */ void main(void) { (…) } File: adc.c /* read ADC channel ‘chan’ */ unsigned int ADC_Read(unsigned int chan) { (…) } /* initialize ADC */ void ADC_Init(void) { (…) } File: adc.h /* declare ADC_Read */ extern unsigned int ADC_Read(unsigned int chan); /* declare ADC_Init */ extern void ADC_Init(void);

Embedded Control Applications IMP source code files (modules) need to be defined: serial.c, pwm.c, adc.c and DCMot.c (the main program) PWM control of a DC motor

Embedded Control Applications IMP9-11 -Module serial.c takes care of the (background) communication with the host; all public functions defined in serial.c are declared to the calling modules in header file serial.h /* header file for serial.c, fw */ #ifndef _SERIAL_H_ #define _SERIAL_H_ /* I/O interface */ void serInit(void); int serOutchar(char); char serInchar(void); int serOutstring(char *); void myPrintf(char *fmt,...); #endif /* _SERIAL_H_ */ It is good programming style to avoid recursive inclusions; these three lines do just that The declaration of all public functions of serial.c…

PWM control of a DC motor Embedded Control Applications IMP9-12 -Module pwm.c takes care of the (background) generation of the PWM signal on port P7.3; all public functions defined in pwm.c are declared to the calling modules in header file pwm.h /* header file for pwm.c, fw */ #ifndef _PWM_H_ #define _PWM_H_ #define PWMPERIOD (20e6/64)*100e-3 /* 100 ms */ void pwm_init(void); void pwm_set(unsigned int off_phase); #endif /* _PWM_H_ */ Macro PWMPERIOD has been moved into the header file to make it available to the calling modules

PWM control of a DC motor Embedded Control Applications IMP9-13 -Initialization and the setting of the duty cycle have been implemented in two separate functions: #include #include "pwm.h" /* macro PWMPERIOD */ void pwm_init(void) { DP7 |= 0x08; /* P7.3 : output associated with CC7 (CC7IO) */ P7 &= ~0x08; /* set P7.3 low -> motor off */ PP3 = PWMPERIOD; /* initialize channel 3 period register */ PW3 = PWMPERIOD/2; /* initialize channel 3 pulse width register */ PWMCON1 = 0x0008; /* channel 3: edge aligned PWM, o/p enabled */ PWMCON0 = 0x0088; /* channel 3 operates of fCPU/64, timer is running */ } /* pwm_init */ void pwm_set(unsigned int off_phase) { PW3 = off_phase; /* initialize channel 3 pulse width register */ } /* pwm_set */

PWM control of a DC motor Embedded Control Applications IMP9-14 -Module adc.c takes care of the reading of ADC channel 4 (P5.4); all public functions defined in adc.c are declared to the calling modules in header file adc.h /* header file for adc.c, fw */ #ifndef _ADC_H_ #define _ADC_H_ void adc_init(unsigned int channel); void adc_read(float *result); #endif /* _ADC_H_ */ -Module DCMotorController.c includes the header files of all of the above modules

PWM control of a DC motor Embedded Control Applications IMP9-15 -Initialization and the reading of the ADC result have been implemented in two separate functions: #include /* reg167.h doesn't seem to define P5DIDIS... */ #define P5DIDIS (*((unsigned int volatile sdata *) 0xFFA4)) void adc_init(unsigned int channel) { P5DIDIS |= channel; /* disable input buffer in parallel w/h channel */ ADCON = channel; /* select channel for single conversion */ } /* adc_init */ void adc_read(float *result) { ADCON |= 0x0080; /* start ADC */ while(ADCON & 0x0100); /* loop in this line until ADBSY is clear */ /* retrieve result, eliminate channel number and rescale to */ *result = ((float)(ADDAT & 0x03FF))/1023*5; } /* adc_read */

PWM control of a DC motor Embedded Control Applications IMP9-16 -With these modules in place, the main program becomes very simple: #include #include /* fabs */ #include "serial.h" /* S0 communication routines */ #include "adc.h" /* adc_init, adc_read */ #include "pwm.h" /* pwm_init, pwm_set */ /* control of the on-board LED */ void blinky(long duration) { long i; DP2 |= 0x0001; /* make sure P2.0 is an output */ P2 &= ~0x0001; /* LED on (active low) */ for(i=0; i<duration; i++); /* wait (on phase) */ P2 |= 0x0001; /* LED off */ for(i=0; i<duration; i++); /* wait (off phase) */ } (…) Function blinky has been defined to flash the on-board LED (connected to port P2.0); it is used during the debugging stage of this project

PWM control of a DC motor Embedded Control Applications IMP9-17 (…) void main(void) { float myVoltage, myVoltage_old = 2.5; /* say hello... */ blinky(10000); serInit(); /* initialize S0, 1-N */ adc_init(4); /* initialize ADC channel 4 */ pwm_init(); /* initialize PWM unit */ IEN = 1; /* allow interrupts to happen */ /* display message */ myPrintf("\r\nDC Motor controller \n\r"); (…) -The call to function blinky reveals whether the target is running or not; this is particularly important when working on a new microcontroller and/or when modifying the settings of the startup module -The program initializes the serial interface ASC0, the ADC and the PWM unit; it then sends a welcome message to a terminal on ASC0

PWM control of a DC motor Embedded Control Applications IMP9-18 (…) while(1) { /* read ADC (channel 4) */ adc_read(&myVoltage); /* adjust duration of off_phase */ if(fabs(myVoltage_old-myVoltage) > 0.02) { /* flash LED to give some feedback */ blinky(1000); myPrintf("Voltage on channel 4: %1.2f volts\r\n", myVoltage); pwm_set((unsigned int)(myVoltage/5*PWMPERIOD)); myVoltage_old = myVoltage; } /* if */ } /* while */ } /* main */ ADC channel 4 is read and the result compared to the previously read value; if there is a difference of more than 0.02 V, the duty cycle of the PWM is changed and a log message is sent to the terminal

Embedded Control Applications IMP9-19 Simulation allows the program structure to be checked; however, its timing can only be checked on the real hardware PWM control of a DC motor

Embedded Control Applications IMP9-20 PWM control of a DC motor -A downloadable output file needs to be generated; the KEIL tools make use of the Intel HEX format

Embedded Control Applications IMP9-21 PWM control of a DC motor -The correct memory map has to be specified – this information is found in the manual of the dev. board

Embedded Control Applications IMP9-22 PWM control of a DC motor -Once generated, the HEX output file has to be burnt into the Flash EEPROM of the controller/board

Embedded Control Applications IMP9-23 PWM control of a DC motor -Finally, the program can be run out of Flash ROM – a hardware reset should initialize the controller and divert execution to the destination address of the RESET vector; if everything has worked, this should be the startup routine which, in turn, calls main -This is where the on-board LED becomes an invaluable debugging tool – if it stays dark, then there is a problem with the initialization of the chip; the latter could be due to incorrectly set flags (  see startup file) or because of a problem with the memory map (  see linker map file)

Embedded Control Applications IMP9-24 PWM control of a DC motor -Assuming everything has worked properly, the terminal (57600 bps, 8/N, 1 stop bit, no protocol) should show the welcome message and possibly a few lines with voltage values -More values are printed when P5.3 is interfaced to an external voltage source (e.g. a potentiometer, between 0 and 5 V)

Embedded Control Applications IMP9-25 PWM control of a DC motor -The timing of the PWM signal can only be verified using an oscilloscope; on the phyCORE-167 all processor pins have been broken out to an expansion board – this is very useful to avoid short circuits… Verifying the timing of a PWM signal requires an oscilloscope; note that the requested period of 100 ms has been achieved; the picture shows a duty cycle of approximately 1/3 of the period (33 ms)

PWM control of a DC motor Embedded Control Applications IMP9-26 -Module adc.c could have used an Interrupt Service Routine (ISR) to read out the conversion result: (…) unsigned int ADC_result; /* global result register */ /* ADC interrupt service routine (ISR) */ void ADC_ISR(void) interrupt 0x28 { ADC_result = ADDAT & 0x03FF; /* fetch result and store in global */ } void adc_init(unsigned int channel) { P5DIDIS |= channel; /* disable input buffer in parallel w/h channel */ ADCON = channel|0x0090; /* select channel for continuous conversion */ ADCIC = 0x0044; /* enable ADC interrupt, ILVL = 1, GLVL = 0 */ } /* adc_init */ Note that the ADC has been set up for continuous conversion, i. e. the ADC is immediately restarted following the completion of a conversion

PWM control of a DC motor Embedded Control Applications IMP9-27 -The main program now simply processes the continuously updated global variable ADC_result (…) while(1) { /* read ADC (channel 4) */ myVoltage = (float)(ADC_result)/1023*5; /* adjust duration of off_phase */ if(fabs(myVoltage_old-myVoltage) > 0.02) { /* flash LED to give some feedback */ blinky(1000); myPrintf("Voltage on channel 4: %1.2f volts\r\n", myVoltage); pwm_set((unsigned int)(myVoltage/5*PWMPERIOD)); myVoltage_old = myVoltage; } /* if */ } /* while */ } /* main */

PWM control of a DC motor Embedded Control Applications IMP9-28 -Even better performance can be achieved using the so-called Peripheral Event Controller (PEC) -PECs implement a very fast Direct Memory Access (DMA) scheme; PEC transfers can transport one or more data bytes or words from a source area to a destination area -This transfer is extremely fast (a single CPU cycle!) and can simply be set up by specifying source and destination pointers and choosing the interrupt level (ILVL) which corresponds to PEC transfers

PWM control of a DC motor Embedded Control Applications IMP9-29 -Saving the ADC conversion result via PEC transfer on PEC channel 0 (ILVL: 14, GLVL: 0) (…) #include #include /* _sof_ : segment offset (-> segment 0) */ unsigned int ADC_result; /* global result variable */ void adc_init(unsigned int channel) { ADCON = channel|0x0090; /* select channel for continuous conversion */ SRCP0 = (unsigned int)&ADDAT; /* PEC0 transfer from ADDAT... */ DSTP0 = _sof_ (&ADC_result); /* to ADC_result, 16-bit address, segment 0 */ PECC0 = 0x00FF; /* PEC0 Word transfer, continuous operation */ ADCIC = 0x0078; /* enable ADC -> PEC0 : = 0x78 */ } /* adc_init */ The ADC Interrupt Service Routine is no longer required; PEC transfers only work with source/destination pointers in segment 0; operator _sof_ extracts the segment offset of a variable – this is what is required here

Embedded Control Applications IMP9-30 Simulation shows how the PEC operates; notice the almost permanent availability of ADC conversion data PWM control of a DC motor

Embedded Control Applications IMP9-31 -Upon downloading the modified code to the target the PWM appears to be stuck, i. e. it does no longer change with the voltage of the potentiometer -Considering that the program was working before, it must be suspected that the PEC transfer does not function as expected -A logical conclusion would be to look for the fault in the way memory is accessed; PEC transfers require linear 16-bit addresses in segment 0 – it is conceivable that variable ADC_result has not been placed there

PWM control of a DC motor Embedded Control Applications IMP9-32 -The linker map file confirms this suspicion: START STOP LENGTH TYPE RTYP ALIGN TGR GRP COMB CLASS SECTION NAME ===================================================================================== H H H * INTVECTOR TABLE * H H H XDATA REL WORD GLOB --- ?C_INITSEC H H H CONST ABS WORD PRIV --- ?C_CLRMEMSEC H 00007DH 00005AH DATA REL WORD PUBL FCONST ?FC??PRNFMT 00007EH H 00001CH DATA REL BYTE PUBL FCONST ?FC?SERIAL 0000A8H 0000AFH H * INTVECTOR TABLE * 0000B0H 0000ECH 00003DH DATA REL BYTE PUBL FCONST ?FC?DCMOTORCONTROLLER 0000EEH 00011DH H DATA REL WORD PUBL NCONST ?C_LIB_NCONST 00011EH H H CODE REL WORD PRIV ICODE ?C_STARTUP_CODE H 000C39H 0009F6H CODE REL WORD PUBL NCODE ?C_LIB_CODE 000C3AH 000F99H H CODE REL WORD PUBL NCODE ?PR?SERIAL 000F9AH 00107FH 0000E6H CODE REL WORD PUBL NCODE ?PR?DCMOTORCONTROLLER H 0010ADH 00002EH CODE REL WORD PUBL NCODE ?PR?ADC 0010AEH 0010D3H H CODE REL WORD PUBL NCODE ?PR?FABS 0010D4H 0010F5H H CODE REL WORD PUBL NCODE ?PR?PWM 0010F6H H H CODE REL WORD PUBL NCODE ?PR?STRLEN 00FA00H 00FBFFH H * SYSTEM STACK * 00FC00H 00FC1FH H DATA --- BYTE *REG* ?C_MAINREGISTERS H 100FFFH H DATA REL WORD PUBL NDATA ?C_USERSTACK H H H DATA REL WORD PUBL NDATA0 ?ND0?SERIAL H H H DATA REL WORD PUBL NDATA0 ?ND0?ADC H 1012EFH 0002E8H DATA REL WORD PUBL FDATA0 ?FD0?SERIAL The Address of variable ADC_result has been located at 0x101006, i. e. outside segment 0; this is why the PEC transfer didn’t work as expected

PWM control of a DC motor Embedded Control Applications IMP9-33 -The definition of ADC_result is extended by the memory class specifier idata (non-ANSI, KEIL only) (…) #include #include /* _sof_ : segment offset (-> segment 0) */ unsigned int idata ADC_result; /* global result variable in internal RAM */ void adc_init(unsigned int channel) { ADCON = channel|0x0090; /* select channel for continuous conversion */ SRCP0 = (unsigned int)&ADDAT; /* PEC0 transfer from ADDAT... */ DSTP0 = _sof_ (&ADC_result); /* to ADC_result (16-bit address, seg. 0) */ PECC0 = 0x00FF; /* PEC0 Word transfer, continuous operation */ ADCIC = 0x0078; /* enable ADC -> PEC0 : = 0x78 */ } /* adc_init */ Non-ANSI keyword idata causes the compiler to place ADC_result in the internal RAM (0xF600 – 0xFFFF), i. e. into segment 0

PWM control of a DC motor Embedded Control Applications IMP9-34 -The modified linker map file: START STOP LENGTH TYPE RTYP ALIGN TGR GRP COMB CLASS SECTION NAME ===================================================================================== H H H * INTVECTOR TABLE * H H H XDATA REL WORD GLOB --- ?C_INITSEC H H H CONST ABS WORD PRIV --- ?C_CLRMEMSEC H 00007DH 00005AH DATA REL WORD PUBL FCONST ?FC??PRNFMT 00007EH H 00001CH DATA REL BYTE PUBL FCONST ?FC?SERIAL 0000A8H 0000AFH H * INTVECTOR TABLE * 0000B0H 0000ECH 00003DH DATA REL BYTE PUBL FCONST ?FC?DCMOTORCONTROLLER 0000EEH 00011DH H DATA REL WORD PUBL NCONST ?C_LIB_NCONST 00011EH H H CODE REL WORD PRIV ICODE ?C_STARTUP_CODE H 000C39H 0009F6H CODE REL WORD PUBL NCODE ?C_LIB_CODE 000C3AH 000F99H H CODE REL WORD PUBL NCODE ?PR?SERIAL 000F9AH 00107FH 0000E6H CODE REL WORD PUBL NCODE ?PR?DCMOTORCONTROLLER H 0010ADH 00002EH CODE REL WORD PUBL NCODE ?PR?ADC 0010AEH 0010D3H H CODE REL WORD PUBL NCODE ?PR?FABS 0010D4H 0010F5H H CODE REL WORD PUBL NCODE ?PR?PWM 0010F6H H H CODE REL WORD PUBL NCODE ?PR?STRLEN 00F600H 00F601H H DATA REL WORD PUBL IDATA0 ?ID0?ADC 00FA00H 00FBFFH H * SYSTEM STACK * 00FC00H 00FC1FH H DATA --- BYTE *REG* ?C_MAINREGISTERS H 100FFFH H DATA REL WORD PUBL NDATA ?C_USERSTACK H H H DATA REL WORD PUBL NDATA0 ?ND0?SERIAL H 1012EDH 0002E8H DATA REL WORD PUBL FDATA0 ?FD0?SERIAL The Address of variable ADC_result has been located at 0xF600, i. e. in segment 0; the PEC transfer now works as expected

PWM control of a DC motor Embedded Control Applications IMP9-35 -The test set-up: