TurboLS
Originally posted by TurboLS
OK, I wired up the serial port and, using the built-in serial port com tool in MicroStudio, I am able to see information from PORTC.6; however the data (which I thought would be 1s and 0s) is coming out all garbled as weird characters and zeros with square edges.
I am using the SEROUT2 command:
SEROUT2 PORTC.6,16780,[adval]
Also, I have included the modedefs.bas file. Any ideas?
SEROUT2 PORTC.6,16780,[adval]
will send out the value of adval.
what your Terminal program displays is the ASCII representation of adval.
if you would like to see 1's and 0's try:
SEROUT2 PORTC.6,16780,bin [BIN10 adval,13,10]
If you are using only 8bit ADC and adval is Byte size replace BIN10 with BIN8
if you would like to see the decimal value of adval try:
SEROUT2 PORTC.6,16780,bin [DEC4 adval,13,10]
for 8 Bit ADC with adval being byte size replace DEC4 with DEC3
The ",13,10" simply adds a "Carriage Return" and a "Line Feed" after each line
Last edited by NavMicroSystems; - 18th February 2005 at 16:50.
regards
Ralph
_______________________________________________
There are only 10 types of people:
Those who understand binary, and those who don't ...
_______________________________________________
Bookmarks