Hi,
Ich hab vor für mein RC Car n kleines Kontrollsystem zu basteln und die Daten direkt per Funk an einen Laptop zu senden. Ich hab die Pollin RFM02 und RFM01 Module. Nun hab ich das Problem, dass ich nich ganz weiß wie man die anschließt/anspricht. Ich versteh nicht ganz was der FSK Pin is und ob man den CLK Pin braucht, wenn man n externen Quarz am Atmega8 hat? Und was ist der nIRQ? Was genau macht der? Ich hab auch in der SuFu einen interessanten Thread gefunden, aber leider nix mit Assembler. Den Großteil des Programms hab ich schon fertig. Am INT0 hab ich einen Magnetfeldsensor, an ADC0 einen Akku und an ADC1 einen Tempsensor. Also hier mal meinen Code, die Senderoutine is nur mal provisorisch und mein Code könnte nich ganz soo perfekt sein.
Code:
.include "m8def.inc"

.def temp = r16
.def temp1 = r17
.def akkulo = r18
.def akkuhi = r19
.def templo = r20
.def temphi = r21
.def adclo = r22
.def adchi = r23
.def upms = r24
.def timereg = r25
.def adccount = r26
.def adcreg = r27
.equ CLOCK = 16000000
.equ BAUD = 9600
.equ UBRRVAL = CLOCK/(BAUD*16)-1#

.org 0x000
	rjmp main
.org INT0addr
	rjmp upmplus
.org OC1Aaddr
	rjmp transmit

main:
	ldi temp, LOW(RAMEND)
	out SPL, temp
	ldi temp, HIGH(RAMEND)
	out SPH, temp

	ldi temp, LOW(UBRRVAL)
	out UBRRL, temp
	ldi temp, HIGH(UBRRVAL)
	out UBRRH, temp

	ldi temp, LOW(40000-1)
	out OCR1AL, temp
	ldi temp, HIGH(40000-1)
	out OCR1AH, temp

	ldi temp, 0x00
	out DDRD, temp
	ldi temp, 0xFF
	out PORTD, temp

	ldi temp, ( 1 << WGM12 ) | ( 1 << CS00 )
    out TCCR1B, temp
 
    ldi temp, 1 << OCIE1A  ; OCIE1A: Interrupt bei Timer Compare
    out TIMSK, temp	

	ldi temp, (1<<URSEL)|(3<<UCSZ0)
	out UCSRC, temp

	ldi temp, 0b00001010
	out MCUCR, temp
	ldi temp, 0b10000000
	out GICR, temp

	sbi UCSRB, TXEN

	sei

	ldi temp, (1<<PB4) | (1<<PB5)
	out DDRB, temp
	ldi temp, (1<<SPE) | (1<<MSTR) | (1<<SPR0)
	out SPCR, temp

configadc0:
	ldi  temp, (1<<REFS0)
    out  ADMUX, temp
    ldi  temp, (1<<ADEN) | (1<<ADPS2) | (1<<ADPS1) | (1<<ADPS0)
    out  ADCSRA, temp

startadc0:
	clr adcreg
	clr temp1
	clr akkulo
	clr akkuhi
	ldi adccount, 0
	sbi ADCSRA, ADSC
warteadc0:
	sbic ADCSRA, ADSC
	rjmp warteadc0

	in adclo, ADCL
	in adchi, ADCH

	add temp1, adclo
	adc akkulo, adchi
	adc akkuhi, adcreg
	dec adccount
	brne startadc0

	ldi  temp, (1<<REFS0 | 1<<MUX0)
    out  ADMUX, temp
    ldi  temp, (1<<ADEN) | (1<<ADPS2) | (1<<ADPS1) | (1<<ADPS0)
    out  ADCSRA, temp

startadc1:
	clr adcreg
	clr temp1
	clr templo
	clr temphi
	ldi adccount, 0
	sbi ADCSRA, ADSC
warteadc1:
	sbic ADCSRA, ADSC
	rjmp warteadc1

	in adclo, ADCL
	in adchi, ADCH

	add temp1, adclo
	adc templo, adchi
	adc temphi, adcreg
	dec adccount
	brne startadc1

	ldi  temp, (1<<REFS0)
    out  ADMUX, temp
    ldi  temp, (1<<ADEN) | (1<<ADPS2) | (1<<ADPS1) | (1<<ADPS0)
    out  ADCSRA, temp

loop: rjmp loop

upmplus:
	inc upms
	reti

transmit:
	out SPDR, upms
	sbis SPSR, SPIF
	rjmp transmit
transbreak:
	ldi temp, '|'
	out SPDR, temp
	sbis SPSR, SPIF
	rjmp transbreak
transakku:
	out SPDR, akkulo
	sbis SPSR, SPIF
	rjmp transmit
transbreak1:
	ldi temp, '|'
	out SPDR, temp
	sbis SPSR, SPIF
	rjmp transbreak1
	reti
transakku1:
	out SPDR, akkuhi
	sbis SPSR, SPIF
	rjmp transmit
transbreak2:
	ldi temp, '|'
	out SPDR, temp
	sbis SPSR, SPIF
	rjmp transbreak2
	reti
transtemp:
	out SPDR, templo
	sbis SPSR, SPIF
	rjmp transmit
transbreak3:
	ldi temp, '|'
	out SPDR, temp
	sbis SPSR, SPIF
	rjmp transbreak1
	reti
transtemp1:
	out SPDR, temphi
	sbis SPSR, SPIF
	rjmp transmit
transbreak4:
	ldi temp, '|'
	out SPDR, temp
	sbis SPSR, SPIF
	rjmp transbreak2
	reti
Das Konfigurieren des Sendemoduls fehlt hier noch, da ich darüber nich viel weiß. Die Empfangseinheit ist NOCH nicht in arbeit.
Ich hoff mir kann jemand helfen.

gruß homedom