EmbeddedRelated.com
Forums

Using Interrupt driven serial Port on 8051

Started by Makhan August 8, 2004
Thank you all for the discussion, I am afraid there is more to it than
I first wrote.

Actually, there is an array of microcontrollers each doing identical
job, that is lighting up a multiplexed LED array (of variable
characters) and the characters to display are configurable ofcourse,
i.e. user can choose to display any information onto the array(s).
Each micro corresponds to one row.

So there we go. I thought of giving an identity (any character 0xA0
and so on) each, to the microcontrollers for the rows and initially
the idea was on identity match, update the allocated IDATA space with
the charcters, else just ignore.

But can you please comment on the fact that if I go for filing the
buffers on each serial port interrupt I will end up writing and
rewriting all the micros with same data?

Thanks

Makhan


Dan Henry <dhenry@sprynet.com> wrote in message news:<1q1dh09vrjdf5qgdiu9lbg20mho7c291ic@4ax.com>...
> makhan_rocks@hotmail.com (Makhan) wrote: > > >So the ISR goes like: > > > >ISR_SP: > > JBC TI, QUITY ; if TI caused it, just quit > > MOV A, SBUF ; if '0' = 30 then update the IDATA > > ADD A, #-30H ; else skip the update > > JNZ QUITY > > SETB UpdateFlag > >QUITY: > > RETI ; if TX irq just returns > > One problem that has not been mentioned by others (at least in > c.a.e.), is that your ISR does not save and restore ACC and PSW. > > Oops!
"Makhan" <makhan_rocks@hotmail.com> schreef in bericht
news:60f42c64.0408100818.1f967bd9@posting.google.com...
> Thank you all for the discussion, I am afraid there is more to it than > I first wrote. > > Actually, there is an array of microcontrollers each doing identical > job, that is lighting up a multiplexed LED array (of variable > characters) and the characters to display are configurable ofcourse, > i.e. user can choose to display any information onto the array(s). > Each micro corresponds to one row. > > So there we go. I thought of giving an identity (any character 0xA0 > and so on) each, to the microcontrollers for the rows and initially > the idea was on identity match, update the allocated IDATA space with > the charcters, else just ignore. > > But can you please comment on the fact that if I go for filing the > buffers on each serial port interrupt I will end up writing and > rewriting all the micros with same data?
Each and every uC in your setup will receive and generate an interrupt for each character. Of course you only want one uC to actually display the message, if the first character matches. But who cares if each uC stores the entire message in a ringbuffer? Your main loop will just ignore messages that don't have that first character match. When it sees a character 0x0A or higher, it has received a full previous message, and it can check if that is is a matching one that needs to be copied to your led display. So yes, you end up writing each uC with the same data, but who cares? -- Thanks, Frank. (remove 'x' and 'invalid' when replying by email)
"Makhan" <makhan_rocks@hotmail.com> wrote in message
news:60f42c64.0408100818.1f967bd9@posting.google.com...
> Thank you all for the discussion, I am afraid there is more to it than > I first wrote. > > Actually, there is an array of microcontrollers each doing identical > job, that is lighting up a multiplexed LED array (of variable > characters) and the characters to display are configurable ofcourse, > i.e. user can choose to display any information onto the array(s). > Each micro corresponds to one row. > > So there we go. I thought of giving an identity (any character 0xA0 > and so on) each, to the microcontrollers for the rows and initially > the idea was on identity match, update the allocated IDATA space with > the charcters, else just ignore. >
Why not use 9 bit mode with an "address" as your identity ?
> But can you please comment on the fact that if I go for filing the > buffers on each serial port interrupt I will end up writing and > rewriting all the micros with same data? > > Thanks > > Makhan > > > Dan Henry <dhenry@sprynet.com> wrote in message
news:<1q1dh09vrjdf5qgdiu9lbg20mho7c291ic@4ax.com>...
> > makhan_rocks@hotmail.com (Makhan) wrote: > > > > >So the ISR goes like: > > > > > >ISR_SP: > > > JBC TI, QUITY ; if TI caused it, just quit > > > MOV A, SBUF ; if '0' = 30 then update the IDATA > > > ADD A, #-30H ; else skip the update > > > JNZ QUITY > > > SETB UpdateFlag > > >QUITY: > > > RETI ; if TX irq just returns > > > > One problem that has not been mentioned by others (at least in > > c.a.e.), is that your ISR does not save and restore ACC and PSW. > > > > Oops!