View previous topic :: View next topic |
Author |
Message |
RobS
Joined: 29 Jan 2005 Posts: 10
|
port pin behavior on reset question |
Posted: Wed Jul 27, 2005 6:11 pm |
|
|
I'm using the 18LF8720 and the ICD 2 as a debugger with MPLAB ver 7.10. Compiler is PCWH ver 3.206.
Port F pins F1 and F4 are set up as outputs (SET_TRIS_F( 0x2c ). The program sets them both high and this is confirmed by stoping operation and viewing PORTF SFR bits 1 and 4 in a watch window. A Process Reset (hot key F6) is issued in MPLAB. Bit 1 is set to 0 but not bit 4 as viewed in the watch window. Operation is continued by pressing hot key F9. After stopping operation port F is viewed again. Bit 1 and bit 4 are now both high.
I understand they should both be high when operation resumed because nothing sent them low. Why does bit 1 go low with a reset? Why does bit 4 not go low with the reset? Both outputs are pulled down with a 10K resistor.
thanks |
|
|
Ttelmah Guest
|
|
Posted: Thu Jul 28, 2005 2:13 am |
|
|
Look at the data sheet. By default, the TRIS register is setup to make all pins inputs on a reset. This will be the setting, till you reach your TRIS instruction. Though you say both have pull-down resistors (which should then make them both go to '0'), are these enough to actually pull-down the pins with the circuitry attached?.
Best Wishes |
|
|
|