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.

Software Uart problem with pic16f877a

Status
Not open for further replies.

abilashjoseph

Member level 1
Joined
Sep 8, 2009
Messages
34
Helped
1
Reputation
2
Reaction score
1
Trophy points
1,288
Location
Kerala
Activity points
1,560
Hi all,

i am using pic 16f877a and CCS compiler,

i am tried for a software uart. it work properly in Proteus and oshonsoft simulator.

but in board transmit section is ok but reception is not working.
receive will get only null.

like " you entered : [ ]"
no character appear there.

the code is given below

HTML:
#include <16f877a.h>
//#device adc=8
                   
#FUSES NOWDT                    //No Watch Dog Timer
#FUSES HS                       //High speed Osc (> 4mhz for PCM/PCH) (>10mhz for PCD)
#FUSES NOPUT                    //No Power Up Timer
#FUSES NOBROWNOUT               //No brownout reset
#FUSES NOLVP                    //No low voltage prgming, B3(PIC16) or B5(PIC18) used for I/O
#FUSES NOCPD                    //No EE protection
#FUSES NOWRT                    //Program memory not write protected
#FUSES NODEBUG                  //No Debug mode for ICD
#FUSES NOPROTECT                //Code not protected from reading

#use delay(clock=20000000,RESTART_WDT)
                         
#use rs232(baud=9600,parity=N,xmit=PIN_C6,rcv=PIN_C7,bits=8,errors,stream=HOSTPC,RESTART_WDT)
#use rs232(baud=9600,parity=N,xmit=PIN_C4,rcv=PIN_C5,bits=8,errors,stream=FPM)
                                          



void main()
{
char a=0;
 while(1)
 {
 fprintf(FPM,"Press any key\r\n");
 
  a= getch(FPM); 
  
 fprintf(FPM,"You entered : [%C]\r",a);
  
 }

}

please give a solution ASAP




Thanks

the oshonsoft simulation image:

 

Status
Not open for further replies.

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top