• AVR Freaks

HLVD not working with PIC18F4550

Author
Sunil4u
New Member
  • Total Posts : 17
  • Reward points : 0
  • Joined: 2016/12/10 11:37:57
  • Location: 0
  • Status: offline
2018/08/10 04:36:19 (permalink)
0

HLVD not working with PIC18F4550

Hi, 
I am trying to implement HLVD (low supply detection) to store the final value into EEprom. Below are the config bits set in the program. Am I missing anything to generate interrupt?
 
//LVD configuration
PIE2bits.HLVDIE = 0;
PIR2bits.HLVDIF = 0;
HLVDCONbits.HLVDEN = 0;
HLVDCONbits.HLVDL = 0b1100;
HLVDCONbits.VDIRMAG = 0;
INTCONbits.GIE = 1;
INTCONbits.PEIE = 1;
IPR2bits.HLVDIP = 1;
PIE2bits.HLVDIE = 1;
HLVDCONbits.HLVDEN = 1;
PIR2bits.HLVDIF = 0;
HLVDCONbits.IRVST = 1;
 
Thanks and Regards
Sunil Parmar
#1

3 Replies Related Threads

    qɥb
    Monolothic Member
    • Total Posts : 3332
    • Reward points : 0
    • Joined: 2017/09/09 05:07:30
    • Location: Jupiter
    • Status: offline
    Re: HLVD not working with PIC18F4550 2018/08/10 04:43:16 (permalink)
    +1 (1)
    Don't set GIE until everything else has been done.
    How are you testing this to see if it worked?
     

    This forum is mis-configured so it only works correctly if you access it via https protocol.
    The Microchip website links to it using http protocol. Will they ever catch on?
    PicForum "it just works"
    #2
    Sunil4u
    New Member
    • Total Posts : 17
    • Reward points : 0
    • Joined: 2016/12/10 11:37:57
    • Location: 0
    • Status: offline
    Re: HLVD not working with PIC18F4550 2018/08/10 15:45:37 (permalink)
    0
    I have hardware which has LCD and push buttons. With push button, I am changing some value and display on the LCD. With HLVD, I am storing the value in the EEprom. So after power restart, the value should be same. But it is not with my program. I have one doubt which I am debugging, the time taken by the EEprom write cycle and Power down time. I am also not able to find out, till what voltage EEprom continue working ? So I keep changing the value of HLVDL.
    #3
    DeutcheN
    Super Member
    • Total Posts : 121
    • Reward points : 0
    • Joined: 2010/09/01 12:35:40
    • Location: DM43BH
    • Status: offline
    Re: HLVD not working with PIC18F4550 2018/08/13 15:31:28 (permalink)
    +1 (1)
    So, are you resetting the device upon a HLVD interrupt?
    Per the datasheet EEPROM read/write is spec'd at Vmin which in the case of your device is 4.2V.
    The time to write to EEPROM (again per the datasheet) is 2ms typical.   Page 391 of DS.
     
    Please post your entire code and schematics if you need further help.
    #4
    Jump to:
    © 2019 APG vNext Commercial Version 4.5