RA6 on an 18F2455?

Forum for problems or queries regarding the Flowcode application and compiler usage.

Moderators: Benj, Mods

jadiflow
Flowcode v5 User
Posts: 249
Joined: Thu Apr 17, 2008 9:59 am
Has thanked: 16 times
Been thanked: 16 times
Contact:

RA6 on an 18F2455?

Postby jadiflow » Wed Aug 13, 2008 12:49 pm

Hello,

Port RA6 on an 18F2455 is muxed with OSC2/CLKO. I have configured the chip for Int Osc as HS: HS+PLL, USB-HS . So I assume that RA6 is available. However, when I try to access port A everything above bit 5 is unavailable. Am I doing something wrong in the configuration?

Thanks,

Jan Didden

Sean
Valued Contributor
Valued Contributor
Posts: 548
Joined: Tue Jun 26, 2007 11:23 am
Has thanked: 6 times
Been thanked: 44 times
Contact:

Re: RA6 on an 18F2455?

Postby Sean » Fri Aug 15, 2008 10:39 am

Port pin allocations are defined in the Flowcode FCD file for the selected device. These pin allocations are not currently linked to the configuration settings and can not automatically reflect all the multiplexed options offered by some of the newer devices. The allocations generally assume that external oscillator pins, /MCLR etc. are only used for their original functions and are not available to the ports.

Many of the general purpose development/programmer boards only link the multiplexed oscillator pins to external oscillator components, not to the port connectors. Check that your development platform provides the necessary connections, unless you are using custom hardware.

It is possible to add edited versions of the FCD files to the Flowcode FCD folder to allow some of the multiplexed functions to be made available (hardware permitting). These should only be used with the appropriate configuration settings, and require some understanding of the FCD file structure to be edited successfully. If there are any errors they will not berecognised by Flowcode. Only edit copies of the FCD files, not the originals!!

I have attached a version of the 18F2455 FCD file that recognises RA6 (18F2455_ra6.fcd). If you add this file to the Flowcode FCD folder, it will appear as 18F2455_ra6 in the target device listing the next time you run Flowcode.

18F2455_ra6.fcd
(7.59 KiB) Downloaded 265 times


There are three edits required to the original 18F2455 FCD file to activate RA6:

In the [Device] section add the line ChipName=18F2455. This is required if the file name does not exactly match the device name, as used by the compiler and programmer.

In the [Ports] section add the line PortPin10=0x0006. 00 = Port A, 06 = Port pin 6.

In the [PortMasks] section, modify the value of PortMask0 from ox3F to PortMask0=0x7F. This is the bit pattern of the pins available for Port A.

jadiflow
Flowcode v5 User
Posts: 249
Joined: Thu Apr 17, 2008 9:59 am
Has thanked: 16 times
Been thanked: 16 times
Contact:

Re: RA6 on an 18F2455?

Postby jadiflow » Tue Aug 19, 2008 1:30 pm

Sean,

Works like a charm!

Thanks,

Jan Didden

mishka_1985
Posts: 3
Joined: Fri Mar 25, 2011 4:02 pm
Contact:

Re: RA6 on an 18F2455?

Postby mishka_1985 » Fri Mar 25, 2011 5:54 pm

Hi Sean,
I have a similar problem with my ECIO-40. I tuned the design, so that there is an oscillator instead of crystal. Everything works very well, but i cannot access the OSC2 pin and I really need to. I looked into the .fcd file, and some of the stuff there looks understandable and i seem to have a clue what is being described there, but the rest i don't get and i don't really want to screw it up. Do you think you could make a similar ra6 .fcd patch for ECIO-40?
Thank you in advance,
Michail Klimkovic

User avatar
Benj
Matrix Staff
Posts: 14142
Joined: Mon Oct 16, 2006 10:48 am
Location: Matrix TS Ltd
Has thanked: 4329 times
Been thanked: 4075 times
Contact:

Re: RA6 on an 18F2455?

Postby Benj » Tue Mar 29, 2011 11:40 am

Hello Michail,

How have you modded your ECIO? Have you unsoldered the crystal or are you simply moddelling a design on the ECIO?

Allowing the extra I/O pins is likely to stop the PLL from working and you may loose USB connectivity. This is then likely to stop your ECIO from working or being able to reprogram itself.

If you do wish to do this then why not use a standard 18F4455 as your target and add the extra parameter to your linker options -rb 0x800.

mishka_1985
Posts: 3
Joined: Fri Mar 25, 2011 4:02 pm
Contact:

Re: RA6 on an 18F2455?

Postby mishka_1985 » Thu Mar 31, 2011 10:23 am

Hi Benj,
Thank you for your reply. I have actually developed my own board with the 18F4455 and i am using an oscillator there. I've been in contact with your colleague Steve Tandy and he provided me with the programming bootloader (after signing some sort of agreement). Of course I had to change several configuration bits in the MPLAB IDE project, since i am using oscillator rather than crystal and I also use the alternative JTAG pins - to save the RE3/MCLR pin (I enabled ICPORT, enabled RE3 as input and disabled RE3 as master reset). As I said everything works smoothly, I can upload new programs that I create in the Flowcode, I have tested nearly all the peripherals including USB and everything works fine. The only problem is that the RA6 is not available in the Flowcode environment, because it is blocked in the .fcd file.
I was considered creating a 18F4455 project, but then I assume the bootloader won't work properly and i also want the board to be able to use the Free versions of Flowcode.
Michail Klimkovic

User avatar
Benj
Matrix Staff
Posts: 14142
Joined: Mon Oct 16, 2006 10:48 am
Location: Matrix TS Ltd
Has thanked: 4329 times
Been thanked: 4075 times
Contact:

Re: RA6 on an 18F2455?

Postby Benj » Fri Apr 01, 2011 11:32 am

Hello Michail,

Here is a updated FCD for the ECIO40 that should allow you to use the RA6 pin as an input and update the config to use the EC PLL + RA6 I/O instead of HS PLL.

ECIO-40.fcd
(13.13 KiB) Downloaded 193 times


Note to any standard ECIO users do not use this FCD or you are likely to stop the USB bootloader from working.

mishka_1985
Posts: 3
Joined: Fri Mar 25, 2011 4:02 pm
Contact:

Re: RA6 on an 18F2455?

Postby mishka_1985 » Sat Apr 02, 2011 12:22 pm

Hi,
works great! Thank you very much.
Michail Klimkovic