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.
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.
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
Datasheet said:
Tuning the INTOSC source requires knowing when to
make the adjustment, in which direction it should be
made, and in some cases, how large a change is
needed. Three compensation techniques are
discussed in
Section 2.6.5.1 “Compensating with
the EUSART”
,
Section 2.6.5.2 “Compensating with
the Timers”
and
Section 2.6.5.3 “Compensating
with the CCP Module in Capture Mode”
, but other
techniques may be used.
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.
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.
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...