On Tue, Sep 1, 2009 at 1:37 PM, James Ewen<[email protected]> wrote:
> From previous posts:
>
>
>>I could not get ADC1 beeing reported. In some earlier documentation
>> I found the standard telemetry packet of OT2m mentioned to be
>>T#,internalTemperature,SupplyVoltage,ADC0_Pin10,COUNTER_Pin6,HDOP_GPS,000000,Jumper,Profile
> I missed this before... here's the pinout for the 16 pads at the front,
> starting at the 'M' in MON08:
>
> 1 - PTB7/T2CH1 (digital I/O or timer channel)
> 2 - GND
> 3 - PTB5/T1CH1
> 4 - Reset
> 5 - No connection
> 6 - IRQ (counter/transmit-now input)
> 7 - No connection
> 8 - PTA3/ADC3 (digital I/O or ADC input)
> 9 - No connection
> 10 - PTA0/ADC0
> 11 - No connection
> 12 - PTA2/ADC2
> 13 - Clock oscillator (32.768 kHz)
> 14 - PTA1/ADC1
> 15 - +5V
> 16 - PTB0 (digital I/O)
>
> ADC0 and ADC1 are reported in the standard telemetry string.
Below is an excerpt from hardware.h
4 Tracker2: PTA0-5 - External A/D inputs (A5 is RSSI on T2-301)
Below are excerpts from tracker2_main.c
480 adc[1] = readadc(ADC_TEMPERATURE);
481 adc[2] = readadc(ADC_VOLTAGE);
482 adc[3] = readadc(0);
483 adc[4] = readadc(1);
677 // Send telemetry packet if selected
678 if (config->status_tm_interval & 0xf0)
679 {
680 if (tx_number % ((config->status_tm_interval &
0xf0) >> 4) == 0)
681 {
682
sprintf(scratch,"T#%03u,%03u,%03u,%03u,%03u,%03u,000000%c%c", tmseq++,
adc[1], adc[2], adc[3], counter & 0xff,
683 fixdata.hdop, JUMPER_SET ? '1' : '0',
flags.current_config ? '1' : '0');
684 uitemp = strlen(scratch);
685 send_raw((char *)flag, sizeof(flag));
686 send_header();
687 send_data(scratch, uitemp);
688 send_trailer();
689 }
690 }
So, I'm a little confused... line 438 reads a value into adc[4] from
PTA1, but line 682 stuffs temperature, voltage, PTA0 and the counter
value into the telemetry string followed by the HDOP and digital bits
on line 683.
So, it looks like PTA1 was read in a previous version and may have
been inserted into the telemetry string, but currently we only get
PTA0 as an analog telemetry input. Am I reading this right Scott?
I've also got a digital input that I can see on the telemetry by
grounding the jumper input (pin 6 on the accessory connector).
I don't believe that there's any way to access the adc values in the
script engine, but it would be nice to be able to do that. I'd like to
be able to compare an adc or digital value, and then act upon the
outcome. Specifically, monitor the AC power at the digipeater, and if
the AC drops, send an APRS message. I can monitor the AC power as an
analog or digital input, and have that reported in the telemetry
string. It would be nice to have the OT2 able to send me an alert
automatically, rather than having to monitor the telemetry values
manually.
So Scott, it looks like I have some feature requests... don't know how
much is involved in doing some of this, but maybe some of it is low
hanging fruit that would be easy pickings!
1) User selectable telemetry input. Counter value|PTA1 and HDOP|PTA2
(dunno if PTA2 is available as an ADC input)
2) Another ADC input to complete the 5 analog values in the telemetry string.
3) Full complement of digital I/O for the telemetry.
4) Script engine access to adc values for external input based decision making.
5) Of course the script accessible volatile path settings
Sheesh, that sounds like a lot of cases of Coke and Twinkies!
James
VE6SRV