RS232 to blue tooth modules


Closed Thread
Results 1 to 9 of 9

Hybrid View

  1. #1
    Join Date
    Jan 2008
    Posts
    28

    Default Bluetooth problme with the PIC 16F977A

    hello...got thing want to ask u all de.....now i using the KC-21 bluetooth module to connect with the pic 16F877A and now i facing the problem is why my pic tx out the data to my kc-21 bluetooth cant tx to the receiver part and the receiver part i also using the kc21 bluetooth module with max232 and the hyperterminal there cant receiver the data from my tx there...what the happen...below is my programming souce code....hope u all can help me....!!! thanks.......a lot...!!!!

    Define LCD_DREG PORTB
    Define LCD_DBIT 4
    Define LCD_RSREG PORTB
    Define LCD_RSBIT 0
    Define LCD_EREG PORTB
    Define LCD_EBIT 1
    DEFINE LCD_BITS 4
    DEFINE LCD_LINES 2
    DEFINE LCD_COMMANDUS 2000
    DEFINE LCD_DATAUS 50
    DEFINE OSC 4 ' We're using a 4 MHz oscillator
    DEFINE ADC_BITS 8 ' Set A/D for 8-bit operation
    DEFINE ADC_CLOCK 1 ' Set A/D clock Fosc/8
    DEFINE ADC_SAMPLEUS 50 ' Set A/D sampling time @ 50 uS
    DEFINE debug_mode 0 ' Debug sending True serial data
    DEFINE debug_reg Portc ' Debug Port = PortC
    DEFINE debug_bit 6 ' Debug.bit = PortC.6
    DEFINE debug_baud 9600 ' Default baud rate = 9600
    define loader_user 1


    include "modedefs.bas"

    pause 2000
    LCDOUT 254,1, " WELCOME MY "
    LCDOUT 254,192,20,"MONITOR SYSTEM"

    samples VAR WORD ' Multiple A/D sample accumulator
    sample VAR BYTE ' Holds number of samples to take
    temp VAR BYTE ' Temperature storage
    samples = 0 ' Clear samples accumulator on power-up


    TRISA = %11111111 ' Set PORTA to all input
    ADCON1 = %00000011 ' Set PORTA.0,1,2,5 = A/D, PortA.5 = +Vref
    PAUSE 500 ' Wait .5 second

    loop:

    FOR sample = 1 TO 20 ' Take 20 samples
    ADCIN 0, temp ' Read channel 0 into temp variable
    samples = samples + temp ' Accumulate 20 samples
    PAUSE 250 ' Wait approximately 1/4 seconds per loop 250
    NEXT sample

    temp = samples/20


    LCDOUT $FE, 1 ' Clear LCD
    LCDOUT "My Temp: ",DEC temp,"'C"
    serout Portc.6,N9600,[#temp]


    pause 5000

    If temp >= 80 then Alarm
    if temp <= 20 then Alarm1
    high portd.0
    samples = 0 ' Clear old sample accumulator
    GOTO loop ' Do it forever
    end

  2. #2
    skimask's Avatar
    skimask Guest

    Default

    Quote Originally Posted by slimpeng View Post
    DEFINE debug_mode 0 ' Debug sending True serial data
    DEFINE debug_reg Portc ' Debug Port = PortC
    DEFINE debug_bit 6 ' Debug.bit = PortC.6
    DEFINE debug_baud 9600 ' Default baud rate = 9600
    define loader_user 1
    CAPS CAPS CAPS , DEFINE's need to be in CAPS!

Similar Threads

  1. UART vs software RS232
    By Michael in forum mel PIC BASIC Pro
    Replies: 27
    Last Post: - 5th September 2008, 18:27
  2. Software RS232 and wireless modules
    By Michael in forum mel PIC BASIC Pro
    Replies: 10
    Last Post: - 17th August 2008, 05:27
  3. PIC18F4680 to PC via MAX232 (RS232 serial) no output
    By opticsteam1 in forum mel PIC BASIC Pro
    Replies: 2
    Last Post: - 14th April 2008, 20:39
  4. Help with CC1100 RF Modules.
    By charudatt in forum mel PIC BASIC Pro
    Replies: 13
    Last Post: - 27th November 2006, 20:58
  5. supply FSK COB modules and FSK modules
    By Elsa zhang in forum Adverts
    Replies: 0
    Last Post: - 8th August 2006, 06:40

Members who have read this thread : 0

You do not have permission to view the list of names.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts