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.

Simple project help me!!!

Status
Not open for further replies.

ryusgnal

Advanced Member level 4
Full Member level 1
Joined
Oct 4, 2005
Messages
102
Helped
3
Reputation
6
Reaction score
1
Trophy points
1,298
Location
Malaysia
Activity points
1,992
Hi i'm newbies in PIC design. I want to built simple project for exercise. I'm using PIC16F877a for this project.

I want to PIC to read data from serial port which i send from hiperterminal. then PIC will XOR the data with '11111111' and send it back to serial port. and i can see the output in hiperterminal. does anybody know the code in C language?

thank you for any help.
 

ryusgnal,

I have some codes writen in C++Builder 5.03 working with serial port, but it do not exactly what you want, instead, it work under a proprietary frame protocol. If you want it, I may send to you, or post here. You choice.


+++
 

Code:
#use delay (clock=20000000)
#use rs232(baud=9600, xmit=PIN_C6,rcv=PIN_C7)

void main(void)
{
  while (1)
  {
     putc(~getc());
  }
}




the magic of ccs pic c compiler....

edit: sorry, i think it was 1-complement... but this is the xor version
Code:
#use delay (clock=20000000)
#use rs232(baud=9600, xmit=PIN_C6,rcv=PIN_C7)

void main(void)
{
  while (1)
  {
     putc(getc() ^ 0b11111111);
  }
}
 

Go to Oshonsoft.com and download Pic_Simulator_IDE. This software includes a Basic compiler which generates assembly and hex code. This code can be programmed into a 16F877A or you can use the Bootloader you will find on the site. Or if you like you can run a simulation. Try it it is.
 

Status
Not open for further replies.

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top