Anonymous
now i lost a SENT protocol message
Anonymous
from the second interrupt triggering twice
Talula
They are mostly kept in stack... if you exit from one interrupt it jumps back to older interrupt.
Talula
Interrupts are never triggered twice, unless your code returns to it... they are locked.
Anonymous
Anonymous
Talula
Why would anyone use PWM for ticks?
Anonymous
to prevent nested interrupts
Anonymous
Anonymous
SENT protocol requires the number of ticks between each falling edge
Anonymous
it seems straight forward to use an interrupt for that right?
Anonymous
but then lets say CAN has more priority
Anonymous
and then you are parsing that CAN message
Talula
But that is the best way to do multi tasking, event based programming, what you're saying is forcing your microcontroller to do something it is not suppose to do to run multiple tasks that are actually consuming more time.
Anonymous
when the sent protocol gets 2 falling edges
Anonymous
when you break out of can
Anonymous
you now deal with these 2 falling edge interrupts
Talula
You can make it that it doesn't...
Anonymous
and the number of ticks between them is gonna be less then 100 ticks
Talula
You can write the program that would ignore all the information coming from other interrupt by disabling them when you are handling CAN.
Anonymous
Talula
Nope... disable them when interrupt is called... simple.
Anonymous
Talula
Why should I make a time sharing program that does nothing but bounce back to main time handler, manage my own stacks?
Anonymous
if i did that i would have a bigger issue
CAN MESSAGE
disable interrupts
get falling edge
FINISH CAN MESSAGES
reenable interrupts
get falling edge
Anonymous
now what?
Talula
When you enter CAN interrupt function, you disable global interrupt... execute everything, enable global and return back.
Anonymous
i missed the start of that message for the SENT protocol
Anonymous
and that is all because i stopped interrupts
Talula
No matter what you do, it's going to be same amount of time... or worse...
Talula
Or you program can keep jumping between two or 3 functions based on time.
Talula
That isn't efficent at least not for CAN.
Talula
Normally most of these things have Buffer...
Talula
And even if you disable the interrupt that doesn't mean you don't keep information in buffer.
Anonymous
Anonymous
there is no buffering for that
Anonymous
like in SENT
Talula
You'll either lose the information if you don't read it or you'll lose CAN or you'll slow down both.
Anonymous
and SENT is pretty widely used but no microcontroller maker has it really built in
Anonymous
Anonymous
and no interrupt for the falling edge
Anonymous
since a falling edge requires a high point and a low point
Anonymous
i can set up one thread to run at 1 khz or something
Anonymous
which will check if a falling edge occured
Anonymous
if it did we take that approximate tick time
Anonymous
as the beginning
Anonymous
in our can interrupt we just send the buffer to a memory in the stack
Anonymous
and raise 1 flag
Anonymous
that flag awakens another thread
Anonymous
that reads and parses the can message
Anonymous
now i did not lose the sent protocol message and i might have slowed down the can message implementation just a bit (less then 1 khz cycle probably)
Anonymous
which makes the thing hit the limits for standard signal processing applications
Talula
Yep whatever you said can be done using Interrupt too...
Anonymous
Anonymous
when i am processing the can message
Anonymous
for longer then 100 ticks
Talula
Or if you want to bounce progam from one point to another that is fine too but that is not required... what you're talking about is special case.
Anonymous
and i get 2 different falling edges at that same time
Anonymous
if i disable interrupts during that time
Anonymous
the falling edges are gone
Anonymous
and my checksum is a byte early
Talula
Normally you don't... even if you do there are always buffers... for I2C all microcontrollers that support I2C has buffers.
Anonymous
and i have to disregard that whole problem
Talula
For TTL or Serial... same...
Anonymous
Talula
Yeah but if you need such a quick action on Hall Effect... maybe special case...
Talula
If I delay Hall effect by 2ns... if nothing bad is going to happen it's fine.
Anonymous
hello guys do you know books about zero days
Talula
Anonymous
Anonymous
which are quite common for PLC use
Anonymous
do you understand what is SENT protocol?
Talula