interfacing bluetooth with 8051 trainer

13
8051 HOW-TO GUIDE Interfacing Bluetooth with 8051

Upload: knightangle

Post on 20-Oct-2015

65 views

Category:

Documents


4 download

TRANSCRIPT

Page 1: Interfacing Bluetooth With 8051 Trainer

8051 HOW-TO GUIDE

Interfacing Bluetooth

with 8051

Page 2: Interfacing Bluetooth With 8051 Trainer

Join the Technical Community Today!

http://www.pantechsolutions.net

Contents at a Glance

8051TRAINER KIT ............................................................. 3

BLUETOOTH ..................................................................... 3

INTERFACING BLUETOOTH ............................................... 4

INTERFACING BLUETOOTH WITH 8051 ............................. 5

PIN ASSIGNMENT WITH 8051 ........................................... 5

CIRCUIT DIAGRAM TO INTERFACE BLUETOOTH ................ 6

ASSEMBLY PROGRAM TO INTERFACE BLUETOOTH ........... 7

TESTING THE BLUETOOTH WITH 8051 .............................. 8

PC SIDE BLUETOOTH MODULE SETTING ............................ 9

KIT SIDE BLUETOOTH MODULE SETTING ........................... 9

GENERAL INFORMATION ............................................... 10

SOURCE CODE ................................................................ 11

Page 3: Interfacing Bluetooth With 8051 Trainer

Join the Technical Community Today!

http://www.pantechsolutions.net

8051TRAINER KIT

PS-TRAINER-8051 trainer kit is proposed to smooth the

progress of learning and developing designs of MCU from

Intel and NXP. It has the facility to connect PC’s 101/104

Keyboard, to enter user programs in Assembly languages.

Serial communication achieved using 8051. It also supports

C & assembly language in standalone kit (P89V51RD2). It’s

designed as to facilitate On-board Programmer for NXP

8051 MCU through ISP on serial port.

BLUETOOTH

Bluetooth is a proprietary open wireless technology

standard for exchanging data over short distances from

fixed and mobile devices, creating personal area networks

(PANs) with high levels of security. Bluetooth technology

allows electronic devices to communicate wirelessly.

Page 4: Interfacing Bluetooth With 8051 Trainer

Join the Technical Community Today!

http://www.pantechsolutions.net

INTERFACING BLUETOOTH

Fig. 1 shows how to interface the Bluetooth with

microcontroller. Bluetooth technology handles the wireless

part of the communication channel; it transmits and

receives data wirelessly between these devices. It delivers

the received data and receives the data to be transmitted to

and from a host system through a host controller interface

(HCI). The most popular host controller interface today is

either a UART or a USB. Here, I will only focus on the UART

interface; it can be easily show how a Bluetooth module can

be integrated on to a host system through a UART

connection.

Fig. 1 Interfacing Bluetooth to Microcontroller

Page 5: Interfacing Bluetooth With 8051 Trainer

Join the Technical Community Today!

http://www.pantechsolutions.net

INTERFACING BLUETOOTH WITH 8051

We now want to transmit & receive the data from host

system to PS-2 8051 Trainer Board by using Bluetooth

module through UART0. The serial data is taken from or

sent to the host system by using Bluetooth module through

MAX232 into the SBUF register of 8051 microcontroller

(refer serial interfacing with 89V51RD2). The serial data

from the host device is taken by using the Serial Interrupt of

the 8051 controller. The UART0 pin lines are used to

transmit & receive operations in PS-2 8051 Trainer.

PIN ASSIGNMENT WITH 8051

UART DB-9

Connector

LPC2148

Processor Lines Serial Port Section

UA

RT0

(P1

)

ISP

PG

M

TXD-0 P0.0

RXD-0 P0.1

UA

RT1

(P2

) TXD-1 P0.8

RXD-1 P0.9

8051

MAX

3232

Page 6: Interfacing Bluetooth With 8051 Trainer

Join the Technical Community Today!

http://www.pantechsolutions.net

CIRCUIT DIAGRAM TO INTERFACE BLUETOOTH WITH 8051

Page 7: Interfacing Bluetooth With 8051 Trainer

Join the Technical Community Today!

http://www.pantechsolutions.net

ASSEMBLY PROGRAM TO INTERFACE BLUETOOTH WITH 8051

*************************************************************************************** Title : Program to interface Bluetooth and display a text in PC from 8051 through UART0

***************************************************************************************

MEMORY ADDRESS OPCODE MNEMONICS

8500 75,89,21 MOV TMOD,#21

8503 75 8D FD MOV TH1,#FD

8506 75 98 52 MOV SCON,#52

8509 D2 8E SETB TR1

850B 74 41 H:MOV A,#41

850D B1 11 ACALL TXMT

850F 80 FA SJMP H

8511 30 99 FD TXMT:JNB TI,TXMT

8514 C2 99 CLR TI

8516 F5 99 MOV SBUF,A

8518 22 RET

Page 8: Interfacing Bluetooth With 8051 Trainer

Join the Technical Community Today!

http://www.pantechsolutions.net

TESTING THE BLUETOOTH WITH 8051

Give +9V power supply to 8051 trainer Board; connect

the 5V adapter with Bluetooth module which is connected

with the 8051 trainer Board. There are two Bluetooth

modules are required. One is connected with 8051 trainer

Board; other one is connected with PC.

First connect the serial cable between 8051 Trainer

board & PC. Then open the Hyper Terminal screen, select

which port you are using and set the default settings. Now

the screen should show some text messages. If the

messages are correctly displayed in Hyper Terminal, then

only connect the Bluetooth modules in 8051 Trainer Board

UART0 & PC.If you are not reading any data from UART0,

then you just check the jumper connections & just check

the serial cable is working. Otherwise you just check the

code with debugging mode in Keil. If you want to see more

details about debugging just see the videos in below link.

How to Create & Debug a Project in Keil.

Page 9: Interfacing Bluetooth With 8051 Trainer

Join the Technical Community Today!

http://www.pantechsolutions.net

PC SIDE BLUETOOTH MODULE SETTING

KIT SIDE BLUETOOTH MODULE SETTING

Page 10: Interfacing Bluetooth With 8051 Trainer

Join the Technical Community Today!

http://www.pantechsolutions.net

GENERAL INFORMATION

For proper working use the components of exact values

as shown in Circuit file. Wherever possible use new

components.

Solder everything in a clean way. A major problem

arises due to improper soldering, solder jumps and

loose joints.

Use the exact value crystal shown in schematic.

More instructions are available in following articles,

User Manual of 8051 Trainer Board.

Tutorial of how to create & Debug a project in KEIL. Interfacing UART with 8051.

Page 11: Interfacing Bluetooth With 8051 Trainer

Join the Technical Community Today!

http://www.pantechsolutions.net

SOURCE CODE

The Interfacing Bluetooth module with 8051program is

very simple and straight forward, which send a message to

mobiles from 8051 trainer through Bluetooth module by

using UART0. Some delay is occurring when a single data is

sent to mobile through UART.

Page 12: Interfacing Bluetooth With 8051 Trainer

Join the Technical Community Today!

http://www.pantechsolutions.net

Pantech solutions creates information packed technical

documents like this one every month. And our website is a rich

and trusted resource used by a vibrant online community of

more than 1,00,000 members from organization of all shapes

and sizes.

Did you enjoy the read?

Page 13: Interfacing Bluetooth With 8051 Trainer

Join the Technical Community Today!

http://www.pantechsolutions.net

What do we sell?

Our products range from Various Microcontroller

development boards, DSP Boards, FPGA/CPLD boards,

Communication Kits, Power electronics, Basic electronics,

Robotics, Sensors, Electronic components and much more . Our

goal is to make finding the parts and information you need

easier and affordable so you can create awesome projects and

training from Basic to Cutting edge technology.