I still think separating the numbers on the way in is the way to go. Although Jerson's code is pretty slick.
Here is what I was thinking. Just tested it using SERIN2 as the chip I have on the bench is not set up for HSERIN right now.
The first WAIT is to keep garbage out.
Code:
N1 VAR LONG
N2 VAR LONG
LOOP:
SERIN2 PORTD.2, 16416, [WAIT("X"),DEC N1,WAIT(","),DEC N2]
GOTO DISPLAY
DISPLAY:
Serout2 PORTC.6, 16416, [ DEC N1, $d, $a]
Serout2 PORTC.6, 16416, [ DEC N2, $d, $a]
GOTO LOOP
If you need the data in an array just modify the above with STR...
Bookmarks