-
Notifications
You must be signed in to change notification settings - Fork 60
AVR128DB48 OPAMP Voltage follower example does not work on DxCore 1.6.x #601
Copy link
Copy link
Open
Labels
BugBehavior of core does not match API or reasonable expectationsBehavior of core does not match API or reasonable expectationsCRITICALSevere bug which is top priority to fixSevere bug which is top priority to fix
Description
I tested the OPAMP Voltage_follower example on AVR128DB48.
https://github.com/SpenceKonde/DxCore/tree/master/megaavr/libraries/Opamp/examples/Voltage_follower
Environment
- MCU: AVR128DB48
- DxCore: 1.5.11 → works
- DxCore: 1.6.0 / 1.6.1 → does not work
- Bootloader was written when using DxCore 1.5.1
Problem
The OPAMP output pin (PD2) is not driven in DxCore 1.6.x.
Register check:
OPAMP.OP0CTRLA
1.5.11 → 0x07
1.6.1 → 0x06 (ENABLE bit not set)
Adding the following line fixes the problem:
OPAMP.OP0CTRLA |= OPAMP_ENABLE_bm;
ADC issue
Additionally, ADC seems incorrect in 1.6.x.
analogReference(VDD);
analogReadResolution(12);
The ADC result saturates near full scale.
Register check:
VREF.ADC0REF
1.5.11 → 5
1.6.1 → 0
Question
Is this a bug in DxCore 1.6.x, or has the usage changed?
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
BugBehavior of core does not match API or reasonable expectationsBehavior of core does not match API or reasonable expectationsCRITICALSevere bug which is top priority to fixSevere bug which is top priority to fix