usart-bluetooth problem


Results 1 to 33 of 33

Threaded View

  1. #25
    Join Date
    Dec 2014
    Posts
    14


    Did you find this post helpful? Yes | No

    Default Re: usart-bluetooth problem

    Name:  fff.png
Views: 3010
Size:  100.0 KB

    Code:
    DEFINE OSC 4
    
    
    DEFINE LCD_DREG PORTB
    DEFINE LCD_DBIT 0
    DEFINE LCD_EREG PORTD
    DEFINE LCD_EBIT 5
    DEFINE LCD_RSREG PORTD
    DEFINE LCD_RSBIT 6
    DEFINE LCD_RWREG PORTD
    DEFINE LCD_RWBIT 4
    DEFINE LCD_BITS 4
    DEFINE LCD_Lines 2
    
    
    DEFINE HSER_RCSTA 90h'%10010000  
    DEFINE HSER_TXSTA 24h'%00100100
    DEFINE HSER_CLROERR 1
    DEFINE HSER_BAUD 9600 
    DEFINE HSER_SPBRG 25 
    
    A VAR WORD  
    B var word 'ADRES DEĞİŞKENİ 
    C VAR BYTE
    D var byte
    G VAR BYTE[128]
    H VAR BYTE[128]   
    BAYRAK VAR BIT
    
    
    
    SYMBOL LED=PORTE.1
    SYMBOL SCL=PORTC.3
    SYMBOL SDA=PORTC.4
    
    DATAYAZMA CON $A0
    DATAOKUMA CON $A1
    ZAMANYAZMA  CON $D0
    ZAMANOKUMA  CON $D1
    BEKLE CON 25
    
    TRISA.0=1
    TRISC.7=1
    TRISC.6=0
    TRISE.1=0 
     
    
    INTCON = %11000000 ' enable global and peripheral and portb change interrupts
    PIE1.5=1 'enable rx interrupt
    PIR1.5=0 
    
    
    LCDOUT $FE,1,"merhaba"
    pause 2000
    B=0
    PAUSE 500
    
    On Interrupt GoTo KESME
    BASLA:          
             If BAYRAK=0 Then
                LCDOUT $FE,1,"BiLGi BEKLENiYOR"
                For a=0 To 10000
                pauseUS 1
                Next a
                goto BASLA
            EndIf
             IF BAYRAK=1 THEN
                BAYRAK=0  
            ENDIF   
    GOTO BASLA
    
    
    Disable
    KESME:
    
    for d=0 to 63
    hserin [wait ("a"),hex2 H[d]]
    next d
    
    I2CWRITE SDA,SCL,DATAYAZMA,B,[STR H\64]
    PAUSE BEKLE
    I2CREAD SDA,SCL,DATAOKUMA,B,[STR G\64]
    
    HSEROUT [STR G\64]     
    BAYRAK=1     
    ATLA:
    PIR1.5=0
    Resume
    Enable
    End

    i send 64 bytes from pc in total and it sends me back 64 bytes- no problem at this point... but the row, array is mixed
    thanks...
    Last edited by murat44; - 3rd February 2015 at 12:32.

Similar Threads

  1. Bluetooth headset for non bluetooth devices?
    By Normnet in forum Bluetooth
    Replies: 4
    Last Post: - 26th September 2015, 11:22
  2. USART SPI problem !
    By TripleS in forum mel PIC BASIC Pro
    Replies: 1
    Last Post: - 16th October 2007, 22:09
  3. USART Problem , but don't know where, in pc? or in PIC?
    By precision in forum mel PIC BASIC Pro
    Replies: 0
    Last Post: - 15th July 2007, 08:12
  4. problem with USART
    By leemin in forum Serial
    Replies: 4
    Last Post: - 11th December 2006, 17:56
  5. PIC16F688 USART problem
    By Kees Reedijk in forum mel PIC BASIC Pro
    Replies: 6
    Last Post: - 2nd October 2006, 04:59

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