pisoiu said:You can connect both outputs at the INTx inputs of the MCU. Enable both external interrupts (EX0=EX1=1) and configure them for edge triggering (IT1=IT0=1). Use timers 0 and 1 to count when the wave is at 1 logic, enable them (TR0=TR1=1) and configure them to run only when INTx=1 (GATE Timer0=Gate timer1=1). You will have to choose the timer mode M1,M0 to either 00 (13 bit) or 01 (16 bit) for both timers, in such a way that the full counter period for the chosen timer mode is as close as possible to the duration of the signal generated by accelerometer. You will have to consider the MCU clock speed, MCU timer dividers (if you use modified 8051 architectures) and resistors from ADXL which sets the output period. The mechanism is simple, when the output becomes 1, then the counter starts, and when it becomes 0, it will stop. In the same time, an interrupt will be generated, and in the interrupt routine you'll have to read the values from THx,TLx, then clear them, because at the next cycle, the count must begin from 0, then RETI from interrupt.
/pisoiu
pisoiu said:Yes, this can be a problem. Using this method, you will use all external interrupts and both timers which can work in this mode, leaving no room for extensions. Perhaps a multiplexer will solve your problem, and measuring on the same INTx inputs, one accelerometer at the time, then switching to the next one, and so on. But in this case you will miss some samples. If the events you want to measure are not quick, this may not be an inconvenient.
/pisoiu
IanP said:I would design a "mother board" with slots for small cards. Each card will have its microcontroller and each card will operate only with one sensor.
The main microcontroller on the mother board will have in this case enough time to interrogate each card for results and process them at your will without loosing vital information from all sensors.
By doing this you can add almost as many cards as you wish..
Regards,
IanP
pisoiu said:You can use 3state buffers, like 74HC125. However, it is impossible to avoid missing of samples using this method, because when you perform measurement on one acc., the others will be disconnected. Another issue is that the first cycle after you switch to a certain accelerometer must be ignored, because you will not know the moment when the mux is enabled, relatively to the pulse, and this can affect the measurement.
If you cannot afford to miss samples, then the only method is described by IanP. You will need one MCU for every acc., and you will have to develope a communication protocol between them. This is simple for 51 family, using multiprocessor communication.
/pisoiu
IanP said:Look, you will never be able to connect several devices that require constant attention using just one microcontroller ..
And, this has nothing to do with the selection of a microcontroller ..
8051(s) are as good as all the other mcus, just, as I mentioned before, designate one microcontroller per sensor, and you will be all right ..
Regards,
IanP
pisoiu said:h**p://
You can also try another approach, instead of working simultaneous with so many digital signals, perhaps you can convert them to analogic (you'll need an integrator, basically a cheap opamp and few R and C), then convert them to digital. You will have to find a suitable ADC, with enough inputs. Just an idea.....
/pisoiu
We use cookies and similar technologies for the following purposes:
Do you accept cookies and these technologies?
We use cookies and similar technologies for the following purposes:
Do you accept cookies and these technologies?