Searching \ for '[PIC] sending my function to the pic ?' 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=pic
Search entire site for: 'sending my function to the pic ?'.

Exact match. Not showing close matches.
PICList Thread
'[PIC] sending my function to the pic ?'
2007\01\08@131455 by dgdg ghhghg

flavicon
face
Is it possible to send a function to a 18fxxxx pic, what
I mean is that I can send the function by rs232, then
I want the pic to jump to it, so there is a need to
write the ram data to rom so that I can jump into it, has
anyone done something like that?
Thanks.

2007\01\08@133311 by Maarten Hofman

face picon face
Redwood Shores, 8 januari 2006.

What you are describing sounds similar to a bootloader. I believe there are
many solutions to do this, and I guess you could do it on the fly too. Be
aware, though, that some 18F only allow you to overwrite the internal memory
up to 1000 times, which could become an issue if you keep using this RS-232
solution to upload different functions. I think it would be better (if
possible in your case) to just premake all the functions, and only upload a
byte that indicates the location in a jumptable, and jump to the function
that way. You might wish to elaborate a little bit more on what you're
trying to accomplish.

Greetings,
Maarten Hofman.

2007\01\08@134237 by alan smith

picon face
Forcing a new address you mean to jump to (as in the code is already stored in the flash) or updating a piece of the flash via the RS232?  sounds like a bootloader of sortss

dgdg ghhghg <spam_OUTreectogaTakeThisOuTspambtinternet.com> wrote:  Is it possible to send a function to a 18fxxxx pic, what
I mean is that I can send the function by rs232, then
I want the pic to jump to it, so there is a need to
write the ram data to rom so that I can jump into it, has
anyone done something like that?
Thanks.

2007\01\08@142212 by Rich Satterlee

flavicon
face
Hiya-

There are several examples of bootstrap loaders out there for your reference.

 Cheers,

  Rich S.



>
> Forcing a new address you mean to jump to (as in the code is already stored in the flash) or updating a piece of the flash via the RS232?  sounds like a bootloader of sortss
>
> dgdg ghhghg <.....reectogaKILLspamspam@spam@btinternet.com> wrote:  Is it possible to send a function to a 18fxxxx pic, what
> I mean is that I can send the function by rs232, then
> I want the pic to jump to it, so there is a need to
> write the ram data to rom so that I can jump into it, has
> anyone done something like that?
> Thanks.
> --

2007\01\08@151618 by dgdg ghhghg

flavicon
face
Hello,

It is like a bootloader, I am trying to identify the main issues,
if anyone can help then good, otherwise I shall check out
the bootloader.

Can anyone refer me to an explanation how to write, lets say,
1,2,3,4,5 into rom memory ? better still, how to write the
contents of an array a[5] to rom (a[0],a[1]...)

Next issue, I will have a "do nothing" function hard coded,
e.g.

void do_nothing(void)
{
;
}

What do I do to change the contents, I need the rom location
of the function to which I will write, changing the functionality
from "do nothing" to "do something", but keeping the name
"do_nothing"

I also need to reserve bytes in "do_nothing" so that "do someting"
doesn't extend into possible code which is after it.

Also, my code needs to be address independant, assuming the
compiler is unaware that I am actually sending the assembled
code down a serial line.

Thanks.

dgdg ghhghg <reectogaspamKILLspambtinternet.com> wrote: Is it possible to send a function to a 18fxxxx pic, what
I mean is that I can send the function by rs232, then
I want the pic to jump to it, so there is a need to
write the ram data to rom so that I can jump into it, has
anyone done something like that?
Thanks.

2007\01\08@160608 by Gerhard Fiedler

picon face
dgdg ghhghg wrote:

> Also, my code needs to be address independant, assuming the
> compiler is unaware that I am actually sending the assembled
> code down a serial line.

I'm among the first to object when someone says "you need to start with
assembler", but in this case, I'd say you need to start with reading at
least one PIC data sheet, also maybe the relevant family manual. At the
very least the sections that have to do with the programming (memory
organization, commands and the like).

And then of course understand your compiler and linker. I'm not sure there
are PIC C compilers out there that can create address independent code. For
what you say you want to do, you may be better off with a Basic interpreter
that can execute code from external serial memory. (If there is one that
can create such p-code address independently.)

Gerhard

2007\01\09@134825 by alan smith

picon face
Hmmmm.....maybe what you want to do is run one of the newer PIC18F in the microprocessor mode, have external memory and overwrite the file.  I've never looked .into this...can you have embedded code and run from external memory..ie...memory mapped of sorts?  So your bootloader is resident, and just updates when required.
 
 Or....
 
 Sometimes you gotta step back and think....is a PIC the best way?  FPGA's can be reloaded on the fly.  For example, the Xilinx Spartan 3E I am currently using can load code from either the top of the external memory, or the bottom.  Might need something external to switch it. Run a pico-blaze or microblaze in the core, but it can get new code and write it out the the external flash and then reboot.
 
 dgdg ghhghg <.....reectogaKILLspamspam.....btinternet.com> wrote:
 Hello,

It is like a bootloader, I am trying to identify the main issues,
if anyone can help then good, otherwise I shall check out
the bootloader.

Can anyone refer me to an explanation how to write, lets say,
1,2,3,4,5 into rom memory ? better still, how to write the
contents of an array a[5] to rom (a[0],a[1]...)

Next issue, I will have a "do nothing" function hard coded,
e.g.

void do_nothing(void)
{
;
}

What do I do to change the contents, I need the rom location
of the function to which I will write, changing the functionality
from "do nothing" to "do something", but keeping the name
"do_nothing"

I also need to reserve bytes in "do_nothing" so that "do someting"
doesn't extend into possible code which is after it.

Also, my code needs to be address independant, assuming the
compiler is unaware that I am actually sending the assembled
code down a serial line.

Thanks.

dgdg ghhghg wrote: Is it possible to send a function to a 18fxxxx pic, what
I mean is that I can send the function by rs232, then
I want the pic to jump to it, so there is a need to
write the ram data to rom so that I can jump into it, has
anyone done something like that?
Thanks.

2007\01\09@151236 by David VanHorn

picon face
I'm not sure what the real problem is here, but maybe an interpreter and a
custom language would serve better.

If it's math problems, then send it as an equation, and let the pic deal
with it.
I've done an interpreter for the AVR, similar to the TCL interpreter in
Verifone credit card terminals.
Both platforms are capable of self-modifying code as well, if need be.

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