PDA

View Full Version : 433mhz



mpardinho
- 4th December 2006, 14:19
i use 2 circuits

1 - 16F628
1 - Transmiter

2 - 16F628
2 - Receive

1 - code - Transmit


INCLUDE "modedefs.bas"

Transmissor_Saida VAR PORTA.2 '

Dados var byte
Sincronismo var byte
Codigo_Teste var byte

CMCON = 7 ' PortA = digital I/O
VRCON = 0 ' Voltage reference disabled
OPTION_REG.7 = 0 ' Enable PORTB pull-ups

codigo_Teste = "©"
Sincronismo = "®"

Inicio:
pause 100

for dados = 33 to 255
serout Transmissor_Saida, T2400, [codigo_Teste, sincronismo, dados, codigo_Teste]
PAUSE 1
next
serout Transmissor_Saida, T2400, ["END", 13, 10]
goto inicio

end



2 - code - Receive


INCLUDE "modedefs.bas"

Serial_Entrada VAR PORTA.3 ' 2 Pic Rx -> 9 Max 232 Tx Marron
Serial_Saida VAR PORTA.2 ' 1 Pic Tx -> 10 Max 232 Rx Laranja
Receptor_Entrada VAR PORTA.1 ' 1 Pic Rx -> 9 Receptor data

Dados var byte
Sincronismo var byte
Codigo_Teste var byte

CMCON = 7 ' PortA = digital I/O
VRCON = 0 ' Voltage reference disabled
OPTION_REG.7 = 0 ' Enable PORTB pull-ups

codigo_Teste = "©"
Sincronismo = "®"

serout serial_saida, T2400, ["Inicio", 13, 10]

Inicio:

'SERIN serial_entrada, T2400, [CODIGO_TESTE, SINCRONISMO], DAdos
'SERIN receptor_entrada, T2400, [CODIGO_TESTE, SINCRONISMO], DAdos

SERIN receptor_entrada, T2400, DAdos
SEROUT SERIAL_SAIDA, T2400, [DAdos, 13, 10]

gOTO inicio


my problem is than in receive,
Dados = "["
i not receive "[", "]", A
in hyperterminal i receivce 10 caracter "["


i use this code for test http://www.rentron.com/Stamp_RF.htm

sayzer
- 4th December 2006, 14:32
I am no expert but,

1. You send three variables : T1, T2, and A.

Then you have one variable, DAdos, in your receiver to receive them.
You should have three variables in receiver.

2. You use T2400 in your sender.
But you have T1200 in your receiver.



---------------------------------

HenrikOlsson
- 4th December 2006, 14:33
Hi,
Well, according to your code you are sending at 2400baud and recieving at 1200. That will not work....

Also, on your reciever, you are telling SERIN to recieve one byte (DAdos). If you are sending three bytes you need to tell SERIN to recieve 3 bytes.


DAdos var byte
Temp1 var byte
Temp2 var byte

SERIN SER_IN, T1200, DAdos, Temp1, Temp2
SEROUT SER_OUT, T1200, DAdos, Temp1, Temp2, 10, 13

'....and so on


You can also try:


DEFINE CHAR_PACING 1000 'Serout character pacing in us

Perhaps that will help.

/Henrik Olsson.

skimask
- 4th December 2006, 14:38
i use 2 circuits

1 - 16F628
1 - Transmiter

2 - 16F628
2 - Receive

1 - code - Transmit
T1 = "["
T2 = "]"

start:
For A = 1 to 10
SEROUT SERIAL_OUT, T2400, [T1, T2, A]
next
goto start

2 - code - Receive

start:
SERIN SER_IN, T1200, DAdos
SEROUT SER_OUT, T1200, [DAdos, 13, 10]
goto start


my problem is than in receive,
Dados = "["
i not receive "[", "]", A
in hyperterminal i receivce 10 caracter "["


i use this code for test http://www.rentron.com/Stamp_RF.htm



You send 3 numbers and only receive one...how's that going to work?
You send at 2400, receive at 1200...how's that going to work?
Also, I don't see anything set up to synchronize the receiver, nothing relating to manchester encoding your data, and I could go on.
Read thru the example at Rentron's site a bit more before you start in again.
JDG

mpardinho
- 4th December 2006, 14:49
pardon....both are T2400.. rewrite post...my real code

i will try DEFINE CHAR_PACING 1000 and post the results

many thanks brothers

sayzer
- 4th December 2006, 15:00
Don't scare him skimask!

Not having that much experience is not a crime nor is making mistakes.


-----------------------------

skimask
- 4th December 2006, 17:21
Don't scare him skimask!

Not having that much experience is not a crime nor is making mistakes.


-----------------------------


No scaring going on here. Just pointing out the blatently obvious...again.
JDG