Sign in

username:

password:



Not a member?

Search rabbit-semi



Search tips

Subscribe to rabbit-semi



Ads

Discussion Groups

Discussion Groups | Rabbit-Semi | _GetFlashID Returning Garbage

This is a group for folks designing and programming embedded systems using the Rabbit Semiconductor C-programmable microcontroller. Rabbit Semi is a spin-off from Z-World who makes a variety of embedded modules and tools. This group is not affiliated with either Rabbit or Z-World, but is a user forum for sharing ideas, asking questions, flaunting knowledge, and other typical user group stuff. The Rabbit is a powerful uC, supported by a full-featured C-compiler.

_GetFlashID Returning Garbage - Matt - Apr 8 20:59:14 2008

Hi,

I have a question about using _GetFlashID (located in FLASHWR.LIB) to
obtain the flash id. I am using Dynamic C 8.61 with a Rabbit 2000
running a program in RAM to obtain the flash id. There is only one
external flash chip in our setup and it will be either a SST39SF020A
or an AM29F040B, both are supported by Dynamic C. When I run the
program with the SST chip it returns C8 69, which I believe to be
garbage since the id is BF B6. When I run the program with the AMD
chip the id is returned as 00 00.

Has anyone else used _GetFlashID in a similar way? Does anyone have
an idea as to why this is happening?

Thanks for your help.

Here is my call to _GetFlashID in my RAM program:

#asm
#ifdef __SEPARATE_INST_DATA__
#if __SEPARATE_INST_DATA__
ld hl, _GetFlashID
lcall _CallRAMFunction
#else
call _GetFlashID
ld (id), hl
#endif
#else
call _GetFlashID
ld (id), hl
#endif
#endasm

------------------------------------



(You need to be a member of rabbit-semi -- send a blank email to rabbit-semi-subscribe@yahoogroups.com )


Re: _GetFlashID Returning Garbage - Matt - Apr 28 8:21:11 2008

The solution was simple, use a static variable for the value from the
assembly code. Only variables that are of the type static or auto can
hold a value from the assembly code. I gather this is based on the way
static variables are stored in memory.
------------------------------------



(You need to be a member of rabbit-semi -- send a blank email to rabbit-semi-subscribe@yahoogroups.com )