PDA

View Full Version : How to use TRIS on a ICD programs



timseven
- 9th August 2009, 02:54
Hi, I am a newbie on this forum and first of anything I want to thank you and said hello to everybody out there.
As a beginner I am using PicBasic Pro, MicroCode Studio a serial programmer TE-20 and a Lab-x3 board for ICD learning. I think the In-Circuit Debugger is a must for a person that wants to know the PIC programming in depth. I have ran the first few model programs for my 16F628 pic and now I am getting into more complex programming. I am using the same pic on my new project that uses the first four pins of the port A as inputs and also the last four pins of port B as outputs. So what I do first on the program is load TRISA with $0F and TRISB with $0F so I let free the RB1 [RX] and RB2[TX] to be use by the ICD program for the MAX232 communication ability. When I compile, write and run the program for ICD the instructions are stopped as soon as the two lines “TRIS” are read. If I take out these two lines and compile it again there is no problem running the program but of cause it does not do what it should. I have looked everywhere for how to use these TRIS command on programs that run as ICD with no luck. Please, help me. Thanks.

Darrel Taylor
- 9th August 2009, 21:02
Try using ...

TRISB = $0B

or

TRISB = %00001011
<br>

timseven
- 9th August 2009, 23:51
Thank you, but what about TRISA ?

Darrel Taylor
- 10th August 2009, 00:03
Do whatever you need to with TRISA.

I just figured that since MicroCode Studio uses the USART for communications...

Setting RB2[TX] to INPUT, would probably stop communications with the ICD.
<br>

timseven
- 10th August 2009, 01:12
Thanks, you are right is working now. Thank you.