Hello,
did anybody set the stm32G4xx to internal Vref of 2.048, 2.5 or 2.9 V or other STM32 with internal reference which can be used?
Thanks in advance
stm32G4xx set to internal Vref of 2.048, 2.5 or 2.9 V
stm32G4xx set to internal Vref of 2.048, 2.5 or 2.9 V
Ulrich
It's 106 miles from Chicago, we have a full tank of gas, half a pack of cigarettes, it's dark, and we're wearing sunglasses.
(Blues Brothers)
It's 106 miles from Chicago, we have a full tank of gas, half a pack of cigarettes, it's dark, and we're wearing sunglasses.
(Blues Brothers)
Re: stm32G4xx set to internal Vref of 2.048, 2.5 or 2.9 V
never used the chip myself but presummably there is a register / bits that control the internal reference?
Re: stm32G4xx set to internal Vref of 2.048, 2.5 or 2.9 V
Yes, there are register(s) to set it, but if anybody made it before and got it running then it would be helpful.
Ulrich
It's 106 miles from Chicago, we have a full tank of gas, half a pack of cigarettes, it's dark, and we're wearing sunglasses.
(Blues Brothers)
It's 106 miles from Chicago, we have a full tank of gas, half a pack of cigarettes, it's dark, and we're wearing sunglasses.
(Blues Brothers)
Re: stm32G4xx set to internal Vref of 2.048, 2.5 or 2.9 V
ok, it was easier than i thought.
#define VREFBUF (*(volatile uint32_t *)(0x40010030)) // address of the VREF register
To use the internal Reverence:
Bit0 (ENVR) must be set to 1. That swithes to internal reference mode.
Bit1 (HIZ) must be set to 0. That connects the VREF+ pin internally with the vref buffer output. The reference voltage is now also at the VREF+ pin and can be used for other devices. In this mode the VREF+ pin must not connected to another voltage source.
Bit4 and 5 sets the reference voltage. 00= 2.048V, 01= 2.50V and 10= 2.90V.
in my case it is just 1 for 2.048V.
VREFBUF =1;
Now you should check Bit 3 (VRR) until it is set. Then the setup is finished.
https://www.st.com/resource/en/referenc ... ronics.pdf page 770+
#define VREFBUF (*(volatile uint32_t *)(0x40010030)) // address of the VREF register
To use the internal Reverence:
Bit0 (ENVR) must be set to 1. That swithes to internal reference mode.
Bit1 (HIZ) must be set to 0. That connects the VREF+ pin internally with the vref buffer output. The reference voltage is now also at the VREF+ pin and can be used for other devices. In this mode the VREF+ pin must not connected to another voltage source.
Bit4 and 5 sets the reference voltage. 00= 2.048V, 01= 2.50V and 10= 2.90V.
in my case it is just 1 for 2.048V.
VREFBUF =1;
Now you should check Bit 3 (VRR) until it is set. Then the setup is finished.
https://www.st.com/resource/en/referenc ... ronics.pdf page 770+
Ulrich
It's 106 miles from Chicago, we have a full tank of gas, half a pack of cigarettes, it's dark, and we're wearing sunglasses.
(Blues Brothers)
It's 106 miles from Chicago, we have a full tank of gas, half a pack of cigarettes, it's dark, and we're wearing sunglasses.
(Blues Brothers)
Re: stm32G4xx set to internal Vref of 2.048, 2.5 or 2.9 V
You can use ll system API by including stm32yyxx_ll_system.h to manage the bits you mentioned:
https://github.com/stm32duino/Arduino_C ... 1158-L1254
with those values for voltage:
https://github.com/stm32duino/Arduino_C ... #L306-L308:
https://github.com/stm32duino/Arduino_C ... 1158-L1254
with those values for voltage:
https://github.com/stm32duino/Arduino_C ... #L306-L308:
Re: stm32G4xx set to internal Vref of 2.048, 2.5 or 2.9 V
Thank you fpiSTM, that was what i am asking for but i did not found by myself.
Ulrich
It's 106 miles from Chicago, we have a full tank of gas, half a pack of cigarettes, it's dark, and we're wearing sunglasses.
(Blues Brothers)
It's 106 miles from Chicago, we have a full tank of gas, half a pack of cigarettes, it's dark, and we're wearing sunglasses.
(Blues Brothers)
-
- Posts: 1
- Joined: Thu Feb 16, 2023 3:21 am