Decibit Development Kit (DDK) Contents 1 CDROM 1 USB Programmer 1 USB cable 2 Modules DCBT-24AX 2 Hand-Held-Tester 6 AA size batteries 1 Printed datasheet Product code of modules: D24-AX-01-1CB Option "C" Programmer: USB type LPT type CDROM: Programmer (dspiu.exe 32-bit, Decibit) Assembler (avrasm2.exe 32-bit, Atmel) C/C++ Compiler (WinAVR) Example codes (SetupDDK.exe) USB Driver 1
Getting Started 1) Install code examples with SetupDDK.exe. 2) Install USB driver. 3) Plug USB programmer to your PC / Laptop. 4) Place batteries in HHT's. Run CODE_0 Example 1) Open code_0 folder and double click!module.bat" to execute script. 2) Insert one RF module to programmer socket. 3) Press ENTER to start loading code into module. 4) Take programmed module from programmer and place in HHT. See page 5 for detailed explanations. This code only awaits sequence of button presses to show how to erase user code. See note below. Run CODE_1 Example 1) Open code_1 folder and double click!module1.bat" to execute script. 2) Insert one RF module to programmer socket. 3) Press ENTER to start loading code into module 1. 4) Take programmed module from programmer and place in HHT. 5) Double click!module2.bat" to execute script. 6) Insert other RF module to programmer socket. 7) Press ENTER to start loading code into module 2. 8) Take programmed module from programmer and place in other HHT. Observe LED's at both HHT, they toggle at each completed data transmission. See note below to erase user code after your tests. Other code examples are loaded similarly into modules. Note: All examples make use of Button_1 press to invalidate user code. Here is the procedure: Press Button_1 and keep it down, then press reset Button_3. Release reset Button_3 and then release Button_1. Press reset Button_3 again to see that module is in code loading mode. Indicator is that all LED's stay off. 2
CODE 1 Continuous Ping-Pong without timeout. Demonstration of D_TX and D_RX functions. Module 1 starts sending (TX). Module 2 starts receiving (RX). When 248 bytes data is received, the same data is sent back and so forth, forever. Even if link was down for any time period, the sequence will always catch up and the cycle will continue without glitches. CODE 2 Compatible with CODE_1. Continuous Ping-Pong with 2 second timeout at both TX and RX. To see timeout, press and hold reset Button_3 on one HHT. After 2 seconds, LED_2 on other HHT will go off. CODE 3 Remote control, 2-way acknowledged. Press buttons to control LED's on other HHT. Button_1 @ HHT_1 controls LED_1 @ HHT_2 Button_2 @ HHT_1 controls LED_2 @ HHT_2 (Toggle mode) (Sustaining mode) LED status on HHT_1: LED_1 LED_3 ON ON transfer in progress ON OFF transfer failed (1 sec timeout) OFF OFF transfer success In this example, the sender knows for 100% certain whether the receiver has received the data packet or not, as indicated by the table above. Another example of how powerful D_TX / D_RX functions are. CODE 3.1 Same as CODE_3. Dimmer function, instead switching on/off LED's. Button_1 to dim up, Button_2 to dim down. 3
CODE 4 Enhanced ShockBurst data transfer, 2-way. Similar to CODE_3. Data packets may be received or be lost, even that automatic repeat and acknowledge feature is used. More than one button press may be needed to get the data through. Result is acceptable, but poor in comparison to CODE_3. CODE 5 ShockBurst data transfer compatible with nrf24xx @ 1 Mbps, 1-way. No ACK used, thus result is much more poor than CODE_4. This type transfer is equal to broadcasting without any feedback. CODE 6 Some non-rf related examples. Writing and reading of EEPROM and FLASH memories. Clock output example. CODE 7 (if requested) SPI data communications with PC via USB programmer itself. Control LED's on HHT by keyboard input from PC Control PC through button press on HHT CODE 8 (if requested) RS232 serial data input/output on I/O pins by bit-bang. 9600 115200 baud. 4
CODE 0 The following is a simple but complete and valid user code example written in AVR assembler. It is only 7 actual code lines, highlighted in gray..include "m168def.inc" ;AVR specific definitions.include "nrf24l01.inc" ;Nordic specific definitions.include "header.inc" ;user code general header file.cseg ;code segment.include "interrupt.asm" ;general interrupt routines I_RESET: ;all I/O pins are High-Z initially ;after any reset condition sbi ddrb,ddb3 ;push pull low output => LED_1 on nop ;no operation sbi portb,portb5 ;pull-up input => Button_1 ready for use call D_DELAY ;1000 cycles delay ;~125µs @ 8 MHz sbis pinb,pinb5 ;skip next instruction ;if Button_1 was not pressed call D_ERASE ;void user code if Button_1 was pressed ;to be able to download new user code ;after next reset _end0: rjmp _end0 ;endless loop.eseg ;EEPROM segment.org $1FF ;last EEPROM address $1FF.db $FE ;as example $FE to validate user code ;just anything other than $FF.exit In this example code, first LED_1 is turned on. Then I/O pin PB5 for Button_1 is setup as pull up input. This way a button press to ground can be detected. Then a function call to delay 125 µs is executed. If Button_1 was pressed, D_ERASE function call is executed, thus this user code is practically deleted from the module. The same module can then be put in USB programmer and reprogrammed again. If Button_1 was not pressed, LED_1 will keep on burning while application is stuck in the endless loop. 5
Hand-Held-Tester (HHT) Module DCBT-24AX 3 LED's 3 Buttons Battery holder 3 x AA HHT to module connections: 1 GND 2 LED_3 OUTPUT PB6 3 BUTTON_3 RESET 4 LED_2 OUTPUT PB1 (Clock Out) 5 BUTTON_2 INPUT PB4 6 LED_1 OUTPUT PB3 7 BUTTON_1 INPUT PB5 8 VCC 6
USB Programmer (Universal Serial Bus Type) To read and write EEPROM and user FLASH program memory via SPI. Tiny size. USB cable connector Module connector J1 Connector for Transceiver Modules USB connection to host PC Desktop / Laptop Supported OS: Windows Vista, Windows Vista 64 Windows XP, Windows XP 64 Windows Server 2003, Windows Server 2003 64 Windows 2000 Windows ME Windows 98 Install driver either by running the exe file in drivers folder on the CD or let windows detect the USB hardware when plugged and let search for drivers from CDROM location. 7
LPT Programmer (Parallel Port Type) (*) To read and write EEPROM and user FLASH program memory via SPI. J1 Connector for Transceiver Modules J2 Connector for Remote Control LPT Parallel Port connection USB connection for 5 V power supply only (*) obsolete item 8