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

Program is STUCK in E3 board, now what?

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



Joined: 20 Dec 2014
Posts: 69
Location: Arizona

View user's profile Send private message Visit poster's website

Program is STUCK in E3 board, now what?
PostPosted: Wed Dec 31, 2014 11:27 am     Reply with quote

Hello all,

We purchased the E3 / book combo listed on the CCS web site to learn C. We are about half way through the book, and the learning is going well. Until now.

We are doing the chapter on interrupts. The book has you type in this code to show how it works:

Code:
#include <e3.h>
#include <ios.h>    //must have for cout to work

int count;
#int_ext
void button_isr(void)  {
count++;
}

void main() {

 count = 0;
 enable_interrupts(INT_EXT_H2L);
 
 enable_interrupts(GLOBAL);
 
 while(true)  {
   delay_ms(1000);
   cout << "we got " << count << " interrupts" << endl;
   
 }   
}

Now here is the problem - the book is packed full of typos and here is another example, the button that initiates the interrupt is on int1 not int0 as the program shows and wont work. But once I loaded this program, now I cant replace it with any thing! When I compile even my tested lamp flashing program and load it it is still running the failed program. Just keeps on sending the message to the terminal "we got 0 interrupts" every second.

How do I fix this? why is the program stuck in the flash and cant be changed now?

Thanks.
temtronic



Joined: 01 Jul 2010
Posts: 9134
Location: Greensville,Ontario

View user's profile Send private message

PostPosted: Wed Dec 31, 2014 11:55 am     Reply with quote

I don't have any of that stuff but....
as to not being able to load a previous working program...

1) if using the bootloader are the USB connections OK? PC sees the device,etc??

2) I'd think you should be able to 'erase' the current program without deleting the bootloader.

3) the software is put into the wrong folders on the PC?

4) not the real admin ?

5) delete AND erase all the software, reinstall from scratch , following the directions from CCS

6) contact CCS at their official support website.....


hth
jay
Arizona Chris



Joined: 20 Dec 2014
Posts: 69
Location: Arizona

View user's profile Send private message Visit poster's website

stuck
PostPosted: Wed Dec 31, 2014 12:19 pm     Reply with quote

Jay, my suspicion is that the bootloader is corrupt, so I cant update the program. I'm using the exact same setup I've used for weeks now to put programs into the E3 which have worked fine. Nothing has changed. I tried other USB ports, hitting "clean" and recompiling, but its never changing the program.

It may be a coincidence that the interrupt example program crashed it.

Is there a way to totally wipe the program with this bootloader intact I don't see like in MPLAB where I can "blank" a chip with my chip burner any function for this via CCS ide. Maybe I have to reinstall the bootloader? I wonder how you do that?

Anyones thoughts on this is appreciated.

Chris
PCM programmer



Joined: 06 Sep 2003
Posts: 21708

View user's profile Send private message

PostPosted: Wed Dec 31, 2014 12:29 pm     Reply with quote

Quote:
with my chip burner

If you have a PIC programmer, and you have the .hex file for the
bootloader, then you could connect the programmer to the ICSP
connector on the E3 board and re-program the 18F14K50 with the
bootloader code. Then you would be back in operation.
ELCouz



Joined: 18 Jul 2007
Posts: 427
Location: Montreal,Quebec

View user's profile Send private message

PostPosted: Wed Dec 31, 2014 12:42 pm     Reply with quote

Too bad the CCS support is down 31th to Jan 1st...

They will reply on Jan 2nd tho Smile
_________________
Regards,
Laurent

-----------
Here's my first visual theme for the CCS C Compiler. Enjoy!
Arizona Chris



Joined: 20 Dec 2014
Posts: 69
Location: Arizona

View user's profile Send private message Visit poster's website

Got it working - the book is still a frustration.
PostPosted: Wed Dec 31, 2014 12:59 pm     Reply with quote

I have now changed this post 3 times as I find new issues. What I found was when you open a new source file, compile it, it was not reading it was compiling the file I had open! It kept on re compiling the source file that was stuck in the chip. I went under Options tab, and UNCHECKED the "Recall Open Files" checkbox. Problem gone.

Both me and my young son who are learning C for the first time together are both excited and pulling our hair out over this book! My 15+ years as a embedded micro controller programmer in other languages has given me patience. I have no hair left.

Chris
temtronic



Joined: 01 Jul 2010
Posts: 9134
Location: Greensville,Ontario

View user's profile Send private message

PostPosted: Wed Dec 31, 2014 1:37 pm     Reply with quote

ah the 'fun' of learning something new......
I kept getting 'stung' by the MPLAB 'debug' mode until I email Microchip,talked to a senior support tech and he showed how to alter MPLAB to default to 'release' instead of 'debug'. Newer versions allow for this but 5 years ago........
sigh...
That PIC seems like a winner so I ordered 6 to 'play ' with.....

cheers
Jay
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