This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts

uart configuration putty?

Hi,

I am new to MCUs and I am trying to send information from NRF51 via UART (not BLE UART) to Putty. No matter what I try I can't seem to print anything on Putty. I started working with the template file under peripherals. The file produces no errors on keil.

I am using NRF_LOG_PRINTF statement. Here is the code:

    /* Copyright (c) 2009 Nordic Semiconductor. All Rights Reserved.
 *
 * The information contained herein is property of Nordic Semiconductor ASA.
 * Terms and conditions of usage are described in detail in NORDIC
 * SEMICONDUCTOR STANDARD SOFTWARE LICENSE AGREEMENT.
 *
 * Licensees are granted free, non-transferable use of the information. NO
 * WARRANTY of ANY KIND is provided. This heading must NOT be removed from
 * the file.
 *
 */

/** @file
* @brief Example template project.
* @defgroup nrf_templates_example Example Template
*
*/
#include "RTE_Components.h"             // Component selection
#include <stdbool.h>
#include <stdint.h>
#include "nrf_adc.h"
#include "nrf.h"
#include "nrf_gpio.h"
#include "nordic_common.h"
#include "nrf_delay.h"
#include "app_error.h"
#include "app_timer.h"
#include "app_util_platform.h"
#include "boards.h"
#include "bsp.h"
#include "nrf_drv_adc.h"
#include "nrf_drv_config.h"
#include "nrf_log.h"
#include "nrf_drv_uart.h"
#include "nrf_drv_ppi.h"
#include "nrf_drv_timer.h"


//Main function
int main(void)
{
	uint32_t err_code;
	err_code = NRF_LOG_INIT();
	if (err_code != NRF_SUCCESS)
	{
			// Module initialization failed. Take corrective action.
	}
	NRF_LOG_PRINTF("Hello World \n");
}
/** @} */
Parents
  • What type of UART is on the device where you are running Putty? Is it a "normal" RS-232 serial port or something else?

    The GPIO pins on the nRF51 will want/use 0 volts for a zero bit and something around +3 volts for a one bit.

    On the other hand, an RS-232 port -- like you would commonly find on a computer -- uses a voltage of less than -3 volts for a zero and more than +3 volts for a one. Common RS-232 voltages are +/-12 volts.

    So, if you are trying to connect a "normal" serial port to the UART on your nRF51 it wont work.

    If this is your problem you'll need a level shifter to match the voltages. Or, you could get a USB serial adapter that uses 0/+3. The adapter appears to your computer as a regular serial port but the electronics end that connects to your nRF51 is at 0/3 volts. (Actually they are usually 0/+3.3 volts but that's close enough to +3 to make it work.)

    This type of adapter can be found online at pretty much every electronics parts store for $10 to $20. I've been getting them at Sparkfun, but I'm pretty sure you can get them at Digi-Key, SeeedStudio, or sites where you can buy accessories for Arduinios or Raspberry PIs.

    --- ta2

Reply
  • What type of UART is on the device where you are running Putty? Is it a "normal" RS-232 serial port or something else?

    The GPIO pins on the nRF51 will want/use 0 volts for a zero bit and something around +3 volts for a one bit.

    On the other hand, an RS-232 port -- like you would commonly find on a computer -- uses a voltage of less than -3 volts for a zero and more than +3 volts for a one. Common RS-232 voltages are +/-12 volts.

    So, if you are trying to connect a "normal" serial port to the UART on your nRF51 it wont work.

    If this is your problem you'll need a level shifter to match the voltages. Or, you could get a USB serial adapter that uses 0/+3. The adapter appears to your computer as a regular serial port but the electronics end that connects to your nRF51 is at 0/3 volts. (Actually they are usually 0/+3.3 volts but that's close enough to +3 to make it work.)

    This type of adapter can be found online at pretty much every electronics parts store for $10 to $20. I've been getting them at Sparkfun, but I'm pretty sure you can get them at Digi-Key, SeeedStudio, or sites where you can buy accessories for Arduinios or Raspberry PIs.

    --- ta2

Children
No Data
Related