1 / 7

Exercise 7ASC_1 - DAvE Configurations

Exercise 7ASC_1 - DAvE Configurations. Start DAvE Create new Project with microcontroller C167CR/CS* Project name: 7ASC_1 Select project path: c:hot167_17asc_1 Project Settings: General: Select Keil Compiler, SMALL model System Clock: External Oscillator Frequency: Set to 5 MHz

wolfe
Download Presentation

Exercise 7ASC_1 - DAvE Configurations

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Exercise 7ASC_1 - DAvE Configurations • Start DAvE • Create new Project with microcontroller C167CR/CS* • Project name: 7ASC_1 • Select project path: c:\hot167_1\7asc_1 • Project Settings: • General: • Select Keil Compiler, SMALL model • System Clock: • External Oscillator Frequency: Set to 5 MHz • Startup Configuration: • Bus Type after Reset: Set to 16 bit DEMUX • Write Configuration: Pin #WR and #BHE operates as #WRL and #WRH • Save & close * C167CS not yet supported by DAvE V1.0 CD ROM. See “Hints regarding DAvE.” HOT167-1 Version 2.0

  2. Exercise 7ASC_1 - DAvE Configurations (cont.) • Configure GPT1: • Core Timer 3: • Timer 3 Mode: Timer Mode • Up/Down Control: Count down • Timer Start: Start T3 after initialization • Input Selection: Fcpu/16 (this results in a resolution of 0.8us and a period of 52.4ms) • Timer Register: Load T3 Register with 10ms value((10ms / 0.8us) in HEX) (0x30d3) • Interrupt Control: Enable Timer 3 interrupt • Auxiliary Timer 4: • Timer 4 Mode: Reload Timer 3 with T4 • Timer Register: Load T4 Register with 10ms value((10ms / 0.8us) in HEX) (0x30d3) • Input Selection: Any transition of output toggle latch T3OTL HOT167-1 Version 2.0

  3. Exercise 7ASC_1 - DAvE Configurations (cont.) • Configure GPT1 (cont.) • Interrupts: • Choose interrupt level for GPT1 Timer 3 interrupt • Functions: • Include GPT1 initialization function GT1_vInit • Save & close • Configure ASC USART: • Control: • Global: Use pin TxD0 for ASC • Receiver: Enable Receiver (S0REN) • Baudrate: • Required Baudrate: Depends on your debugger configuration; Default after installation is 9600 baud • Functions • Include ASC_vInit, ASC_vSendData • Save & close • Generate Code HOT167-1 Version 2.0

  4. Exercise 7ASC_1 - µVision2 Configurations • Start µVision2 • Open Project c:\hot167_1\7asc_1\7asc_1.uv2 (Project | Open Pr.) • Add Files: • Go to Project | Targets, Groups, Files… • Click ‘Groups / Add Files’ • Select ‘Source Group 1’ • Click ‘Add Files to Group’ • Select all C files and click ‘add’ • ???Enter file name ‘start.asm’, click ‘add’ (Assembler Startup File) • Click ‘Close’ and ‘OK’ • Double-click all files in the Project Window to open them • Select Target Hardware (kitCON-167): • Go to Project | Options for Target ‘Target 1’ • Go to ‘Debug’ tab • Click ‘Settings’ (upper right hand corner) • Monitor configuration: select ‘Phytec KC167’ • Click ‘OK’ twice HOT167-1 Version 2.0

  5. Exercise 7ASC_1 -µVision2 Configurations (cont.) • Edit MAIN.C: • include endless loop in main(): // USER CODE BEGIN (Main,2) while(1) {}; // USER CODE END • Edit GT1.C: • Define Global Variable ascii_char:// USER CODE BEGIN (GT1_General,2)unsigned char ascii_char;// USER CODE END • In Timer 3 Interrupt Service Routine (GT1_viIsrTmr3(void)): Write ascii_char to ASC and increment ascii_char: // USER CODE BEGIN (GT1_IsrTmr3,1)ASC_vSendData(ascii_char++);// USER CODE END HOT167-1 Version 2.0

  6. Exercise 7ASC_1 - Running the Program • Reset Target Hardware (Press Reset Button on Starter Kit) • Build Project (Project | Rebuild Target) • Run integrated Debugger from within µVision2 • Debug | Start / Stop Debug Session (click ‘OK’ when prompted) • The Debugger will load the Keil Monitor into the kitCON-167’s RAM via bootstrap loader • Object file c:\hot167_1\7asc_1\7asc_1 will be loaded automatically and the debugger will go to main(). • Go! (Debug | Go) • Program Verification: • Watch Serial Window in Debugger (View | Serial Window #1)(right mouse button lets you switch between ASCII and Hex output) • Connect Scope to P3.10 / TxD0 (connector X3 pin 110)(select 200 us/Div, trigger on falling edge) • Hint: When stopping the program, override the appearing error message by pressing “continue”. The program will stop. HOT167-1 Version 2.0

  7. Exercise 7ASC_1 - Screenshot P3.10 / TxD0 HOT167-1 Version 2.0

More Related