PDA

View Full Version : 18F8722 and MPASM confusion!



Jackson
- 1st April 2006, 21:54
Hi all,

I'm using a 18F8722 with PBP and MPASM, and can't for the life of me get port E to act like a normal digital I/O port.

The datasheet for the PIC says that after a power up reset the port comes up in digital I/O mode, but then goes on to say that in 80-pin devices, the EBIDS bit (7) of MEMCON must be cleared first!

Well, MPASM is absolutely new to me, and I see all those names called out in a 'P18F8722' file in the MPASM directory, but don't really know what to do next. Do I need to include this file somehow in my project before those names will be recognized? How do you do that?

If not, I can see in the file that the hex address for the MEMCON register is 09FCh. (It says so in the datasheet, and in the MPASM file). I tried just taking a 'shortcut' (not) and including the following:

@ __CONFIG 09FCH, 10000000B (to set bit 7)

but the compiler said 09FCh wasn't a good address! Can someone help me make port E a normal digital i/o?

Thanks very much,
Jackson

Dave
- 1st April 2006, 22:10
Jackson,TRISE = %11111111 for all pins programmed as inputs or TRISE=%00000000 for all pins programmed as outputs. It works for me......

Dave Purola,
N8NTA

Jackson
- 1st April 2006, 22:18
oh, that scares me... cause it doesn't work for me! I take it you didn't go through any config monkey business, it just came up in digital. Thanks!!

Bruce
- 1st April 2006, 22:36
MEMCON isn't a config word setting. It's a special function register.

@ __CONFIG is only valid for "config word" settings. It has nothing to do with
"special function registers".

If you just need to set MEMCON.7, then MEMCON.7 = 1 should be all you
need.

Jackson
- 2nd April 2006, 01:24
Thanks Bruce