So, here it is:
pragma target clock 20_000_000 -- oscillator frequency
pragma target RSTOSC HFINT32 -- power-up clock select: OSC
You're telling the compiler, the PIC would run at 20MHz, and you're setting the
PIC to 32MHz.
Make it
pragma target clock 32_000_000 -- oscillator frequency
and your baudrate will be as specified.
Greets,Kiste
Am Dienstag, 17. Mai 2022, 21:12:10 MESZ hat flyway38 <[email protected]>
Folgendes geschrieben:
Hi again Kiste,
Here my code pragmas;
-- Pragmas/ configuration memory settings (fuses)
pragma target clock 20_000_000 -- oscillator frequency
pragma target OSC OFF -- HS crystal or resonator
pragma target RSTOSC HFINT32 -- power-up clock select: OSC
pragma target CLKOUTEN DISABLED -- no clock output
pragma target WDT DISABLED -- watchdog
pragma target DEBUG DISABLED -- no debugging
pragma target BROWNOUT DISABLED -- no brownout reset
pragma target FCMEN DISABLED -- no clock monitoring
pragma target CSWEN ENABLED -- allow writing OSCCON1 NOSC
and NDIV
pragma target LVP DISABLED -- no low voltage programming
pragma target MCLR EXTERNAL -- external reset
-- The configuration bit settings above are only a selection, sufficient
-- for this program. Other programs may need more or different settings.
--
WDTCON_SWDTEN = OFF -- disable watchdog
--
_usec_delay (100_000) -- wait for power to stablilize
--
enable_digital_io() -- make all pins digital I/O
CheersFilipe Santos.
On Tuesday, May 17, 2022 at 7:05:54 PM UTC+1 Kiste wrote:
Hi Filipe,
I suspect the baudrate problem in settings like
pragma target clock ?
pragma target OSC ?
pragma target RSTOSC ?
OSCCON* = ?
What are these settings?
Greets,Kiste
--
You received this message because you are subscribed to the Google Groups
"jallib" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/jallib/6e0906ee-c9ec-4f45-94fb-3f99356d83aen%40googlegroups.com.
--
You received this message because you are subscribed to the Google Groups
"jallib" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/jallib/1502497946.2497071.1652816047051%40mail.yahoo.com.