View previous topic :: View next topic |
Author |
Message |
tamagee
Joined: 02 Sep 2009 Posts: 6
|
PIC 18s known to work |
Posted: Sat Sep 05, 2009 1:01 pm |
|
|
What PIC 18s are known to work with the CCS compiler? In particular, the UARTS. The 18F26J50 does not. Any in that series that do? (18F24J50, etc) |
|
|
PCM programmer
Joined: 06 Sep 2003 Posts: 21708
|
|
Posted: Sat Sep 05, 2009 2:24 pm |
|
|
In the future, please don't start a new thread for questions that are
related to your existing current thread. Just add it on to the existing
thread.
To answer your question:
1. Post your compiler version.
2. Does it have to be a J-series PIC ?
3. Does the PIC need to have 2 UARTS ? |
|
|
tamagee
Joined: 02 Sep 2009 Posts: 6
|
|
Posted: Sun Sep 06, 2009 2:07 pm |
|
|
I have 3 serial devices, but only 1 will be initiating communication to the PIC, so 1 hardware uart would be acceptable. Internal RTC was nice but not necessary.
Compiler version 4.099.
Is there an 18 series pic that is commonly used? |
|
|
PCM programmer
Joined: 06 Sep 2003 Posts: 21708
|
|
Posted: Sun Sep 06, 2009 2:18 pm |
|
|
You could use the 18F4520. It could be considered the modern, general
purpose 18F-series PIC. |
|
|
FvM
Joined: 27 Aug 2008 Posts: 2337 Location: Germany
|
|
Posted: Sun Sep 06, 2009 2:44 pm |
|
|
As far as I experienced, PCH built-in functions are working for all classical PIC18 chips. It's apparently a different story with new PIC18 J-series devices. However, you are not required to use built-in functions to access the UARTs. If you are using a Hitech or Microchip C18 compiler, you also have to manage the UART SFR access directly. You still can do this with CCS C.
P.S.: I don't want to justify the CCS way of implementing new chips, which seems to work like "ship first, check later". |
|
|
dyeatman
Joined: 06 Sep 2003 Posts: 1934 Location: Norman, OK
|
|
Posted: Sun Sep 06, 2009 3:30 pm |
|
|
It is pretty easy to "write around" the internal functions with your own.
The RS232 register setup be accomplished manually without much work.
For your own putc1() routine all you have to do is loop while polling
the TRMTx register. When zero, load TXREGx with the passed byte/char.
A better way is to use bputc() as shown in STISR.C then modify STISR.c to
test TRMT and move the char directly into the TXREG rather than using
putc().
If the compiler generates garbage assembly for other routines they may
need to be bypassed as well. _________________ Google and Forum Search are some of your best tools!!!! |
|
|
|