Pages

Thursday, 20 November 2014

Bluetooth Module HC-06


Bluetooth Module HC-06:

This module enables you to wireless transmit & receive serial data. It is a drop in replacement for wired serial connections allowing transparent two way data communication. You can simply use it for serial port replacement to establish connection between MCU or embedded project and PC for data transfer. This board operates on 5V and has LED indication and 3V regulator.







Bluetooth Interface Arm code: 


/*
 * Project name:
     BLUETOOTH MODULE
 * Copyright
     (c) Researchdesignlab.com
 * Description:
    
 * Test configuration:
     MCU:             LPC2129
     Dev.Board:       LPC2129 mini
     Oscillator:      12 MHz
     Software:        Keil uVision3

*/


#include<stdio.h>
#include"lpc21xx.h"    // header file
#include<string.h>
//*******************************************************************
void SEND_CMD_2_LCD(unsigned char);    // function protoype
void SEND_2_LCD(unsigned char *, unsigned char);
void DISPLAY_ON_LCD(unsigned char DATA);
unsigned char RECIVE_DATA(void);
void TRANSMIT_UART0_BYTE(unsigned char P);
void TRANSMIT_UART0(unsigned char *P);


#define sw4 0x00010000 

void DELAY(void); 
void LCD_DELAY(void);


unsigned int LCD_RS=0X01000000;      // pin declerations
unsigned int LCD_EN=0X02000000;
unsigned int LCD_DATA_LINES=0X00003C00;
unsigned char RX;
                        

//*******************************************************************
int main()
{
    unsigned char LCD_CMD[]={0X20,0X28,0X0f,0X06,0X01,0X80},COUNT,i; // LCD commands


    IODIR0|=LCD_DATA_LINES;
    IODIR1=0X03300000;
      
    for(COUNT=0;COUNT<6;COUNT++)
    SEND_CMD_2_LCD(LCD_CMD[COUNT]); // LCD INIT function call

    PINSEL0    = 0X00050000;
    PINSEL1=0X15400000;       // UART INIT
    U1LCR = 0X83;           // 8bit data setting        
    U1DLL = 0X61;                                   
    U1LCR = 0X03;    // 9600 baud rate setting        
    U1FCR = 0X01;    // FIFO enable

    PINSEL0|=0X00000005;
    U0LCR=0X83;
    U0DLL=0X61;
    U0DLM=0X00;
    U0LCR=0X03;

      DELAY();

      DELAY();
      DELAY();
      
                 
  TRANSMIT_UART0("MC 1");              //TRANSMIT DATA TO BLUE TOOTH
  while(1)
   {
  
   
   RX=RECIVE_DATA();            // RECEIVING BLUE TOOTH DATA DISPLAY ON LCD
   DISPLAY_ON_LCD(RX);
   i++;
  

  }
 }



    void DELAY(void)
    {
    unsigned int X=800000;
    while(X--);
    }
    
    
    void LCD_DELAY(void)
    {
    unsigned int X=20000;  // delay calculation subroutine
    while(X--);
    } 

 void SEND_CMD_2_LCD(unsigned char DATA)
{
    unsigned int TEMP;                      // LCD command write function
    IOCLR0=LCD_DATA_LINES;
    TEMP=DATA;
    TEMP=((TEMP&0xf0)<<6);
    IOCLR1=LCD_RS;
    IOSET0=TEMP;
    IOSET1=LCD_EN;
    LCD_DELAY();
    LCD_DELAY();
    IOCLR1=LCD_EN;
    IOCLR0=LCD_DATA_LINES;
    
    LCD_DELAY();

    TEMP=DATA;
    TEMP=((TEMP&0x0f)<<10);
    IOCLR1=LCD_RS;
    IOSET0=TEMP;
    IOSET1=LCD_EN;
    LCD_DELAY();
    LCD_DELAY();
    IOCLR1=LCD_EN;
    IOCLR0=LCD_DATA_LINES;
}

void DISPLAY_ON_LCD(unsigned char DATA)
{
    unsigned int TEMP;
    IOCLR0=LCD_DATA_LINES;
    TEMP=DATA;                          //LCD data write function
    TEMP=((TEMP&0xf0)<<6);
    IOSET1=LCD_RS;
    IOSET0=TEMP;
    IOSET1=LCD_EN;
    LCD_DELAY();
    LCD_DELAY();
    IOCLR1=LCD_EN;
    IOCLR0=LCD_DATA_LINES;
    
    LCD_DELAY();

    TEMP=DATA;
    TEMP=((TEMP&0x0f)<<10);
    IOSET1=LCD_RS;
    IOSET0=TEMP;
    IOSET1=LCD_EN;
    LCD_DELAY();
    LCD_DELAY();
    IOCLR1=LCD_EN;
    IOCLR0=LCD_DATA_LINES;
}


void SEND_2_LCD(unsigned char *PTR, unsigned char POS)
{
    SEND_CMD_2_LCD(POS);
    while(*PTR)
    {                               // sending the data to LCD data line function
        DISPLAY_ON_LCD(*PTR);
        PTR++;
    }
    LCD_DELAY();
    LCD_DELAY();
}


void TRANSMIT_UART0(unsigned char *P)
   {
    while(*P){
        U0THR=*P;
        while(!(U0LSR&0X20));
        P++;}
    }

        
void TRANSMIT_UART0_BYTE(unsigned char P)
   {

        U0THR=P;
        while(!(U0LSR&0X20));
    
    }

    
  unsigned char RECIVE_DATA(void)
   { 
        while(!(U0LSR&0X01));
        RX=U0RBR;
        return(RX);
   }


Bluetooth Interface atmel schematic:




Bluetooth Interface Atmel Code:


/*
 * Project name:
    BLUETOOTH MODULE
 * Copyright
     (c) Researchdesignlab.com
 * Description:
    
 * Test configuration:
     MCU:             AT89S52
     Dev.Board:       8051
     Oscillator:      11.0592 MHz
     Software:        Keil uVision3

*/


#include<reg51.h>  

#define LCD_PORT P2                    // LCD D0-D7 PINS connected P2
sbit rs=P3^5;                        // LCD RS PIN connected P3.5
sbit en=P3^7;                        // LCD EN PIN connected P3.7
sbit D7=P2^7;
sbit rw=P3^6;                         // LCD RW PIN connected P3.6


void busy();                          //LCD busy 
void CMD_WRT(unsigned char);           //To write the commands to the LCD
void DATA_WRT(unsigned char);         //To write the data to the LCD
void LCD_WRT(unsigned char *); 
void DELAY();
void TRANSMIT(unsigned char *);
void transmit_byte(unsigned char );
unsigned char SCI_ReceiveByte( void );


 void main()
  {
   unsigned char CMD[]={0x38,0x01,0x0f,0x06,0x80},TEMP1,i,RX;

    for(i=0;i<5;i++)
    {
    TEMP1=CMD[i];                         //write the commands to the LCD
    CMD_WRT(TEMP1);
    }

    TMOD=0X20;                              //TIMER 1 , MODE 2
    TH1=0XFD;                              //9600 BAURD RATE            //SERAIL INIT
       SCON=0X50;
    TR1=1;                                  //TIMER1 ON
    DELAY();
    DELAY();
    DELAY();                               //DELAY
    DELAY();

     TRANSMIT("MC 1 ");          // trasmit the data to BLUETOOTH
  while(1)
  {
  
  
   RX=SCI_ReceiveByte();                      // RECIVING DATA from BLUETOOTH AND DISPLAY ON LCD
   DATA_WRT(RX);
      
  }
 }
    
    void DELAY()
    {                                  //delay of 3ms 
    unsigned int X=800000;
    while(X--);
    }
    
    
    void busy()
    {
    D7=1;
    rs=0;                             //cmd mode
    rw=1;                             //read
    while(D7!=0)                    //wait till LCD is ready
    {
    en=0;
    en=1;                            // low to high latch 
    }
    } 
    
    
    
    void CMD_WRT(unsigned char val)
    {
    busy();
    LCD_PORT=val;                   //write cmd to P2
    rs=0;                           //cmd mode
    rw=0;                           //write
    en=1;
    en=0;                           //high to low latch 
    }
    
    
    void DATA_WRT(unsigned char ch)
    {
    busy();
    LCD_PORT = ch;                  //write cmd to P2
    rs=1;                          //data mode
    rw=0;                          //write
    en=1;
    en=0;                          //high to low latch 
    }
    

    void transmit_byte(unsigned char  byte)       // TRANSIMITT SERIAL DATA
    {
    SBUF=byte;                                  //TRANSMIT DATA FROM  BYTE TO SBUF 
    while(!TI);                                   // WAIT TILL DTA GET TRANSMITTED 
    TI=0;
    }
    
    void TRANSMIT(unsigned char *string)
    {
    while(*string)
    transmit_byte(*string++);
    }
          
    unsigned char SCI_ReceiveByte( void )
    {                                            // RECIVING SERIAL DATA
    unsigned char byte;
    //    RI=0;
    while(RI!=1);                                // WAIT TILL RI IS HIGH
    byte = SBUF;                                //RECIVE DATA FROM SBUF TO BYTE
    RI=0;
    return byte;                                 // RETURN THE DATA
    }

Bluetooth Interface PIC Schematic:



Bluetooth Interface PIC Code:

/*
 * Project name:
    BLUETOOTH MODULE
 * Copyright
     (c) Researchdesignlab.com
 * Test configuration:
     MCU:             PIC16F877A
     Dev.Board:       PIC
     Oscillator:      20.0 MHz
     Software:  mikroC PRO for PIC v 4.6

*/



// LCD module connections
sbit LCD_RS at RB4_bit;
sbit LCD_EN at RB5_bit;
sbit LCD_D4 at RB0_bit;
sbit LCD_D5 at RB1_bit;
sbit LCD_D6 at RB2_bit;
sbit LCD_D7 at RB3_bit;

sbit LCD_RS_Direction at TRISB4_bit;
sbit LCD_EN_Direction at TRISB5_bit;
sbit LCD_D4_Direction at TRISB0_bit;
sbit LCD_D5_Direction at TRISB1_bit;
sbit LCD_D6_Direction at TRISB2_bit;
sbit LCD_D7_Direction at TRISB3_bit;
// End LCD module connections

unsigned char uart_rd,i;

void main() {


  Lcd_Init();                        // Initialize LCD

  Lcd_Cmd(_LCD_CLEAR);               // Clear display
  Lcd_Cmd(_LCD_CURSOR_OFF);          // Cursor off

  UART1_Init(9600);               // Initialize UART module at 9600 bps
  Delay_ms(100);                  // Wait for UART module to stabilize

   UART1_Write_Text("MC 1");       // TRANSMIT "MC 1" TO   bluetooth

  
  while(1)
  {

   if (UART1_Data_Ready()) {     // If data is received,
      uart_rd = UART1_Read();     // read the received data FROM   bluetooth
      Lcd_Chr_Cp(uart_rd);       // and send data lcd
      i++;
      }

    /*
   
    
     */
    
  }
  
 }



Bluetooth module Features:

  • 5V power operation.
  • Supports baud rates from 1200 to 1382400 bps (default is 9600 bps)
  • UART interface
  • TTL output.
  • Built in antenna
  • 10 meters range
  • Easy to use
  • Minimum External Components
  •  Status LEDs
  • High quality PCB FR4 Grade with FPT Certified.

For Sample Codes , Schematics : CLICK HERE




Friday, 14 November 2014

ISP ATMEGA Programmer



ISP ATMEGA Programmer:


This programmer is based on USBasp design and connects to your computer's USB port. Not only is it quite compact, but the design is really elegent. The USB interface is achieved by using an atmega processor and the rest is done in firmware. ISP programmer supports  Atmel and Atmega microcontrollers. It is a reliable tool for fast programming of Atmel and Atmega devices.


ISP ATMEGA Programmer Features:


  • No special controllers or smd components are needed.
  • Programming speed is up to 5kBytes/sec.
  • SCK option to support targets with low clock speed (< 1,5MHz).
  • AVR Series: ATTiny12 (L), ATTiny13 (V), ATTiny15 (L), ATTiny24 (V), ATTiny25 (V), ATTiny26 (L), ATTiny2313 (V) , ATTiny44 (V), ATTiny45 (V), ATTiny84 (V), ATTiny85 (V), AT90S2313 (L), AT90S2323 (L), AT90S2343 (L), AT90S1200 (L), AT90S8515 (L), AT90S8535 (L), ATMEGA48 (V), ATMEGA8 (L), ATMEGA88 (V), ATMEGA8515 (L), ATMEGA8535 (L), ATMEGA16 (L), ATMEGA162 (V), ATMEGA163 (L), ATMEGA164 (V), ATMEGA165 (V), ATMEGA168 (V), ATMEGA169 (V), ATMEGA169P (V), ATMEGA32 (L), ATMEGA324 (V), ATMEGA325 (V), ATMEGA3250 (V), ATMEGA329 (V), ATMEGA3290 (V), ATMEGA64 (L), ATMEGA640 (V), ATMEGA644 (V), ATMEGA645 (V), ATMEGA6450 (V), ATMEGA649 (V), ATMEGA6490 (V), ATMEGA128 (L), ATMEGA1280 (V), ATMEGA1281 (V), ATMEGA2560 (V), ATMEGA2561 (V) etc
    High quality PCB FR4 Grade with FPT Certified.

For Sample Codes , Schematics : CLICK HERE


RF TX RX with 8 Bit Encoder and Decoder


RF TX RX with 8 Bit Encoder and Decoder


The TX is an ASK transmitter module.The TX isdesigned specifically for remote-control , wireless mouseand car alarm system operating at 315/433.92 MHz.The RX is a miniature receiver module that receives On-offkeyed ( OOK )modulation signal and demodulated to digital signal for the next decoder stage.The RX is designed specifically for remote-control and wireless security receiver operating at 315/434Mhz. UART TTL o/p - Baud Rate - 9600.



RF TX RX with 8 Bit Encoder and Decoder Features:

  • Input Power supply - 5 Volts
  • Compatible for Both RF 433/ 315 Mhz
  • Interface upto 8 Bit Data.
  • UART TTL o/p - Baud Rate - 9600
  • Package Includes with RF Tx Rx.
  • Indicating LED's.
  • High quality PCB FR4 Grade with FPT Certified.

For Codes , Schematics : CLICK HERE

Wednesday, 12 November 2014

CC2500 RF Transceiver


CC2500 RF Transceiver

CC2500 RF Module is a transreceiver module which provides easy to use RF communication at 2.4 Ghz. It can be used to transmit and receive data at 9600 baud rates from any standard CMOS/TTL source. This module is a direct line in replacement for your serial communication it requires no extra hardware and no extra coding toIt works in Half Duplex mode i.e. it provides communication in both directions, but only one direction at same time.


CC2500 RF Transceiver Features:

  • Input Voltage - 5Volts DC
  • Serial Data Rate - 9600bps,
  • Available frequency at : 2.4-2.483 GHz
  • No external Antenna required.
  • Low current consumption. (RX:13.3mA,TX:21.2mA @0dBm output power)
  • Easy for application.
  • Efficient SPI interface
  • Operating temperature range: -40 85
  • Operating voltage:1.8~ 3.6 Volts.
  • Programmable output power (up to 1dBm).
  • Hi sensitivity (-101dBm @10kbps)
  • High quality PCB FR4 Grade with FPT Certified.
For Codes , Schematics : CLICK HERE

Tuesday, 11 November 2014

Mega 2560 R3 ATmega2560-16AU Board+Free USB Cable For Arduino


QUICK OVERVIEW :

Alternative ATMEGA16U2 chip 2011 version of ATMEGA8U2 , ISP FLASH increased capacity doubled, to facilitate greater functionality extensions, developers need. ATMEGA16U2 addition to traditional USB to serial, also allows user programming to define other functions, such as the USB port can be configured as a mouse, keyboard, game joystick, camera, of course, these applications have yet to be Arduino team to disclose the specific embodiments.External interface increase on the basis of the 2011 version of the SDA, SCL (the left side of the position in the AREF).IOREF interface can be provided to the Shield a voltage reference. And compatibility considerations for future products the IOREF reserve a port on the left side.RESET circuit than the 2011 version. Prevent RESET the accidental reset the the RESET circuit more stable.






FOR MORE SAMPLE CODES & SCHEMATICS : CLICK HERE