Well, I'm having a bit of trouble with come code so firs let me describe the context: PIC-18 from Hi-tech + MPLAB -> HEX file JOLT Bootloader (so the pic-18 has the -a0x200 modifier to add the offset for the bootloader) PIC18F452 @ 24MHz (6MHz and HS-PLL mode) lcd display with well known working routines rs-232 serial interface WDT - OFF BOD - OFF OSC_SW - OFF Ok, the program I made worked fine, real fine until last Friday. What it does? Well, it's a simple menu application, it has lots of pointers and stuff like that, but it DOESN'T have any function pointers. The actual problem is that when a insert some lines of code (meaningless lines) the code refuses to work properly. For example, adding "send_232_byte( DATA)" makes the program reset. Let's clear that up. The send_232. routine is a working thing, tested on many projects and it's actually a simple polling send routine. When I said reset, I mean that the program resets itself (sometimes) periodically. Perhaps I remove that line and everything seems to work, but if I add, for example, "a = a/5;" it's fails again, always the same way. The code, as I said, has a 60 items struct (40 bytes each) plus some more long arrays of data. The code also has a long (18 items) switch/case statement, which I read gives some problem, but I'm not sure and couldn't really find more info on that. Yeah, I know, you are thinking "it's the stack man!" mmmm sorry but don't think so. The map file shows me that the stack never reach the 8th level. and it has 32.. Also manually put a "goto $" at address 0xFFFE to see it the program reaches that address and roll back to address 0 but nothing happened, the code keeps reseting. I have placed a copy of the code and bootloader code for anyone who can help at www.janso.com.ar/download/files.zip there is a file something_test that you shoul ignore. Oh, I've tried to manually save the code to the pic and It also fails to work properly (no bootloader, and not offset) Also, there is another (related) problem: If I remove the global optimization option -ZgN the code fails to work completely, it actually prints all 0's to the LCD display instead of the usuall screen, that realy knock me out. Any ideas? Best regards, Mauricio D. Jancic Janso Desarrollos - Microchip Consultant (54) 011 - 4542 - 3519 Lugones 3238 "B" - C1430ECN www.janso.com.ar info@janso.com.ar MSN: jansodesarrollos@hotmail.com -- http://www.piclist.com hint: The PICList is archived three different ways. See http://www.piclist.com/#archives for details.