CCS C Software and Maintenance Offers
FAQFAQ   FAQForum Help   FAQOfficial CCS Support   SearchSearch  RegisterRegister 

ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

CCS does not monitor this forum on a regular basis.

Please do not post bug reports on this forum. Send them to support@ccsinfo.com

There's a way to clear all the RAM(non SFRs) at once?

 
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion
View previous topic :: View next topic  
Author Message
E_Blue



Joined: 13 Apr 2011
Posts: 406

View user's profile Send private message

There's a way to clear all the RAM(non SFRs) at once?
PostPosted: Thu Apr 25, 2019 8:34 am     Reply with quote

Again, the device is a PIC24FJ1024GB610 and I'm trying to port PIC18F code to PIC24FJ device.

On PIC18F I was using the following code to clear the GPRs (Non SFR RAM)

Code:

void CleanRAM()
{
        #asm
        movlw   0x0F
        movwf   FSR0H
        movlw   0x3F
        movwf   FSR0L
NextByte:               
        clrf    POSTDEC0
        tstfsz  FSR0H
        bra     NextByte
        tstfsz  FSR0L
        bra     NextByte
        clrf    INDF0
        #endasm
}



I was think in to use pointers but CCS will put that pointer in the same memory that I'm trying to erase(set to zero) so this ain't going to end well.

Any suggestion about how to get this goal?
_________________
Electric Blue
Ttelmah



Joined: 11 Mar 2010
Posts: 19215

View user's profile Send private message

PostPosted: Thu Apr 25, 2019 8:44 am     Reply with quote

#ZERO_RAM
E_Blue



Joined: 13 Apr 2011
Posts: 406

View user's profile Send private message

PostPosted: Thu Apr 25, 2019 9:16 am     Reply with quote

Thanks!
_________________
Electric Blue
Display posts from previous:   
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion All times are GMT - 6 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group