View previous topic :: View next topic |
Author |
Message |
picprogrammer
Joined: 10 Sep 2003 Posts: 35
|
Using 18F66K80 |
Posted: Sun Dec 04, 2011 2:39 pm |
|
|
For a new project we want to use the 18F66K80. There is no hardware yet but searching the connections pins I found 2 UARTS. The compiler seems to know ony one. And it is connected to E6 and E7 but the compiler says that are invalid pins. Maybe they copied the code from 18F6680, that one has no E6 and E7
Last edited by picprogrammer on Mon Dec 05, 2011 2:02 am; edited 1 time in total |
|
![](templates/subSilver/images/spacer.gif) |
dyeatman
Joined: 06 Sep 2003 Posts: 1924 Location: Norman, OK
|
|
Posted: Sun Dec 04, 2011 3:16 pm |
|
|
What version are you using?
Looking the the version 4.114 18F66K80.H file I see only PIN_E0 to
PIN_E3 are defined. The others are missing but you can copy them
from the 18F66K90 file.
Version 4.114 works fine using UART1 and UART2, The second UART is defined in the device.dat file. _________________ Google and Forum Search are some of your best tools!!!! |
|
![](templates/subSilver/images/spacer.gif) |
w2drz
Joined: 27 Dec 2006 Posts: 55 Location: Western New York - USA
|
Re: Using 18F66K80 |
Posted: Sun Dec 04, 2011 4:01 pm |
|
|
picprogrammer wrote: | For a new project we want to use the 18F66K80. There is not hardware yet but searching the connections pins I found 2 UARTS. The compiler seems to know ony one. And it is connected to E6 and E7 but the compiler says that are invalid pins. Maybe they copied the code from 18F6680, that one has no E6 and E7 |
Hi,
May wish to review prior post's as the "K80" chip has unique features,
requires compiler 4.121 or later.
As this chip is unique in the programming of 'K80' chip,
must also use the latest CCSLOAD with U64 programmer,
do not know about any other programmers working with this chip correctly.
see this post also:
http://www.ccsinfo.com/forum/viewtopic.php?t=46813
tom W2DRZ |
|
![](templates/subSilver/images/spacer.gif) |
dyeatman
Joined: 06 Sep 2003 Posts: 1924 Location: Norman, OK
|
|
Posted: Sun Dec 04, 2011 7:11 pm |
|
|
After his question I successfully compiled and tested a 2 UART K80
program using 4.114. I have already completed three projects using
"K" series chips so far with no problems. _________________ Google and Forum Search are some of your best tools!!!! |
|
![](templates/subSilver/images/spacer.gif) |
picprogrammer
Joined: 10 Sep 2003 Posts: 35
|
|
Posted: Mon Dec 05, 2011 11:42 am |
|
|
Compiler is version 4.119
The error is when i want two hardware uarts:
Code: |
#use rs232(baud=38400,parity=N,xmit=PIN_E7,rcv=PIN_E6,bits=8,stream=PORT1)
#use rs232(baud=38400,parity=N,xmit=PIN_G3,rcv=PIN_G0,bits=8,stream=PORT2) |
With the E5..7 pins added to the .H file it will compile. Can I be sure to have hardware UARTS now? otherwise no irq on receiving data.
The receive interrupts are #int_RDA and #int_RDA2 ? |
|
![](templates/subSilver/images/spacer.gif) |
PCM programmer
Joined: 06 Sep 2003 Posts: 21708
|
|
![](templates/subSilver/images/spacer.gif) |
picprogrammer
Joined: 10 Sep 2003 Posts: 35
|
|
Posted: Mon Dec 05, 2011 2:48 pm |
|
|
Thanks, I tried a putc. First with hardware uart and here the .lst:
.................... fputc('A',PORT1);
004FE: MOVLW 41
00500: MOVWF 19
00502: MOVLB 0
00504: BRA 03DA
.................... fputc('B',PORT2);
00506: MOVLW 42
00508: BRA 041A
....................
When changing the ports into port A impossible for hardware uart:
.................... fputc('A',PORT1);
00530: MOVLW 41
00532: MOVWF 19
00534: MOVLB 0
00536: BRA 03DA
.................... fputc('B',PORT2);
00538: MOVLW 42
0053A: MOVWF 19
0053C: BRA 041C
....................
Not exactly the same, conclusion?? |
|
![](templates/subSilver/images/spacer.gif) |
PCM programmer
Joined: 06 Sep 2003 Posts: 21708
|
|
Posted: Mon Dec 05, 2011 4:37 pm |
|
|
Quote: | When changing the ports into port A
|
I don't understand this. Post a test program that shows the complete
code that you are compiling, when it fails. |
|
![](templates/subSilver/images/spacer.gif) |
picprogrammer
Joined: 10 Sep 2003 Posts: 35
|
|
Posted: Tue Dec 06, 2011 1:22 am |
|
|
There is no error since i added the extra E pins to the .H file. Now I want to be sure to have hardware uarts. So the first part of the code is with RX and TX connected to the hardware pins to use the internal uart. The second part is with other pins to have a software rs232 |
|
![](templates/subSilver/images/spacer.gif) |
|