Home
Application Note
Contents
1. asco x ASCO_AX Pin Selection as amp SCU FE selected f Use pin as ASCO receive input signal amp amp CO Fr C Use pin ASCO receive input signal ASCO Pull Device Oriver P5 0 pull device Pul up device Driver of P5 0 Strong driver sharp edge 7 Configure Alternate Pin Functions 2 u ASCOT Pin Selection No pin as ASCOT selected Use pin F5 1 as ASCO output signal ASCO Te C Use pin P69 as ASCO output signal 4500 Push Pull Open Drain Driver Made Activate open drain function for 1 Driver of P5 1 Strang diver sharp edge driver sharp 2 Asynchronous Synchronous Seral Interface 0 ASCO 02 7 Control M Receiver Enable Loopback Mode an Enable receiver HEN Enable loopback mode LB Stop Bit Selection STP Parity Selection 000 C T bit data parity asynchronous One stop bit f C Two stop bits ie C 9 bit data asynchronous B bit data wake up asynchronous Interrupts Enable transmit interrupt TSRC C Bbit data parity asynchronous Error Check Enable transmit buffer interrupt TESRC Enable overun check W Enable receive interrupt ASAC Enable framing check FEN r Copyright 2005 Hitex Development Tools GmbH Page 25 34 hitex DEVELOPMENT TOOLS Application Note a
2. Function Library Part 1 Function Library Part 2 Note DAvE will create any source file only if you selected the init function Copyright 2005 Hitex Development Tools GmbH Page 23 34 hitex mum DEVELOPMENT TOOLS Application Note 3 2 2 Configuring ASCO To get interrupts from the serial port you will have to configure ASCO e In the DAvE main screen click on the ASCO peripheral red marked in the figure below and make the following settings 1796 j a Asynchronous Synchronous Seral Interface 0 ASCO 1 Module Clock Fin Selection Control Baud Rate Interrupts Functions Parameters Notes Module Disable Request Sleep Mode Enable Control Disable the ASCO module Disable the sleep mode for the ASCO module DISR EDIS Module Run Mode Clock Control 18 System clock 1 20 0000 MHz T Asynchronous Synchronous Seral Interface 0 ASCO 2 Module Clock Selection Control Baud Interrupts Functions Parameters Notes General Operating Mode Full duples asynchronous operating modes Half duplex 8 bit synchronous operating mode Alternate Pin Selection Configure pins 5 0 AS P5 0 and ASCO_TX P5 1 Copyright 2005 Hitex Development Tools GmbH Page 24 34 hitex DEVELOPMENT TOOLS Application Note Configure Alternate Pin Functions PS 7
3. Bypasses E Startup Fl Bus Configuration H Address Select Hegisters Bus Access Parameters Registers Bus Control Registers Emulator Registers SDRAM Registers l Other Registers C Compiler C Compiler Assembler PCP Assembler Linker CrossView Pro Default Help Disable the initialization from the bus configuration settings These settings will be done by toolset Project Options TC1796_PCPDEMO_PJT B Processor Processor Definition 4 Initialize bus configuration registers in startup code Bypasses E Startup 4 us Configuration Address Select Registers Bus Access Parameters Registers Augress registers Bus Control Registers Address Select Registers Emulatar Registers Bus Access Parameters Registers SORAM Registers Bus Control Registers Other Registers Emulator Registers When changing the system startup configuration the system startup code libssrescstart asm must have been added to your project C Compiler 5 Registers C Compiler Other Registers Assembler PCP Assembler Linker Pro B B B B B B Cancel Default Help 22 Copyright 2005 Hitex Development Tools GmbH Page 29 34 hitex mum DEVELOPMENT TOOLS Application Note e Disable the automatic inclusion of sfr file These files will be generated by DAvE TriCore Vx tonlset Project Options 101796 PEPDEMU PJ
4. Jmm Hitex Germany Head Quarters Hitex UK m Greschbachstr 12 049 721 9628 0 Warwick University 44 24 7669 2066 D 76229 Karlsruhe Fax 049 721 9628 149 Science Park Fax 44 24 7669 2131 CNN aa TIONS 7 E mail Sales hitex de GB Coventry CV47EZ E mail Info hitex co uk Visit us at www hitex de www hitex co uk or www hitex com Hitex USA Hitex Asia 2062 Business Center 800 45 25 International 65 6566 7919 hitex ui Drive Suite 230 1 049 863 0320 Business Park 04 62A Fax 65 6563 7539 Irvine CA 92612 Fax 1 949 863 0331 German Centre E mail Sales hitexasia com sg DEVELOPMENT TOOLS E mail Info hitex com Singapore 609916 Eva Application Note Debugging the TriCore C1796 How to use the PCP This documentation demonstrates how to use the PCP of the TriCore 1796 and debug it with the Tanto debug system Architecture TriCore Author Peter Walk Hitex GmbH T amp l Revision 08 2005 001 Copyright 2005 Hitex Development Tools GmbH All rights reserved No part of this document may be copied or reproduced in any form or by any means without prior written consent of Hitex Development Tools Hitex Development Tools retains the right to make changes to these specifications at any time without notice Hitex Development Tools makes no commitment to update nor to keep current the information contained in this document Hitex Development Tools makes no warranty of any
5. set an interrupt source to the non interrupting level Level 0 click an it drag it to the Level list and drap it On the right all available interrupts not being distributed are listed Drag and drop them into the CPU Interrupt column on the left Note The interrupt level in this column corresponds to the channel used In this example it is recommended to use exactly these settings 3 2 4 Generating Code e To generate code click on the toolbar button red marked in the figure below Select a directory you want save your code DAvE Elle View Options Addjae Windaws Copyright 2005 Hitex Development Tools GmbH Page 28 34 hitex mum DEVELOPMENT TOOLS Application Note 3 3 Setup Tasking Project 3 3 1 Making the Project The generated files will have to be added to the Tasking project For information on how to generate a new Tasking Project refer to the Manufacturer s Manual In the following we give some hints different to the default settings the Tasking Toolset will use e Select the correct target processor Vx tonlset Project Options 101796 Processor Definition Target processor lud The and MMU options are only relevant For user defined processors 4 possible the selected CPU vaill be supported regardless the state of the grayed checkbox present present
6. Look ir E Tasking TC1796_PCPDemo CS_ SIEPCPTimerASC htp File name 5 as type project files Cancel 22 Copyright 2005 Hitex Development Tools GmbH Page 7 34 hitex mum DEVELOPMENT TOOLS Application Note The following dialog will be displayed Download Applications 1 96 Cancel dadn Hez Enable Flash Programming e Click OK to download the application tc1796 pcpdemo After downloading will look like this or similar 5 HiTOP5 Source n x File Edit Project Debug RTOS System Window Help 8 x BQH 5 Fe 22 2 IK _pepdemo 1 4 workspace X Disassembly ax tc1796_pcpdemo Address OpCode Instruction 0j cS nt gt 0000000 10000020 J 0 0004000 18000880 0 MIS 0 0 0000004 6080 40 08 2 Ej cstart 0 0000006 0000 00000000 54 gpta 0 0000008 60004600 CALL 0 0000094 00000100 HHA gptal 00000000 8988 jo 0 000000 60007200 00000 0 00000000 E a main 0 40000010 38401740 MOV 04 0x1F4 40000100 H E pepinit 0 0000014 60001600 CALL 0 0000040 00000000 Ha pepw
7. 1 word l1GlobalCounterPCP ENS word 0x00000000 PRA word 0x00000000 ARE word 0x00000000 R2 word 0x00000000 RI word 0x00000000 250 Copyright 2005 Hitex Development Tools GmbH Page 6 34 hitex mum DEVELOPMENT TOOLS Application Note 3 1 Debug Session In order to get a quick entry in debugging the PCP a ready to start example is available from www hitex com If you want to generate a project from scratch you have to initialize the TriCore s SFRs and then generate an executable file For more information on how to do this refer to p 31ff In this section the first debug session using the Tanto debugger and the HiTOP user interface is described 3 1 1 Preparing the Session To work properly with this example some assumptions must be made 1 A debugger must be connected to the target 2 For testing the ASCO interrupt a serial interface must be connected to the board and a terminal program should be opened For this example we use the following settings Baudrate 9 600 e Stop bit 1 Parity none 3 If you want to use a preconfigured project you should download the example from www hitex com and extract this zip file into a folder From here you may load the example project into the target see below 3 1 2 Using the Example Project e Start and execute HiTOP s Project gt Open command Select the example project PCPTimerASC htp from the directory you had copied the example to
8. 2005 Hitex Development Tools GmbH Page 13 34 hitex DEVELOPMENT TOOLS Application Note GPTA Clock a ta Timer Clock Cantral Timer Clock Control Enable timer clock GOEN Enable GPTA1 timer clock 31 Global Timer 0 Run Control GPTA1 Global Timer 0 Run Control 311 5 started aten GTO clock is started after initialization GT ORUN TOORUN Global Timer 1 Hun Control Global Timer 1 Aun Control 11 clock is started after initialization clock te started atten RTOTRLIM ERT LT C42 Timer Clock Control Enable LT C42 timer clack L2EN After configuring the GPTA clock module the Clock Distribution Unit has to be configured This unit dispenses the clock onto seven different clock busses e Click on the CDU button see below and make the settings displayed Only the clock bus 7 will be different from the default values a General Purpose Timer Array 0 GPTAQ Global Time Local Timer Output Pins Functions SAN Parameters Notes Filter and Prescaler Cell FPC 0 1 FFC 2 3 FPC 4 5 Phaze Discrimination Logic Cell PDL POL D Duty Cycle Measurement and Limit Checking Cell DCM DCM 0 DCM 1 Digital Phase Locked Loop Cell PLL Clock Distribution Unit
9. Asynchronous Synchronous Seral Interface 0 ASCO 19 2 2 Baud Hate Selection Bit Fractional Divider Baud Hate Generator Hun Control Additionally reduce serial clock to 2 Disable baud rate generator Additionally reduce serial clack to 3 Enable baud rate generator Use fractional divider as prescaler for baud rate timer FDE Baud Hate Required baud rate kbaud agn Real baud rate kbaud BaS Fractional divider n 512 Percentage of deviation pie baud rate baud 6294 Reload value AL baud rate kbaud 2500 a Asynchronous Synchronous Seral Interface 0 5 7 Initialization Functian Source File 85 sinit File name 85 Function Library Fart 1 Function Library 2 JASCO ySendData JASCO usGetData ASCO wil sButter ASCO ASCO ASCO ySendSlaveAdr ASCO ub wneddress ASCO ubTxDataReady ASCO_ubRxDataReady ASCO ubEmarCheck M I M NN Note DAVE will create any source file only if you selected the init function Copyright 2005 Hitex Development Tools GmbH Page 26 34 hitex mum DEVELOPMENT TOOLS Application Note 3 2 3 Configuring PCP In this section the real PCP will be configured e Click on the PCP periphera
10. COU Copyright 2005 Hitex Development Tools GmbH Page 14 34 Application Note hitex DEVELOPMENT TOOLS Configure Clock Distribution Unit COU 9 2 Clock Bus 7 8 Clock Bus 5 4 Clock Bus 3 2 Clock Bus 1 0 Clock Bus Signal DFAU Clock coming from FPC4 20 0000 MHz Divide clock 2714 1 221 KHz 819 2000 ps Clock Bus Signal 6 DFATE f Clock coming fram 20 0000 MHz C Divided GPTALU clock In the following steps the Global timer 0 and Global timer 1 are configured e Click on the GTO and GT1 buttons and make the settings displayed General Purpose Timer Array 0 GPTAO 2 Global Timer GT GTO GT 1 Global Timer Cell BTE GTC GTC 2 GTC 3 GTC 4 GTCS ITE B GTC GICs GTC 3 GTC 10 GTC 11 GTC 12 ITE 13 GTC 14 GTC 18 GTC 15 GTC 17 GTC 18 GTC 13 GTC 20 GTC 21 GTC 22 GTC 23 GTC 24 25 GTC 26 GTC 27 GTC 28 GTC 23 GTC 30 GTC 31 Copyright 2005 Hitex Development Tools GmbH Page 15 34 hitex DEVELOPMENT TOOLS Application Note Global Timer 0 GTO 02 27 Timer Clock Selection MU signal Clock bus 7 GPTAU clock 2714 1 221 KHz 819 2000 ps TGE Source Selection SCO GTO Reload Compare flag bit of the substraction result GTO reload Value REV OxFFFB The Global timer 1 in
11. GTO timer Capture timer f Compare with GTO timer Compare with 311 timer Multiplexer Connection line ta Mode Control Equal compare Greater or equal compare Capture After Compare Select One Shot Mode Enable Enable capture after compare GTC16 Register register value lt p FFFFFO Ia Output Control DIEM Hold the GTC16 output by an local event only Force the selected action alter initialization 014 tapue altema timer mii Enable One Shot Made OSM Bypass Control Brae bypass After configuring the timer the service request nodes of the must be defined Use the buttons marked in the following figures and then make the required settings a General Purpose Timer Array 0 BGPTAU 2 Service Request Nodes Service Request Node 0 1 10 1 Service Request Made 2 3 DCM 3 Service Request Made 4 PLL Service Request Node 5 GTO 1 Service Request Made 10 13 GTCS 15 _ _ Service Request Made 14 17 RTCTB 23 Service Request Made 18 21 RTC24 31 Service Request Made 22 23 Service Request Made 24 25 LTCS 15 Service Request Made 26 27 LTCTB 23 Service Request Made 28 29 LT
12. Wi nop ADD F R1 R5 SIZE 32 nop eue ma RI R5 nop INT 0 Beal UC exit no interrupt channel start d next PC nop JL channel 4 p Notes A special section name pcpdata is used to the linker locator to locate this section in pcp data memory pram This section is initialized at start up time pepelata DATA eu 21102 word 0 0 7 57 sword 050 RG sword 050 DOSES sword 020 owore 0x0 EDS owore 0x0 owore 0x0 SOBRE word 0x0 RO CHili channel 1 lt lt 16 0x0140 R7 channel enable set DPTR 0 word 0x00010000 2 CPU Interrupt Configuration owore 0x0 RS PI OUT R4 P1 Output Register owore 0x0 R3 owore 0x0 R2 owore 0x0 sword 0x0 3 RO Copyright 2005 Hitex Development Tools GmbH Page 33 34 Application Note 228 word channel 2 lt lt 16 0 0140 word 0x00010000 word 0 0 mood P4 OUT owore owore owore 0x0 owore 0x0 els woe sword 001000000 ASCO addr o Ouse word 0 00000000 word 0x00000000 word 0 00000000 ch4 Word channel 4 lt 125 040147 word 00000001 sword lGlobalCounter PCE word 0x00000000 word 0x00000000 word 0x00000000 word 0x00000000 word 0x00000000 Module End Copyright 2005 Hitex Development Tools GmbH hitex mum DEVELOPMENT T
13. Application Note Service Request Node 14 17 2 Service Request 14 Trigger Control GPT AO Service Request 15 Trigger Control Enable service request on GTC16 event Enable request on ele event compare GTO timer Enable request off m Enable request event celie aPTA Service Request Made 14 Enable Control Enable service request node 14 5 14 GPT AQ Service Request Node 15 Enable Control 1 Enable service request node dE Service Request Node 16 Trigger Control GPT AQ Service Request Node 17 Trigger Control Enable serice request on event Enable request on event Eel redditae Enable serice request on BESH event E Errata E request on DESS event celie dianed celie disabled Service Request 16 Enable Control Enable semice request node 8 1 I3PTAL Service Request Made 17 Enable Control Grable semice B BET e Finally select the functions you want to be created by DAVE Select at least GPTAO_vinit E General Purpose Timer Array 0 GPTAO Initialization Function Source File vinit File name
14. C24 31 Service Request 30 31 LTCSZ 39 Service Request Made 32 33 LTCAU 47 Service Request Made 34 35 LTC48 55 Service Request Node 36 37 LTC56 63 Copyright 2005 Hitex Development Tools GmbH Page 20 34 hitex mum DEVELOPMENT TOOLS Application Note ea I3PTA Service Request Made 6 Trigger Control GPT AO Service Request Made Trigger Control 72 Enable service request on GTCO event Enable semite request compare GTO timer Enable semite request on THES ewent celle disabled Enable semite request event cell te disabled GPT AQ Service Request Made 6 Enable Control Enable service request node SREE GPT AO Service Request Made Enable Control Grable request node Shey Service Request Node Trigger Control GPT AU Service Request Node Trigger Control Enable semite request on WIEG ewent cell te disabled Enable semite request on ile event cell 8 disabled Enable Service request WES event Enable request on MEn event disabled celie Service Request Node Enable Control Grable sence request node GPT AU Service Request Node 3 Enable Control Grable senice request node SERES E General Purp
15. N 176 WORD 4 Expression Value xF0050000 0000 O1 main lGlobalCounterPCP 0 00000000 0 OxF0050010 0000 02 main GlobalCounter 0 00000000 0 050020 0140 0 0050030 0000 0 0050040 0142 0 0050050 0000 0 0050060 0140 0 0050070 0 0050080 a 2 Locals Wwatch5 Debug Halted 7 HISCRIPTLog Before starting the emulation set the PC has to be set to 1000000 because the example application is linked to this address and the Starterkits usually reset to 0000000 depending on the hardware configuration options For more information see the Tricore Starterkit User Manual Copyright 2005 Hitex Development Tools GmbH Page 8 34 mum DEVELOPMENT TOOLS Application Note e To perform target reset setting the PC use the SetPC script button provided in the toolbar 5 T The script linked to this button additionally performs Go until main to ensure that the PCP code is copied into RAM Start the emulation of the TC1796 s TriCore by using the F5 key or by clicking on the Go button An LED should blink at regular intervals e Inthe Source window switch to the PCP tab e debug the PCP set a breakpoint e g at address PCPCODE OxXXXXXXXXXX The PCP will stop the execution with the PCP PC on the breakpoint s address With a single step F9 F11 you can step through the code and turn on o
16. OOLS R7 channel enable set DPTR 0 EIOS EStG ndum stern RS R4 P4 Output Register RG RA RAI RO R7 channel enable set DPTR 0 CPU Configuration R4 R3 R2 R1 RO R7 channel enable set DPTR 0 R6 CPU Interrupt Configuration R5 R4 RG R2 RI RO Page 34 34
17. P program Channel 1 2 Channel 3 Channel 4 Priority level Description Toggles the on Toggles an LED Simple echo Increments a board LED externally function at the global variable Pin 1 15 connected serial port ASCO Pin 4 7 in this storing the example character into a global variable Table 1 Example program functions Channel 1 2 Channel 3 Channel 4 Priority level Interrupt GPTAO SRN14 GPTAO SRN10 ASCO receive SRN GPTAO SRNG Used timer GPTAO GPTAO GPTAO array 9 7 se se 05sec 5 05sec se 18620000 Table 2 Used timer interrupts Copyright 2005 Hitex Development Tools GmbH Page 4 34 mum DEVELOPMENT TOOLS Application Note Toggle LED The codes for channel 1 and channel 2 are identical except for the port used The first entry point from the channel is stored in the CSA It is preselected with the address from the label channel 1 channel 2 With the very first interrupt concerning the channel the port is initialized and the port is set to low The PCP runs to the exit command and waits for the next interrupt From this point the PCP continues working from next PC to the next exit command and switches the LED on With the next interrupt the PCP switches the LED off and runs until exit The next interrupt causes the PCP to jump to the label led on This behaviour is the same like with channel 2 Ch
18. T Bus Access Parameters Registers Bus Control Registers H Emulator Registers Automatic inclusion of sfr file e g disable for DAVE projects SDRAM Registers H Other Registers B Compiler Define user macros e g 1001 SERIAL gt Preprocessing 2 Embedded C Settings C Language Include this file before source T Warnings jo Precompiled Headers Miscellaneous Browse 2 Optimization Allocation Options string warnings A c na tasking sfr Cic 796b Awe c38 switch auto gt W c alignz1 00 inline mas incre35 inline mas sizez10 0 Miscellaneous J PRODBDIR include GL Aesembler Cancel Default Help 22 Disable the default allocation Otherwise you will get error messages from the Tasking compiler caused by a compiler bug TriCore toolset Project Options 101796 PEPDEMU PJT H Bus Access Parameters Registers Allocation H Bus Control Registers E Emulator Registers T SDRAM Registers Default allocation tor objects below threshold Other Registers Default a1 allocation for objects below threshold E C Compiler Prepracessing jo Embedded C Settings 2 C Language Z Warnings Z Precompiled Headers Miscellaneous C Compiler Preprocessing Language js Debug Information jo Code Generation 2 Optimization bad Options strin
19. TC 21 GTC 22 GTC 23 GTC 24 25 GTC 26 GTC 27 GTC 28 GTC 23 ITE 30 GTC 31 Copyright 2005 Hitex Development Tools GmbH Page 17 34 hitex DEVELOPMENT TOOLS Application Note Global Timer Cell 0 GTCO 9 o 2 Data Input Output Selection GTCO Enable Control Multiplexer Connection Enable I3 cell after initialization 7 GTCO Made Selection MOD GTCO Mode Control Capture GTO timer Equal compare C Capture GT1 timer Greater or equal compare gt f Compare with timer Capture After Compare Select Shot Mode Enable C Compare with timer Enable capture after compare CAC Ia TCI Register aT CU register value D FFFD SD Enable Shot Mode EIS M GTCO Output Control Made D CM Bypass Control Hold the TL output by an local event only Force the selected action after initialization 014 General Purpose Timer Array 0 GPTAO 2 ota 7 Global Timer GT GTO GT 1 Global Timer Cell BTE GTC ITE 1 GTC 2 GTC 3 GTC 4 GTCS ITE B GICs GTC 3 GTC 10 GTC 11 GTC 12 GTC 13 GTC 14 GTC 18 GTC 15 GTC 17 GTC 18 GTC 13 GTC 20 GTC 21 GTC 22 GTC 23 GTC 24 25 GTC 26 GIL z GTC 28 GTC 23 ITE 30 GTC 31 Copyright 2005 Hitex Development Tools GmbH Page 18 34 hitex DEVELOPMENT TOOLS Application Note Globa
20. annel 1 toggle 15 Channel 1e nop leal iu ri MA ITOCRIZ 3 Inicialize port PIs lal il ri lo PI1 ITOCRIZ port register 12 set i lell cert pin tO Output elr 2 Ser pin P1 15 TO LOW nop exit ec 0 st 0 int 0 0 12 Ue Pe Exit AO interrupts start 0026 2280 nop led ons 2 LED elr OR PITIS 11 22 p CC UGC 3 Exit no interrupt start next PC nop led 2 Switch LED set i r4 E PILIS nop exit Ses st 0 int 0 CG UGC Exit nO interrupt start next PC nop j led on Loop ems PEIR Oxi chan enable sword Ox000 10000 2 RO CPU Interrupt Configuration 12020020 R5 Sword PI OUT ge RA PI Output Register owore 0x0 nS owore 0x0 R2 owore 0x0 RI word 050 RO ehz s or 2 lt lt gt R 0x1 word 0x00010000 2 RO CPU Interrupt Configuration owore word P4 OUT R4 P4 Output Register owore 0040 0x0 9 R2 owore 0 0 RI owore 0x0 gt RO Copyright 2005 Hitex Development Tools GmbH Page 5 34 mum DEVELOPMENT TOOLS Application Note Local Echo With each interrupt from the ASCO the PCP loads the ASCO receive buffer and transfers it into the ASCO transmit buffer Additionally the transmit buffer will be copied into R3 that is the cBufPCP variab
21. ction This application note describes how to debug the TC 1796 PCP We are using and the Tanto TriCore to debug and DAvE and Tasking VX Toolset for TriCore v2 2r1 to generate the application The evaluation board being used is an Infineon TriBoard TC1796 300 The aim of this document is to debug a PCP example with HiTOP For this the following has to be performed e adjusting the TriCore peripherals using DAVE e creating an executable using the Tasking Tool chain e opening the debug session using the Tanto debugger and as the user interface Note that an example project for the Tanto TriCore can be downloaded from www hitex com which will do the required settings 2 About PCP The PCP is a Peripheral Control Processor that relieves the CPU from most of time critical interrupts Basically the PCP is to be considered as a conventional processor executing code in response to interrupts only Whenever the PCP handles an interrupt it will use a register set which depends on the interrupt priority level currently used For this reason the term channel will be used in this document Copyright 2005 Hitex Development Tools GmbH Page 3 34 mum DEVELOPMENT TOOLS Application Note 3 Example To demonstrate the behavior of the PCP four different channels are used to handle four different interrupts from the TC1796 The following table shows the assignment of the interrupt channel to the function in the PC
22. ew file The real PCP pcpWork pcp program will be delivered with the example project see also the Appendix on p 32 You have to add it to the tasking project You may now generate the executable using the Tasking Compiler s Make button This generated executable can be loaded to the target as described on p ff Copyright 2005 Hitex Development Tools GmbH Page 31 34 hitex mum DEVELOPMENT TOOLS Application Note Appendix M SR x x c c c E use pcpWork pcp 2 276 mA AR AAA A AA UR AAA AA AA A A A A A AAA AAA A A A A IE OS E eoe o bo o bo oo ooo p Definition of symolols extern lGlobalCounterPCP extern cBufPCP ASCO addr 50000420 address register ASCO TBUE ASCO RBUF 0000 24 address of register ASCO 7 NOES A special section name pcptext is used to the immer locator to locate this section in pep code The CODE and INIT attributes are used to force this section to be copied at the start up of the program to pcode memory CODE INIT Sect pcptext 2 Channel L eoo ceu LED PL 15 Channel 1e nop lal iu ri ni PI _IOCRIZ p Initialize port PIs lal il ri port control register 12 sert oi sr 1026 1686 pin P1 15 tO Output elr 3 6er pln P1 15 tO LOW nop exit ec 0 Exit nO interrupts
23. g M Default allocation for objects below threshold 9 gt Warnings Wwie no tasking sfr Etel 796b V c c89 Aw cA switeh auto gt AM c alianzl 4 c O0 mnline mas inere 28 inline mas size 10 A c NU Miscellaneous J PRODBDIR Junclude 31 s emhler iz Cancel Default Help 2 Copyright 2005 Hitex Development Tools GmbH Page 30 34 hitex mum DEVELOPMENT TOOLS Application Note 3 3 2 Customizing Code The code created by DAVE is only a frame of functions which have to be customized To get the example running you should insert the following sections In the created code the following sections are embedded in the source USER CODE BEGIN Main 9 USER CODE END Code inserted between these keywords will not be changed by in the following The table below gives an overview on files and sections you have to change Seaton O MAIN General 7 unsigned long 1GlobalCounter unsigned long IiGtoboalCountersPCP char EE pcplnit c 5 include main h 7 Thais function larcializes che PCP unite x enable PCP channel start is taken from restored context use full context save 2 initPCP void PCP esr 030002001 ICR 90 et m Context Full context 0 03000000 3L eyeles 2 arbitration 7 Create a n
24. in use In this example Infineon s TC1796 Starterkit is used working properly with the following configuration Copyright 2005 Hitex Development Tools GmbH Page 10 34 hitex mum DEVELOPMENT TOOLS Application Note Project Settings 19 2 General System Clack Interrupt System System Driver Startup Configuration Notes A d External Clack Frequency External clock frequency 20 PLL Bypass operation fosc MHz pin BYPASS 1 Input divider fp fosc 2 10 000 MHz Voltage Controlled Oscillator CO Bypass mode WOO range enn MHz 700 MHz Feedback divider NDIV ico fosc 600 000 MHz 600 000 Output Divider Output divider KDI tenu 15 40 000 MHz EBD The fepu feys is 271 System Clock 20 00000000 MHz The ratio is 1 1 e Do not forget to enable the Interrupt System x 1209 da 2 General System Clack Interrupt System System Pad Driver Startup Configuration Notes CPU Global Late Number of Arbitration Cycles Four arbitration cycles 255 interrupt sources Three arbitration cycles max 63 interrupt sources Two arbitration cycles 15 interrupt sources One arbitration cycle 3 interrup
25. kind with regard to this material including but not limited to the implied warranties of merchantability and fitness for a particular purpose Hitex Development Tools assumes no responsibility for any errors that may appear in this document DProbe Hitex Tanto and Tantino are trademarks of Hitex Development Tools All trademarks of other companies used in this document refer exclusively to the products of these companies 00 002 0 10p eyoNuoneoirddy DEVELOPMENT TOOLS Application Note Preface In order to keep you up to date with the latest developments on our products we provide Application Notes containing additional topics special hints examples and detailed procedures etc For more information on the current software and hardware revisions as well as our update service please contact www hitex de www hitex co uk or www hitex com Contents Introduction About PCP 1 2 3 Example 3 Debug Session 3 1 1 Preparing the Session 3 1 2 Using the Example Project 3 2 Generating Framework with DAVE 3 2 1 Configuring GPTA 3 2 2 Configuring ASCO 3 2 3 Configuring PCP 3 2 4 Generating Code 3 3 Setup Tasking Project 3 3 1 Making the Project 3 3 2 Customizing Code IN IN IN gt Is ISIS IB ISIN le 109 Copyright 2005 Development Tools GmbH Page 2 34 hitex mum DEVELOPMENT TOOLS Application Note 1 Introdu
26. l red marked in the figure below and make the following settings 179 e Activate the PCP Peripheral Control Processor PCP 2 108 2 Enable ENDIMIT true then disallow writes to the register EIE Enable Control Enable PCP for operation after initialization Context Size C5 Channel Start Mode Control f Use Full Context save area R U R F Use Small Context save area R F Use Minimum Context save area AIE R F Start progam counter as left by last invocation Start program counter at the appropriate channel entry point Channel Watchdog Enable channel watchdog Channel watchdog number 15 Q 0 2 Error Service Request Mode Maxinum Channel Checking Enable maximum channel number checking PFE Maximum channel number 2 Enable PCP error CPU SRN Copyright 2005 Hitex Development Tools GmbH Page 27 34 hitex mum DEVELOPMENT TOOLS Application Note e The last step to be done by DAVE is assigning the interrupt levels Peripheral Control Processor PCP2 jEP lntemupt max255 0 PCPIntemupt max285 GPTAU SAN 6 ASCO receive SAN GPTAU SAN 10 GPTAU SAN 14 Note To change the level and the group of an interrupt source click an it drag it to tts new position and drop it
27. l Timer Cell 8 GTCS 28 ea Data Input Output Selection 3T C8 Enable Control Multiplexer Connection Enable GTCS cell after initialization TCS Mode Selection MOLD GTCS Made Control Capture GTO timer Equal compare C Capture GT1 timer Greater equal compare gt gt Compare with B timer Capture After Compare Select One Shot Mode Enable f Compare with T1 timer Enable capture after compare GTCS Register GTCS register value 4 D FFFFF Enable Ore Shot Mode 05M GITC8 Output Control Made Bypass Control Hald the GTCS output by an local event only Force the selected action after initialization 015 General Purpose Timer Arap 0 GPTAO ota Global Timer GT GTO GT 1 Global Timer Cell GTC GTC ITE 1 GTC 2 GTC 3 GTC 4 GTCS GICE GICs GTC 9 GTC 10 GTC 11 GTC 12 GTC 14 GTC 15 GTC 18 ITE 13 GTC 20 GTC 21 GTC 22 GTC 23 GTC 24 GTC 25 GTC 26 GTC 27 28 GTC 23 GTC 30 GTC 31 Copyright 2005 Hitex Development Tools GmbH Page 19 34 hitex mum DEVELOPMENT TOOLS Application Note 83 Global Timer Cell 16 GTC16 8 2 1 Data Input Output Selection Ia TE T5 Enable Control Enable I3 T C15 cell after initialization GTC16 Mode Selection MOD C Capture
28. le in the main program After the next interrupt the PCP jumps to the beginning of this code part and runs up to the exit command gt Channel 35 local echo on ASCO transfer value to R3 gt global variable Channel 3 DORSET PA wis R1 ASCO Receive Buffer nop gt ASCO Transmit Buffer BI nop ST E RI R3 SIZE 32 ASCO Transmit Butter gt R3 gt nop EXIT SUSU INT 0 HPS cc UC 2 exit Stark 8 next PC nop Jl channel 3 we wal channel 3 lt lt 16 0 R7 channel enable set DPTR 0 word 0x01000000 2 RO CPU Interrupt Configuration word ASCO addr DES word ASCO RBUF addr R4 suse PCE word 0x00000000 EDD word 0x00000000 ZEE word 0x00000000 Increment With the first interrupt concerning this channel the PCP loads the contents from the variable IGlobalCounterPCP into the register R1 increments it by 1 and then stores it back to the variable After an interrupt the PCP jumps to the beginning of this section repeats the procedure and halts on the exit command Channel 4 increases R5 gt global variable channel 4 al nop ADD F R1 R5 5 2 22 nop ST P RI R5 12 22 nop EXIT COL UL INT 0 Bel co UC exit no interrupt channel start next nop 11 channel 4 ChA s word channel 4 lt lt 16 0x0140 7 channel enable set DPTR 0 word 0x01000000 R6 CPPN
29. ontrol Grable senice GPT AO Service Request Node 12 Trigger Control GPT AO Service Request Made 13 Trigger Control Enable request on 1 event Enable serice request on S event 2 cell te celie dikabled Enable service request on GIES event 2 cell te Enable semite reguest on GEIS event 2 cell te disabled GPT AU Service Request Node 12 Enable Control Enable service request node de HET GPT AO Service Request Node 13 Enable Control Enable service request node Te ET S Ww General Purpose Timer Arap 0 GPTAO 8 2 Service Request Nodes Service Request Made 0 1 DEMO 1 Service Request Made 2 3 DCM 3 Service Request Node 4 PLL Service Request Node 5 GTO 1 Service Request Node 3 7 Service Request Node 10 13 RTCB 15 Service Request Node 18 21 BTC24 31 a Service Request Made 22 23 7 Service Request Made 24 25 LTCS 15 Service Request Made 26 27 23 Service Request Made 28 29 LTC24 31 Service Request Made 30 31 LTC32 33 Service Request Made 32 33 LTC40 47 Service Request 34 35 LTC48 55 Service Request Made 36 37 LTC56 63 Copyright 2005 Hitex Development Tools GmbH Page 22 34 hitex mum DEVELOPMENT TOOLS
30. ork 0 0000018 00000003 ocana H S scu 0 000001 300 3 000001 Globals 0xA000001E FFFF6D00 JGE D15 1 0xa00000f8 A00013E0 0 0000022 9600 OR 015 0 0 80000000 0 0000024 BBFOOFOO MOV U OxfF 0 0000028 85FF0080 LD W 15 0 0000200 00000000 0 000002 9BFOFFOF ADDIH D0 DO Oxffff 00000000 0 0000030 260 AND 015 00 puis 0 0000032 8FOFSOF1 OR 15 015 40 100 0 0000036 ASFFOOBO 5 Oxfo000200 D15 0000064 0 000003 1000 500 1 0 0000184 70000060 0 000003 FFFFO24F GE D15 f 1 0x9fff9e42 PTT 0 0000042 60008500 CALL Oxa000014c 00000000 0 0000046 10 MOV U 01 0 40000000 000004 85 00080 LD W 00 0 0000200 0 000004 OBFIFFIF ADDIH _D1 D1 0xffff DEN 0 0000052 2610 AND 00 01 00000000 0 0000054 8 005001 OR 00 00 0 100 00000000 0 0000058 5 080 ST W Oxf0000200 D0 CE 0 000005 60009400 CALL 0 0000184 00000000 0 0000060 804 02 MOV U D0 0x24f8 00000000 0 40000064 CSFF3080 LEA 15 0 0000230 Moduleview 0 0000068 98100000 ADDIH 00 00 1 71 0 00000000 LEN 32 WORD gt 1GlobalCounter LEN 80 WORD Address Data SMALL DATA LEN 32 WORD SHALL LEN 16 WORD 0 00000000 LEN 32 WORD 0 0050000 LEN 80 WORD 0 0050000 LEN 80 WORD 0 0050000 LEN 64 WORD 0 0050000 LEN 64 WORD 0 0050040 LEN 176 WORD OxFOO4FF50 LE
31. ose Timer Array 0 BPTAU 2 Service Request Nodes Service Request Made 0 1 10 1 Service Request Made 2 3 DCM 3 Service Request Made 4 PLL Service Request Node 5 GTO 1 Service Request Made B 9 BTLT 7 C sese sgt Node Service Request Made 14 17 6 1 23 Service Request Made 18 21 RTC24 31 Service Request Made 22 23 Service Request Made 24 25 LTCS 15 Service Request Made 26 27 LTCTB 23 Service Request Made 28 29 LTC24 31 Service Hequest Made 30 31 LTCS2 39 Service Request Made 32 33 LTCAU 47 Service Request Made 34 35 LTC48 55 Service Request Made 36 37 LTC56 63 Copyright 2005 Hitex Development Tools GmbH Page 21 34 hitex mum DEVELOPMENT TOOLS Application Note d Service Request Node 10 13 99 ta 2 SHNs 1 Interrupts Functions Service Request Node 10 Trigger Control GPT AO Service Request 11 Trigger Control Enable service request on GTCS event compare RT 1 timer Enable semite request onl event celie Enable request on lies exert disabled request on DIE event disabled GPT AO Service Request 10 Enable Control Enable service request node 10 SRE10 GPT AO Service Hequest Node 11 Enable C
32. r off the LED To jump into another channel you just have to set the breakpoints to the following addresses Start Address Breakpoint Address Im PCPCODE 0x00000000 PCPCODE 0x00000009 PCPCODE 0x00000013 PCPCODE 0x0000001C PCPCODE 0x00000027 PCPCODE 0x00000027 PCPCODE 0x00000030 PCPCODE 0x00000030 Note Channel 1 2 and 4 are triggered periodically from the timer Channel 3 will be triggered from the serial interface To stop at a breakpoint you must send a character via the serial interface Copyright 2005 Hitex Development Tools GmbH Page 9 34 Application Note hitex mum DEVELOPMENT TOOLS 3 2 Generating Framework with DAvE To work properly with the TriCore and the PCP you have to configure all TriCore SFRs With Infineon s Digital Application virtual Engineer you may create a framework of functions initializing your SFRs In the following the settings being different to DAvE s default settings are presented e Start DAvE and create a new TC1796 project In the General tab of the Project Settings dialog select the correct compiler settings Project Settings 8 2 Controller Type Type 796 system clock 50 MHz Source File Header File File name MAIN c File name Compiler Settings GNU Tasking 1 5 Tasking 2 0 e In the following dialog you may select your system clock These settings depend on the target
33. start next nop lec on 7 Switch LED ON elr 1090 Ee PINTS 32 Mcd Mc 2 Exit nO interrupt Start Q next nop 2016 2 LED set r4 PIRIS exit 0 st 0 int 0 pela e we 2 Exit nO interrupt start next PC nop Jl led on Loop Channel 2 toggle LED P4 7 Channel 2e nop leal iu ri ni P4 IOCRIZ Initialize port P4 il rl IOCRIZ Control register 12 et gU see pin P47 TO 21 lei 0x7 Set pin P4 7 to Low zit ec 0 st 0 int 0 uc Exit nO 1NTtT amp rrupts Start next PC nop 15012 8 Swith LED mE T 0x7 gt Clear P4 7 Copyright 2005 Hitex Development Tools GmbH Page 32 34 mum DEVELOPMENT TOOLS Application Note nop exit Sea Sea lime p Be 2 Exit nO interrupt Start next qoe 2 LED nop set 0x7 Ser P4 7 nop exit p Exit NO interrupt start next nop LOOP Channel 5 local echo on ASCO value to R3 gt global variable Channel 3 DORT PA 2 ASCO Receive Buffer nop R5 SIZE 32 gt ASCO Transmit Buffer BI nop ST E RI R3 SIZE 32 ASCO Transmit Butter gt R3 gt CBuULPCE nop EXIT INT 0 cc UC exit no interrupt channel start 0 next PC nop JL channel 3 channel 4 Ril
34. t sources Number of Clocks per Arbitration Cycle COME CYC Two clocks per arbitration cycle C One clock per arbitration cycle low frequency Copyright 2005 Hitex Development Tools GmbH Page 11 34 hitex mum DEVELOPMENT TOOLS Application Note e and the PCP System ds Project Settings Copyright 2005 Hitex Development Tools GmbH Page 12 34 hitex mum DEVELOPMENT TOOLS Application Note 3 2 1 Configuring First step is to assign the timer settings to the GPTA Click on the GPTA clock area red marked in the figure below and use the following settings PLMB O PADU el 9 CPS mL a M ger alg 9 GPTA Clock 2 Timer Clock Conta Module Disable Request Sleep Made Enable Control Disable the sleep made for the module EDIS Divider Mode Control Disable Clock Control BEES becomes inactive after initialization Select normal divider made Enable Hardware Clock Control Bit DISCLK ts reset by Hw while input signal Select fractional divider mode ECEN INT 0151 a high level Module Clack Control Required module clack MHz 9 980 Real module clock MHz 20 000 Minimal module clack KHz 9 531 Percentage of deviation 5 00 Disable the module DISA Maximal module clack MHz 20 000 Step value STEF JOx3FF Copyright
35. terrupts every gt second General Purpose Timer Array 0 GPTAQ 2 Input Pins Clock Generation Global Timer Local Timer Output Pins Functions SAN Parameters Notes Global Timer GT Global Timer Cell GTC GTC GTC 1 GTC 2 GICs GTC 4 GIES ITE B GICs ITE 3 GTC 10 GTC 11 GTC 12 GTC 13 GTC 14 GTC 15 GTC 16 GIC1 GTC 18 GTC 19 ITE 20 GTC 21 GTC 22 GIC 23 GTC 24 GTC 25 GTC 26 GTC 27 GTC 28 GTC 23 GTC 30 GTC 31 Copyright 2005 Hitex Development Tools GmbH Page 16 34 Application Note hitex DEVELOPMENT TOOLS Global Timer 1 GT1 92 7 Timer Clock Selection 1 Bus signal Clock bus 7 clock 2 14 1 221 KHz 819 2000 psl TGE Flag Source Selection 5 0 Reload Value Compare flag bit of the substraction result 311 reload Value REV ID FFFD an To get different interrupts we use the global timer cells 0 8 and 16 Each cell we assign to one SRN of the TriCore First configure the timer cells e Click on the GTC GTC8 and GTC16 buttons and make the suggested settings i General Purpose Timer Array 0 GPTAO 9 c2 7 Global Timer GT GT 1 Global Timer Cell BTE GTC ITE 1 GTC 2 GTC 3 GTC 4 GTCS ITE B GICs GTC 9 GTC 10 GTC 11 GTC 12 GTC 13 GTC 14 I TC 15 GTC 15 GTC 17 GTC 18 GTC 13 GTC 20 G
Download Pdf Manuals
Related Search
Related Contents
Sylvania 0027840 fluorescent lamp - biovendis PAT APPAT BLEU Les Rendez-vous - Le Grand Cercle D F I E - Makita gereedschap online kopen? Mtools.nl OR 52 5 OR 52 6 Copyright © All rights reserved.
Failed to retrieve file