Dloman Posted August 16, 2023 Share Posted August 16, 2023 Using a MCC152, all of the DIO are set to outputs. During power up, they are all on. Is there a way to configure these outputs to be low on power-up? Link to comment Share on other sites More sharing options...
0 DAQman Posted August 16, 2023 Share Posted August 16, 2023 The digital IO power up as inputs that are logic high. Use the programmable pull resistors to pull them low. Use the mcc152_dio_config_write_bit or mcc152_dio_config_write_port to configure them for output, output type, and pull-up direction. https://mccdaq.github.io/daqhats/c.html#c.mcc152_dio_config_write_bit https://mccdaq.github.io/daqhats/c.html#c.mcc152_dio_output_write_port Link to comment Share on other sites More sharing options...
0 linuxrocks Posted August 16, 2023 Share Posted August 16, 2023 Can you program the pulldown function so it is there instead of pullup at powerup? Do configuration changes such as pull-up/pull-down/disabled get saved in the eeprom? Link to comment Share on other sites More sharing options...
0 DAQman Posted August 16, 2023 Share Posted August 16, 2023 The board is programmed at the factory to be pull-up. You can override this using the functions I mentioned, and the new configuration is saved to the board. Modify the digital_output_write_port example to include the mcc152_dio_config_write_port to change the pull-up direction. Run the program and after repower the RPI and check the lines - they should be low. Link to comment Share on other sites More sharing options...
0 linuxrocks Posted August 16, 2023 Share Posted August 16, 2023 I tried this and it still comes up as all on... Confirmed the port was off before cycling power. from daqhats import hat_list, HatIDs, mcc128, mcc152 from daqhats import DIOConfigItem,AnalogInputMode,AnalogInputRange,OptionFlags a = mcc152(0) values=0 a.dio_output_write_port(values) a.dio_config_write_port(DIOConfigItem.DIRECTION,0) a.dio_config_write_port(DIOConfigItem.PULL_CONFIG,0) a.dio_config_write_port(DIOConfigItem.PULL_ENABLE,1) Link to comment Share on other sites More sharing options...
0 linuxrocks Posted August 16, 2023 Share Posted August 16, 2023 Further, if I read the DIRECTION, PULL_CONFIG, PULL_ENABLE configurations back after setting (0,0,1) before I cycle power, they match the settings. After I cycle power, I get 255 instead for all three. I even tried using daqhats_read_eeproms. Link to comment Share on other sites More sharing options...
0 linuxrocks Posted August 16, 2023 Share Posted August 16, 2023 Also tried 255 for the PULL_ENABLE as this is a port write. Still get 255 for all three even after a graceful SHUTDOWN -h 0 and power-up. Link to comment Share on other sites More sharing options...
0 DAQman Posted August 17, 2023 Share Posted August 17, 2023 I've asked engineering for more information about the pull-up resistor configuration. My test set the port to input, pull down, push-pull, and pull enabled fail because it still returns 0xFF as the port value. When I have more information I will update this thread. Link to comment Share on other sites More sharing options...
0 DAQman Posted August 17, 2023 Share Posted August 17, 2023 I got the pull-downs to work for inputs using the commands below. However, when the board goes through a power cycle the pull-downs get disabled. When the port was set to output, the lines remained high when the pull-downs were enabled. Because the pull resistors don't work as expected, I recommend adding an external inverter circuit so that when the board powers up with the lines high, your circuit will see lows. mcc152_dio_config_write_port(address, DIO_OUTPUT_TYPE, 0x00); //push pull mcc152_dio_config_write_port(address, DIO_PULL_CONFIG, 0xFF); // pull down mcc152_dio_config_write_port(address, DIO_PULL_ENABLE, 0xFF); //enable mcc152_dio_config_write_port(address, DIO_DIRECTION, 0xFF); // set to input Link to comment Share on other sites More sharing options...
0 linuxrocks Posted August 18, 2023 Share Posted August 18, 2023 Any chance the firmware will get updated to retain these settings? Yeah, an inverter works, but this is not what the McDaq requires. Hardware setup was made for that. McDaq was out of stock, so went with the Pi Hat approach. Didn't realize it would work differently. Link to comment Share on other sites More sharing options...
0 DAQman Posted August 18, 2023 Share Posted August 18, 2023 There are no firmware updates planned. Which MCC device were you previously using? Link to comment Share on other sites More sharing options...
0 linuxrocks Posted August 18, 2023 Share Posted August 18, 2023 E-1608 Ethernet DAQ device, Ethernet-based, with 8 SE/4 DIFF analog inputs, 16-bit resolution, 250 kS/s sample rate, 2 analog outputs, 8 digital I/O, and 1 counter input Have a couple USB versions as well that have a similar configuration. Link to comment Share on other sites More sharing options...
Question
Dloman
Using a MCC152, all of the DIO are set to outputs. During power up, they are all on. Is there a way to configure these outputs to be low on power-up?
Link to comment
Share on other sites
11 answers to this question
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now