CCS C Software and Maintenance Offers
FAQFAQ   FAQForum Help   FAQOfficial CCS Support   SearchSearch  RegisterRegister 

ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

CCS does not monitor this forum on a regular basis.

Please do not post bug reports on this forum. Send them to CCS Technical Support

Communication rf adc
Goto page Previous  1, 2, 3, 4  Next
 
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion
View previous topic :: View next topic  
Author Message
Ttelmah



Joined: 11 Mar 2010
Posts: 19539

View user's profile Send private message

PostPosted: Sat Mar 25, 2017 3:10 pm     Reply with quote

Think about it:

Code:

#int_RDA
void RDA_isr(void)
{
   vetor[n] = getc();
   if (n == 1)
   {
      data = 1;
      n = 0;  //n is now 0
   }
   n++; //n is now 1..... 
}

You are never going to write to vetor[0]....
PCM programmer



Joined: 06 Sep 2003
Posts: 21708

View user's profile Send private message

PostPosted: Sat Mar 25, 2017 5:12 pm     Reply with quote

Quote:
but the output pin on the transmitter is not set yet, as I'm going to
do so that when the transmitter sends the high value to the receiver it is
set in the transmitter with a high value in the transmitter. EX PIN_B0,
because I have the answer on the receiver but on the TX pin of the receiver

I don't know what this means.
temtronic



Joined: 01 Jul 2010
Posts: 9243
Location: Greensville,Ontario

View user's profile Send private message

PostPosted: Sun Mar 26, 2017 5:42 am     Reply with quote

Please post the information about the RF modules.
Make, model and a link to the datasheet
sergio3214



Joined: 15 Mar 2017
Posts: 25
Location: brasil

View user's profile Send private message

PostPosted: Mon Mar 27, 2017 10:24 am     Reply with quote

temtronic wrote:
Please post the information about the RF modules.
Make, model and a link to the datasheet

http://www.filipeflop.com/pd-80dc1-modulo-rf-transmissor-receptor-433mhz-am.html
Here is the rf module
Sorry for the delay in responding
sergio3214



Joined: 15 Mar 2017
Posts: 25
Location: brasil

View user's profile Send private message

PostPosted: Mon Mar 27, 2017 10:28 am     Reply with quote

PCM programmer wrote:
Quote:
but the output pin on the transmitter is not set yet, as I'm going to
do so that when the transmitter sends the high value to the receiver it is
set in the transmitter with a high value in the transmitter. EX PIN_B0,
because I have the answer on the receiver but on the TX pin of the receiver

I don't know what this means.


PCM programmer
And that now through this code I want to control the speed of a DC motor thus making an acceleration ramp.
Ttelmah



Joined: 11 Mar 2010
Posts: 19539

View user's profile Send private message

PostPosted: Mon Mar 27, 2017 11:34 am     Reply with quote

These are amongst the worst modules you could get.
They are not actually designed to send serial data. They are designed for simple on/off remote control type applications. They will receive an enormous amount of invalid data (just about anything transmitting on the 433MHz band can trigger them....). The receive output also idles low.
You are making things hard for yourself, by using cheap modules. It can be done, but honestly to be even remotely reliable is going to require custom serial code and error correction code on the data.
temtronic



Joined: 01 Jul 2010
Posts: 9243
Location: Greensville,Ontario

View user's profile Send private message

PostPosted: Mon Mar 27, 2017 1:18 pm     Reply with quote

As Mr. T says...not a good choice to use. If possible, buy the HC-12 serial RF modems. I paid $6 CDN for them, direct from China, took 3 weeks to get. They WORK. Someone in Brasil must import them. If not, order direct from China (free shipping). When dealing with RF, you need reliable communications.

Jay
sergio3214



Joined: 15 Mar 2017
Posts: 25
Location: brasil

View user's profile Send private message

PostPosted: Mon Mar 27, 2017 1:23 pm     Reply with quote

Ttelmah wrote:
These are amongst the worst modules you could get.
They are not actually designed to send serial data. They are designed for simple on/off remote control type applications. They will receive an enormous amount of invalid data (just about anything transmitting on the 433MHz band can trigger them....). The receive output also idles low.
You are making things hard for yourself, by using cheap modules. It can be done, but honestly to be even remotely reliable is going to require custom serial code and error correction code on the data.


As I have not purchased I can make the purchase of other modules as for ex
http://www.rficy.com/wp-content/uploads/2013/12/CY03.pdf

http://teslabem.com/modulo-rf-serial-433mhz-bidireccional-hc-11.html


But my desire now is to be able to control a motorcycle through radio frequency because I already get two pic to communicate. Now I want to control the speed of a motor via rf.
temtronic



Joined: 01 Jul 2010
Posts: 9243
Location: Greensville,Ontario

View user's profile Send private message

PostPosted: Mon Mar 27, 2017 1:37 pm     Reply with quote

The HC-11 is a far better choice, but if possible get the HC-12 version.

Jay
sergio3214



Joined: 15 Mar 2017
Posts: 25
Location: brasil

View user's profile Send private message

PostPosted: Mon Mar 27, 2017 1:43 pm     Reply with quote

temtronic wrote:
The HC-11 is a far better choice, but if possible get the HC-12 version.

Jay

Do you have any idea how I can be deprecating the code to control the speed of a motor by rf if it was help me
temtronic



Joined: 01 Jul 2010
Posts: 9243
Location: Greensville,Ontario

View user's profile Send private message

PostPosted: Mon Mar 27, 2017 2:41 pm     Reply with quote

OK, the best way to approach this project , is to NOT use the RF modules, yet.

Get your 2 PICs, the 'controller' and the 'bike' to communicate simply by using RS-232. Yes, it's a 'wired' interface but you should be able to get 99% of the software running without the RF modules. Once you get good RF modules, you should be able to wire them in and do final testing.
That's why I suggested the HC-12 units. They are 'transparent' as far as communication goes, same as real wire...
By breaking up the project into two stages, you eliminate the problem of deciding is it transmitter code, receiver code or a wireless module problem.

There are several example programs detailing PIC to PIC communcation via serial (aka RS-232), start there.
sergio3214



Joined: 15 Mar 2017
Posts: 25
Location: brasil

View user's profile Send private message

PostPosted: Mon Mar 27, 2017 3:03 pm     Reply with quote

temtronic wrote:
OK, the best way to approach this project , is to NOT use the RF modules, yet.

Get your 2 PICs, the 'controller' and the 'bike' to communicate simply by using RS-232. Yes, it's a 'wired' interface but you should be able to get 99% of the software running without the RF modules. Once you get good RF modules, you should be able to wire them in and do final testing.
That's why I suggested the HC-12 units. They are 'transparent' as far as communication goes, same as real wire...
By breaking up the project into two stages, you eliminate the problem of deciding is it transmitter code, receiver code or a wireless module problem.

There are several example programs detailing PIC to PIC communcation via serial (aka RS-232), start there.

I have searched the forum for many days and could not find the solution.
Could you be a little more clear, because I could not get it.
sergio3214



Joined: 15 Mar 2017
Posts: 25
Location: brasil

View user's profile Send private message

PostPosted: Thu Mar 30, 2017 5:35 pm     Reply with quote

Is there someone who can help me ???
I need a lot to control an engine with this code via radio frequency.
Please help me.
temtronic



Joined: 01 Jul 2010
Posts: 9243
Location: Greensville,Ontario

View user's profile Send private message

PostPosted: Fri Mar 31, 2017 5:59 am     Reply with quote

As I said earlier, forget about the 'RF modules' for now. Concentrate on getting your 2 PICS to work on the same breadboard. TX1>RX2, RX1<TX2.

I don't know how much 'control' you're supposed to have over the motorcycle but that will NOT be easy. It's details like balance, turning, interfacing to throttle, brakes, shifter, etc. that can easily take a year or two.
Decades ago I designed an RC motorcycle....regular RC servos. Took 4 months just to get it to go straight down the road.

Start small with 2 PICS and the breadboard..one small step at a time.

Jay
sergio3214



Joined: 15 Mar 2017
Posts: 25
Location: brasil

View user's profile Send private message

PostPosted: Fri Mar 31, 2017 10:52 am     Reply with quote

So I already did the communication works on the same network baud, I already did communication between the TX and RX turn the led on and off, and also the ADC conversion, what is happening and that I get the conversion value on the tx pin of the receiver and now I want this value to be in a pin such as
Code:



void main()

   enable_interrupts(INT_RDA);
   
   enable_interrupts(global);
   while(TRUE)
   { 
      if (data == 1)
      {           
         resultado = (((int16)vetor[0]<<8) | vetor[1]);         
         fprintf (Wireless, "\n\r%lu", resultado);         
         data++;
             printf_ valor alto( PIN_B0) // High value on receiver PIN_B0
      }

   }
}   
Display posts from previous:   
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion All times are GMT - 6 Hours
Goto page Previous  1, 2, 3, 4  Next
Page 2 of 4

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group