Menu

FF on a PIC18F14k22, Internal RC OSC set. Garbled characters.

2015-05-11
2015-05-11
  • Randall Young

    Randall Young - 2015-05-11

    Hi Folks,

    Running a test this am on a PIC18F14k22, through a know good USB2TLL serial converter off a Microchip LPC demo board.

    Builds fine, but PICKit2 programmer complained that not all CONFIG bits were set when I flashed the chip. (I assume that is harmless there are a lot of extraneous config words to control write protection to flash, eeprom, etc.)

    Almost running but getting garbled characters from my terminal session. I've tried building with both PLL ENABLE and DISABLE in software. ENABLE seems to be closer to working.

    Any idea what I'm missing? I'd love to be able to run Flashforth on this chip, without the x'tll, very convenient.

    Thanks!

    Randy

    Ps. I did experiment with down shifting the baud to 9600, and 19200, PLL setting, both enabled and disable. Same behavior.

     

    Last edit: Randall Young 2015-05-11
  • Randall Young

    Randall Young - 2015-05-11

    Got it! Took a slog through the data sheet, and a little help from the venerable config P. A. Jacobs FlashForth Programmer's Guide...

    --- Edit p18f14k22.cfg

    1. Activate correct config bit for PLL 4X

    config PLLEN = ON
    config PCLKEN = ON

    1. Logically enough, enable PLL from software

      set define directive to PLL ENABLE

    --- Edit p18main.cfg

    1. set constant clock=d'64000000' ; Hz

    Just take a gander at the diagram in the datasheet it clearly show 16 mhz. from the HS internal osc. being fed into the the X4 PLL for a resulting 64 Mhz. clock. (Figure 2-1, page 14)

    running fine at 38400, n, 8, 1

    Best,

    R.

     

    Last edit: Randall Young 2015-05-11

Log in to post a comment.