Hserout in Oshonsoft causing unrecognisable digits

Status
Not open for further replies.

camerart

Well-Known Member
Hi,
I'm using a PIC with Oshonsoft.
I am sending an HSEROUT via radio link to a computer terminal.
Normally I get sensible results but occasionally I get gobbledygook.

Here is a section:€xx[00]x[00]x[00]xø€[00]€[00]€[00]€[00]ø€[00]€[00]€[00]€€€xx[00]x[00]x[00]xø€[00]€[00]€[00]€[00]ø€[00]€x[00]€

What can cause this? I've tried changing the terminal BAUD rate, but still unrecognisable.

Camerart.
 
Hi,
I've been trying various old programs with the same PCB/PIC, and one program showed sensible digits. This program has a different clock speed.
I have investigated deeply yet, as it's quite involved and different PICs e,g, 18LF46K20. 18F4620 etc
C.
 
Are you using manchester encoding?

Mike
Hi M,
I don't think so. I've heard of it, but don't know what it is.

EDIT: Just looked it up, and no I'm not. Just simple Oshonsoft BASIC.
C
 
Last edited:
Hi E... Are you using internal crystal???
Hi I,
Yes internal Crystal.
I've had to change PICs over time and sometimes the settings get lost. I suspect the latest one I'm using 18F4620 has a different OSCCON and PLL or HS setting in the configuration BITs. I have tried and failed to get the PICs to run at 32MHz.
C.
 
Thought so.... Its almost impossible to get an internal crystal perfect..... You have to use the OSCTUNE reg to get it to work

Each device is different
 
Thought so.... Its almost impossible to get an internal crystal perfect..... You have to use the OSCTUNE reg to get it to work


Each device is different
Hi I,
Luckily, I added tracks for XTLS, so I think it may be a good idea to add them.
EDIT: Just ordered some 8MHz XTLS
C.
 
Last edited:
They can run at 40Mhz so any.... 10Mhz seems the logical answer... BUT!! 8 will yield better baud rates... You'll need to do a bit of homework!
 
They can run at 40Mhz so any.... 10Mhz seems the logical answer... BUT!! 8 will yield better baud rates... You'll need to do a bit of homework!
Hi I,
We got crossed messages there, I just edited the above message.
Just ordered some 8MHz.
Cheers, C.
 
Are we talking bitbang or hardware? In hardware your speed has to be out by 5% or more to get these kind of errors. Errors can accumulate over long strings if only 1 stop bit is used. Using 2 stop bits causes each byte to reset the accumulated error.

Mike.
 
If the wrong clock rate is specified, you'll also get errors like this. Flash an LED on and off for 1000mS and verify the correct timing.
 
setting in the configuration BITs. I have tried and failed to get the PICs to run at 32MHz.
This is also your issue..

If you select 32Mhz BUT!! you do't achieve it ( assume 8Mhz PLL not running ) then your baud is set incorrectly as Vlad will use the frequency setting and not the actual crystal speed... Post the whole thing and I'll tell you how fast its running..
 
Hi,
I doubt it's clock selection or PLLEN, because I've been trying lots of different programs that work on other PCBs and are wired the same. These other programs have different OSCCON and PLLEN settings. I checked the CLKOUT PIN on an Oscilloscope and they are the same.

After I changed from 18LF4520 to 18LF46K20, this is when I started having difficulties. I now have removed all of the 18LF46K20 and replaced them with 18F4620. (I still have working 18LF4520 PCBs, but they have limited programs, because of memory size.

In the D/S there is reference to HSPLL, but this is not an option in Oshonsoft. The LED switches ON/OFF 1/sec by eye.
C.
 
Hi,
Just tried a parallel 4XPIN SPI digital analysis Here:

EDIT: Just discovered the sspcon section.
C.
 

Attachments

  • 1SEC TEST.bas
    2 KB · Views: 220
  • Parallel.jpg
    194.5 KB · Views: 229
Last edited:
When you set the PLL to on, the frequency has to be set to 32Mhz and not 8... Even if the internal 8 Mhz is used
 
Just loaded your stuff into Oshonsoft.... I selected pic18f4620, but I noticed the pic18f46k20 in the text.... Oshonsoft doesnt support hardware serial on the K series.... Which chip should I test...
 
When you set the PLL to on, the frequency has to be set to 32Mhz and not 8... Even if the internal 8 Mhz is used
Hi I,
OK.
Initially I tried to get PICs running at 32MHz, but after failing, I use 8MHz and no PLLEN till things get working,
Thanks.
C.
 
Hi I,
OK.
Initially I tried to get PICs running at 32MHz, but after failing, I use 8MHz and no PLLEN till things get working,
Thanks.
C.
Hi I,
Note #15, I don't use the 'K' type anymore. I've removed the 'K' from the text.
C.
 
Last edited:
Status
Not open for further replies.
Cookies are required to use this site. You must accept them to continue using the site. Learn more…