I am trying to better understand the functionality of the Chipkit Max32 board with respect to the analogWrite command. I have been testing pins A4, A5, 21, 23, 44 and 45 using the anlogWrite function. I am testing each pin separately, i.e. one at a time. I have the pin connected to ground through a 180Ohm resistor and monitoring the voltage across the resistor using an oscilloscope. I am using the following code changing the pin number in the analogWrite for each pin:
I am using the delay(5000) command to give me enough time to monitor and measure the oscilloscope value and the Serial.print function to know where I am in the code execution.
When I test the A4 and A5 pins, I measure 0V, regardless of the value written with the analogWrite. When I test the 21, 23, 44 and 45 pins the voltage is 0 until a value of 127 is reached. above 127 the voltage is 3.3V., constant.
Do I need to initialize any other values for the analogWrite to function properly?
Question
VCSEL
Hello:
I am trying to better understand the functionality of the Chipkit Max32 board with respect to the analogWrite command. I have been testing pins A4, A5, 21, 23, 44 and 45 using the anlogWrite function. I am testing each pin separately, i.e. one at a time. I have the pin connected to ground through a 180Ohm resistor and monitoring the voltage across the resistor using an oscilloscope. I am using the following code changing the pin number in the analogWrite for each pin:
void setup() {
Serial.begin(9600);
}
void loop() {
for (int i=0;i<256;i++){
analogWrite(4,i);
delay(5000);
Serial.print(i);
Serial.println(""); }
}
I am using the delay(5000) command to give me enough time to monitor and measure the oscilloscope value and the Serial.print function to know where I am in the code execution.
When I test the A4 and A5 pins, I measure 0V, regardless of the value written with the analogWrite. When I test the 21, 23, 44 and 45 pins the voltage is 0 until a value of 127 is reached. above 127 the voltage is 3.3V., constant.
Do I need to initialize any other values for the analogWrite to function properly?
Thank You
Link to comment
Share on other sites
3 answers to this question
Recommended Posts
Archived
This topic is now archived and is closed to further replies.