File: /media/j/texas/my msp430/g3tr/g3tr.c Pagina 1 di 5

Similar documents
File: /home/peppino/sketchbook/g3tr_due/g3tr_due.ino Pagina 1 di 5

Timers and Clocks CS4101 嵌入式系統概論. Prof. Chung-Ta King. Department of Computer Science National Tsing Hua University, Taiwan

Copyright 2015 by Stephen A. Zajac & Gregory M. Wierzba. All rights reserved..spring 2015.

University of Texas at El Paso Electrical and Computer Engineering Department. EE 3176 Laboratory for Microprocessors I.

Getting Started with the Texas Instruments ez430

// Conditions for 9600/4=2400 Baud SW UART, SMCLK = 1MHz #define Bitime_5 0x05*4 // ~ 0.5 bit length + small adjustment #define Bitime 13*4//0x0D

Interfacing CMA3000-D01 to an MSP430 ultra low-power microcontroller

Texas Instruments Mixed Signal Processor Tutorial Abstract

@databasescaling Wednesday, 18 th April 2013

CPE 323 Introduction to Embedded Computer Systems: MSP430 System Architecture An Overview

Interfacing CMR3000-D01 to an MSP430 ultra low-power microcontroller

EEL 4924 Electrical Engineering Design (Senior Design) Team Baudiophile. Wireless Headphones

LC-E201A. Application note. 1. Mechanical Specification: LC-E021A-application note page 1 of 16 Revision:

ECE2049: Embedded Computing in Engineering Design A Term Fall Lecture #8: Making it work: LEDs, Buttons & Keypad

Digital Fundamentals. Integrated Circuit Technologies

Why embedded systems?

ECE2049 Homework #2 The MSP430 Architecture & Basic Digital IO (DUE Friday 9/8/17 at 4 pm in class)

Texas Instruments Microcontroller HOW-TO GUIDE Interfacing Keypad with MSP430F5529

ECGR 4101/5101, Fall 2016: Lab 1 First Embedded Systems Project Learning Objectives:

ECE PRACTICE EXAM #2 Clocks, Timers, and Digital I/O

Getting Started with the MSP430 LaunchPad

Asservissement en température numérique d'une cavité ultra-stable au LPL pour le Strontium

ECE2049: Embedded Computing in Engineering Design C Term Spring Lecture #7: More Digital IO

Hacettepe University

Review Activity 1 CALL and RET commands in assembler

Using peripherals on the MSP430 (if time)

Lecture test next week

Lab 1: I/O, timers, interrupts on the ez430-rf2500

Name: Clint Furrer Project Number: TI003 Project Description: Safety Walking Lights. Description:

Multi-function Tester (TC-V2.12k)

What is an Interrupt?

Getting Started with the MSP430 LaunchPad

ECE2049: Embedded Computing in Engineering Design C Term Spring Lecture #11: More Clocks and Timers

Interrupts, Low Power Modes

CPE 325: Embedded Systems Laboratory Laboratory #7 Tutorial MSP430 Timers, Watchdog Timer, Timers A and B

Fall. Accelerometer RGB LED control Vishal Shah Rebel Sequeira Pratiksha Patil Pranali Dhuru Chris Blackden. George Mason University

Before next weeks lab:

Installation tutorial for the Skomer IDE

ECE2049: Embedded Computing in Engineering Design C Term Spring 2019 Lecture #22: MSP430F5529 Operating Mode & the WDT

MSP430. More on MSP430

MIDTERM#1. 2-(3pts) What is the difference between Von Neumann & Harvard processor architectures?

4 Degrees of Freedom MEMS Sensor Improvements

Multi-function Tester (TC-V2.12k)

Architectures and Applications for Wireless Sensor Networks ( ) Node Programming

CPE 323: MSP430 Timers

Robosoft Systems in association with JNCE presents. Swarm Robotics

Latch-Up. Parasitic Bipolar Transistors

University of Texas at El Paso Electrical and Computer Engineering Department. EE 3176 Laboratory for Microprocessors I.

MSP430 Interrupts. Change value of internal variable (count) Read a data value (sensor, receive) Write a data value (actuator, send)

TPL5000EVM User's Guide

Product Information. IC Outputs Terms & Definitions

Lecture 5: MSP430 Interrupt

6. General purpose Input/Output

Interrupts CS4101 嵌入式系統概論. Prof. Chung-Ta King. Department of Computer Science National Tsing Hua University, Taiwan

Hacettepe University

C Language Programming through the ADC and the MSP430 (ESCAPE)

Embedded Systems. 3. Hardware Software Interface. Lothar Thiele. Computer Engineering and Networks Laboratory

UC Berkeley EE40/100 Lab Lab 6: Microcontroller Input/Output B. Boser, etc.

MICROPROCESSORS A (17.383) Fall Lecture Outline

Analog and Telecommunication Electronics

MIFARE Secure OEM Reader Module Data Sheet

Analog and Telecommunication Electronics

Power IC 용 ESD 보호기술. 구용서 ( Yong-Seo Koo ) Electronic Engineering Dankook University, Korea

MC Connector Wiring Diagrams

Analog and Telecommunication Electronics

Physics 319 Spring 2015: Introduction to the Programming and Use of Microprocessors

Experiment 1 Introduction to PSpice

TABLE OF CONTENTS 1.0 PURPOSE INTRODUCTION ESD CHECKS THROUGHOUT IC DESIGN FLOW... 2

P89V51RD2 Development Board May 2010

Simple Infrared Obstacle Sensor

Halloween Pumpkinusing. Wednesday, October 17, 12

Alex Milenkovich 1. CPE/EE 421 Microcomputers. Course Administration. Review: Outline. Getting Started with EasyWeb2. Review: MSP bit RISC

CPE/EE 323 Introduction to Embedded Computer Systems Homework V

SYLLABUS OF ADVANCED CARD LEVEL & CHIP LEVEL TRAINING ( DESKTOP AND LAPTOP )

Logic Chip Tester User Manual SW Version /8/2012. Chapter 1 Introduction/Background

Chapter 9. Input/Output (I/O) Ports and Interfacing. Updated: 3/13/12

CPE/EE 421 Microcomputers

University of Texas at El Paso Electrical and Computer Engineering Department. EE 3176 Laboratory for Microprocessors I.

Lab 4: Interrupt. CS4101 Introduction to Embedded Systems. Prof. Chung-Ta King. Department of Computer Science National Tsing Hua University, Taiwan

UCBB dual port breakout board user's manual

RAJIV GANDHI COLLEGE OF ENGINEERING AND TECHNOLOGY

CU2/CUF Connector Wiring Diagrams

PIXI click PID: MIKROE Weight: 28 g

Grove - Buzzer. Introduction. Features

Introduction to ICs and Transistor Fundamentals

ECE 492 WINTER 2015 GROUP 2. Texas Instruments MSP430-FR Bit ADC Setup Guide

CPE/EE 323 Introduction to Embedded Computer Systems Homework III

5xx Active & Low Power Mode Operation

IV B.Tech. I Sem (R13) ECE : Embedded Systems : UNIT -2 1 UNIT 2

CONTENTS: Program 1 in C:

ECE2049: Embedded Computing in Engineering Design C Term Spring 2018 Lecture #15: More ADC Examples

MSP430F149 P3.4/UTXD0 P3.5/URXD0 P1.5 P1.6 P1.7 MSP430F149 P1.0 P5.4 P5.3 P5.2 P5.1. Figure B-1. BSL Replicator Block Diagram

EE 105 Microelectronic Devices & Circuits FALL 2018 C. Nguyen

1. Attempt any three of the following: 15

Vector 3D printer complete wire list including extruder PWA listing

Laboratory 1 Introduction to the Arduino boards

Wireless Sensor Networks (WSN)

USB UART 4 click PID: MIKROE Weight: 23 g

Touch Control Switch + - R6 R4 R8 R7 CAT# Grading. Assembly Instructions by Earl D. Gates SUNY Oswego Fall Conference 2007.

SIDDHARTH GROUP OF INSTITUTIONS :: PUTTUR (AUTONOMOUS) Siddharth Nagar, Narayanavanam Road QUESTION BANK (DESCRIPTIVE) UNIT I

Transcription:

File: /media/j/texas/my msp430/g3tr/g3tr.c Pagina 1 di 5 /+ filename: g3tr.c G3TR means: Giuseppe Talarico Transistor Type Recognizer This version is for launchpad MSP430 Just only two 10K resistors and a serial terminal program are needed to implement a simple and powerfull digital Transistor Tester. The circuit allows to test any type of transistor ( npn,pnp, n-channel, p-channel ) both low or High Power. The program tell us if the transistor under test is working or not and which is his type for example: NPN-BJT, PNP-BJT, NCHANNEL-MOSFET, PCHANNEL-MOSFET. The program test diode too and tell us where the Anode is attached ( RED CABLE or BLACK CABLE) Devices broken or shorted are decoded too. Here the circuit: ---------------------------------------------------------------------> to GATE ----------------------- ------- - VCC GND - -- 10K -------- P1.0 P2.6 - ------- <-- P1.1(TX_UART) P2.7 - to SOURCE <--- P1.2 TEST - BTN1 --> P1.3 RST - -------- ----------------> P1.4 P1.7 -------------- 10K -------> to DRAIN -------> P1.5 P1.6 --> GREEN_LED -------- ----------------------- ----------------------------------------------------------- date: mercoledì, 4 maggio 2011 Author: Giuseppe Talarico (www.giuseppetalarico.wordpress.com) / // /opt/msp430-gcc-4.4.5/bin/msp430-gcc -Os -mmcu=msp430x2231 g3tr.c tx_uart_lib.c -o g.elf // Connect launchpad to pc-usb. // The following three command are needed to load and run the file g.elf: // mspdebug rf2500 // prog g.elf // run #include <msp430g2231.h> // registers definitions #include "tx_uart_lib.h" //----------------- hardware abstractions --------------------- #define PORT1_DIR P1DIR #define PORT1 P1OUT #define BTN1 3 // bit P1.3 #define DRAIN_IN 5 // bit P1.5 if n-channel (npn) this bit is!(r_gate_out) #define BJT_MOSFET_IN 4 // bit P1.4 if P1,4 = L the devices is a MOSFET // if P1.4 = H the devices is a BJT #define R_GATE_OUT 0 // bit P1.0 gate or base driver #define SOURCE_OUT 2 // bit P1.2 L --> N-Channel select, H --> P-channel select #define R_DRAIN_OUT 7 // bit P1.7 if P1.7 = H then NPN PNP #define RED_LED 0 // bit P1.0 #define GREEN_LED 6 // bit P1.6 //--------------------------------------------------------------- #define BIT(n) (1<<(n)) // this macro sets bit n

File: /media/j/texas/my msp430/g3tr/g3tr.c Pagina 2 di 5 enum FALSE,TRUE; //-------------------- global variables ------------------------ char RECOGNIZED; //--------------------------------------------------------------- void delay_ms(unsigned int d) unsigned int i,j; for(j=0;j<192;j++) for (i = 0; i<d; i++) nop(); //----------------------------------------------------------------------------------- void hardware_setup(void) WDTCTL = WDTPW WDTHOLD; // stop watchdog Timer BCSCTL1 = CALBC1_1MHZ; // Set range DCOCTL = CALDCO_1MHZ; // SMCLK = DCO = 1MHz PORT1_DIR = BIT(GREEN_LED) BIT(R_GATE_OUT) BIT(SOURCE_OUT) BIT( R_DRAIN_OUT); //configure as outputs PORT1_DIR &= ~BIT(BTN1) & ~BIT(BJT_MOSFET_IN) & ~BIT(DRAIN_IN); // configure as inputs tx_uart_setup(); //----------------------------------------------------------------------------------- void try_npn_nchannel(void) // Polarize the transistor under test like NPN or NCHANNEL PORT1 = BIT(R_DRAIN_OUT); // drain (collector)--> H PORT1 &= ~BIT(SOURCE_OUT); // source (emitter) --> L PORT1 = BIT(R_GATE_OUT); // gate (base) -------> H delay_ms( 20 ); // msec // may be npn or n-channel PORT1 &= ~ BIT(R_GATE_OUT); // gate (base) -------> L if(( P1IN & BIT(DRAIN_IN))!=0 ) //It is npn or n-channel // now it decides for npn-bjt or nchannel-mosfet PORT1 = BIT(R_GATE_OUT); // gate (base) ------ > H if(( P1IN & BIT(BJT_MOSFET_IN))!=0) sendstring(" N-CHANNEL MOSFET"); sendstring(" NPN BJT"); //end try_npn_nchannel //----------------------------------------------------------------------------------------------------- void try_pnp_pchannel(void) // Polarize the transistor under test like PNP or PCHANNEL

File: /media/j/texas/my msp430/g3tr/g3tr.c Pagina 3 di 5 PORT1 &= ~BIT(R_DRAIN_OUT); // drain (collector)---> L PORT1 = BIT(SOURCE_OUT); // source (emitter) ----> H PORT1 = BIT(R_GATE_OUT); // gate (base) -------> H // may be pnp or p-channel PORT1 &= ~ BIT(R_GATE_OUT); // gate (base) --> L //It is pnp or p-channel // now it decides for pnp-bjt or p-channel mosfet PORT1 &= ~ BIT(R_GATE_OUT); // gate (base) --> L if(( P1IN & BIT(BJT_MOSFET_IN))== 0) sendstring("p-channel MOSFET"); sendstring("pnp BJT"); //end try_pnp_pchannel() //---------------------------------------------------------------------------------------- void try_diode(void) //Polarize the DIODE under test PORT1 = BIT(R_DRAIN_OUT); // Anode ---> H PORT1 &= ~BIT(SOURCE_OUT); // Catode---> L //may be a DIODE; to verify, invert Polarization PORT1 &= ~BIT(R_DRAIN_OUT); // Anode ---> L PORT1 = BIT(SOURCE_OUT); // Catode---> H if(( P1IN & BIT(DRAIN_IN)) ==0) sendstring("diode [Anode on RED cable]"); //Polarize the DIODE under test in a different way PORT1 &= ~BIT(R_DRAIN_OUT); // Catode--> L PORT1 = BIT(SOURCE_OUT); // Anode---> H if(( P1IN & BIT(DRAIN_IN))!= 0) //may be a DIODE, so invert Polarization PORT1 = BIT(R_DRAIN_OUT); // Catode --> H PORT1 &= ~BIT(SOURCE_OUT); // Anode --> L sendstring("diode [Anode on BLACK cable]"); //end try_diode() //------------------------------------------------------------------------------------------ void try_short(void)

File: /media/j/texas/my msp430/g3tr/g3tr.c Pagina 4 di 5 PORT1 = BIT(R_DRAIN_OUT); PORT1 &= ~BIT(SOURCE_OUT); // H // L PORT1 &= ~BIT(R_DRAIN_OUT); PORT1 = BIT(SOURCE_OUT); sendstring("device SHORTED"); //end try_short(); // L // H //---------------------------------------------------------------------------------- void try_broken(void) PORT1 = BIT(R_DRAIN_OUT); // H PORT1 &= ~BIT(SOURCE_OUT); // L PORT1 &= ~BIT(R_DRAIN_OUT); // L PORT1 = BIT(SOURCE_OUT); // H sendstring("device BROKEN"); //end try_broken() //================================= M A I N ===================================== void main(void) char title[] ="\n\n\r Transistor Type Recognizer \n\n\r" ; char prompt[] ="\n\rg3tr> "; hardware_setup(); sendstring(title); sendstring(prompt); while (TRUE) if (RECOGNIZED) PORT1 &=~BIT(RED_LED); PORT1 = BIT(GREEN_LED); while (P1IN & BIT(BTN1)==0); // wait BTN1 pressed delay_ms(200); sendstring(prompt); PORT1 &=~BIT(GREEN_LED); PORT1 = BIT(RED_LED); if((p1in & BIT(BTN1))==0) // wait BTN1 pressed

File: /media/j/texas/my msp430/g3tr/g3tr.c Pagina 5 di 5 try_npn_nchannel(); try_pnp_pchannel(); try_diode(); //end while // end main try_short(); try_broken();