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.

Transmitting simple signal with PIC16F877

Status
Not open for further replies.

tomas

Member level 1
Joined
Dec 16, 2012
Messages
41
Helped
0
Reputation
0
Reaction score
0
Trophy points
1,286
Activity points
1,553
I have 2 schematics. First is pic16f877 with pushbutton and rf transmitter, and other shematic is pic16f877 with LED and rf receiver.

my code for transmitter:

Code:
void main()
{
  TRISB.F0 = 0xFF;
  PORTB.F0 = 0;
  UART1_Init(2400); // Initialize UART module at 9600bps
  Delay_ms(100); // Wait for UART module to stabilize
  while (1)
  { // Endless loop
    UART1_Write(PORTB); // and send data via UART
    Delay_ms(500);
  }
}

code for receiver:

Code:
void main()
{
  TRISB = 0;
  PORTB = 0;
  UART1_Init(2400); // Initialize UART module at 9600bps
  Delay_ms(100); // Wait for UART module to stabilize
  while (1)
  { // Endless loop
    if (UART1_Data_Ready())
    { // If data is received,
      PORTB = UART1_Read(); // read the received data,
    }
   }
}

I have those two circuits connected in reality, but this code didn't work. It should transmit signal when I press button which connected to portB pin 0 and LED on receiver portB pin 0 should be on.

Can anyone help me with code? ;/
 

How can I verify this?

Besides, I have connected microcontroller to re transmitter, not to other mc ;)
 


maybe I should encode manchester code when I receive a signal?

- - - Updated - - -

can anyone rewrite my code with manchester encoding/decoding http://www.mikroe.com/esupport/index.php?_m=knowledgebase&_a=viewarticle&kbarticleid=138 ? I need to see how it looks, because Im having hard time to figure it out by myself... :(
 

can anyone help me? :(
 

can anyone help me? :(

Encoder will be built into the Transmitter and Decoder will be built into the Receiver. So, you don't have to worry about encoding/decoding the data. Your RF module works at 4800 bps. What is the baudrate you have selected for your MCUs (both transmitter MCU and Receiver MCU)?
 

Status
Not open for further replies.

Similar threads

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top