GPIO_LDD on Kinetis K60: How to set the pull-up/pull-down resistors? + initialization problems....

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

GPIO_LDD on Kinetis K60: How to set the pull-up/pull-down resistors? + initialization problems....

Jump to solution
3,016 Views
drb
Contributor II

Hello,

 

 I am currently having two issue with Processor Expert for K60.I am currently using CW 10.1 + MQX 3.8.

 

#1) I am trying to look for the pull-up/pull down resistors on GPIO_LDD? How do I set it using PE?

 

 

#2) I have a custom board for K60 using 4MHz crystal oscillator. When I try to debug it, it loses its connection to the Multilink. I traced the code and found that when I comment this line:

//PORTA_PCR5 = (uint32_t)((PORTA_PCR5 & (uint32_t)~0x01000000UL) | (uint32_t)0x0700UL);

 

on the CPU.c file on the function void PE_low_level_init(void), i can debug the code. Whenever I generate a new Process Expert code, this line is always generated. Thus, I always manually uncomment this line to make things work. Is there a workaround for this?

 

Thank you so much.

Labels (1)
0 Kudos
Reply
1 Solution
1,245 Views
ProcessorExpert
Senior Contributor III

Hello,

 

#1), 

Please find attached pdf file that describes the setting of electrical features on Kinetis. The section from the pdf has been transfromed as cheatsheet for CW V10.2.

 

#2), #3), #4)

Could you please post here the PEx project in order to reproduce all your problems?

 

#5)

Please post this question on the MQX forum.

 

best regards
Vojtech Filip
Processor Expert Support Team

View solution in original post

0 Kudos
Reply
6 Replies
1,245 Views
drb
Contributor II

I also have a follow up question. I experienced something strange today.

 

#3) I have two GPIO LLD (one for PORTD and one for PORTE). When I try to add another GPIO LLD for PORTC (I even tried changing it to different port - PortB) , my program doesnt work. I can see from the debugger that it goes to Low Power Wait and none of the tasks are executed.  When I remove the newly created GPIO LLD, it works. 

 

Another test I did: after removing the newly created GPIO LLD, I tried to add a SerialLLD component. My program also worked.

 

My question is that, is there a maximum limit of components I can add? I currently have two GPIO LLD (for PORTD - 2 bits for LED- and PORTE -8bits for DIP switch addressing-) on my program. Adding a third one (for PORTC, just 1 bit for RS485 control pin), unexpectedly results in having the MCU enter "Low Power Wait Mode".

0 Kudos
Reply
1,245 Views
drb
Contributor II

#4) I have this simple routine to send data via rs485 line (just purely sending data, no receive yet). I only have one main task (for debugging only).

 

void hal_rs485_SendBlock(LDD_TData *buff,u16 buffSz)
{
//PROCEXP_RS485_SendBlock();
bTransmitDone=89;
PROCEXP_GPIO_PORTC_SetFieldBits(PROCEXP_GPIO_PORTC_DeviceData,PIN_RS485,1);
RS485SENDBLOCK(RS485DEVDATA, buff, buffSz);
//PROCEXP_GPIO_PORTC_ClearFieldBits(PROCEXP_GPIO_PORTC_DeviceData,PIN_RS485,1); << PROBLEMATIC LINE
}

 

When I add the problematic line (generated by Processor Expert), my main task stops (go into Low Power Wait mode). When I uncomment it, everything is ok again. I can't actually fathom the problem. Maybe there is something I am missing here?

 

#5) Is there a way to start a new clean project for MQX + PE? I am looking for a document for this but the procedures I got is in FSL_MQX_in_CW_10_x.pdf wherein it reuses an existing project. We are planning to create projects with separate BSPs (because of different PE configurations).

0 Kudos
Reply
1,245 Views
drb
Contributor II

Please disregard my question #3:

 

I added SerialLLD + GPIOLLD at the same time, then it suddenly became ok.Though I am still mystified. :smileysurprised:

0 Kudos
Reply
1,246 Views
ProcessorExpert
Senior Contributor III

Hello,

 

#1), 

Please find attached pdf file that describes the setting of electrical features on Kinetis. The section from the pdf has been transfromed as cheatsheet for CW V10.2.

 

#2), #3), #4)

Could you please post here the PEx project in order to reproduce all your problems?

 

#5)

Please post this question on the MQX forum.

 

best regards
Vojtech Filip
Processor Expert Support Team

0 Kudos
Reply
1,245 Views
drb
Contributor II

Hello,

 

#1 )Thank you so much for the reference document, the pull-ups and pull-down are now working.

 

#2 )The program is working fine on the TWR. But on the custom board I need to comment that line. Anyway, this is not a major stopper and I could deal with it by manually commenting the line. :smileyhappy:

 

#3 - #4) )The program is now working fine. I think there are some things in the MQX that I need to deal with and doesn't have to do with the Processor Expert

 

 

Thank you so much

0 Kudos
Reply
1,244 Views
luisgallegos
Contributor III

Hello.

Do you still have the pdf you talk about in this thread? Could you make it available? I can't find it here, I don't know if it was removed.

I am also trying to set the internal pull-up resistors, but for a Kinetis L. I think internal resistors are not available for Kinetis series devices, I would just like to make sure.

Thanks.

0 Kudos
Reply