Author Topic: VCC monitoring during TX  (Read 1746 times)

davegravy

  • Jr. Member
  • **
  • Posts: 56
  • Country: ca
VCC monitoring during TX
« on: May 04, 2016, 12:29:19 AM »
I was planning on setting a threshold VCC limit to prevent transmission from sinking my coin cell below safe voltage level. I.e, check VCC before TX, cancel TX if the test fails.

Problem is, voltage drops due to TX likely aren't deterministic, so you need to give yourself a conservative buffer. Made me wonder if VCC could be monitored DURING transmission, and transmission can be aborted in case of trouble?

From RFM69.cpp:
Code: [Select]
  setMode(RF69_MODE_TX);
  uint32_t txStart = millis();
  while (digitalRead(_interruptPin) == 0 && millis() - txStart < RF69_TX_LIMIT_MS); // wait for DIO0 to turn HIGH signalling transmission finish
  setMode(RF69_MODE_STANDBY);

^--- within that while loop seems like the logical place to be checking. I don't know how long TX takes versus VCC measurement, so perhaps there's no time for it? This is several layers below anything I've worked on with microcontrollers/radios however, so please use kid gloves when explaining why it won't work  :P
« Last Edit: May 04, 2016, 12:32:41 AM by davegravy »

joelucid

  • Hero Member
  • *****
  • Posts: 868
Re: VCC monitoring during TX
« Reply #1 on: May 04, 2016, 05:46:05 AM »
That's exactly what I'm doing. Except I have continuous vcc monitoring running interrupt driven in the background. If vcc breaks below 2v I sleep the radio, slow the cpu, wait for vcc to recover and reboot.

TomWS

  • Hero Member
  • *****
  • Posts: 1930
Re: VCC monitoring during TX
« Reply #2 on: May 04, 2016, 07:47:38 AM »
Another approach is to realize that the coin cell has a certain ESR and will droop a fixed amount for a given load.  From this you can almost predict the resulting voltage from a starting one with nominal load (ie, the processor has been awake for a few milliseconds).  Net is, you don't transmit if the voltage is below a certain level - in my case it's about 2.65v but if you're using an RFM69H, as Joe does, then continuous monitoring might be completely necessary.

Tom

joelucid

  • Hero Member
  • *****
  • Posts: 868
Re: VCC monitoring during TX
« Reply #3 on: May 04, 2016, 01:59:10 PM »
Quote
From this you can almost predict the resulting voltage from a starting one with nominal load (ie, the processor has been awake for a few milliseconds)

Keep in mind though that the older a coin cell gets the more it suffers from a deterioration of IR during a single pulse. So you might measure good voltage in the beginning only to break down at the end of the pulse.

This is particularly bad if something unexpected happens - like a retransmission due to failed ack etc.