Consolidation of dsPIC pins into virtual ports?

Post your requests and ideas on the future development of mikroPascal for dsPIC30/33 and PIC24.
Post Reply
Author
Message
OT
Posts: 581
Joined: 19 May 2005 05:08
Location: Fairbanks, Alaska

Consolidation of dsPIC pins into virtual ports?

#1 Post by OT » 19 Sep 2005 01:19

LGR has already pointed out that most dsPICs except the high pin count versions have only one or no full 8-pin ports available for the various libraries that require so. http://www.mikroe.com/forum/viewtopic.php?t=982
Microchip names Ports according to the function of the pins, so that for instance UARTs always reside on PortF even in a 28-pin dsPIC. While this has many advantages for remembering position of the various modules it also creates many ports with very few pins on the port.

Consistency between libraries for PIC and dsPIC seems to require many of the libraries to only have the full port name as parameter in the different procedures that require an 8-bit port, and not use individual pins as would be wanted for a dsPIC.

Could a solution to this problem be to allow definition of virtual ports in dsPIC for consolidation into full 8-bit ports :?: :idea:
If feasible, it would require some early definition statement, and then of course these pins must be configured the regular way as digital input/output on the original ports they reside. :idea:

User avatar
zristic
mikroElektronika team
Posts: 6608
Joined: 03 Aug 2004 12:59
Contact:

Re: Consolidation of dsPIC pins into virtual ports?

#2 Post by zristic » 19 Sep 2005 08:53

Could a solution to this problem be to allow definition of virtual ports in dsPIC for consolidation into full 8-bit ports.
It is already like that- even if PORTF is not a 16-bit register, it is declared as such. Therefore, you can freely write PORTF.12 := 1 or whatever. Compiler will compile it, but it will never work in real time on dsPIC.

OT
Posts: 581
Joined: 19 May 2005 05:08
Location: Fairbanks, Alaska

Re: Consolidation of dsPIC pins into virtual ports?

#3 Post by OT » 19 Sep 2005 19:10

zristic wrote:
Could a solution to this problem be to allow definition of virtual ports in dsPIC for consolidation into full 8-bit ports.
It is already like that- even if PORTF is not a 16-bit register, it is declared as such. Therefore, you can freely write PORTF.12 := 1 or whatever. Compiler will compile it, but it will never work in real time on dsPIC.
What I was thinking about here was to combine pins from several ports into what the compiler would see as a single virtual 8-bit port that could be used for 8-bit interfaces.
:?:

User avatar
zristic
mikroElektronika team
Posts: 6608
Joined: 03 Aug 2004 12:59
Contact:

Re: Consolidation of dsPIC pins into virtual ports?

#4 Post by zristic » 20 Sep 2005 08:13

OT wrote:What I was thinking about here was to combine pins from several ports into what the compiler would see as a single virtual 8-bit port that could be used for 8-bit interfaces.
That is quite difficult to realize and here is why: accessing a pin in program code means knowing its order and its owner's address (port address). If combining pins from multiple ports then you need to find a place to write information about each pin. The only solution I see at the moment is using structures/records. However, it does not mean that it will be compatible with current libraries, i.e. you cannot pass such structure to LCD_Init for example. Furthermore, using structures in this way will use a lot of ROM/RAM and it is not wise to do if we speak about libraries.

We work on structures. Once they start working I will have some more info on feasibility of the solution.

Post Reply

Return to “mikroPascal for dsPIC30/33 and PIC24 Wish List”