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

pic 16LF1825 brownout reset when wake up

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



Joined: 19 Jan 2013
Posts: 5

View user's profile Send private message

pic 16LF1825 brownout reset when wake up
PostPosted: Mon Feb 18, 2013 7:40 am     Reply with quote

Hi,
I am running following code to wake up from sleep when receiving char
over rs232 on 16F1825 and it is running fine, when programmed
same code to 16LF1825 a brownout reset occuring instead of wake up.
Everything is same - board design, power, hex etc...
the only difference is 16F1825 is DIP package and 16LF1825 is QFN.
the same occurs when i use change on PORT A interrupt for wake
up source.
Any ideas?
Code:

#include <16LF1825.h>
#FUSES INTRC_IO,NOWDT,NOPUT,NOMCLR,NOPROTECT,NOCPD,BROWNOUT_NOSL,NOCLKOUT,NOIESO,NOFCMEN,NOSTVREN,BORV19,NODEBUG,NOLVP
#use delay(clock=16000000)
#use rs232 (baud=9600,parity=N,bits=8,xmit=PIN_c4, rcv=PIN_c5)
#bit  WUE_BIT=GETENV("BIT:WUE")

int8 dummy=0;
int8 stat=0;

void main(void)
{
SETUP_DAC(dac_off);
setup_comparator (nc_nc_nc_nc);
setup_adc(ADC_OFF);
setup_adc_ports(NO_ANALOGS);
setup_ccp1(ccp_off);
setup_vref(VREF_OFF);
setup_spi(SPI_DISABLED );
SETUP_WDT(WDT_OFF);
port_a_pullups(false);
port_c_pullups(false);
delay_ms(100);

stat=RESTART_CAUSE();
printf("Startup reset=%02X\r\n",stat);delay_ms(10);

setup_timer_0 (RTCC_INTERNAL | RTCC_DIV_8);
//setup_timer_1(T1_EXTERNAL | T1_DIV_BY_1  |T1_ENABLE_T1OSC); 
//setup_timer_1(T1_DISABLED);
setup_timer_2(T2_DISABLED,0,1);
//setup_timer_3(T3_DISABLED|T3_DIV_BY_1);

set_tris_a(0b00000000);
set_tris_c(0b00100000);

output_high(PIN_A0);   output_high(PIN_A1);  output_high(PIN_A2);
output_high(PIN_A3);   output_high(PIN_A4);  output_high(PIN_A5);

output_high(PIN_c0);   output_high(PIN_c1);  output_high(PIN_c2);
output_high(PIN_c3);   output_high(PIN_c4);  output_float(PIN_c5);

enable_interrupts(global);


while(1)
   {
   WUE_BIT=1;
   clear_interrupt(int_rda);       enable_interrupts(int_rda);
   sleep(); delay_cycles(1);
   printf("\r\nwake up\r\n");delay_ms(100);
   }

} //end of main()
         
#int_RDA
RDA_isr()
{
dummy=getc();
}
jeremiah



Joined: 20 Jul 2010
Posts: 1322

View user's profile Send private message

PostPosted: Mon Feb 18, 2013 3:41 pm     Reply with quote

The LF chip has some low power settings that the F chip does not. I would start there and see if any of the defaults would cause your problem. Also, what voltage are you operating the PIC at?
zmtek



Joined: 19 Jan 2013
Posts: 5

View user's profile Send private message

PostPosted: Mon Feb 18, 2013 4:02 pm     Reply with quote

i am running it 3.3v down to 2.5V.. I searched data sheet and errdata but
can not find any setting related to LF version :(
PCM programmer



Joined: 06 Sep 2003
Posts: 21708

View user's profile Send private message

PostPosted: Mon Feb 18, 2013 6:48 pm     Reply with quote

I looked in the errata sheet for the 16LF1825 and there's nothing on
brownout. I also checked all the older revisions of the errata and
there's nothing either.

But it still really sounds like an errata. So I kept checking. I found this
post on the Microchip forum, which is for a PIC in the same family:
http://www.microchip.com/forums/m591855.aspx
I think this errata is what you have. Here's the errata sheet for
the 16LF1826. Read the section on Brownout:
http://ww1.microchip.com/downloads/en/DeviceDoc/80485K.pdf
It also affects the "Brownout Nosleep" mode. It lists some work-arounds
that you can try.

If you can confirm that it's the same errata, you should report it to
Microchip so they can add it to the 16LF1825 errata sheet.
zmtek



Joined: 19 Jan 2013
Posts: 5

View user's profile Send private message

PostPosted: Thu Feb 21, 2013 10:44 am     Reply with quote

The solution in 16f1826 errata works (I switched to brownout_sw and switch off brownout before entering sleep mode). Thank you!
I posted the problem in Microchip official forum and I hope they will update the errata.
Best regards
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