This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

About P0 and P1

In my application with c167, I want to use PORT0 and PORT1 as general I/O , but it dosen't work. In my application ,I made the
pin EA keep a high level ,and in the code i
initialization the BUSSCON0 as 0 , then i used the ports , but i faild. pls help me ,
and sorry for my poor english! thank you !!

Parents
  • Can I ask if you are really using a C167 and not a XC167?

    When you have the pin /EA high and boot from a RESET you are operating in single chip mode. In single chip mode the C167 operates only with and out of internal resources. No external bus is configured and no external peripherals and/or memory can be accessed. Also no port lines are occupied for the bus interface.

    To utilize PORT0 or PORT1 as outputs you simply need to configure the DPxx for the port you want to control. Then you can read or write P0 and P1 as you desire. Please note the registers for P0 and P1 can only be address bytewise (for example P0L, P0H, P1L or P1H).

Reply
  • Can I ask if you are really using a C167 and not a XC167?

    When you have the pin /EA high and boot from a RESET you are operating in single chip mode. In single chip mode the C167 operates only with and out of internal resources. No external bus is configured and no external peripherals and/or memory can be accessed. Also no port lines are occupied for the bus interface.

    To utilize PORT0 or PORT1 as outputs you simply need to configure the DPxx for the port you want to control. Then you can read or write P0 and P1 as you desire. Please note the registers for P0 and P1 can only be address bytewise (for example P0L, P0H, P1L or P1H).

Children