Download presentation
Presentation is loading. Please wait.
Published bySylvia Lester Modified over 8 years ago
1
Siemens Microelectronics, Inc. December 98 Slide 1 HOT50x-5 Version 1.0 HOT50x-5 An Add-On to the HOT50x_1 Hands-On Training Materials for the 8bit Family using kitCON-CAN/LCD Module (from PHYTEC; plus DAvE, the kitCON-50x Starter Kit, the Keil uVision + dScope) This version is based on DAvE Version 1.0, uVision V1.24, dScope V1.3W Starter Kit CD ROM V4.0. - Please report any errors to mike.copeland@smi.siemens.com
2
Siemens Microelectronics, Inc. December 98 Slide 2 HOT50x-5 Version 1.0 HOT50x_5 is an add-on to the HOT50x_1 and training materials for the Siemens C500 family of 8-bit microcontrollers. HOT50x_5 will show you how to run the kitCON CAN/LCD Module You can use the HOT 50x-5 for the kitCON CAN/LCD Module in connection with the following 8bit Starter Kits: C504 C505 Introduction to HOT50x_5
3
Siemens Microelectronics, Inc. December 98 Slide 3 HOT50x-5 Version 1.0 Features of the kitCON-CAN/LCD from PHYTEC Two Stand Alone Full CAN Controller 81C90 and 81C91 BATRON LCD-Display (2 lines X 16 Characters) 2 lines X 16 Characters Hitachi Dot Matrix Liquid Crystal Display Controller/Driver HD44780 8 LEDs that can either be connected with Port P0 and P1 of the CAN- Controller or with Port P1 and P3 of the C50x Optional optical decoupling of the CAN - Interface
4
Siemens Microelectronics, Inc. December 98 Slide 4 HOT50x-5 Version 1.0 Features of the Stand-alone Full-CAN Controller SAE 81C90/91 Complies with CAN Specification V2.0A (B passive) (talks Standard-CAN, tolerates Extended-CAN) Maximum CAN Transfer Rate (1 MBit/s) @ 16 MHz Clock Basic CAN Feature (Message Object 0) Full CAN Device 16 message objects with their own identifier and their own status- and control bits Each message object can be defined to handle data frames or remote frames Objects 0 - 7 are equipped with two time-stamp bytes which provide time related information on the or captured in the message memory reception status requency or received data. CAN Module 1444342324140654 2324252621222728181920 12 13 14 15 10 11 16 17 7 8 9 34 33 32 31 36 35 30 29 39 38 37 1282732 141516 12 13 11 10 9 8 7 6 5 4 17 18 19 20 21 22 23 24 25 26 SAE 81C91 SAE 81C90
5
Siemens Microelectronics, Inc. December 98 Slide 5 HOT50x-5 Version 1.0 Features of the SAE 81C90/91 (cont.) Two interfaces to the host controller User configurable outputs for different bus concepts Transmit Check Unit Message Identifier reprogrammable "on the fly" Several transmit jobs can be sent with a single command Programmable Clock Output Interrupt Output to Host-Controller CAN Module
6
Siemens Microelectronics, Inc. December 98 Slide 6 HOT50x-5 Version 1.0 How to set up your system How to set up your system: kitCON-50x HW setup see respective HOT50x material. How to set up your system: DAvE installation see respective HOT50x material. How to set up your system: Keil uVision installation see respective HOT50x material. How to set up your system: Tasking EDE installation see respective HOT50x material. How to set up your system: Exercise directory structure see respective HOT50x material. For this exercise use c:/HOT50x_5/ Hints regarding DAvE and the Exercises see respective HOT50x material.
7
Siemens Microelectronics, Inc. December 98 Slide 7 HOT50x-5 Version 1.0 Exercise kitCAN - Using the kitCON - CAN / LCD Objective: Transmit the context of Port 0 with the 81C90 CAN-Controller (2)* -Count up Port 0 of the 81C90 (1)* -Use 100kbaud bus speed -Use Message Object 1 -Use Identifier 0x7 (11-bit-Identifier) -Use one Data Byte containing the Port 0 value Receive all Messages with Identifier 0x7 with the 81C91 CAN- Controller (3)* -Write the received Data Byte 1 to the LCD - Display (4)* *) refer to the picture on the next site
8
Siemens Microelectronics, Inc. December 98 Slide 8 HOT50x-5 Version 1.0 CAN-Bus Transceiver Receive Transmit CAN_H CAN_L CAN-Bus Transceiver Receive Transmit CAN_H CAN_L SAE 81C91 Px.y Pv.w SAH C505C Connection to the Application A8 Address Decoding Logic Exercise kitCAN - Using the kitCON - CAN / LCD (cont.) SAE 81C90 Add/ Data Siemens HOT Data: 018 LCD - Display LED 1 3 2 4 A9 CAN_L CAN_H Message Object 1 ID: 0x7 Data0: 0x12 (=LED’s) P0
9
Siemens Microelectronics, Inc. December 98 Slide 9 HOT50x-5 Version 1.0 Exercise kitCAN - kitCON-CAN Configurations Jumper settings JP8:close JP12:2+3 JP9:3+4 JP10:3+5 JP11:1+2 JP1:1+2 JP3:1+2 JP2:1+2; 3+4 1 JP1_1:2+3 : : JP1_8:2+3 Hints 1 )By doing that, you connect both CAN-Nodes
10
Siemens Microelectronics, Inc. December 98 Slide 10 HOT50x-5 Version 1.0 Exercise kitCAN _1 - DAvE Configurations Create new Project with microcontroller C50x: Project name: kitCAN Select project path: c:\hot50x_5\ Project Settings: System Clock: -External Oscillator Frequency: Set to 8 MHz (or the crystal frequency of your KitCON-50x board) External Access -Global XRAM / CAN Access Control (XMAP0): Disable access to XRAM and the CAN controller Save & Close
11
Siemens Microelectronics, Inc. December 98 Slide 11 HOT50x-5 Version 1.0 Exercise kitCAN_1 - DAvE Configurations (cont.) Configure T0 (Timer/Counter 0): Timer 0 -Timer Mode (M1, M0): -16-bit timer / counter (TH0, TL0) -Timer Options: -Run Timer (TR0) -Interrupt Control: -Enable Timer 0 interrupt (ET0) Functions: -Include T0 initialization function T01_vInit Save & close Configure CAN Module and LCD-display: Because DAvE can not generate code for the SAE 81C90/91 the files CAN81C9x.C, LCD.C, CAN81C9x.H and LCD.H are included in the directory c:\HOT50x_5\ Generate code
12
Siemens Microelectronics, Inc. December 98 Slide 12 HOT50x-5 Version 1.0 Exercise kitCAN_1 - uVision Configurations Create new Project: c:\hot50x_5\kitCAN.prj Edit Project: Add MAIN.C(from c:\hot50x_5\) Add T01.C(from c:\hot50x_5\) Add CAN81C9x.C(from c:\hot50x_5\) Add LCD.C(from c:\hot50x_5\) Open All Save Options/Environment Pathspecs… In most cases the “Automatically determine path specifications” will work, however if you have problems building the project you may have to enter the paths in manually.
13
Siemens Microelectronics, Inc. December 98 Slide 13 HOT50x-5 Version 1.0 Exercise kitCAN_1 - uVision Configurations Edit MAIN.H: // USER CODE BEGIN (MainHeader,1) #include "CAN81C9x.H" #include "LCD.H" // USER CODE END Edit MAIN.C (Global Variables): // USER CODE BEGIN (Main,0) // temporary variable for the received data ubyte Temp; // USER CODE END
14
Siemens Microelectronics, Inc. December 98 Slide 14 HOT50x-5 Version 1.0 Exercise kitCAN_1 - uVision Configurations (cont.) Edit MAIN.C (Project_Init()-function): // USER CODE BEGIN (Project_Init,1) // initializes the CAN peripheral 81C91/90 CAN81C9x_vInit(); // initializes the LCD peripheral LCD_vInit(); //write text on the Display LCD_text(); // USER CODE END
15
Siemens Microelectronics, Inc. December 98 Slide 15 HOT50x-5 Version 1.0 Exercise kitCAN_1 - uVision Configurations (cont.) Edit MAIN.C (main()-function): // USER CODE BEGIN (Main,2) while(1) // endless loop { //wait until a message arrived while(!CAN_CON[0].INT); CAN_CON[0].RRR1 = 0; //reset receive- and CAN_CON[0].INT = 0; //interrupt req. register //the message’s data field is copied to the //shadow reg. with any read access to byte 7 Temp = CAN_CON[0].MsgObj[1].Data[7]; //write the received data on the display LCD_vWrite_ubyteXY(6,1, CAN_CON[0].MsgObj[1].Data[0]);
16
Siemens Microelectronics, Inc. December 98 Slide 16 HOT50x-5 Version 1.0 Exercise kitCAN_1 - uVision Configurations (cont.) } //end_while(1) // USER CODE END Edit T01.C (T01_viIsrTmr0()-interrupt service routine): // USER CODE BEGIN (T01_IsrTmr0,1) //toggle port and initialize CAN-Message // ~(-- because of low active logic CAN_CON[1].MsgObj[1].Data[0] = ~(-- CAN_CON[1].Port[0].LR); //set transmit request CAN81C9x_vTransmit(1, 1); // USER CODE END Build Project (Project | Build)
17
Siemens Microelectronics, Inc. December 98 Slide 17 HOT50x-5 Version 1.0 Exercise kitCAN_1 - Running the Program Run dScope Debugger File | Load CPU Driver: mon51.dll this will establish a connection between the Keil Monitor (located in the flash) and dScope (once this happens dScope becomes tScope - the target debugger) File | Load Object file: Load c:\hot50x_5\kitCAN Hit Go! When you are finished viewing the output, push the RESET button on the KitCON-50x
Similar presentations
© 2024 SlidePlayer.com. Inc.
All rights reserved.