بعد از مدتها کار موفق شدم مازول ارسال rfm02 را برنامه ریزی کنم تا از آن استفاده کنم
ولی متاسفانه موفق به برنامه ریزی rfm01 (دریافت) نشدم یعنی مثلا با تغییر تنظیمات مربوط به فرکانس پایه clk یا حتی غیر فعال کردن اون دائم فرکانس 1mhz رو در خروجی دارم
برنامه رو بسیار ساده و باز نوشتم البته این برنامه فقط برای بخش تنظیمات است
لطفا کمکم کنید
کد:
$regfile "m16def.dat"
$crystal = 8000000
Config Portb.0 = Output , Portb.1 = Output , Pinb.2 = Input , Pinb.3 = Input , Portb.4 = Output
Sdi Alias Portb.0
Nsel Alias Portb.1
Ir Alias Pinb.2
Sdo Alias Pinb.3
Sck Alias Portb.4
Reset Sck
Set Sdi
Set Nsel
'command=0000 0000 0000 0000 = 0000 status read
Reset Nsel
Waitus 2
Reset Sdi
Gosub Clock
Reset Sdi
Gosub Clock
Reset Sdi
Gosub Clock
Reset Sdi
Gosub Clock
Reset Sdi
Gosub Clock
Reset Sdi
Gosub Clock
Reset Sdi
Gosub Clock
Reset Sdi
Gosub Clock
Reset Sdi
Gosub Clock
Reset Sdi
Gosub Clock
Reset Sdi
Gosub Clock
Reset Sdi
Gosub Clock
Reset Sdi
Gosub Clock
Reset Sdi
Gosub Clock
Reset Sdi
Gosub Clock
Reset Sdi
Gosub Clock
Waitus 2
Set Nsel
Waitus 20
'command =1001 0001 1000 1011=918b configuration setting
Reset Nsel
Waitus 2
Set Sdi
Gosub Clock
Reset Sdi
Gosub Clock
Reset Sdi
Gosub Clock
Set Sdi
Gosub Clock
Reset Sdi
Gosub Clock
Reset Sdi
Gosub Clock
Reset Sdi
Gosub Clock
Set Sdi
Gosub Clock
Set Sdi
Gosub Clock
Reset Sdi
Gosub Clock
Reset Sdi
Gosub Clock
Reset Sdi
Gosub Clock
Set Sdi
Gosub Clock
Reset Sdi
Gosub Clock
Set Sdi
Gosub Clock
Set Sdi
Gosub Clock
Waitus 2
Set Nsel
Waitus 20
'command=1010 0000 1000 0000=a640 frequency setting
Reset Nsel
Waitus 2
Set Sdi
Gosub Clock
Reset Sdi
Gosub Clock
Set Sdi
Gosub Clock
Reset Sdi
Gosub Clock
Reset Sdi
Gosub Clock
Reset Sdi
Gosub Clock
Reset Sdi
Gosub Clock
Reset Sdi
Gosub Clock
Set Sdi
Gosub Clock
Reset Sdi
Gosub Clock
Reset Sdi
Gosub Clock
Reset Sdi
Gosub Clock
Reset Sdi
Gosub Clock
Reset Sdi
Gosub Clock
Reset Sdi
Gosub Clock
Reset Sdi
Gosub Clock
Waitus 2
Set Nsel
Waitus 20
'command=1100 1000 0100 0111=c847 data rate
Reset Nsel
Waitus 2
Set Sdi
Gosub Clock
Set Sdi
Gosub Clock
Reset Sdi
Gosub Clock
Reset Sdi
Gosub Clock
Set Sdi
Gosub Clock
Reset Sdi
Gosub Clock
Reset Sdi
Gosub Clock
Reset Sdi
Gosub Clock
Reset Sdi
Gosub Clock
Set Sdi
Gosub Clock
Reset Sdi
Gosub Clock
Reset Sdi
Gosub Clock
Reset Sdi
Gosub Clock
Set Sdi
Gosub Clock
Set Sdi
Gosub Clock
Set Sdi
Gosub Clock
Waitus 2
Set Nsel
Waitus 20
'command=1100 0110 1001 1011=c698 afc
Reset Nsel
Waitus 2
Set Sdi
Gosub Clock
Set Sdi
Gosub Clock
Reset Sdi
Gosub Clock
Reset Sdi
Gosub Clock
Reset Sdi
Gosub Clock
Set Sdi
Gosub Clock
Set Sdi
Gosub Clock
Reset Sdi
Gosub Clock
Set Sdi
Gosub Clock
Reset Sdi
Gosub Clock
Reset Sdi
Gosub Clock
Set Sdi
Gosub Clock
Set Sdi
Gosub Clock
Reset Sdi
Gosub Clock
Set Sdi
Gosub Clock
Set Sdi
Gosub Clock
Waitus 2
Set Nsel
Waitus 20
'command=1100 0100 0010 1010=c42a data fliter
Reset Nsel
Waitus 2
Set Sdi
Gosub Clock
Set Sdi
Gosub Clock
Reset Sdi
Gosub Clock
Reset Sdi
Gosub Clock
Reset Sdi
Gosub Clock
Set Sdi
Gosub Clock
Reset Sdi
Gosub Clock
Reset Sdi
Gosub Clock
Reset Sdi
Gosub Clock
Reset Sdi
Gosub Clock
Set Sdi
Gosub Clock
Reset Sdi
Gosub Clock
Set Sdi
Gosub Clock
Reset Sdi
Gosub Clock
Set Sdi
Gosub Clock
Reset Sdi
Gosub Clock
Waitus 2
Set Nsel
Waitus 20
'command=1100 0010 1110 0000=c2e0 low battery detector
Reset Nsel
Waitus 2
Set Sdi
Gosub Clock
Set Sdi
Gosub Clock
Reset Sdi
Gosub Clock
Reset Sdi
Gosub Clock
Reset Sdi
Gosub Clock
Reset Sdi
Gosub Clock
Set Sdi
Gosub Clock
Reset Sdi
Gosub Clock
Set Sdi
Gosub Clock
Set Sdi
Gosub Clock
Set Sdi
Gosub Clock
Reset Sdi
Gosub Clock
Reset Sdi
Gosub Clock
Reset Sdi
Gosub Clock
Reset Sdi
Gosub Clock
Reset Sdi
Gosub Clock
Waitus 2
Set Nsel
Waitus 20
'command=1100 0000 1000 0000=c080 reciever setting
Reset Nsel
Waitus 2
Set Sdi
Gosub Clock
Set Sdi
Gosub Clock
Reset Sdi
Gosub Clock
Reset Sdi
Gosub Clock
Reset Sdi
Gosub Clock
Reset Sdi
Gosub Clock
Reset Sdi
Gosub Clock
Reset Sdi
Gosub Clock
Set Sdi
Gosub Clock
Reset Sdi
Gosub Clock
Reset Sdi
Gosub Clock
Reset Sdi
Gosub Clock
Reset Sdi
Gosub Clock
Reset Sdi
Gosub Clock
Reset Sdi
Gosub Clock
Reset Sdi
Gosub Clock
Waitus 2
Set Nsel
Waitus 20
'command=1100 1110 1000 1000=ce88 fifo command
Reset Nsel
Waitus 2
Set Sdi
Gosub Clock
Set Sdi
Gosub Clock
Reset Sdi
Gosub Clock
Reset Sdi
Gosub Clock
Set Sdi
Gosub Clock
Set Sdi
Gosub Clock
Set Sdi
Gosub Clock
Reset Sdi
Gosub Clock
Set Sdi
Gosub Clock
Reset Sdi
Gosub Clock
Reset Sdi
Gosub Clock
Reset Sdi
Gosub Clock
Set Sdi
Gosub Clock
Reset Sdi
Gosub Clock
Reset Sdi
Gosub Clock
Reset Sdi
Gosub Clock
Waitus 2
Set Nsel
Waitus 20
'command=1100 1110 1000 1011=ce8b fifo command
Reset Nsel
Waitus 2
Set Sdi
Gosub Clock
Set Sdi
Gosub Clock
Reset Sdi
Gosub Clock
Reset Sdi
Gosub Clock
Set Sdi
Gosub Clock
Set Sdi
Gosub Clock
Set Sdi
Gosub Clock
Reset Sdi
Gosub Clock
Set Sdi
Gosub Clock
Reset Sdi
Gosub Clock
Reset Sdi
Gosub Clock
Reset Sdi
Gosub Clock
Set Sdi
Gosub Clock
Reset Sdi
Gosub Clock
Set Sdi
Gosub Clock
Set Sdi
Gosub Clock
Waitus 2
Set Nsel
Waitus 20
'command=1100 0000 1100 0001=c0C1 reciever setting
Reset Nsel
Waitus 2
Set Sdi
Gosub Clock
Set Sdi
Gosub Clock
Reset Sdi
Gosub Clock
Reset Sdi
Gosub Clock
Reset Sdi
Gosub Clock
Reset Sdi
Gosub Clock
Reset Sdi
Gosub Clock
Reset Sdi
Gosub Clock
Set Sdi
Gosub Clock
Set Sdi
Gosub Clock
Reset Sdi
Gosub Clock
Reset Sdi
Gosub Clock
Reset Sdi
Gosub Clock
Reset Sdi
Gosub Clock
Reset Sdi
Gosub Clock
Set Sdi
Gosub Clock
Waitus 2
Set Nsel
Waitus 20
Reset Sck
Reset Sdi
Reset Nsel
End
Clock:
Reset Sck
Waitus 10
Set Sck
Waitus 2
Reset Sck
Return