Wondering about Full Duplex Serial
HumanOzz
Posts: 13
Hey guys,
i was just wondering about the object Full duplex serial. At the start~
bla.start(.....) at the main program to initializing the object with a new cog.
From the full duplex serial program:
PUB rx : rxbyte
'' Receive byte (may wait for byte)
'' returns $00..$FF
repeat while (rxbyte := rxcheck) < 0
Well, basically i was wondering about this part, if i put in at the main program -
somename := bla.rx
Its actually using the main program cog to wait for a byte right?
Correct me if i'm wrong.
If its actualy using another cog other than the main program one is using, then it is using the cog it has used in the initialization right?
If this is the case, so that means that after the initialization, this object is given a cog to the rest of the things in the fullduplex code.
Which one is correct?
Thanks
i was just wondering about the object Full duplex serial. At the start~
bla.start(.....) at the main program to initializing the object with a new cog.
From the full duplex serial program:
PUB rx : rxbyte
'' Receive byte (may wait for byte)
'' returns $00..$FF
repeat while (rxbyte := rxcheck) < 0
Well, basically i was wondering about this part, if i put in at the main program -
somename := bla.rx
Its actually using the main program cog to wait for a byte right?
Correct me if i'm wrong.
If its actualy using another cog other than the main program one is using, then it is using the cog it has used in the initialization right?
If this is the case, so that means that after the initialization, this object is given a cog to the rest of the things in the fullduplex code.
Which one is correct?
Thanks
Comments
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Nyamekye,
Mike, are you saying that the main program cog is not used to wait for a byte?
If you only want check if a byte is in the buffer, then use the rxcheck methode.
if you want wait a certain time for a byte then use the rxtime methode.
Andy