Dear friends,
I have another post active here with some detail on my big project. However, after designing possible schematics and some programming effort, I feel at square one. Not in a bad way, but while writing the code, I certainly have found a few things I will have to change in my schematics and the PCB I spent so many hours designing. In the process of doing that I have a question about sharing the workload between several picaxe chips.
My application requires running several parallel, but interdependent processes. I am working with I2C already because of I/O expanders to have enough ports for everything.
1st thing is a traffic light (4 of them actually). Simple enough as a standalone thing. I realised if I run it as a parallel task on the same single picaxe running everything else, my traffic light will not be very constant as the other parallel tasks the program will be dancing to will take different times depending on if, elseif, else and what not. Right?
So this calls for a separate chip running the traffic lights. Fine. Still, the main chip needs to know when and where it is red, yellow or green. What is the best way to achieve that? Read through I2C? I would have to query the thing all the time that would make I2C bus quite busy and would still take processing power of the main chip? Some kind of serial connection?
2nd. There is also the need to drive four servos. This could also be exported to a separate picaxe chip as picaxes are so convenient for servos. What is the best way to let that chip know what to do? Serial line? I2C? Is mixing these a good idea?
3rd. Can I have more than one interrupt? I seem to need one to sense if any of the parameters through I/O expanders have changed, one to sense if there are cars to divert (4 reed switches) and now one more to know when the traffic light has changed its state.
Thank you for your time,
Edmunds
I have another post active here with some detail on my big project. However, after designing possible schematics and some programming effort, I feel at square one. Not in a bad way, but while writing the code, I certainly have found a few things I will have to change in my schematics and the PCB I spent so many hours designing. In the process of doing that I have a question about sharing the workload between several picaxe chips.
My application requires running several parallel, but interdependent processes. I am working with I2C already because of I/O expanders to have enough ports for everything.
1st thing is a traffic light (4 of them actually). Simple enough as a standalone thing. I realised if I run it as a parallel task on the same single picaxe running everything else, my traffic light will not be very constant as the other parallel tasks the program will be dancing to will take different times depending on if, elseif, else and what not. Right?
So this calls for a separate chip running the traffic lights. Fine. Still, the main chip needs to know when and where it is red, yellow or green. What is the best way to achieve that? Read through I2C? I would have to query the thing all the time that would make I2C bus quite busy and would still take processing power of the main chip? Some kind of serial connection?
2nd. There is also the need to drive four servos. This could also be exported to a separate picaxe chip as picaxes are so convenient for servos. What is the best way to let that chip know what to do? Serial line? I2C? Is mixing these a good idea?
3rd. Can I have more than one interrupt? I seem to need one to sense if any of the parameters through I/O expanders have changed, one to sense if there are cars to divert (4 reed switches) and now one more to know when the traffic light has changed its state.
Thank you for your time,
Edmunds