2011-02-13, 10:14:13
Hi Mikael,
Will do, I've made a change in the user init section:
Attached is the updated ds30 program (still not working, though)
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:
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?).
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).
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)
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?).
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).