|
|
View previous topic :: View next topic |
Author |
Message |
jharkins Guest
|
Initializing a port on download? |
Posted: Thu Mar 13, 2003 2:01 pm |
|
|
I've got a new 18F452 based board that has a CPLD who's chip select is port C pin 5, active low. Unfortunatly, right after download that pin is low, so my CPLD is selected. Even more unfortunate, the CPLD uses the ICD-S lines. The upshot is I can't run this thing with ICD attached.
Is there a way, like a #rom or something, to have port C pin 5 start out hi? I understand that I won't be able to use the ICD whilst talking to my CPLD, I can live with that. But I'd sure like to use it when I'm not using the CPLD.
___________________________
This message was ported from CCS's old forum
Original Post ID: 12634 |
|
|
PCM programmer
Joined: 06 Sep 2003 Posts: 21708
|
Re: Initializing a port on download? |
Posted: Thu Mar 13, 2003 11:32 pm |
|
|
:=I've got a new 18F452 based board that has a CPLD who's chip select is port C pin 5, active low. Unfortunatly, right after download that pin is low, so my CPLD is selected. Even more unfortunate, the CPLD uses the ICD-S lines. The upshot is I can't run this thing with ICD attached.
:=
:=Is there a way, like a #rom or something, to have port C pin 5 start out hi? I understand that I won't be able to use the ICD whilst talking to my CPLD, I can live with that. But I'd sure like to use it when I'm not using the CPLD.
-----------------------------------------------------------
As I said in the thread below, Port C, Pin 5 starts out as
an input, after power-up. I guess you didn't want to try
adding a 10K pull-up to that line.
You said that right after download, that pin goes low.
I would guess that your code in the PIC is setting it low.
To answer your question, you don't use #rom to set the
state of the i/o pins, you use code. You could use this:
output_high(PIN_C5);
As a test, why don't you set that pin high, right at the
start of the program, and then put in a long delay. Example:
main()
{
output_high(PIN_C5);
delay_ms(5000);
// Put other code here.
while(1);
}
See what happens.
------------------------
I have another comment:
I don't have ICD, so I'm not that familiar with it.
I assume that during download, the ICD is using ICSP mode
to program the PIC.
It's my understanding that "downloading" and "debugging"
are two separate processes with the ICD, and that you
can disable debugging. I don't know if this is causing
your problem, but if you have debugging enabled, why not
try disabling it ? Then presumably, the ICD won't try
to communicate with the PIC after download. And it won't
give you an error.
___________________________
This message was ported from CCS's old forum
Original Post ID: 12660 |
|
|
jharkins Guest
|
Re: Initializing a port on download? |
Posted: Fri Mar 14, 2003 10:03 am |
|
|
Sorry, I don't know why my reply to your reply (the original thread) started a new thread (this one), that wasn't my intention.
I tried putting while(1); right after main(), it didn't help. ICD downloads the program, then says it can't take control of the board. I don't have time to put a pullup on the port, I'm leaving town for a week at noon today.
Thanks for your help.
___________________________
This message was ported from CCS's old forum
Original Post ID: 12670 |
|
|
|
|
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
|