Searching \ for '[PIC] - 18F1320, Rebuilding library - multiple UAR' in subject line. ()
Make payments with PayPal - it's fast, free and secure! Help us get a faster server
FAQ page: www.piclist.com/techref/microchip/devices.htm?key=18F
Search entire site for: '- 18F1320, Rebuilding library - multiple UAR'.

Exact match. Not showing close matches.
PICList Thread
'[PIC] - 18F1320, Rebuilding library - multiple UAR'
2010\08\24@093918 by Carl Denk

flavicon
face
I am in need of 2.5 serial ports on the 18F1320, (1) RS-232, (1) RS485, and (1) Serial LCD, Tx only). The RS-232 would be the hardware USART, and the others would be Software Uart's. I understand the part of modifying the specific Library files, and rebuilding after  revising the PORT numbers. Here's the approach I'm thinking:
1: Copy 2 sets of the library sw_uart  files to the project directory.
2: Rename one of the sets of files, say append "_2".
3: On the first set of files change the ports, function, and file references to match the first UART.
4:  On the 2nd set of files do the same.
5: Rebuild both sets of  library  files.
6: There will be 2 sets of function calls with different names

A couple of questions:
1: Is there a way to economize on code size? I'm thinking that could add an arguement to the functions where need be to specify which software ports we are pointing.
2: I haven't looked in detail, but, I'm assuming not all of the sw_uart's files are port dependent, and will have no changes. Since they are small and storage in project directory isn't an issue, is there a reason to rebuild them, or will they just come along for the ride?

Thanks for comments. :

2010\08\24@103226 by Isaac Marino Bavaresco

flavicon
face
Em 24/8/2010 10:39, Carl Denk escreveu:
> I am in need of 2.5 serial ports on the 18F1320, (1) RS-232, (1) RS485,
> and (1) Serial LCD, Tx only). The RS-232 would be the hardware USART,
> and the others would be Software Uart's. I understand the part of
> modifying the specific Library files, and rebuilding after  revising the
> PORT numbers. Here's the approach I'm thinking:
> 1: Copy 2 sets of the library sw_uart  files to the project directory.
> 2: Rename one of the sets of files, say append "_2".
> 3: On the first set of files change the ports, function, and file
> references to match the first UART.
> 4:  On the 2nd set of files do the same.
> 5: Rebuild both sets of  library  files.
> 6: There will be 2 sets of function calls with different names
>
> A couple of questions:
> 1: Is there a way to economize on code size? I'm thinking that could add
> an arguement to the functions where need be to specify which software
> ports we are pointing.

It is a good idea, not only to save code (perhaps not that much savings
anyway), but to have a more homogeneous and flexible approach.

I posted some code in the thread "[PIC] C18 function prototypes
(pic18f8627)", related to SPI, but the idea is the same.


> 2: I haven't looked in detail, but, I'm assuming not all of the
> sw_uart's files are port dependent, and will have no changes. Since they
> are small and storage in project directory isn't an issue, is there a
> reason to rebuild them, or will they just come along for the ride?

By keeping the files in the project tree, you don't need to rebuild the
library, but if you stop using some of them, you must remember to remove
them from the source files list or else they will still be linked and
wasting program memory.
If you build a library, then the linker ignores the functions that are
not called.

You don't need to rebuild the compiler's library, you could create a
smaller library with just your new functions and add this library to the
project. If the functions in your library have the same name as some in
the original library, then your library must be listed before the
original one in the project.


It is only worth the hassle of rebuilding the library if you plan to use
these functions on several projects. If they are intended for one
project only, then add the files directly to the project or create a
smaller library.

I at first keep the files added directly to the project. If I feel that
the files may be useful for other projects, and after they are very
stable, tested and bug-free, then I move them to a library.

> Thanks for comments. :)

Best regards,

Isaac


__________________________________________________
Fale com seus amigos  de graça com o novo Yahoo! Messenger http://br.messenger.yahoo.com/

2010\08\24@112213 by Carl Denk

flavicon
face
Thanks for the quick reply. :)

Yea, that's what I was thinking, have a small library of just the changed items in the project lib. These probably won't get used much, so that should work well. If I need them in another project, I always can copy the items to the new project.

And this is with MPLAB and C18. Last night, with the lib files in the project directory, I must have missed something. I needed to change the tool suite to MPASM  and select "build library target" to produce the *.o files, then change back to C18, and build the project. I had tried #including the files global in the C file. I thought that C18 would go and assemble them. I didn't use the library Bat files.

On 8/24/2010 10:32 AM, Isaac Marino Bavaresco wrote:
{Quote hidden}

>

More... (looser matching)
- Last day of these posts
- In 2010 , 2011 only
- Today
- New search...