Low-voltage detect: Datasheet vs. Reference Manual

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Low-voltage detect: Datasheet vs. Reference Manual

908 Views
Weber1
Contributor II

Hi community,

I'm trying to implement the Low-Voltage Detection (LVD) feature of a MCXA156 controller. The Datasheet defines the VLVDH_VDD threshold = 2.619V (typ) and also the VLVDL_VDD threshold = 1.651V (typ). The VLVDH threshold is exactly what I want. But only the VLVDis configured by default (plus having the bad behavior of intermittently flipping the reset signal few times when detecting LVD, as I can see using a scope - hystresis too low!)

Furthermore, the Reference Manual says: "The voltage threshold at which the LVD reset asserts is programmable", and the VD_SYS_CFG register is described aby "...configures the low-voltage trip point..." Fine, so far.

The problem now is that the VD_SYS_CFG register only has the following bits documented in the RM:

  • LOCK
  • HVDIE - HVD interrupt enable
  • HVDRE - HVD reset enable
  • LVDIE - LVD interrupt enable
  • LVDRE - LVD reset enable

None of these is usable to set the threshold. 

Question: How should I configure the LVD threshold?

Best regards

Weber

Labels (3)
Tags (3)
0 Kudos
Reply
2 Replies

682 Views
luis_maravilla
NXP Employee
NXP Employee

Dear Weber,

I apologize for the late response; In Reference Manual Chapter 25.7.17 VD_SYS_CFG configuration, the 8 bit show as reserved is "LVSEL", this should be open to users, we are working on modification for RM.

 

Before Writing to this field, you must write 0 to LOCK.

If you want to change LVSEL, you must do this after disabling the LVD reset and interrupt. Otherwise, SPC could generate an LVD due to the LVSEL change.

Configuration for LVSEL:

0b-Normal

1b-Safe

 

In SDK examples for MCXA156, you can see in file fsl_spc.h the spc_low_voltage_level_select function.

 

Since you want to use the High Range LVD threshold, you need to use [ksPC_LowVoltageHighRange] entering Normal level [0b] in spc_low_voltage_level_select

 

Let me know if that work for you.

Best Regards, Luis

0 Kudos
Reply

902 Views
Weber1
Contributor II

Let me add that in the RM there is the LOCK bit of VD_SYS_CFG, which is commented by "Allows writing to the LVDRE, HVDRE, and LVSEL fields". But there is no LVSEL bit anywhere defined.
Furthermore, there is a SDK function "SPC_SetSystemVDDLowVoltageLevel" which refers to SPC_VD_SYS_CFG_LVSEL (bit 8), where the related code is commented out. Very strange...

Any suggestions?

0 Kudos
Reply
%3CLINGO-SUB%20id%3D%22lingo-sub-2327038%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3ELow-voltage%20detect%3A%20Datasheet%20vs.%20Reference%20Manual%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2327038%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3E%3CP%3EHi%20community%2C%3C%2FP%3E%3CP%3EI'm%20trying%20to%20implement%20the%20Low-Voltage%20Detection%20(LVD)%20feature%20of%20a%20MCXA156%20controller.%20The%20Datasheet%20defines%20the%20VLVDH_VDD%20threshold%20%3D%202.619V%20(typ)%20and%20also%20the%20VLVDL_VDD%20threshold%20%3D%201.651V%20(typ).%20The%20VLVD%3CSTRONG%3EH%3C%2FSTRONG%3E%20threshold%20is%20exactly%20what%20I%20want.%20But%20only%20the%20VLVD%3CSTRONG%3EL%26nbsp%3B%3C%2FSTRONG%3Eis%20configured%20by%20default%20(plus%20having%20the%20bad%20behavior%20of%20intermittently%20flipping%20the%20reset%20signal%20few%20times%20when%20detecting%20LVD%2C%20as%20I%20can%20see%20using%20a%20scope%20-%20hystresis%20too%20low!)%3C%2FP%3E%3CP%3EFurthermore%2C%20the%20Reference%20Manual%20says%3A%20%22The%20voltage%20threshold%20at%20which%20the%20LVD%20reset%20asserts%20is%20programmable%22%2C%20and%20the%20VD_SYS_CFG%20register%20is%20described%20aby%20%22...configures%20the%20low-voltage%20trip%20point...%22%20Fine%2C%20so%20far.%3C%2FP%3E%3CP%3EThe%20problem%20now%20is%20that%20the%20VD_SYS_CFG%20register%20only%20has%20the%20following%20bits%20documented%20in%20the%20RM%3A%3C%2FP%3E%3CUL%3E%3CLI%3ELOCK%3C%2FLI%3E%3CLI%3EHVDIE%20-%20HVD%20interrupt%20enable%3C%2FLI%3E%3CLI%3EHVDRE%20-%20HVD%20reset%20enable%3C%2FLI%3E%3CLI%3ELVDIE%20-%20LVD%20interrupt%20enable%3C%2FLI%3E%3CLI%3ELVDRE%20-%20LVD%20reset%20enable%3C%2FLI%3E%3C%2FUL%3E%3CP%3ENone%20of%20these%20is%20usable%20to%20set%20the%20threshold.%26nbsp%3B%3C%2FP%3E%3CP%3EQuestion%3A%20How%20should%20I%20configure%20the%20LVD%20threshold%3F%3C%2FP%3E%3CP%3EBest%20regards%3C%2FP%3E%3CP%3EWeber%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-LABS%20id%3D%22lingo-labs-2327038%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3E%3CLINGO-LABEL%3ECore%20and%20Memory%3C%2FLINGO-LABEL%3E%3CLINGO-LABEL%3EMCXA%3C%2FLINGO-LABEL%3E%3CLINGO-LABEL%3EPower%3C%2FLINGO-LABEL%3E%3C%2FLINGO-LABS%3E%3CLINGO-SUB%20id%3D%22lingo-sub-2327057%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%20translate%3D%22no%22%3ERe%3A%20Low-voltage%20detect%3A%20Datasheet%20vs.%20Reference%20Manual%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2327057%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3E%3CP%3ELet%20me%20add%20that%20in%20the%20RM%20there%20is%20the%20LOCK%20bit%20of%20VD_SYS_CFG%2C%20which%20is%20commented%20by%20%22Allows%20writing%20to%20the%20LVDRE%2C%20HVDRE%2C%20and%20LVSEL%20fields%22.%20But%20there%20is%20no%20LVSEL%20bit%20anywhere%20defined.%3CBR%20%2F%3EFurthermore%2C%20there%20is%20a%20SDK%20function%20%22SPC_SetSystemVDDLowVoltageLevel%22%20which%20refers%20to%20SPC_VD_SYS_CFG_LVSEL%20(bit%208)%2C%20where%3CLI-EMOJI%20id%3D%22lia_smiling-face-with-sunglasses%22%20title%3D%22%3Asmiling_face_with_sunglasses%3A%22%3E%3C%2FLI-EMOJI%3E%26nbsp%3Bthe%20related%20code%20is%20commented%20out.%20Very%20strange...%3C%2FP%3E%3CP%3EAny%20suggestions%3F%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-2335399%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%20translate%3D%22no%22%3ERe%3A%20Low-voltage%20detect%3A%20Datasheet%20vs.%20Reference%20Manual%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2335399%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3E%3CP%3EDear%20Weber%2C%3C%2FP%3E%0A%3CP%3EI%20apologize%20for%20the%20late%20response%3B%20In%20Reference%20Manual%20Chapter%2025.7.17%20VD_SYS_CFG%20configuration%2C%20the%208%20bit%20show%20as%20reserved%20is%20%22LVSEL%22%2C%20this%20should%20be%20open%20to%20users%2C%20we%20are%20working%20on%20modification%20for%20RM.%3C%2FP%3E%0A%3CBR%20%2F%3E%0A%3CP%3EBefore%20Writing%20to%20this%20field%2C%20you%20must%20write%200%20to%20LOCK.%3C%2FP%3E%0A%3CP%3EIf%20you%20want%20to%20change%20LVSEL%2C%20you%20must%20do%20this%20after%20disabling%20the%20LVD%20reset%20and%20interrupt.%20Otherwise%2C%20SPC%20could%20generate%20an%20LVD%20due%20to%20the%20LVSEL%20change.%3C%2FP%3E%0A%3CP%3EConfiguration%20for%20LVSEL%3A%3C%2FP%3E%0A%3CP%3E0b-Normal%3C%2FP%3E%0A%3CP%3E1b-Safe%3C%2FP%3E%0A%3CBR%20%2F%3E%0A%3CP%3EIn%20SDK%20examples%20for%20MCXA156%2C%20you%20can%20see%20in%20file%20%3CEM%3E%3CSTRONG%3Efsl_spc.h%3C%2FSTRONG%3E%3C%2FEM%3E%20the%20%3CEM%3E%3CSTRONG%3Espc_low_voltage_level_select%3C%2FSTRONG%3E%3C%2FEM%3E%20function.%3C%2FP%3E%0A%3CBR%20%2F%3E%0A%3CP%3ESince%20you%20want%20to%20use%20the%20High%20Range%20LVD%20threshold%2C%20you%20need%20to%20use%20%5B%3CEM%3E%3CSTRONG%3EksPC_LowVoltageHighRange%3C%2FSTRONG%3E%3C%2FEM%3E%5D%20entering%20Normal%20level%20%5B0b%5D%20in%20%3CSTRONG%3E%3CEM%3Espc_low_voltage_level_select%3C%2FEM%3E%3C%2FSTRONG%3E%3C%2FP%3E%0A%3CBR%20%2F%3E%0A%3CP%3ELet%20me%20know%20if%20that%20work%20for%20you.%3C%2FP%3E%0A%3CP%3EBest%20Regards%2C%20Luis%3C%2FP%3E%3C%2FLINGO-BODY%3E