Ok, and in True mode you have RF carrier when the DATA line i in idle.
But i´m still not understanding why its a problem to drive it in true mode, and in my case i have to drive it in true mode for inverted mode does´t work at all.
Ok, and in True mode you have RF carrier when the DATA line i in idle.
But i´m still not understanding why its a problem to drive it in true mode, and in my case i have to drive it in true mode for inverted mode does´t work at all.
Before you test with the RF modules, make sure that your system works when the
two microcontrollers are connected with a 1k ohm resistor.
Make sure that the two PIC microcontrollers share the same ground. (GND).
Both microcontrollers must use inverted logic.Code:PIC #1 PIC #2 1k TX Pin-----/\/\/\------RX pin GND -------------------GND
I have done the Test now.. and here we have the problem
It dosen´t work whit the BS2 code (SERIN2/SEROUT2) whit wires between the pic´s but the other code whit SERIN and SEROUT works fine.
What could be the problem?
Code:SERIN2 reciverpin, 16468, [WAIT("!"),Counter]i´m not sure if the "16468" in the BS2 program shold be the same in a PBP program, i dont understand how to set those bits. but if there shold be "16468" then what else could be wrong?Code:PULSOUT TransmitterPIN, 1200 SEROUT2 TransmitterPIN, 16468, ["!",Counter]
EDIT:
Just find that 9600 baud may be unreliable with 4MHz clock, but it´s still not working when i try to lower the baud to 2400.
It´s not working in inverted mode whit both SERIN/SEROUT and SERIN2/SEROUT2
http://www.microengineeringlabs.com/.../ser2modes.htm
What are i´m doing wrong?
EDIT2:
Can it have someting to do whit that i´m using a 4MHz inernal RC on the transmitter? shold i clock it up to 20MHz whit an external crystal like the reciver?
Last edited by Fredrick; - 17th February 2008 at 01:31. Reason: More info
Hi Fredrick,
A sync pulse of 3000 µs is what is used in the BS1 example visible at page 5 of this doc:
http://www.parallax.com/Portals/0/Do...ceive-v1.0.pdf
(In the BS1 sample code the baud rate is 2400).
I am not a PicBasic Pro user or a Basic Stamp user, so what I can do is very limited
and based only on the user manuals.
Here is my version of the PBP code:
Code:' Transmitter code ' (Clock = 4MHz). ' ' At 4MHz, a PULSEOUT of 300 is OK. ' 300 * 10 µs = 3000 µs ' (See PBP Manual PULSEOUT). ' ' BAUD MODE = 16780 (Baud rate 2400, 8-bit, no-parity, inverted, output DRIVEN). ' ' PULSOUT TransmitterPIN, 300 ' sync pulse of 3000 µs SEROUT2 TransmitterPIN,16780,["!",Counter] '
Code:' Receiver code ' (Clock = From 4MHz to 20 MHz). ' ' BAUD MODE = 16780 (Baud rate 2400, 8-bit, no-parity, inverted). ' ' SERIN2 reciverpin, 16780, [WAIT("!"),Counter] '
Best regards,
Luciano
Does´t work....
The PIC (16F872) stops at
SERIN2 reciverpin, 16780, [WAIT("!"),Counter]
Is there a bug in PBP like the one whit OWOUT that make a never ending loop
I have version PBP 2.50a
http://www.picbasic.co.uk/forum/show...79&postcount=4
Note that both SERIN and SERIN2 make´s the PIC stops when i try to use them whit Inverted mode. whit SERIN and True mode it works..
UPDATE:
When i remove "PULSOUT TransmitterPIN, 300" it works....... ??
Last edited by Fredrick; - 17th February 2008 at 14:30.
Hi Fredrick,
Here is how you can test the TX code and the RX with a terminal emulator.
* * *
You can test the TX code if you connect the PIC to the serial
port of your PC. The 1k resistor is mandatory.
Open your terminal emulator with these settings:
2400 baud, 8 data bits, No-parity, 1 stop bit.
If you run this code you should see in the terminal emulator: !ACode:' 1k ' PIC TX pin ---------/\/\/\---------- DB9 (Pin 2) RS232 port RX data ' ' ' PIC GND -----------------------------DB9 (pin 5) RS232 port GND ' ' ' Counter = 65 '65 = character A SEROUT2 TransmitterPIN,16780,["!",Counter]
* * *
You can test the RX code if you connect the PIC to the serial
port of your PC. The 22k resistor is mandatory.
Open your terminal emulator with these settings:
2400 baud, 8 data bits, No-parity, 1 stop bit.
After you run the code you must type !A in the terminal emulator.Code:' 22k ' PIC RX pin ---------/\/\/\---------- DB9 (Pin 3) RS232 port TX data ' ' ' PIC GND -----------------------------DB9 (pin 5) RS232 port GND ' ' ' SERIN2 reciverpin, 16780, [WAIT("!"),Counter]
* * *
Note that this direct connection with series resistors works only if you
use Inverted logic for SEROUT2 and SERIN2.
Best regards,
Luciano
I give upp now..... Inverted mode does not work but True mode work just fine whit SERIN, i think it has someting to do whit noise in the air becous when i hold my hand over the antenna of the reciver it works a better but not good.
My solution will be to pull down PDN line when i don´t want to transmitt and pull it high when i want to transmitt or just drive the hole modul from an +5v high PIN on the PIC that is active when i want to transmitt and then pull it low.
Transmitter supply current is 5.2 mA so a pin from the 16F628A that have 20mA is enought.
Then i can use True mode whitout have an RF carrier when i don´t send.
Bookmarks