Odd artifacts in string? OSHONSOFT.

Thread Starter

camerart

Joined Feb 25, 2013
3,730
Hi,
I was previously using HSEROUT for monitoring DATA, now I've changed to SEROUT.
My first test is 'kind of' working, but has unusual artifacts in it, shown here.
Where are they coming from and how do I get rid of them, please?

The black screen is the DATA being transmitted with HSEROUT from the computer.
The Termite view is the DATA shown on the computer via SEROUT
C.
 

Attachments

Ian Rogers

Joined Dec 12, 2012
1,136
Are you looking at the "non ASCI" characters??
Anything "non ASCII" will print as the terminal programs "default" character, can be two bars, diamond, most just print a dot.
 

Thread Starter

camerart

Joined Feb 25, 2013
3,730
Are you looking at the "non ASCI" characters??
Anything "non ASCII" will print as the terminal programs "default" character, can be two bars, diamond, most just print a dot.
Hi I,
Yes.
The odd CHARS, shouldn't be there, I don't know where they've come from?
C
 
Last edited:

Thread Starter

camerart

Joined Feb 25, 2013
3,730
Hi,
I've just remembered, that a short while ago, Oshonsoft instroduced a new format, where I had to accept {I think} ANSI CHARS. Could this be the reason for this?
C.
 

ericgibbs

Joined Jan 29, 2010
18,848
Hi C,
Looking through post #6 image . The data to be transmitted is changing, but the corrupted SEROUT is all the same character set?
Write a short test program for SEROUT and print out a test data string.

E
 

Thread Starter

camerart

Joined Feb 25, 2013
3,730
Hi C,
Looking through post #6 image . The data to be transmitted is changing, but the corrupted SEROUT is all the same character set?
Write a short test program for SEROUT and print out a test data string.

E
Hi E,
Just to make sure all is clear:
The black screen is a computer terminal with a MACRO transmitting the shown DATA to the BASE-SLAVE PIC, this is transfered (SPI) to the BASE-MASTER PIC, which is then SEROUTing it to a the connected to the computer screen Termite terminal, for checking.
It can be seen that the correct DATA is being SEROUT, but has the added odd CHARS, from somewhere.
Note: my #7.
Is this what you understand?
C.
 

sagor

Joined Mar 10, 2019
909
Since your strqeideg prints "000" at the end ok, I would suspect your subroutine ADDSTR is corrupting the string data somehow. All three corrupted strings seem to be the same, so your subroutine is making the same error regardless of parameters passed to it.

Why not use something simpler like: (adjust start point and length to proper locations) ??
strremvolt = MidStr(robi, 6, 3)
strremalt = MidStr(robi, 10, 1)
strremdist = MidStr(robi, 12, 2)
 
Last edited:

Thread Starter

camerart

Joined Feb 25, 2013
3,730
Since your strqeideg prints "000" at the end ok, I would suspect your subroutine ADDSTR is corrupting the string data somehow. All three corrupted strings seem to be the same, so your subroutine is making the same error regardless of parameters passed to it.

Why not use something simpler like: (adjust start point and length to proper locations) ??
strremvolt = MidStr(robi, 6, 3)
strremalt = MidStr(robi, 10, 1)
strremdist = MidStr(robi, 12, 2)
Hi S,
Yes, it does look, as you say.
The result should be 3xCHARS, 1xCHAR, and 2xCHARS, but it shows 3xCHARS each?
C.
 

Thread Starter

camerart

Joined Feb 25, 2013
3,730
Hi C,
Please post your program code for that test, I will try in Oshonsoft.
E
Hi E,
Here it is:
C
Code:
'18LF4620 8mHz XTL SEROUT

'----------- SYSTEM CONFIG  --------------------
'PIC Config
Define CONFIG1L = 0x00  'not used
Define CONFIG1H = 0x02  'HS XTL=2 ,HS PLL=6 ,INT=8
Define CONFIG2L = 0x1e  '? brownout/ power
Define CONFIG2H = 0x00  'defaults cleared
Define CONFIG3L = 0x00  'defaults cleared
Define CONFIG3H = 0x80  '80  'MCLR pin enabled
Define CONFIG4L = 0x80  'no debug?
Define CONFIG4H = 0x00  'not used
Define CONFIG5L = 0x0f  'default
Define CONFIG5H = 0xc0  'default
Define CONFIG6L = 0x0f  'default
Define CONFIG6H = 0xe0  'default with a don't care loc added
Define CONFIG7L = 0x0f  'default
Define CONFIG7H = 0x40  'default

'Define SIMULATION_WAITMS_VALUE = 1  'Comment in for SIM out for PIC

Define CLOCK_FREQUENCY = 8

AllDigital

'Set PINS as IN/OUT
TRISA = %00000000  '4=pic4431_cs
TRISB = %00000000
TRISC = %00000000  '5=MOSI 4=MISO 3=SCK
TRISD = %00000000  '4=HC-12_CS
TRISE = %00000000  '2=RLED 1=DRDY

'Initialise PINS As On/OFF
LATA = %00000000
LATB = %00000000
LATC = %00000000
LATD = %00000000
LATE = %00000000  '2=RLED

Symbol yled = LATE.1
Symbol rled = LATE.2

'START UP LED - shows the board is running
rled = 1
yled = 1
WaitMs 1000
rled = 0
yled = 0
WaitMs 1000

Dim test As Byte
test = 111

MAIN:

Serout PORTB.4, 9600, "TEST", #test, CrLf

WaitMs 1000


Goto MAIN

End
 

jjw

Joined Dec 24, 2013
823
Your test code works on my old PIC18 IDE v. 3.46
Comment in Define Simulation_Waitms_Value=1
 
Last edited:
Top