Welcome, Guest
Username: Password: Secret Key Remember me
  • Page:
  • 1
  • 2

TOPIC: Using the HLVD Module in Swordfish Basic

Re: Using the HLVD Module in Swordfish Basic 6 years 8 months ago #16425

  • Jon Chandler
  • Jon Chandler's Avatar
  • Offline
  • Moderator
  • Posts: 365
  • Thanks received: 352
Using the HIGH/LOW-VOLTAGE DETECT (HLVD) Module

Many of the 18F-series micros have an HIGH/LOW-VOLTAGE DETECT (HLVD) module that can be used to monitor VDD and warn if it has decreased below a specified voltage or increased above a specified voltage.  This is a great technique for monitoring the supply voltage of a micro that is directly battery powered.  It has several advantages over using an ADC channel for the purpose:
  1. No port pins are needed to implement.
  2. No external components are required and no power is consumed by an external voltage divider.
  3. The HLVD module uses an internal band-gap reference and draws a maximum of 45 µA when enabled.  It can be disabled except when needed to reduce even this tiny current draw.
  4. It can generate an interrupt when Vdd is below or above (depending on how it's configured) the selected set point.
 
Read full article...

Re: Using the HLVD Module in Swordfish Basic 6 years 7 months ago #12920

  • lespic
  • lespic's Avatar
  • Offline
  • Junior Boarder
  • Posts: 36
  • Thanks received: 35
Useful info , I seem to have jumped from 16F's to 32MX (chipKIT).

Re: Using the HLVD Module in Swordfish Basic 6 years 7 months ago #12919

  • bitfogav
  • bitfogav's Avatar
  • Offline
  • Fresh Boarder
  • Posts: 9
  • Thanks received: 53
Great info there Jon

Re: Using the HLVD Module in Swordfish Basic 6 years 7 months ago #12905

  • Jon Chandler
  • Jon Chandler's Avatar
  • Offline
  • Moderator
  • Posts: 365
  • Thanks received: 352
I did forget to mention one important point. You must keep in mind the allowable operating voltage of the micro in determining what low-level threshold to use.

For my tests, I used an 18F2520, and it was operating below 3.85 volts. What is the allowable supply voltage range for this part? According to the graph from the data sheet, it's 4.2 volts. The chip may work below this voltage but it's not guaranteed. It may fail in strange ways below this voltage.



For a battery-powered application, the 18LF2520 would be a better choice. But look carefully at the graph below. The maximum allowed clock speed is a function of supply voltage. The LF version will operate down to 2 volts...at a maximum clock speed of 4 MHz.



A better choice for a battery-powered application would be the 18F25K22. It will operate down to 1.8 volts at a clock speed of 20 MHz.

Attachments:

Re: Using the HLVD Module in Swordfish Basic 6 years 7 months ago #12906

  • Jon Chandler
  • Jon Chandler's Avatar
  • Offline
  • Moderator
  • Posts: 365
  • Thanks received: 352
There was an off-line question about my battery life estimation. I realize this may be unclear. Consulting the illustration below, the battery discharge curve shows voltage vs some unit of time for a constant current load. At t = 0, the battery is fresh and the voltage is about 1.6 volts per cell. At t = 8, the voltage has dropped to 1.1 volts per cell and by t = 9.5, the voltage is less than 1 volt per cell and falling quickly. At t = 10, the cell voltage is 0.8 volts and there's little juice left in the battery.

This was a convenient curve to pick. The red numbers at the top of the graph show percentage of life used. At t = 10, the battery is essentially dead - 100% of life used.

So we can look at any point along the curve and estimate the life remaining based on the cell voltage. This is an estimate that depends on the cell type, the load current and the nature of the load. The best estimates will be based on a curve at approximately the same load as your circuit.

Attachments:

Re: Using the HLVD Module in Swordfish Basic 6 years 1 month ago #13395

  • Breixo
  • Breixo's Avatar
  • Offline
  • Fresh Boarder
Hi, Jon,
Congratullations and thanks for this wonderful article.
At the begining you say: "This is a great technique for monitoring the supply voltage of a micro that is directly battery powered."
Before to read your article I was planning to use the 'Ultra Low-Power Wake-up (ULPWU)' input pin to detect the low voltage wall power supply and the HLDV input to monitor the low voltage battery but after to read your article I've some troubles as if both signals are or not compatibles and they can do the functions as I had thought.

Can you write any comment about that?. (I use the 18F87K22)

Thanks and best regards,
  • Page:
  • 1
  • 2
Time to create page: 0.294 seconds