CCS C Software and Maintenance Offers
FAQFAQ   FAQForum Help   FAQOfficial CCS Support   SearchSearch  RegisterRegister 

ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

CCS does not monitor this forum on a regular basis.

Please do not post bug reports on this forum. Send them to support@ccsinfo.com

Problems with F Bus Please

 
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion
View previous topic :: View next topic  
Author Message
manu8888



Joined: 01 May 2006
Posts: 1

View user's profile Send private message

Problems with F Bus Please
PostPosted: Mon May 01, 2006 11:55 am     Reply with quote

sorry for my English

I'm working with a Pic 16f877a for connect to a Nokia cell with Fbus

in this form PC-->micro-->phone--> and Work well but when I try to send information directly From Micro It does'nt work, Or When I try to Use FORCE_SW. Can any body Please Help me?

this is the Code
Code:

#include "C:\1\CCS\aBRIL27\pr1.h"
//#include<PIC16F877A>
#include<stdlib.h> // Standard header for std input/output

#use fast_io(A)
#use fast_io(B)
#use fast_io(C)

#use delay(clock=20000000)

#use rs232(baud=115200, xmit=PIN_C6, rcv=PIN_C7,STREAM=X,errors)


int i=0;  //
Byte c;



void usart_sync(){ // USART <-> phone syncronization

   for(i=0;i<200;i++)
   fputc(0X55,X);// putc(0x55); // U
   fputc(0xC1,X);//putc(0xC1);
   }


void hwsw(){ // Getting HW/SW info

byte CONST send_frame_hwswinfo[16] = {0x1E,0x00,0x10,0xD1,0x00,0x07,0x00,0x01,
0x00,0x03,0x00,0x01,0x60,0x00,0x72,0xD5}; // Get HW/SW information

for(i=0;i<=15;i++)
Fputc(send_frame_hwswinfo[i],X);
}


void main() {
   SET_TRIS_A( 0xFF );
   SET_TRIS_B( 0xFF );
   SET_TRIS_D( 0xFF );
   SET_TRIS_E( 0xFF );
   SET_TRIS_C( 0xFF );

   setup_adc_ports(NO_ANALOGS);
   setup_adc(ADC_OFF);
   setup_psp(PSP_DISABLED);
   setup_spi(FALSE);
   setup_timer_0(RTCC_INTERNAL|RTCC_DIV_1);
   setup_timer_1(T1_DISABLED);
   setup_timer_2(T2_DISABLED,0,1);
   setup_comparator(NC_NC_NC_NC);
   setup_vref(VREF_LOW|-2);

   usart_sync();
   hwsw();
   
 while(TRUE)
        {
         c = fgetc() ;
          fputc(c);
        }
}

/// and this don't Work

#include "C:\1\CCS\aBRIL27\pr1.h"
//#include<PIC16F877A>
#include<stdlib.h> // Standard header for std input/output

#use fast_io(A)
#use fast_io(B)
#use fast_io(C)

#use delay(clock=20000000)

#use rs232(baud=115200, xmit=PIN_C6, rcv=PIN_C7,STREAM=X,errors,FORCE_SW)




int i=0;  //
Byte c;



void usart_sync(){ // USART <-> phone syncronization

   for(i=0;i<200;i++)
   fputc(0X55,X);// putc(0x55); // U
   fputc(0xC1,X);//putc(0xC1);
   }


void hwsw(){ // Getting HW/SW info

byte CONST send_frame_hwswinfo[16] = {0x1E,0x00,0x10,0xD1,0x00,0x07,0x00,0x01,
0x00,0x03,0x00,0x01,0x60,0x00,0x72,0xD5}; // Get HW/SW information

for(i=0;i<=15;i++)
Fputc(send_frame_hwswinfo[i],X);
}


void main() {
   SET_TRIS_A( 0xFF );
   SET_TRIS_B( 0xFF );
   SET_TRIS_D( 0xFF );
   SET_TRIS_E( 0xFF );
   SET_TRIS_C( 0xFF );

   setup_adc_ports(NO_ANALOGS);
   setup_adc(ADC_OFF);
   setup_psp(PSP_DISABLED);
   setup_spi(FALSE);
   setup_timer_0(RTCC_INTERNAL|RTCC_DIV_1);
   setup_timer_1(T1_DISABLED);
   setup_timer_2(T2_DISABLED,0,1);
   setup_comparator(NC_NC_NC_NC);
   setup_vref(VREF_LOW|-2);

   usart_sync();
   hwsw();
   
 while(TRUE)
        {
         c = fgetc() ;
          fputc(c);
        }
}
cmdrdan



Joined: 08 Apr 2005
Posts: 25
Location: Washington

View user's profile Send private message

PostPosted: Mon May 01, 2006 6:10 pm     Reply with quote

Check your set_tris statements. You have them all set for inputs, and you're wanting an output somewhere, aren't you?
Display posts from previous:   
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion All times are GMT - 6 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group