7 years, 2 months ago.

mbed with more then 60 inputs

Hi, i need to trigger more then 60 inputs and send a corresponding string to a host PC using RS232. the inputs are receiving pulses from external machines. (1 pulse between 100ms and 4 sec)

f.e. input 1 gets a pulse -> ASCII string : M001 must be sent to a PC input 13 gets a pulse -> ASCII string M013 must be sent to a PC and so on. only |P| pulses are triggered

is this possible using mbed?

some more questions: what extra hardware do I need, I cannot find mbeds with more than 60 inputs.... what happens if 2 inputs get a signal at the same time... I always have to send the string... can this be buffered or can I loose information?

thanks a lot

1 Answer

7 years, 1 month ago.

Devices with that many port pins will be hard to find and it is probably also a waste of pins and peripherals. I recommend that you look at I2C portexpander devices like the PCF8574 and its more modern/advanced successors (PCF8575, MCP23008, MCP23017 etc). These devices offer 8, 16 or more digital inputs and may be read out using I2C (or SPI for some other types). You can avoid continuously polling the devices and still risk missing a level transition by using the interrupt features of the devices. A change of the level at any input pin can be detected and latched by the portexpander hardware and used to generate an interrupt on the mbed. You then need to read out the device(s) that generated the interrupt and check which specific portpin(s) triggered it.