- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I'm trying to figure it out how to use per-pin Api to set alternatively the pin component showed
in attached pic, between open drain drive low and high impedance analog.
I'm using CyPins_SetPinDriveMode(CYREG_PRT0_PC5,PIN_DM_OD_LO );
and CyPins_SetPinDriveMode(CYREG_PRT0_PC5, PIN_DM_ALG_HIZ); with no success.
I would need to measures the R_1 voltage drop with the DeltaSigma adc.
This is just one cell of the circuit I'm trying to implement.
The final circuit is gonna need to measure 4 resistor sequentially using a Amux to connect to ADC, the pot R_2 is manually operated.
That's the reason to switch between Analog high impedance and open drain , drive low.
I cannot achieve hook up the R_1 and and ADC negative input to Vssa with the pin component.
Thank you for some help.
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi Alejandro,
I tried code you are using at my end. I could see the drive modes changing.
for(;;)
{
CyPins_SetPinDriveMode(CYREG_PRT0_PC5,PIN_DM_OD_LO );
CyDelay(5000);
CyPins_SetPinDriveMode(CYREG_PRT0_PC5, PIN_DM_ALG_HIZ);
CyDelay(5000);
}
and could see the output changing for pin pulled up using a resistor.
Best Regards,
Vasanth
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
AIVa,
I would do it differently. Keep in mind that pin_1 has input resistance ~100 oHm, which will affect measurement.
Voltage should be measured by ADC directly on R_1 using two analog input pins. A separate pin should connect R_1 to the ground. Set this extra Pin_4 to 'digital, open drain drives low'.
Command Pin_4_Write(1); will set it to GND. Command Pin_4_Write(0); will set it to Hi-Z .
Use AMUX to switch between resistors. No pins re-assignment in code is necessary.
/odissey1
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Thank you for your suggestion, yes, I can do that way.
But you or someone else can explain the way I asked for?
Reason: I remove form my project the function that was working OK, and to ease the test for other functions and I paste it in .txt file and save it in created folder. This happened 3 moth ago. This week I put back the function and it did not work. That way worked OK for my app.
Thank you.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi Alejandro,
I tried code you are using at my end. I could see the drive modes changing.
for(;;)
{
CyPins_SetPinDriveMode(CYREG_PRT0_PC5,PIN_DM_OD_LO );
CyDelay(5000);
CyPins_SetPinDriveMode(CYREG_PRT0_PC5, PIN_DM_ALG_HIZ);
CyDelay(5000);
}
and could see the output changing for pin pulled up using a resistor.
Best Regards,
Vasanth
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Thank you VasanthR_91
Yes, I'm doing that.
Regards