good aftrnoon,
I am not good in Microncontroller nor programmg. Only basic.
wish anybody could tell me how to send data in serial from RF module ( transmit and receive) to pic ( 16f877)using c language or any example of flowcode. i have read from the forum about SPI and confuse whether to use master sync port ( MSSP ) or USART for this purpose since i have seen from others using USART for this purpose. Again pleasss help me.
TQ
serial Rf module
- Benj
- Matrix Staff
- Posts: 15312
- Joined: Mon Oct 16, 2006 10:48 am
- Location: Matrix TS Ltd
- Has thanked: 4803 times
- Been thanked: 4314 times
- Contact:
Hi Wati
What is the serial / product code fo the RF module. Maybe there will be a datasheet informing exactly how to interface it.
If other people are using the UART then you will probably need to use this also. However you will need to find out if the communictaion method is synchronous or asynchronous (clocked half-duplex / full-duplex).
In the Pic datasheet there is a list of exactly how to program the UART in both synchronous or asynchronous mode.
What is the serial / product code fo the RF module. Maybe there will be a datasheet informing exactly how to interface it.
If other people are using the UART then you will probably need to use this also. However you will need to find out if the communictaion method is synchronous or asynchronous (clocked half-duplex / full-duplex).
In the Pic datasheet there is a list of exactly how to program the UART in both synchronous or asynchronous mode.
Regards Ben Rowland - MatrixTSL
Flowcode Product Page - Flowcode Help Wiki - Flowcode Examples - Flowcode Blog - Flowcode Course - My YouTube Channel
Flowcode Product Page - Flowcode Help Wiki - Flowcode Examples - Flowcode Blog - Flowcode Course - My YouTube Channel
rf control
thank for the concern of replying,
I am using 433 MHz rf ( transmitter and receiver )at this moment. I am attendint to use tranceiver ( laipac 2.4 Ghz - not buy yet ) for dual communication. I don't know the serial number ( when i bought it small size with no serial number ). I think it usart ( ascynronous serial comm ). I have 2.1 flowcode but it doesn,t have the asyncr serial block. some example using basic which i get from internet( retron) at below web . the program look simple in basic
http://www.rentron.com/ruf-bot.htm
I am using 433 MHz rf ( transmitter and receiver )at this moment. I am attendint to use tranceiver ( laipac 2.4 Ghz - not buy yet ) for dual communication. I don't know the serial number ( when i bought it small size with no serial number ). I think it usart ( ascynronous serial comm ). I have 2.1 flowcode but it doesn,t have the asyncr serial block. some example using basic which i get from internet( retron) at below web . the program look simple in basic
http://www.rentron.com/ruf-bot.htm
WATI
- Benj
- Matrix Staff
- Posts: 15312
- Joined: Mon Oct 16, 2006 10:48 am
- Location: Matrix TS Ltd
- Has thanked: 4803 times
- Been thanked: 4314 times
- Contact:
I have seen this project before and your right the code does look easy. If you use the RS232 component in flowcode then this will utilize the UART pins.
I would however suggest these modules
http://www.maplin.co.uk/Module.aspx?Mod ... &doy=28m11
and these encoder chips
http://www.maplin.co.uk/Module.aspx?Mod ... &doy=28m11
I suggest these ones because they do not need the RS232 serial communication. They are basically an easy way to get 4 digital I/O lines straight to the reciever module. All of the multiplexing is taken care of for you and the devices are encrypted to limit the possibility of data loss / corruption.
I would however suggest these modules
http://www.maplin.co.uk/Module.aspx?Mod ... &doy=28m11
and these encoder chips
http://www.maplin.co.uk/Module.aspx?Mod ... &doy=28m11
I suggest these ones because they do not need the RS232 serial communication. They are basically an easy way to get 4 digital I/O lines straight to the reciever module. All of the multiplexing is taken care of for you and the devices are encrypted to limit the possibility of data loss / corruption.
Regards Ben Rowland - MatrixTSL
Flowcode Product Page - Flowcode Help Wiki - Flowcode Examples - Flowcode Blog - Flowcode Course - My YouTube Channel
Flowcode Product Page - Flowcode Help Wiki - Flowcode Examples - Flowcode Blog - Flowcode Course - My YouTube Channel
rf remote
U are definately right benj, i have tried use RF encoder before and it's working but i wish to try and learn using serial communcation. I have choose, pick and alter some of the program in c2c( i am also use c2c compiler ) website wher i wish to send and receive binary / data for rf ( were 2 micocontroller involve, one at the transmitter and another one at the receiver )but i don't know whether its working or not. Pls comments. TQ
//transmit
#pragma CLOCK_FREQ 3276800
// Port addresses
char PORTC@0x07;
// USART Registers
char TXREG@0x19;
char RCREG@0x1a;
char TXSTA@0x98;
char RCSTA@0x18;
char SPBRG@0x99;
void main()
{
set_bit( STATUS, RP0 ); // *** Register page 0 ***
clear_bit( TXSTA, SYNC ); // Asyncronous mode;
clear_bit( TXSTA, BRGH ); // RRGH = 1 ( High speed mode )
SPBRG = 22; // SPBRG = 22 ( Set Baud rate 9,600 )
clear_bit( STATUS, RP0 ); //
set_bit( RCSTA, SPEN ); // Enable Serial port
clear_bit( STATUS, RP0 ); // Asyncronous mode;
clear_bit( TXSTA, TX9 ); // 8 bit transmit mod
set_bit( TXSTA, TXEN ); // Enable Transmitter
clear_bit( STATUS, RP0 ); //
TXREG=0;
{
WHILE(1)
((_TXSTA &_TMRT)!=1));
TXREG = 2; // data 0000 0010 send
DELAY(400);
}
}
//receive
#pragma CLOCK_FREQ 3276800
// Port addresses
char PORTC@0x07;
// USART Registers
char TXREG@0x19;
char RCREG@0x1a;
char TXSTA@0x98;
char RCSTA@0x18;
char SPBRG@0x99;
void main()
{
set_bit( STATUS, RP0 ); //
clear_bit( TXSTA, SYNC ); // Asyncronous mode;
clear_bit( TXSTA, BRGH ); // RRGH = 1 ( High speed mode )
SPBRG = 22; // SPBRG = 22 ( Set Baud rate 9,600 )
set_bit( RCSTA, SPEN ); // Enable Serial port
clear_bit( STATUS, RP0 ); // Asyncronous mode;
clear_bit( TXSTA, RX9 ); // 8 bit transmit mod
WHILE(1)
((_PIR1&_RXIF)!=0));
IF (RCREG == 2)
{
set_bit(STATUS,RPO);
TRISA=0X00 ;
clear_bit(STATUS,RPO);
PORTA = 1; // to turn on bit 0 at port A
delay_s(2);
}
mainendloop :goto mainedloop;
}
//transmit
#pragma CLOCK_FREQ 3276800
// Port addresses
char PORTC@0x07;
// USART Registers
char TXREG@0x19;
char RCREG@0x1a;
char TXSTA@0x98;
char RCSTA@0x18;
char SPBRG@0x99;
void main()
{
set_bit( STATUS, RP0 ); // *** Register page 0 ***
clear_bit( TXSTA, SYNC ); // Asyncronous mode;
clear_bit( TXSTA, BRGH ); // RRGH = 1 ( High speed mode )
SPBRG = 22; // SPBRG = 22 ( Set Baud rate 9,600 )
clear_bit( STATUS, RP0 ); //
set_bit( RCSTA, SPEN ); // Enable Serial port
clear_bit( STATUS, RP0 ); // Asyncronous mode;
clear_bit( TXSTA, TX9 ); // 8 bit transmit mod
set_bit( TXSTA, TXEN ); // Enable Transmitter
clear_bit( STATUS, RP0 ); //
TXREG=0;
{
WHILE(1)
((_TXSTA &_TMRT)!=1));
TXREG = 2; // data 0000 0010 send
DELAY(400);
}
}
//receive
#pragma CLOCK_FREQ 3276800
// Port addresses
char PORTC@0x07;
// USART Registers
char TXREG@0x19;
char RCREG@0x1a;
char TXSTA@0x98;
char RCSTA@0x18;
char SPBRG@0x99;
void main()
{
set_bit( STATUS, RP0 ); //
clear_bit( TXSTA, SYNC ); // Asyncronous mode;
clear_bit( TXSTA, BRGH ); // RRGH = 1 ( High speed mode )
SPBRG = 22; // SPBRG = 22 ( Set Baud rate 9,600 )
set_bit( RCSTA, SPEN ); // Enable Serial port
clear_bit( STATUS, RP0 ); // Asyncronous mode;
clear_bit( TXSTA, RX9 ); // 8 bit transmit mod
WHILE(1)
((_PIR1&_RXIF)!=0));
IF (RCREG == 2)
{
set_bit(STATUS,RPO);
TRISA=0X00 ;
clear_bit(STATUS,RPO);
PORTA = 1; // to turn on bit 0 at port A
delay_s(2);
}
mainendloop :goto mainedloop;
}
WATI
-
- Posts: 150
- Joined: Mon Oct 15, 2012 5:19 pm
- Has thanked: 12 times
- Been thanked: 18 times
- Contact:
Re: serial Rf module
Ola estou aproveitando este topico para tirar uma dúvida.Eu preciso decodificar controle remoto tx HT6P20B utilizando o pic 16f628a.Esse controle é o mesmo que usam em PORTÃO AUTOMATICO e ALARMES residencial.Gostaria de saber como implementar isso no FLOWCODE
Re:
Hi Benj,Benj wrote:Hi Wati
What is the serial / product code fo the RF module. Maybe there will be a datasheet informing exactly how to interface it.
If other people are using the UART then you will probably need to use this also. However you will need to find out if the communictaion method is synchronous or asynchronous (clocked half-duplex / full-duplex).
In the Pic datasheet there is a list of exactly how to program the UART in both synchronous or asynchronous mode.
I intend to use this DRF7020D27 module (from here: http://www.dorji.com/pro/RF-module/High ... eiver.html) for my wireless data collection which is one master and two slaves, controller used is PIC16F877A. The idea is using polling method.. I do not experience on programing...could you give me some advise?
Thanks in front!
Re: Wireless IO lines
Dear Benji,
Sorry for asking for helping on such an old thread, but I would really like to know exactly how we should implement this kind of solution in Flowmotion?
It would be great if I could get 4 wireless IO lines, but It would help to see some sample coding, if possible.
Cheers and thank you for your help!
Sorry for asking for helping on such an old thread, but I would really like to know exactly how we should implement this kind of solution in Flowmotion?
It would be great if I could get 4 wireless IO lines, but It would help to see some sample coding, if possible.
Cheers and thank you for your help!
Benj wrote:I have seen this project before and your right the code does look easy. If you use the RS232 component in flowcode then this will utilize the UART pins.
I would however suggest these modules
http://www.maplin.co.uk/Module.aspx?Mod ... &doy=28m11
and these encoder chips
http://www.maplin.co.uk/Module.aspx?Mod ... &doy=28m11
I suggest these ones because they do not need the RS232 serial communication. They are basically an easy way to get 4 digital I/O lines straight to the reciever module. All of the multiplexing is taken care of for you and the devices are encrypted to limit the possibility of data loss / corruption.
- Benj
- Matrix Staff
- Posts: 15312
- Joined: Mon Oct 16, 2006 10:48 am
- Location: Matrix TS Ltd
- Has thanked: 4803 times
- Been thanked: 4314 times
- Contact:
Re: serial Rf module
Hello,
I assume you mean Flowcode as FlowMotion is according to Google a "Organic Personal Lubricant" or sequencer software.
Assuming your using the encoders you simply need to use an input icon to read the incoming values and an output icon to set the outgoing values.
The logic level on the pin to the encoder will be transmitted before being received and output on the decoder.
I assume you mean Flowcode as FlowMotion is according to Google a "Organic Personal Lubricant" or sequencer software.
Assuming your using the encoders you simply need to use an input icon to read the incoming values and an output icon to set the outgoing values.
The logic level on the pin to the encoder will be transmitted before being received and output on the decoder.
Regards Ben Rowland - MatrixTSL
Flowcode Product Page - Flowcode Help Wiki - Flowcode Examples - Flowcode Blog - Flowcode Course - My YouTube Channel
Flowcode Product Page - Flowcode Help Wiki - Flowcode Examples - Flowcode Blog - Flowcode Course - My YouTube Channel