RF12 transmitter demo: /* ; copyright (c) 2006 ;Title RF12 TX simple example based on AVR C ;Company: Hope microelectronic Co.,Ltd. ;Author: Tank ;Current version: v1.0 ;Date: 2006-11-13 ;processor ATMEGA48 ;Clock: 10MHz Crystal ;Contact: +86-0755-86106557 ;E-MAIL: hopefsk@hoperf.com Connections ATMEGA48 SIDE RF12 SIDE SCK--------------->SCK MISO--------------->SDO MOSI--------------->SDI SS--------------->nSEL INT0<---------------nIRQ PD6: LED GREEN PD7: LED RED */ #include #define DDR_IN 0 #define DDR_OUT 1 #define PORT_SEL PORTB #define PIN_SEL PINB #define DDR_SEL DDRB #define PORT_SDI PORTB #define PIN_SDI PINB #define DDR_SDI DDRB #define PORT_SCK PORTB #define PIN_SCK PINB #define DDR_SCK DDRB #define PORT_SDO PORTB #define PIN_SDO PINB #define DDR_SDO DDRB #define PORT_DATA PORTD #define PIN_DATA PIND #define DDR_DATA DDRD #define PB7 7//--\ #define PB6 6// | #define RFXX_SCK 5// | #define RFXX_SDO 4// |RF_PORT #define RFXX_SDI 3// | #define RFXX_SEL 2// | #define NC 1// | #define PB0 0//--/ #define SEL_OUTPUT() DDR_SEL |= (1<SCK MISO<---------------SDO MOSI--------------->SDI SS--------------->nSEL PD4--------------->FSK/DATA INT0<---------------nIRQ PD6: LED GREEN PD7: LED RED */ #include #define DDR_IN 0 #define DDR_OUT 1 #define PORT_SEL PORTB #define PIN_SEL PINB #define DDR_SEL DDRB #define PORT_SDI PORTB #define PIN_SDI PINB #define DDR_SDI DDRB #define PORT_SCK PORTB #define PIN_SCK PINB #define DDR_SCK DDRB #define PORT_SDO PORTB #define PIN_SDO PINB #define DDR_SDO DDRB #define PORT_IRQ PORTD #define PIN_IRQ PIND #define DDR_IRQ DDRD #define PORT_DATA PORTD #define PIN_DATA PIND #define DDR_DATA DDRD #define PB7 7//--\ #define PB6 6// | #define RFXX_SCK 5// | #define RFXX_SDO 4// |RF_PORT #define RFXX_SDI 3// | #define RFXX_SEL 2// | #define NC 1// | #define PB0 0//--/ #define SEL_OUTPUT() DDR_SEL |= (1<