Specific GPIO problems on GT16A

取消
显示结果 
显示  仅  | 搜索替代 
您的意思是: 

Specific GPIO problems on GT16A

1,659 次查看
shiloh
Contributor I
I have used the GT32/GT60 MCUs quite a bit and I am having a problem getting some code of mine to work properly on a GT16A.  I have six LEDs connected through a resistor array to the GT16A at pins 2 through 7 (PTC0 through PTE1).  In my code, I set the direction to output for all of these pins and then I set the individual pins high or low throughout the rest of my code.  The problem is that the PTC0, PTC1, and PTC2 pins do not reflect the values I set from my code.  But PTC3, PTE0, and PTE1 all work as expected.
 
For example, here is some of my code:
 
void TurnOnAllLights( void ){
  /* turn on all of the lights */
  PTCD_PTCD0=0; // does not work
  PTCD_PTCD1=0; // does not work
  PTCD_PTCD2=0; // does not work
  PTCD_PTCD3=0; // LED works
  PTED_PTED0=0; // LED works
  PTED_PTED1=0; // LED works
}
 
 
It acts like a serial module is grabbing the pins, but I am not using any serial ports in my code.  I even added code to explicitly disable TX and RX for the serial ports, but that did not help. 
 
I have looked through my schematic and my code, and I just do not see any reason that I would not be able to get the PTC0, PTC1, and PTC2 pins into GPIO output mode.  I have never had this problem with the GT32/GT60, and this is my first time using the GT16A.  Is there something obvious that I may have overlooked?  Maybe something specific to the GT16A?
标签 (1)
0 项奖励
回复
2 回复数

920 次查看
peg
Senior Contributor IV
Hello shiloh,

I have used the GT16A quite a lot. I have a product that runs these pins to an expansion header. Sometimes they are GPIO and other times the second serial port is implemented with RS-485. I can tell you for sure that PC2 works as an input. I set PC0&1 to output when the serial port hardware is not there but have never actually tested it works. AFAIK there is nothing special to do here.

0 项奖励
回复

920 次查看
shiloh
Contributor I
I have spent several hours on this today and still cannot get PTC0, PTC1, or PTC2 to work as output GPIO pins.  I have never had this problem with any GT32 or GT60.  If I had to guess, I would say the SCI module is grabbing the pins, but it is not enabled.  This is really strange.
 
Maybe there is something wrong with the MCU I have soldered to my board, but everything else seems to work properly, including GPIO on PTC2, PTE0, PTE1, and TPM input and output on TPM1CH0, TPM1CH1, and TPM2CH0.
 


Message Edited by shiloh on 2009-02-05 08:24 PM
0 项奖励
回复