فكر مي كنم بيشترين ايراد برنامه در خط هاي 90 درجه باشه .
چون خط 90 درجه سياه مثل 90 درجه در ناحيه برعكس ( خط سفيد با محيط سياه ) بوده ( به دليل كمبود سنسور ) ( جهت چرخش هر كدوم هم فرق داره ) و يه روشي عجيب براي تشخيص اين دو از هم نوشتم كه فكر كنم بيشترين ايراد برنامه تو همونه .
سلام دوستان من ماژول hmt-hmاستفاده کردم جواب نگرفتم بعد RFM12کار کردم اونم مثل ماژول hmt-hm جواب نگرفتم فعلآ با این ماژول hm-TR جواب گرفتم ولی یک کمی گرونه
دوست مثل پول، به دست آوردنش از نگه داشتنش آسان تر است
باتلر
'************************ TxRx_1.05.bas *********************** ' 'Test program for using the RFM12 or RFM12B '433MHz Radio Data Transceivers. 'These transceivers sell for about $8.00 US. 'from: http://www.futurlec.com/Radio.shtml ' 'This code + hardware takes serial data from a PC and converts 'it to RF. A second indentical device receives the RF signal and 'converts it back to serial. ' 'This code is not ment to be a complete RF serial link. It is 'for testing and evaluating the RFM12 modules only. However with 'the addition of error detection and correction, I beleve a 'reliable RF link could be relized. ' 'July 28, 2008 'By: David Carr '***************************************************************
config Spi = Hard , Interrupt = Off , Data Order = Msb , Master = Yes , _ Polarity = Low , Phase = 0 , Clockrate = 4 , Noss = 1 spiinit
declare sub RFM12_SPI_wrt declare sub RFM12_Tx(TxArray as byte) declare sub RFM12_Rx(RxArray as byte) declare sub RFM12_Tx_ready declare sub RFM12_Rx_wait declare sub RFM12_Get_Status_bit declare sub SaveFlags declare sub RFM12_Clear_FIFO declare sub RFM12_Rx_on declare sub RFM12_Init declare sub PrintFlags
'Fc = the center Freq. in MHz 'Fr = the Freq. register value. 'Fc = 430 + Fr * 0.0025 (MHz) 'Fr = (Fc - 430) * 400 const Fc = 435.00 const Fr =(Fc - 430) * 400 const Fcmnd = &hA000 + Fr
'Payload can be up to 254 bytes. 'I have tested up to 128 bytes only. 'const Payload_Size = 128 const Payload_Size = 32 'const Payload_Size = 16 const PLS_plus1 = Payload_Size + 1
'make the test beacon length Payload_Size - 2 const Beacon = "123456789012345678901234567890"
dim Tempbit as bit dim Temp as byte dim TempW as word
dim SPI_Tx_wrd as word dim SPI_Tx_L as byte at SPI_Tx_wrd overlay dim SPI_Tx_H as byte at SPI_Tx_wrd + 1 overlay dim SPI_Rx_wrd as word dim SPI_Rx_L as byte at SPI_Rx_wrd overlay dim SPI_Rx_H as byte at SPI_Rx_wrd + 1 overlay
dim Rx_Status_bit as bit dim RxBuffer(PLS_plus1) as byte dim RxString as string * Payload_Size at RxBuffer(1) overlay RxBuffer(PLS_plus1) = 0
dim TxIndex as byte dim TxBuffer(PLS_plus1) as byte dim TxString as string * Payload_Size at TxBuffer(1) overlay TxBuffer(PLS_plus1) = 0
dim Timeout as word dim Cmnd as string * 4 dim Flags as byte
EchoFlag alias Flags.0 BeaconFlag alias Flags.1 SerMsgFlag alias Flags.2 RxOnFlag alias Flags.3 TxOnFlag alias Flags.4
'I have read somewhere that eram address 0 has a bug 'so I don't use it. dim Dummy as eram word at 0 'ProgCntr must be at eram address 2. 'ProgCntr is incramented by the bootloader 'each time the chip is flashed. dim ProgCntr as eram word at 2 dim SavedFlags as eram byte
do if BeaconFlag = 1 then 'Tx a test beacon about once a second. TxString = Beacon print "Tx: " ; TxString RFM12_Tx TxBuffer(1) 'now loop waiting for a reply msg. for temp = 1 to 255 'poll RFM12 for Rx data. RFM12_Get_Status_bit if Rx_Status_bit = 1 then 'Rx RxBuffer RFM12_Rx RxBuffer(1) print "Rx: " ; RxString if RxString <> TxString then reset Error_LED print "<>" endif RxString = "" exit for endif if temp = 255 then reset Error_LED print "no echo" endif 'this delay gives the other module time to echo 'back the beacon. 'waitus 50 'at 38.3kbps, 32 byte payload 'waitus 350 'at 19.2kbps, 128 bytes waitus 150 'at 19.2kbps, 32 bytes set Error_LED next temp else 'poll RFM12 for Rx data. RFM12_Get_Status_bit if Rx_Status_bit = 1 then 'reset RX_LED 'Rx RxBuffer RFM12_Rx RxBuffer(1) print "Rx: " ; RxString if EchoFlag = 1 then print "Ec: " ; RxString 'Tx RxBuffer. RFM12_Tx RxBuffer(1) endif 'set RX_LED endif endif
temp = inkey() if temp <> 0 then
if temp = 27 then 'press "esc" to get a command prompt. SPI_Tx_wrd = 0 RFM12_SPI_wrt print print Description print File print version() print TempW = ProgCntr print "uC flashed " ; TempW ; " times." 'print 'print "Status word = " ; bin(SPI_Rx_H) ; "_" ; bin(SPI_Rx_L) PrintFlags print input "Command >" , Cmnd print RFM12_Rx_on elseif temp = 13 then print print "Tx: " ; TxString 'Tx TxBuffer. RFM12_Tx TxBuffer(1) TxString = "" TxIndex = 0 else 'fill the TxBuffer until <cr> or full. if TxIndex < Payload_Size then print chr(temp); incr TxIndex TxBuffer(TxIndex) = temp Temp = TxIndex + 1 TxBuffer(Temp) = 0 endif endif endif
if Cmnd <> "" then Select Case Cmnd case "u" 'To start the bootloader without using the reset button. 'Press "u <CR>" 'then within 2+3=5 seconds press F4 to start the programer. print print "Press F4 to start upload." Waitms 3000 'address of boot loader. 'for mega168 'goto &H1C00
'for mega88 goto &hC00
case "c" 'Input a hex command word value to send to RFM12. 'For example enter: c0e0 <enter> will set the 'ouput CLK to 10MHZ. 'see the RFM12 Programing guide for commands. print input "Enter a Command Word in HEX >" , Cmnd SPI_Tx_wrd = hexval(Cmnd) RFM12_SPI_wrt print "RFM12 returned >" ; hex(SPI_Rx_wrd)
case "b" toggle BeaconFlag if BeaconFlag = 1 then EchoFlag = 0 SaveFlags PrintFlags
case "e" toggle EchoFlag if EchoFlag = 1 then BeaconFlag = 0 SaveFlags PrintFlags
case else print "Unknown Command"
end select print Cmnd = "" endif loop
sub PrintFlags if BeaconFlag = 1 then print "Beacon ON" else print "Beacon OFF" endif if EchoFlag = 1 then print "Echo ON" else print "Echo OFF" endif end sub
sub SaveFlags 'save to eram Flags = Flags and 3 SavedFlags = Flags end sub
sub RFM12_Init local i as byte print "Init values:" 'Initialize RFM12 Restore Init_data for i = 1 to 14 read SPI_Tx_wrd print hex(SPI_Tx_wrd) 'send init data to RFM12. RFM12_SPI_wrt 'waitms 100 next i print end sub
'*********************************************************************** 'The following data lines are RFM12 commands used to initialize the device. 'read the RFM12 progamming guide and data sheets for a complete 'description of these commands. ' 'Configuration settings: ' '&h80D8 = Configure module for 433Mhz band. ' 'RF center Freq. setting 'select freq with const "Fc" above. 'Fcmnd is a constant that holds the Freq command. 'see the "const" statments at the top of this code. 'example: &hA000 + Fr = &hA7D0 for 435MHz ' 'To change the data rate the following values will need to be adjusted. ' 'bit rate '&hC611 = 19.2kbps works well at 8MHz '&hC608 = 38.3kbps works at 8MHz ' 'Rx band width '&h94A0 = Rx BW = 134KHz works at 8MHz '&h9480 = 200kHz works at 8MHz ' 'Tx deviation '&h9850 = 90kHz works at 8MHz '&h9870 = 120kHz works at 8MHz
sub RFM12_Clear_FIFO 'Clear FIFO SPI_Tx_wrd = &hCA81 RFM12_SPI_wrt SPI_Tx_wrd = &hCA83 RFM12_SPI_wrt end sub
sub RFM12_Tx(TxArray as byte) local i as byte reset TX_LED 'turn on Tx SPI_Tx_wrd = &h8239 RFM12_SPI_wrt TxOnFlag = 1 waitus 150 'Send Preamble. restore TxPreamble_data for i = 1 to 5 read SPI_Tx_wrd RFM12_Tx_ready if Timeout = 0 then exit for RFM12_SPI_wrt next i 'Send payload. for i = 1 To Payload_Size RFM12_Tx_ready if Timeout = 0 then exit for SPI_Tx_wrd = &hB800 + TxArray(i) RFM12_SPI_wrt next i RFM12_Tx_ready RFM12_Rx_on set TX_LED end sub
sub RFM12_Tx_ready Reset RFM12_cs Timeout = 65500 While RFM12_sdo = 0 decr Timeout waitus 6 if Timeout = 0 then print "Tx Timeout" exit while endif Wend end sub
sub RFM12_Rx_on 'Start Rx SPI_Tx_wrd = &h8299 RFM12_SPI_wrt RFM12_Clear_FIFO RxOnFlag = 1 waitus 80 end sub
sub RFM12_Rx(RxArray as byte) local i as byte timeout = 1 reset RX_LED SPI_Tx_wrd = &hB000 for i = 1 To Payload_Size RFM12_Rx_wait if Timeout = 0 then set RX_LED set Error_LED exit for endif RFM12_SPI_wrt RxArray(i) = SPI_Rx_L next i RxArray(i) = 0 RFM12_Clear_FIFO set RX_LED end sub
sub RFM12_Rx_wait Timeout = 35500 do RFM12_Get_Status_bit 'timeout if nothing happens. decr Timeout if Timeout = 0 then reset Error_LED print "Rx Timeout" exit do endif loop until Rx_Status_bit = 1 end sub
sub RFM12_Get_Status_bit reset RFM12_sdi reset RFM12_cs set RFM12_sck Rx_Status_bit = RFM12_sdo reset RFM12_sck set RFM12_cs end sub
sub RFM12_SPI_wrt 'Send word (SPI_Tx_wrd) to RFM12. 'Also receive word (SPI_Rx_wrd). 'RFM12 Chip select reset RFM12_cs 'send hi byte. SPI_Rx_H = spimove(SPI_Tx_H) 'send lo byte. SPI_Rx_L = spimove(SPI_Tx_L) 'deselect chip. set RFM12_cs end sub
کد php:
'$sim $regfile = "m8def.dat" $crystal = 4000000 ' $hwstack = 32 $swstack = 32 $framesize = 40 $baud = 19200 '########### SPI Config Spi = Hard , Interrupt = Off , Data Order = Msb , Master = Yes , Polarity = Low , Phase = 0 , Clockrate = 128 , Noss = 1 Config Portb.2 = Output Spi_cs Alias Portb.2 ' SS-Pin Spi_sdo Alias Pinb.4 ' MISO-PIN Set Spi_cs 'Set Spi_sdo '### wlacz spi Spiinit Config Portc.3 = Output ' LED0 Config Portc.2 = Output ' LED1 Config Portc.1 = Output ' LED2 Config Portc.0 = Output ' LED3 Led0 Alias Portc.3 Led1 Alias Portc.2 Led2 Alias Portc.1 Led3 Alias Portc.0 '###############Stale###################### Const Rf12freq = 869.85 ' Sende-/Empfangsfrequenz in 5.0kHz-Schritten Const Rf12baud = 700 ' Baudrate >663 Const Maxchar = 16 '################Zmienne######################################################## Dim Count As Byte Dim Temp As Word Dim Rfdata(maxchar) As Byte Dim Text As String * Maxchar At Rfdata Overlay Dim Rf12_error As Bit Dim Rf12_status As Word Dim I As Word Dim C As Byte Dim D As String * 4 Dim K As Byte Dim L As Byte Dim V As Word Dim W As Word Dim R As String * 1 ' Empfangsfeldstärke Slave Dim S As String * 1 ' Spannung Batterie Slave Dim T As Word '##############Podprocedury##################################################### Declare Sub Rf2_int Declare Sub Rf12_ready Declare Function Rf12_trans(byval Wert As Word) As Word Declare Sub Cowys Declare Sub Rf12_txdata(byval Maxchar As Byte) Declare Sub Rf12_rxdata(byval Maxchar As Byte)
Do nop loop end '###############Inicacja modulu############################################## Sub Rf2_int: Waitms 150 Temp = Rf12_trans(&H0000) ' czestotliwosc 868mhz Temp = Rf12_trans(&Hc000) Temp = Rf12_trans(&H80e7) Temp = Rf12_trans(&Hc2ec) ' Data fliter Command Temp = Rf12_trans(&Hca81) ' Output and FIFO mode Command Temp = Rf12_trans(&He000) ' Wake-Up Timer Command Temp = Rf12_trans(&Hc800) ' Low Duty-Cycle Command ' Temp = Rf12_trans(&Hc4f7) ' AFC Command Part 1 Temp = Rf12_trans(&Hc447) ' AFC Command Part 1 Temp = Rf12_trans(&H0000) ' Status einlesen Rf12_status = Temp Temp = Rf12_trans(&Ha7b1) ' czestotliwosc 868,92 Mhz Temp = Rf12_trans(&H94a0) ' 135kHz Bandbreite, 0dB Verstärkung, DRSSI threshold: -103dBm temp = Rf12_trans(&HC6BC) Temp = Rf12_trans(&H9850) ' 0dBm/1mW Ausgangangsleistung, 90kHz Frequenzshift Return End Sub
'#################Wysylanie dancyh do modolu rf################################ Function Rf12_trans(byval Wert As Word) As Word Local Lowbyte As Byte Local Highbyte As Byte Lowbyte = Low(wert) Highbyte = High(wert) Reset Spi_cs Highbyte = Spimove(highbyte) Lowbyte = Spimove(lowbyte) Set Spi_cs Temp = Makeint(lowbyte , Highbyte) Rf12_trans = Temp End Function '############################################################################### ' '############################################################################### Sub Rf12_txdata(byval Maxchar As Byte) Print Maxchar Print "_" Temp = Rf12_trans(&H8239) ' Power Management Command, Sender einschalten, DC Rf12_ready Temp = Rf12_trans(&H0000) ' Status einlesen Rf12_status = Temp Rf12_ready Temp = Rf12_trans(&Hb8aa) ' Transmit Register Write Command (sendet AA zur Synchronisation) Rf12_ready Temp = Rf12_trans(&Hb8aa) ' Transmit Register Write Command (sendet AA zur Synchronisation) Rf12_ready Temp = Rf12_trans(&Hb8aa) ' Transmit Register Write Command (sendet AA zur Synchronisation) Rf12_ready Temp = Rf12_trans(&Hb82d) ' Transmit Register Write Command (sendet 2D zur Synchronisation)' Rf12_ready Temp = Rf12_trans(&Hb8d4) ' Transmit Register Write Command (sendet D4 zur Synchronisation) For Count = 1 To Maxchar Rf12_ready Temp = &HB800 + Rfdata(count) Print Temp Temp = Rf12_trans(temp) ' Transmit Register Write Command (sendet Daten) Next Count Rf12_ready Temp = Rf12_trans(&Hb8aa) ' Dummybyte nachschieben Rf12_ready Temp = Rf12_trans(&Hb8aa) ' Dummybyte nachschieben Rf12_ready Temp = Rf12_trans(&Hb8aa) ' Dummybyte nachschieben Rf12_ready Temp = Rf12_trans(&H8209) ' Power Management Command, Sender + Empfänger ausschalten, DC End Sub
Sub Rf12_rxdata(byval Maxchar As Byte) Temp = Rf12_trans(&H82c9) ' Power Mangement Command, Empfänger einschalten, DC Temp = Rf12_trans(&H0000) ' Status einlese Rf12_status = Temp Print "stat" Print Temp Print Rf12_status Print "_" Temp = Rf12_trans(&Hca81) ' Output and FIFO Mode Command, FIFO deaktivieren Temp = Rf12_trans(&Hca83) ' Output and FIFO Mode Command, FIFO aktivieren For Count = 1 To Maxchar Rf12_ready Temp = Rf12_trans(&Hb000) ' Receiver FIFO Read Command Print Temp Rfdata(count) = Temp Print "-" Print Rfdata(count) Print Count Next Count Temp = Rf12_trans(&Hca81) Temp = Rf12_trans(&Hca83) Temp = Rf12_trans(&H8209) ' Power Management Command, Sender + Empfänger ausschalten, DC Toggle Led0 End Sub
'######Gotowosc modulu rf12#################### Sub Rf12_ready Reset Spi_cs For I = 1 To 10000 If Spi_sdo = 1 Then 'Exit Sub Toggle Led3 Waitms 120 Exit Sub end if Next I ' Count = Maxchar ' Empfangsroutine abbrechen, falls Timeout Rf12_error = 1 ' Fehler setzen Toggle Led2 End Sub
کد php:
'####################################### 'inculde file for RF12-device 'info about RF12 Transceiver: www.hoprf.com or www.integration.com 'info about using RF12 with Bascom: www.comwebnet.de ' 'Version History '--------------- 'Initial Version: v0.10 'Date: 200711 'Author: Kurzschluss '--------------- 'Version: v0.11 'Date: 20071120 'Added by: Eisbaeeer 'Added: Get status from RF12 'Description: 'To get information about Statis as Offset, FIFO or something else you can 'decode the Rf12_status. More information about the RF12_status at the End 'of File '####################################### '------[Inculde-Datei: Treiber für RF12 Chip]----------------------------- '$nocompile
Declare Sub Rf12_init() Declare Sub Rf12_setfreq(byval Freq As Single) Declare Sub Rf12_setbandwith(byval Bandwith As Byte , Byval Gain As Byte , Byval Drssi As Byte) Declare Sub Rf12_setbaud(byval Rfbaud As Long) Declare Sub Rf12_setpower(byval Outpower As Byte , Byval Fskmod As Byte) Declare Sub Rf12_ready Declare Sub Rf12_txdata(byval Txlen As Byte) Declare Sub Rf12_rxdata(byval Maxchar As Byte) Declare Function Rf12_trans(byval Wert As Word) As Word
Dim Rf12_timeout As Word Dim Rf12_err As Byte Dim Rf12_status As Word
'------[Sende Daten]------------------- Sub Rf12_txdata(byval Txlen As Byte) Temp = Rf12_trans(&H8238) : Rf12_ready 'Power CMD: synt.& PLL on Temp = Rf12_trans(&H0000) : Rf12_ready 'Status holen Rf12_status = Temp 'Status einlesen Temp = Rf12_trans(&Hb8aa) : Rf12_ready 'Preamble Temp = Rf12_trans(&Hb8aa) : Rf12_ready 'Preamble Temp = Rf12_trans(&Hb8aa) : Rf12_ready 'Preamble in FIFO schieben Temp = Rf12_trans(&Hb82d) : Rf12_ready 'Startzeichen: 2D für den Empfänger Temp = Rf12_trans(&Hb8d4) : Rf12_ready 'Startzeichen: D4 für den Empfänger For Lv = 1 To Txlen Rf12_ready Temp = &HB800 + Rf12_data(lv) 'Sende Nutzdaten Temp = Rf12_trans(temp) Next Lv Temp = Rf12_trans(&Hb8aa) : Rf12_ready 'Dummybyte nachschieben Temp = Rf12_trans(&H8208) : Rf12_ready 'Power CMD: synt.& PLL off, Quarz-clk läuft weiter End Sub
'------[Empfange Daten]--------------- Sub Rf12_rxdata(byval Maxchar As Byte) Temp = Rf12_trans(&H82c8) 'Power CMD: Empfänger an, Quarz-clk läuft weiter Temp = Rf12_trans(&H0000) 'Status auslesen Rf12_status = Temp 'Status einlesen Temp = Rf12_trans(&Hca81) 'FIFO&Reset CMD: sensitiver Reset aus (Brownout) Temp = Rf12_trans(&Hca83) 'FIFO&Reset CMD: Synchroner Zeichenemfang (warte auf Startzeichen: 2DD4) For Lv = 1 To Maxchar Rf12_ready : Temp = Rf12_trans(&Hb000) 'lese 1Byte vom FIFO Rf12_data(lv) = Temp 'Nutzdaten einlesen Next Lv Temp = Rf12_trans(&H8208) 'Power CMD: Empfänger aus, Quarz-clk läuft weiter End Sub
'------[SPI Busroutinen]---------------- Function Rf12_trans(byval Wert As Word) As Word Local Lowbyte As Byte Local Highbyte As Byte
'------[Busy check]----------------------- Sub Rf12_ready Rf12_timeout = 50000 Reset Spi_cs 'SS-Pin--> select RF12 While Spi_sdo = 0 'MISO muss von RF12 auf high gehen 'In der Sim. auf 1 stellen If Rf12_timeout > 0 Then 'Timeout Loop Decr Rf12_timeout Else Rf12_err = 1 'Flag setzen Exit While 'Timeout --> Abbruch kein ready vom RF12 End If Waitus 20 Wend 'Warten bis senden bzw. empfangen fertig End Sub
'------[Setze TrägerFrequenz]--------------------- Sub Rf12_setfreq(byval Freq As Single) Freq = Freq - 430.00 Temp = Freq / 0.0025 If Temp < 96 Then Temp = 96 Elseif Temp > 3903 Then Temp = 3903 End If Temp = Temp + &HA000 Temp = Rf12_trans(temp) 'Axxx - Frequenzsetting (Kanal Einstellung) End Sub
'------[Setze Bandweite]--------------------------- Sub Rf12_setbandwith(byval Bandwith As Byte , Byval Gain As Byte , Byval Drssi As Byte) Drssi = Drssi And 7 Gain = Gain And 3 Temp = Bandwith And 7 Shift Temp , Left , 2 Temp = Temp + Gain Shift Temp , Left , 3 Temp = Temp + Drssi Temp = Temp + &H9400 Temp = Rf12_trans(temp) 'Revicer Control Command (Pin20 VDI output) End Sub
'------[Einstellung der Baudrate]-------------------- Sub Rf12_setbaud(byval Rfbaud As Long ) Local Ltemp As Long If Rfbaud < 663 Then Exit Sub If Rfbaud < 5400 Then Temp = 43104 / Rfbaud Temp = Temp + &HC680 Else Ltemp = 344828 / Rfbaud Temp = Ltemp Temp = Temp + &HC600 End If Decr Temp Temp = Rf12_trans(temp) End Sub
'------[Sendeleistung einstelllen]----------------- Sub Rf12_setpower(byval Outpower As Byte , Byval Fskmod As Byte) Outpower = Outpower And 7 Temp = Fskmod And 15 Shift Temp , Left , 4 Temp = Temp + Outpower Temp = Temp + &H9800 Temp = Rf12_trans(temp) End Sub
'------------------------------------------------------------------------------- 'Info: '=== Status Read === 'Dieses Kommando löst die Rückgabe des Statusregisters aus, welches nach der ersten 0 im ersten Bit syncron übertragen wird. 'Hex = 0000 'Bit-Syntax: 0000000000000000<000> 'Rückgabe-Syntax: x0 | x1 | x2 | x3 | x4 | x5 | x6 | x7 | x8 | x9 | x10 | x11 | x12 | x13 | x14 | x15 | x16 | x17 | x18 'x0 -> x5 = Interrupt bits 'x6 -> x15 = Status Bits 'x16 -> x18 = FIFO 'x0 = FFIT / RGIT (RGIT = TX Register ist bereit neue Daten zu senden ... kann mit dem TX Register gelöscht werden)(FFIT = Die anzahl der Datenbits im FIFO Puffer hat das eingestellte Limit erreicht. Kann mit einer der FIFO-Lese methoden gelöscht werden) 'x1 = POR (PowerOnReset) 'x2 = FFOV / RGUR (RGUR = Der Datenstrom beim Senden ist abgerissen, da nicht schnell genug Daten nachgeladen wurden)(FFOV = Der RX FIFO ist übergelaufen) 'x3 = WKUP 'x4 = EXT 'x5 = LBD 'x6 = FFBM (Der FIFO Puffer ist leer) 'x7 = RSSI/ATS (ATS = )(RSSI = Die Signalstärke ist über dem eingestelltem Limit) 'x8 = DQD 'x9 = CRL 'x10 = ATGL 'x11 = OFFS_4 'x12 = OFFS_3 'x13 = OFFS_2 'x14 = OFFS_1 'x15 = OFFS_0 'x16 = FO 'x17 = FO+1 'x18 = FO+2
'=== FIFO und RESET-Mode === 'Hex = ca & xx 'Bit-Syntax: 11001010 | f3 | f2 | f1 | f0 | -unknow- (0) | al | ff | dr 'f... = (FIFO interrupt Level) '-unknow- (0) = ??? (Standard = 0) (Auch im Datenblatt von IA4420 so beschrieben) 'al = (FIFO Fill Condition) Legt den Wert fest, ab dem das Füllen des FIFOs beginnt. (0=Syncron / 1=Ständig). Bei nutzung des Syncronen Modus, werden erst dann Daten in den FIFO geschrieben, wenn eine definierte 16Bit Datenfolge empfangen wurde (Standard ist Hex: 2dd4). 'ff = (FIFO Fill) Startet das einlesen der Empfangenen Daten in den FIFO Puffer. Wenn al (FIFO Fill Condition) auf Syncron steht, dann startet das Setzen dieses Bits die Syncronisation Bit Erkennung. 'dr = (Sens Reset Mode) Wenn dieses Bit auf 1 steht, wir bei einer schwankung von 200mV auf der VCC (Spannungsversorgung des Chips) Leitung, ein System-Reset ausgelöst.
(آخرین ویرایش در این ارسال: ۰۵-اسفند-۱۳۸۷, ۰۱:۰۳:۰۷، توسط t3r!p3000.)
سلام به همه دوستان
کسی از دوستان هست که فرستنده RFM12رو راه اندازی کرده باشه؟؟؟ به قول معروف ممنون میشم قلق (قلق=فوت و فن کوزه گری) راه اندازی شو به منم یاد بدین
دوست مثل پول، به دست آوردنش از نگه داشتنش آسان تر است
باتلر
سلام
قسمت پروژه های گروهی توی قسمت الکترونیک راه اندازی شد ، فکر کنم جمع کنید بیاد اونجا بهتر باشه ، چون معمولا دوستان اینطرفا نمیان http://www.forum.iranled.com/forumdisplay.php?fid=180
و همون طور که میدونید این ماژول ها ارتباط سریال هستند ، و ارتباط سریال بدون ماژول کلی درد سر داره حالا اگه ماژول هم اضافه بشه که دیگه ...
شما اول میکرو رو بدون ماژول راه اندازی کنید ، یعنی دو تا میکرو رو کنار هم بذارین ، پایه txd اولی به rxd دومی و برعکس ، برنامه زیر رو روی میکرو بریزید و میکرو بدون ماژول راه اندازی کنید لینک دریافت برنامه http://forum.iranled.com/showthread.php?tid=9531