Having just started with the K60, the first thing I found was the disabled pins - such as PTE4 and PTE5.
I need to enable the pins and set the ALT function to the UART. I also require 4 uarts...
I set the user_config.h to enable the TTYx set and ttya: is transmitting correctly.
Any thoughts or demo code I can get a bootstrap from?
Brian
Solved! Go to Solution.
Thanks Luis - I'll try it and get back shortly!
A non-obvious spot to set stuff!
Thanks,
Brian
Edit: OK, I see. I also imagine that the I2C and the other buses work in a similar way.
Many thanks for pointing me in the right direction!
Here's another problem, but is associated with the first issue: When I change from one "ALT" function to another. do you have some magic code to illustrate this function? What I'd like to do is save off the initial function and invoke the second, third, etc. and be able to go back and forth between the functions.
Thanks again Luis!
Brian
Hello,
Go to the file:
C:\Freescale\Freescale_MQX_4_0\mqx\source\bsp\twrk60n512\init_gpio.c
Make the modifications you need in ports (ALT) and rebuild the BSP.
Function:
_mqx_int _bsp_serial_io_init
(
/* [IN] Serial device number */
uint_8 dev_num,
/* [IN] Required functionality */
uint_8 flags
)
{
SIM_MemMapPtr sim = SIM_BASE_PTR;
PORT_MemMapPtr pctl;
/* Setup GPIO for UART devices */
switch (dev_num)
{
case 0:
pctl = (PORT_MemMapPtr)PORTD_BASE_PTR;
if (flags & IO_PERIPHERAL_PIN_MUX_ENABLE)
{
/* PTD6 as RX function (Alt.3) + drive strength */
pctl->PCR[6] = 0 | PORT_PCR_MUX(3) | PORT_PCR_DSE_MASK;
/* PTD7 as TX function (Alt.3) + drive strength */
pctl->PCR[7] = 0 | PORT_PCR_MUX(3) | PORT_PCR_DSE_MASK;
……
Luis
Thanks Luis - I'll try it and get back shortly!
A non-obvious spot to set stuff!
Thanks,
Brian
Edit: OK, I see. I also imagine that the I2C and the other buses work in a similar way.
Many thanks for pointing me in the right direction!
Here's another problem, but is associated with the first issue: When I change from one "ALT" function to another. do you have some magic code to illustrate this function? What I'd like to do is save off the initial function and invoke the second, third, etc. and be able to go back and forth between the functions.
Thanks again Luis!
Brian