On Wed, May 26, 2010 at 10:47:50AM +0200, Maarten Brock wrote:
> Peter,
> 
> Since the W7100 uses the value of P2 for MOVX @Ri instructions, P2 should
> have the correct value. SDCC supports only one page of 256 bytes and sets
> P2 to the correct value during startup (not neccesarily 0). If you also
> use P2 for an LCD then either don't use PDATA or be very careful around
> accesses to the LCD (save/restore P2 and no pdata access in between).
> 
> Maarten
> 

        Thanks that is very helpful! Unfortunatly I think P2 was a bad choice
of data register on Wiznet's part :-). The LCD needs stable data for reasonably
long periods (in the msec at times) and there are interrupts occurring which
may want to use movx @Ri instructions. I expect the appropriate (i.e. working
:-)) answer is to change the hardware to use a different port for the LCD
data now I see where the problem likely is. This started out as atoi returning
wrong values and tracing that indicates that it is using movx @r0 instructions
and if P2 is an odd value it will write on random memory in xdata with likely
unfortunate results ...

Peter Van Epp


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

_______________________________________________
Sdcc-user mailing list
Sdcc-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/sdcc-user

Reply via email to