View previous topic :: View next topic |
Author |
Message |
starfire151
Joined: 01 Apr 2007 Posts: 195
|
PIC18F26J11 / CCS PCWH help |
Posted: Sun Jul 19, 2009 5:23 pm |
|
|
I'm using PCWH V4.095 (just updated) and a PIC18F26J11 processor. I am a little confused with some of the new fuse definitions and a couple of the settings.
I've managed to get the second hardware serial port mapped and responding to the serial data receive interrupt correctly. The readme file explained how to use the #PIN_SELECT to set the functions.
1. Is there a summary list of the pin defintions used for the #PIN_SELECT directive? In other words "U2TX" is the second UART transmit pin and "U2RX" is the second UART receive pin. Is there a list of all the valid pins?
2. Is the summary set of fuse definitions defined anywhere? I see from the fuses listing in the compiler IDE that there is a number in front. I think this is the section in the datasheet defining this fuse but they don't quite map out to the same as what's listed. For instance, I see a #fuse H4_SW defined but is this the PLL selection?
3. According to the datasheet, the device should work up to 48MHz with the PLL. I'm trying to get the device to run with an external crystal of 9.216MHz and the PLL (* 4) for an operational speed of 36.864MHz. I tried the H4_SW fuse but the system was recognized as 9.216MHz, not 36.864MHz. Does the "SW" mean software switched? How do I enable that?
4. How would I select the internal 8MHz oscillator? Can this be used in conjunction with the * 4 PLL for an operational rate of 32MHz? How do I select these fuses?
5. In looking at the file for the 18F26J11, it appears there is an RTC internal to the device with a setup_rtc() function. Where is the definition of the RTC functions and parameters? Is this like an external RTC (like an I2C device like the Xicor X1226, the STI M41T81, the Maxim DS1338 or similar) where I could set the date/time and then get the updated date/time values later during program execution?
Thanks. |
|
|
PCM programmer
Joined: 06 Sep 2003 Posts: 21708
|
|
|
starfire151
Joined: 01 Apr 2007 Posts: 195
|
|
Posted: Mon Jul 20, 2009 7:06 pm |
|
|
Thanks very much, PCM Programmer... You da Man! |
|
|
bkamen
Joined: 07 Jan 2004 Posts: 1615 Location: Central Illinois, USA
|
|
Posted: Wed Jul 22, 2009 8:54 pm |
|
|
I'm (still) writing code for an 18F46J11 -- they're a blast.
It's so nice to have 2 UART's on a small (<64 pin) package.
The re-mappable pins are fabulous (once they work).
Enjoy your 26J11 project!
-Ben _________________ Dazed and confused? I don't think so. Just "plain lost" will do. :D |
|
|
starfire151
Joined: 01 Apr 2007 Posts: 195
|
|
Posted: Thu Jul 23, 2009 12:12 pm |
|
|
I agree! This is a great processor family. One of Microchips' best efforts that I've used. The second hardware com port (and associated recv data ISR) is very useful. I will use this feature often. The *4 PLL and operation up to 48MHz lets the code get through quicker, also.
I'm starting to play with the internal RTC feature of this family, which is kind of downplayed but a very nice feature. As most of my applications require an external RTC chip, this simplifies the hardware interface without having to lose functionality.
Please see the links posted in the response from PCM Programmer (above) for the PCD manual. This is very useful and explains many features not currently documented in the PCWH manual (setup_rtc(), etc).
I had been using the PIC18LF2620 but I've discovered a new favorite processor... the PIC18F26J11!
Enjoy this new family... it's great! Great job, Microchip!
Dave |
|
|
bkamen
Joined: 07 Jan 2004 Posts: 1615 Location: Central Illinois, USA
|
|
Posted: Thu Jul 23, 2009 1:00 pm |
|
|
The RTC is very nice.
I used the PPS output from the GPS I get the time from and then did a little offset adjustment with INT0.
It's pretty fabulous...
I also used the IDLE modes which ends up drawing a lot less current while still running at full speed than when the core is doing something...
The chip is really quite versatile. _________________ Dazed and confused? I don't think so. Just "plain lost" will do. :D |
|
|
Pulsartomi
Joined: 26 May 2010 Posts: 17
|
|
Posted: Wed Jun 02, 2010 10:30 am |
|
|
Hello All!
I didn't want to create a new topic for this.
I have problem with ccs 18f46j11.h, because it has defined pins only for 28-pin version.But i would like to use the 44-pin TQFP.
PORT D is not defined, nor PORT E (for example #define PIN_D0 is missing from header file).Can i define with the pin's address?What could it be?
Thank You |
|
|
bkamen
Joined: 07 Jan 2004 Posts: 1615 Location: Central Illinois, USA
|
|
Posted: Wed Jun 02, 2010 10:37 am |
|
|
You must be using an older version of PCH, I'm looking at 18F46j11.h and I show port D and E.
What version of PCWH are you using?
The current version is: 4.107 _________________ Dazed and confused? I don't think so. Just "plain lost" will do. :D |
|
|
Pulsartomi
Joined: 26 May 2010 Posts: 17
|
|
Posted: Wed Jun 02, 2010 10:41 am |
|
|
Sure, it's an older version.
Thank You |
|
|
dyeatman
Joined: 06 Sep 2003 Posts: 1936 Location: Norman, OK
|
|
Posted: Wed Jun 02, 2010 1:28 pm |
|
|
If you have a registered version you might ask CCS for an updated header
file. They should send it to you since that one is bad. The other option is to
copy the needed lines from another variant of the same version. Since I
am running the latest version of PCWH I can't look and see which ones you
might have.
Here are the port definition lines but there may be some other things missing as well:
Code: |
#define PIN_D0 31768
#define PIN_D1 31769
#define PIN_D2 31770
#define PIN_D3 31771
#define PIN_D4 31772
#define PIN_D5 31773
#define PIN_D6 31774
#define PIN_D7 31775
#define PIN_E0 31776
#define PIN_E1 31777
#define PIN_E2 31778
|
_________________ Google and Forum Search are some of your best tools!!!! |
|
|
Pulsartomi
Joined: 26 May 2010 Posts: 17
|
|
Posted: Mon Jun 07, 2010 7:46 am |
|
|
Thank You very much.
Tomi |
|
|
rsappia
Joined: 22 Dec 2010 Posts: 12
|
|
Posted: Thu Dec 23, 2010 7:18 am |
|
|
bkamen wrote: | I'm (still) writing code for an 18F46J11 -- they're a blast.
It's so nice to have 2 UART's on a small (<64 pin) package.
The re-mappable pins are fabulous (once they work).
Enjoy your 26J11 project!
-Ben |
Hi!!! I would like to share this thought... but right now Im having some delays in my code because of this PPS feature that i cant get running well...
Could you please give some advice on this?
http://www.ccsinfo.com/forum/viewtopic.php?t=44325
Thanks in advance!! |
|
|
|