CCS C Software and Maintenance Offers
FAQFAQ   FAQForum Help   FAQOfficial CCS Support   SearchSearch  RegisterRegister 

ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

CCS does not monitor this forum on a regular basis.

Please do not post bug reports on this forum. Send them to support@ccsinfo.com

Using 18F66K80

 
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion
View previous topic :: View next topic  
Author Message
picprogrammer



Joined: 10 Sep 2003
Posts: 35

View user's profile Send private message

Using 18F66K80
PostPosted: Sun Dec 04, 2011 2:39 pm     Reply with quote

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
dyeatman



Joined: 06 Sep 2003
Posts: 1924
Location: Norman, OK

View user's profile Send private message

PostPosted: Sun Dec 04, 2011 3:16 pm     Reply with quote

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!!!!
w2drz



Joined: 27 Dec 2006
Posts: 55
Location: Western New York - USA

View user's profile Send private message Visit poster's website

Re: Using 18F66K80
PostPosted: Sun Dec 04, 2011 4:01 pm     Reply with quote

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
dyeatman



Joined: 06 Sep 2003
Posts: 1924
Location: Norman, OK

View user's profile Send private message

PostPosted: Sun Dec 04, 2011 7:11 pm     Reply with quote

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!!!!
picprogrammer



Joined: 10 Sep 2003
Posts: 35

View user's profile Send private message

PostPosted: Mon Dec 05, 2011 11:42 am     Reply with quote

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 ?
PCM programmer



Joined: 06 Sep 2003
Posts: 21708

View user's profile Send private message

PostPosted: Mon Dec 05, 2011 1:52 pm     Reply with quote

Quote:
The receive interrupts are #int_RDA and #int_RDA2 ?

Yes, that's correct.

Quote:
Can I be sure to have hardware UARTS now?

This thread explains how to see if you have hardware UART code,
by looking at the .LST file:
http://www.ccsinfo.com/forum/viewtopic.php?t=22149

If you can't make it work, this thread has work-around routines for UART2.
It's for a different PIC, but it could be modified (register addresses) to
work with the 18F66K80:
http://www.ccsinfo.com/forum/viewtopic.php?t=44394&start=16
picprogrammer



Joined: 10 Sep 2003
Posts: 35

View user's profile Send private message

PostPosted: Mon Dec 05, 2011 2:48 pm     Reply with quote

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??
PCM programmer



Joined: 06 Sep 2003
Posts: 21708

View user's profile Send private message

PostPosted: Mon Dec 05, 2011 4:37 pm     Reply with quote

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.
picprogrammer



Joined: 10 Sep 2003
Posts: 35

View user's profile Send private message

PostPosted: Tue Dec 06, 2011 1:22 am     Reply with quote

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
Display posts from previous:   
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion All times are GMT - 6 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group