Continue to Site

Welcome to our site!

Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

  • Welcome to our site! Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

315 MHz modules and Manchester coding

Status
Not open for further replies.

Vizier87

Active Member
Hi guys,

I have posted a similar question in MikroE but they took their time though, so I'm posting it here for extra input from the old-timers here. According to Uncle Nigel, the Manchester Code is the most suitable for the standard 315 MHz modules. I'm attempting a simple transmission between my 16F84A and 16F876, where the Tx continuously transmits 0xff and the Rx, upon receiving 0xff, turns on all PORTB pins, and all turned off if otherwise. I'm doing it real simple, the wires are connected to each other (Tx to Rx, and GND tied together, not using the RF modules yet), with the following code:

Tx:
Code:
extern sfr sbit MANTXPIN;
extern sfr sbit MANTXPIN_Direction;

sbit MANTXPIN at rb7_bit;
sbit MANTXPIN_Direction at trisb7_bit;

void main() {
  Man_Send_Init();

  while (1) {
    Man_Send(0xff);
  }

}


Rx:
Code:
extern sfr sbit MANRXPIN;
extern sfr sbit MANRXPIN_Direction;

sbit MANRXPIN at rc7_bit;
sbit MANRXPIN_Direction at trisc7_bit;

void main() {
  trisb=0;
  portb=0;

  Man_Receive_Init();

  while(1){

    unsigned char data_ = 0, error = 0;
    a_ = Man_Receive(&error);
    if (a_==0xff){
       portb = 0xff;
    }
    else portb=0;

  }

}

It doesn't work, but I believe code-wise that's enough to see the transmission work, right?

Thanks.
Vizier87
 
Hi,

It will be good to indicate which library you are using for Manchester encoding (Man_Receive and Man_Send function).

Use an oscilloscope and check the waveform on the output pins intended for the transmitted signal. See what you get there. After that, try to see what is the value received from Man_Receive, and what value is returned in variable "error"
 
It will be good to indicate which library you are using for Manchester encoding (Man_Receive and Man_Send function).
As its written in MikroC, I would assume the MikroC built in library..
 
Status
Not open for further replies.

Latest threads

Back
Top