Continue to Site

Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

communication between CCS uart and C18 usart

Status
Not open for further replies.

yalcinelmas

Newbie level 3
Joined
Sep 13, 2012
Messages
3
Helped
0
Reputation
0
Reaction score
0
Trophy points
1,281
Activity points
1,298
Hi, I have a question. I spend lot of time. There is a receiver circuit and code developed with CCS.
And there is a transmitter circuit and code developed with C18. I want to communicate these circuit serially. I wrote the CCS and C18 code below. Can anyone help me ?

C18 sender code :
Code:
#include<p18f4685.h>
#include <stdlib.h>
#include <string.h>
#include <usart.h>

#pragma config OSC=HSPLL, WDT=OFF, MCLRE=ON, PBADEN=OFF, LVP=OFF

#define LED_TRIS      (TRISAbits.TRISA0)
#define LED_IO         (LATAbits.LATA0)
void main()
{
    int n=0;
    long int i;
   
    LED_TRIS=0;

    OpenUSART( USART_TX_INT_OFF & USART_RX_INT_ON & USART_ASYNCH_MODE & USART_EIGHT_BIT & USART_CONT_RX & USART_BRGH_HIGH, 2082);

    TXSTA = 0x20;
    RCSTA = 0x90;
    BAUDCONbits.BRG16=1;

   
    while(1)
    {
        while(BusyUSART());
            WriteUSART('vexxx\r');
        //putcUSART('veseeds\r\n');
        LED_IO ^= 1;
        Delay10KTCYx(100);
        /*while(BusyUSART());
            WriteUSART('0');
        */
        LED_IO ^= 1;
        Delay10KTCYx(100);
    }
}

CCS receiver code:
Code:
#include <18F4685.h>     // Kullanılacak denetleyicinin başlık dosyası tanıtılıyor.
#fuses HS,NOWDT
#use delay (clock=40000000)
#use rs232 (baud=1200,xmit=PIN_C6, rcv=PIN_C7, parity=N, bits=8, stop=1)
char kk[20];
void main ( )
{
   while(1)
   {
      gets(kk);
      if(kk[0]=='v' && kk[1]=='e')
      {
         output_high(pin_a0);
         delay_ms(100);
         output_low(pin_a0);
         delay_ms(100);
         printf("ok\r");
      }
   }
   }
 

no, I cant do it. because of I am using EM4095 RFIDCard reader. EM4095 RFIDCard reader library is exists for CCS. it is not exists for C18.
 

abooo :) it is 750 lines. I have not got time any... Is there someone who can help for this problem
 

Status
Not open for further replies.

Similar threads

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top