好的,没有火焰,但是你的方法是天真的,没有考虑GPIO端口一般如何操作的特殊性质,以及PIC16F628 A的目标特定要求。PIC16F628 A是一个过时的设备,不应该用于任何新的设计。我知道有很多关于这个特定设备的信息在互联网上,但在某些时候你需要继续前进。你的特定任务是读取POTB上的4、5、6、7位的输入状态,然后将这些状态输出到POTB的0、1、2、3位。这是可能的代码:这个代码是UNTES。特德。你独自一人完成这项任务,希望你的课程成绩好。
以上来自于百度翻译
以下为原文
OK, no flames but your approach is naive and fails to consider the "special" nature of how GPIO ports must operate in general and the target specific requirements of the PIC16F628A.
The PIC16F628A is an archaic device that should not be used for any new design. I know there is a lot of information about this specific device on the internet but at some point you need to move on.
Your particular task is to read the input states of bits 4,5,6,7 on PORTB then output those states on bits 0,1,2,3 of PORTB.
This is code that is likely to to that: movlw 0xF0 ; Bit mask to make bits 4-7 inputs, 0-3 outputs
banksel TRISB ; Select bank where TRIS register is
movwf TRISB ; Make PORTB bits 4-7 inputs, 0-3 outputs
banksel PORTB ; Select bank where PORT register is
swapf PORTB,W ; Use nibble swap to read PORTB bits 4-7 and store them in WREG bits 0-3
movwf PORTB ; Write to output bits 0-3
This code is UNTESTED. You are on your own with that task.
Hope you do well in your course.
好的,没有火焰,但是你的方法是天真的,没有考虑GPIO端口一般如何操作的特殊性质,以及PIC16F628 A的目标特定要求。PIC16F628 A是一个过时的设备,不应该用于任何新的设计。我知道有很多关于这个特定设备的信息在互联网上,但在某些时候你需要继续前进。你的特定任务是读取POTB上的4、5、6、7位的输入状态,然后将这些状态输出到POTB的0、1、2、3位。这是可能的代码:这个代码是UNTES。特德。你独自一人完成这项任务,希望你的课程成绩好。
以上来自于百度翻译
以下为原文
OK, no flames but your approach is naive and fails to consider the "special" nature of how GPIO ports must operate in general and the target specific requirements of the PIC16F628A.
The PIC16F628A is an archaic device that should not be used for any new design. I know there is a lot of information about this specific device on the internet but at some point you need to move on.
Your particular task is to read the input states of bits 4,5,6,7 on PORTB then output those states on bits 0,1,2,3 of PORTB.
This is code that is likely to to that: movlw 0xF0 ; Bit mask to make bits 4-7 inputs, 0-3 outputs
banksel TRISB ; Select bank where TRIS register is
movwf TRISB ; Make PORTB bits 4-7 inputs, 0-3 outputs
banksel PORTB ; Select bank where PORT register is
swapf PORTB,W ; Use nibble swap to read PORTB bits 4-7 and store them in WREG bits 0-3
movwf PORTB ; Write to output bits 0-3
This code is UNTESTED. You are on your own with that task.
Hope you do well in your course.
举报