Exact match. Not showing close matches.
I've done just a little bit of playing around with microcontrollers
(PICs) and I try to read everything here one the list, at least to the
level of what to watch out for should I have to do 'that' some day.
Having written Zmodem code on a PC at one point, I know comm code can be
frustrating to get right. From the list it seems there are similar
experiences getting serial comm going on a PIC. In fact, serial comm is
one of those things I keep putting off for the PIC...
Is there a code repository anywhere for PIC code modules? I think most
compilers allow inline assy lang., so that might be most useful,
understanding that any particular module may only be useful to a small
group of part numbers. Initialising ports seems to be a common challenge
here too. Maybe modules that are bullet-proof for that as well. Such a
thing is a great learning tool, and I've used and contributed to other
PC repositories in the past. However, in the PIC world, there's also so
much else to debug - the code, hardware, setup, interfaces, etc, that
having some pieces of known quality might make the job a bit easier,
especially beyond just sensing a voltage and operating relays. In other
repositories, you end up with hacks and the not-so-good examples as well
as the great and elegant ones. I'm hoping that a repository exists, and
with the expertise here, it's be a good one. Can anyone point me to one
> I'm hoping that a repository exists, and
> with the expertise here, it's be a good one. Can anyone point me to
> or more?
For serial routines the oft recommended material is Father Tom
McGahee's serial library. Searching piclist archives for McGahee and
serial should turn them up.
Tom's page is here
It has a PIC UART listing which will be useful but I don't know if
that is the routines I mentioned above.
I have absolutely NO problems with serial communications. I have written
several. Interpretation of
GPS NEMA coding, interface with a PC, RS485, RS422, even synchronous
communication from a
pager. I have run the PIC as fast as 250kb for DMX512 (theatrical
lighting standard). I've done all of it.
The main problem you will have in using PICs is that your receiving and
transmitting buffers must be
small, because many of the PICs don't have much memory. You can
alleviate this greatly by designing
in a 32K SPI RAMTRON scratch pad memory. These memories, unlike EEPROMS,
need NO write waits.
Otherwise, just write the code carefully. Receive using an interrupt,
and write in the main loop whenever
the UART can accept another character. When you have received 16
characters, shove it into the RAMTRON
Its just like most stuff, after awhile it becomes second nature, like
riding a bicycle.
Dr Skip wrote:
Alan B. Pearce
>For serial routines the oft recommended material is Father Tom
>McGahee's serial library. Searching piclist archives for McGahee
>and serial should turn them up.
Note that his code is excellent for devices that have the USART, but for
devices that use the EUSART you may find Olins code module in his
development environment better.
Anyway I would recommend Olins development environment for the macro library
that he has which takes care of most bank/page switching when required, and
it has many hooks and options in it that make re-using code on any PIC
family, even when developed originally for another family, almost seamless.
Also contains macros that help keep the conditional branching more user
friendly, and includes neat bits like FIFO and long integer math macros.
See http://www.embedinc.com/pic/ to download, and the instructions on how to
use. His site also contains a link to a PDF that Jan-Erik did for an earlier
version of the environment, but it gives a good easier to read detail for
the beginner, and then you can get back to the later documentation that
comes with the environment at a late stage.
Thanks for the replies and good info. Some interesting links.
Serial was just the example though, there are other areas I'm not that
keen to take on as well. ;-)
More... (looser matching)
- Last day of these posts
- In 2007
, 2008 only
- New search...