Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
18F25K22 Support [solved]
#5
Hi Mikael,

Quote:You could also try to set the tris bits for u1 tx and rx correctly

Will do, I've made a change in the user init section:

Code:
        ; Enable digital i/o    
        ifdef    ADCON1
            ifndef DEV_MODE
;                error Do you need to configura uart pins to be digital? If not, remove this line
                ifdef    __18F25K22
                    clrf     ANSELC
                    movlw    0x80
                    movwf    TRISC
                endif
            endif
        endif

Attached is the updated ds30 program (still not working, though)
.zip   firmware PIC18F.zip (Size: 57.96 KB / Downloads: 16)

The K22 support has got me stumped. I only dabble with low level code - I much prefer to use a HLL such as Swordfish.. With that in mind, my fault finding capability is rather limited working with assembly!

I made the following simple program for testing the K20 and K22 USART hardware. The only the config fuses change depending on which device is selected:

Code:
Device = 18F25K22
//Device = 18F25K20

Clock = 16
#if _device = 18F25K20
    Config FOSC = HS
#else
    Config PLLCFG = OFF, FOSC = HSHP    
#endif

Include "USART.bas"

USART.SetBaudrate(br38400)
While True
    USART.Write("Hello World",13,10)
    DelayMS(1000)
Wend

The program works perfectly fine with either K20 or K22 defined, and results with "Hello World" on the terminal program every second. Which is interesting, as the USART module is configured exactly the same between the Swordfish programs. Going a little further, and the SF USART initialisation looks much the same as what you have in the ds30 program.

Attached are the assembly outputs for each variation of the above program (just in case you'd like to inspect the configuration between them?).
.zip   K20+K22 ASM.zip (Size: 11.22 KB / Downloads: 23)

Have you had any success with K22's in the past? There also appears to be a small bug in the GUI for the 18F25K22 - the device is listed twice in v1.3.14.0).
Reply


Messages In This Thread
18F25K22 Support [solved] - by Mitchy - 2011-02-12, 07:27:49
RE: 18F25K22 Support - by Mikael Gustavsson - 2011-02-12, 12:03:44
RE: 18F25K22 Support - by Mitchy - 2011-02-12, 12:41:13
RE: 18F25K22 Support - by Mikael Gustavsson - 2011-02-12, 22:12:41
RE: 18F25K22 Support - by Mitchy - 2011-02-13, 10:14:13
RE: 18F25K22 Support - by Mikael Gustavsson - 2011-02-14, 21:20:23
RE: 18F25K22 Support - by moonshadow - 2011-02-17, 14:06:05
RE: 18F25K22 Support - by Mikael Gustavsson - 2011-02-17, 21:18:59
RE: 18F25K22 Support - by Mitchy - 2011-02-19, 00:10:20
RE: 18F25K22 Support - by moonshadow - 2011-03-17, 15:24:44
RE: 18F25K22 Support [solved] - by rotting79 - 2013-10-08, 07:10:35
RE: 18F25K22 Support [solved] - by rotting79 - 2013-10-29, 03:13:42

Forum Jump:


Users browsing this thread: 3 Guest(s)