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.

[SOLVED] UART not working 18f25k22

Status
Not open for further replies.

ep.hobbyiest

Full Member level 4
Joined
Jul 24, 2014
Messages
212
Helped
1
Reputation
2
Reaction score
1
Trophy points
18
Activity points
1,487
Hi,
I am using pic18f25k22 PIC and CCS Compiler. Code is working on proteus but not on real hardware.
Led blinking is working properly on hardware.
Here is the code.

Code:
#include <main.h> 

void main() 
{ 

   while(TRUE) 
   { 
      //TODO: User Code 
      printf("Live\r\n"); 
      delay_ms(1000); 
   } 

}

and main.h file is as

Code:
#include <18F25K22.h> 
#device ADC=16 

#FUSES NOWDT                    //No Watch Dog Timer 
#FUSES WDT128                   //Watch Dog Timer uses 1:128 Postscale 
#FUSES NOBROWNOUT               //No brownout reset 
#FUSES NOLVP                    //No low voltage prgming, B3(PIC16) or B5(PIC18) used for I/O 
#FUSES NOXINST                  //Extended set extension and Indexed Addressing mode disabled (Legacy mode) 

#use delay(internal=16MHz) 
#use rs232(baud=9600,parity=N,xmit=PIN_C6,rcv=PIN_C7,bits=8,stream=PORT1)
 

No Oscillator fuses.

eg: HS, XT...
 

Finally got working. It was chip's problem. With other hardware this code is working.
 

Status
Not open for further replies.

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top