KEAZ128 PTB4 output unusual?

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

KEAZ128 PTB4 output unusual?

2,699 Views
pg31321
Contributor III

When I using J-LINK do step by step. PTB4 is correct output. Like LED3 in photo:31729.jpg

But,when I Stand alone by power supplier. PTB4 is strange. Like LED3 in photo:31728.jpg

PTB4 only supply 1.68V. Unlike other PIN supply 5V.

LED1~LED4 are same circuit design.The only difference is using  difference output pin in order PTC2,PTC3,PTB4,PTB5.

What difference between PTB4 with other?

Program like this:

pastedImage_4.png

0 Kudos
Reply
8 Replies

2,494 Views
jiri_kral
NXP Employee
NXP Employee

Hi, 

Isn't your GPIO settigns overwritten by running program? The PTB4 may be used by Analog comparator. Did you check the PTB4 output by osciloscope if it is steady 1.68V or some periodical signal? 

Jiri

0 Kudos
Reply

2,494 Views
pg31321
Contributor III

I have check the PTB4 output by osciloscope.

It is standard DC voltage 1.68V.

P.S

circuit design like it:

dc.jpg

My program just let PTB4 output 5V. There are no other programs here.

0 Kudos
Reply

2,494 Views
jiri_kral
NXP Employee
NXP Employee

Hi, 

with colleague we did some research - and the issue may be caused by SIM_SOPT0 register (which is write once). I'm not sure if you are setting something there, but by default there is NMI functionality Enabled for PTB4. You need to clear bit 1 - NMIE (set to 0). For more details please see reference manual - Chapter 12.2.2 (page 177). Have no chance test it yet. 

Hope it helps. 

Jiri 

0 Kudos
Reply

2,494 Views
pg31321
Contributor III

I have tried diferent board. It has same issue .

try to clear the NMIE . But it is still has same issue.

Program like it:

pastedImage_1.png

typedef struct {
   volatile const uint32_t SRSID;
   volatile uint32_t SOPT0;
   volatile uint32_t SOPT1;
   volatile uint32_t PINSEL;
   volatile uint32_t PINSEL1;
   volatile uint32_t SCGC;
   volatile const uint32_t UUIDL;
   volatile const uint32_t UUIDML;
   volatile const uint32_t UUIDMH;
   volatile uint32_t CLKDIV;
} SIM_Type, *SIM_MemMapPtr;

#define SIM_SOPT0_NMIE_MASK 0x2u
#define SIM_SOPT0_NMIE_SHIFT 1

I can't understand what error with PTB4. Can you give me examples?

My program here:

PTB4.zip - Google Drive 

0 Kudos
Reply

2,494 Views
jiri_kral
NXP Employee
NXP Employee

Hi, 

tested your program with FRDM-KEAZ128 EVB - and there is no issue. I can see steady 5V on PTB4 (because of EVB design I can use only current sinking mode for LED - PTB4=0 -> LED is lite, PTB4=1 ->LED is OFF). 

Try to measure voltage directly on PTB4 PIN (23) and if it is possible - without LED. Also enabling  High current drive for PTB4 may help ( PORT_HDRVE register). 

Jiri 

0 Kudos
Reply

2,494 Views
pg31321
Contributor III

Unexpected,when I remove the resistance which front the PTB4. I measured  it is 5V. I guess I have not success enabling High current drive for PTB4. 

In my program:

SIM_Type SOPT0_0;
SOPT0_0.SOPT0 &= ~(1<<SIM_SOPT0_NMIE_SHIFT);

I have try to enabling High current drive.But it doesn't working?

In addition,I Have not enabling High current drive another pin. Why are they work properly?

Thank for your enthusiastic answer.

 

0 Kudos
Reply

2,494 Views
jiri_kral
NXP Employee
NXP Employee

Hi, 

 

In my opinion - your connection is acting as voltage divider for some reason - but it is hard to say why and how it is possible. 

Jiri 

0 Kudos
Reply

2,494 Views
jiri_kral
NXP Employee
NXP Employee

Hi, 

if your program and circuit is that simple, there must be some issue with MCU. Did you tried diferent board? 

Jiri

0 Kudos
Reply