Taniwha Flight Computer Specific Information
A distribution
A release includes all the binary files to build a
program. To get started download the appropriate kit from
the above list. To build you need 4 binaries:
- rl - the compiler
- rsim - the simulator
- rcvt - the converter (converts rl .x files to 8051 assembly code)
- asm51 - the 8051 assembler
Getting Started
To build the file XXX.r into a binary suitable for loading into the Taniwha flight computer
enter the following commands (there's a PC tc.bat file included in the PC
distribution that will do this for you):
rl XXX.r
rcvt XXX.x -o XXX.s
asm51 XXX.s -o XXX.51
Now download your program into your flight computer - all RL programs start at 0x8000
so type "g 8000" to run your program.
A sample - using the 'hello world' program included in the distribution:
type:
rl hello.r
rsim hello.x
This will run the simulator that will print "hello world". Now build a FC binary:
rl hello.r
rcvt hello.x -o hello.s
asm51 hello.s -o hello.51
Now download hello.51 into your flight computer (this may be as simple as
catting it out of a text file and pasting it into your terminal window - if
it supports this). Next type "g 8000" to the flight computer it should print
"hello world" and reset.
Known Problems
Notes - known problems (V1.0):
- all EEPROM support is broken
set/get ports
The addresses addressed by the get(N) intrinsic are slightly confusing,
since the FC by default puts an ADXL50 on channel 3 but the standard channel
for RL accelerometers is channel 0 I fudge the addresses passed to get(),
channel numbers between 0 and 7 are passed to you ADC via the ADC utility hook (so
it should work with properly hooked up non-standard ADCs - like Larry's), however
in order to do the mapping the 2 LSBs of the indexes are reversed. The input ports p1.5-p1.7
are also available this way:
get(0) channel 3 (acc)
get(1) channel 2 (barometer)
get(2) channel 1
get(3) channel 0
get(4) channel 7
get(5) channel 6
get(6) channel 5
get(7) channel 4
get(8) p1.7
get(9) p1.6
get(10) p1.5
set(N, V) only applies to p1.5-p1.7 so set(8,0) clears p1.7, and set(10, 1) sets p1.5
(note on an 8051 you must write a 1 into an output port if you wish to use it as
an input.
beep(0) and beep(1) just toggle p1.7 (inversly to the value passed - I've been connecting
a small Radio Shack sonalert (rated 3-16v) between this pin and 5 volts - it works great
We only support arm(0) and safe(0) calls - you also need to do a fire(0) a while after
you've fired a pyro charge to let the charge cap. recover for about a second before reuse.
Logging
The log buffer is created out of the space left over in the flight computer's 32k sram after
the code and data has been loaded and the stack space has been removed (by default
512 bytes are allocated for the stack - the -S flag on the compiler can be used to trade
off morre or less stack space for logging space.