I need to make one project and I would like to share your opinion.
Well whole thing is that I have to read two sinus signals. They should be phase shifted. Their phase difference is 90 degrees. Sinus and cosinus.
I would like to make my project on two atmega8.
But one microcontroller I would like to use as a SIMULATOR and another as an ANALYSER.
Simulator should produce two signals sinus which will be shifted for a 90 degrees from another sinus.
If you push phase buton you change phase from 90 to -90. Via simulator I should also be able to set length of the signal(two pushbuttons). When I switch button "start" buttons should be disactivated.
I think that the best option to do that is to switch off Timer/Counter0 overflow interrupt enable for a while when signals will be genarating. I won`t use signals longer than two or three periods. Freguency of these sirgnals wIll be also low.
Well coming to the main aspect and main my concern.
As I can do this all I don`t know how to coordinate these two microcontrollers. I need to coordinate them cause only one handle display which shows ordered value and shows read value. For example I am pushing button length+ two times and should have 0.5 period of the two signals. But on display I can read 0.25 cause second microcontroller didn`t read button on time.
I don`t know if I expleined it right but the problem is that I cannot use display in simulator cause I used almost all pins.
Well maybe there is option how to read these buttons in one time. This problem really drives me crazy ?
I am using Danni`s debouncing procedure anid as far as I am conce.rn TCCNT0 of these two microcontrollersshould be exactly the same two provides interrupts in the same time. Maybe set one timer via interrupt from another ??
Or maybe use microcontroller with more pins not atmega8 ??
Waiting for your suggestions
I am also enclosing picture of my drawings!