max232n with beaglebone serial - serial-port

I have USB 2.0 to Serial Adapter LogiLink, which gives rs232 voltage, so I use max232n chip to get 5v, then I connected it to beagleboard J1 header and set up minicom correctly but during booting I get strange characters (like http://pastebin.com/KtCQG6jK) What can be the problem? for max232n I use power source from beaglebone, its supposed to be 5v but its 0.4v, can it be the problem? is it necessary to have DC power source to make it work

The hardware documentation for the BeagleBone Black states that
UART0 access via 6 pin 3.3V TTL Header.
and
Expansion Header Usage
There are several precautions that need to me [sic] taken when working with the expansion headers to prevent damage to the board.
ALL VOLTAGE LEVELS ARE 3.3V MAX.
"3.3V TTL" means that the UART's TxD and RxD signals are logic levels of 0 to 3.3 Volts (and not the proper RS-232 levels).
You have and are trying to connect a MAX232N converter, which is for 5V TTL.
Instead you need to be using a 3.3V converter, such as a MAX3232, to match the logic levels used on the BeagleBone Black.
Also double check that you have the baud rate, char size, parity and stop bits correct on the PC side. 115200 8N1 is typical on these embedded devices.
Note that the MAX3232 (and similar chips) should be supplied with 3.3V for Vcc when using 3.3V logic (i.e. it can work with either TTL or CMOS). Supplying 5V to a MAX3232 would be the same as using a MAX232.

Related

Intercepting a signal with ESP32/Arduino - resistor placement

I'm hacking a callbell to connect an ESP32 in order to send me a Telegram notification. The software side is OK but I'm having difficulty in detecting when the callbell goes off. When it is triggered, 5 LEDs flash. They are connected in parallel with +5V at the anode and via a 2K resistor into a pin on an unmarked IC.
Ideally, I'd solder a wire between the resistor and the IC to detect the falling edge but there is very little space. Between the LEDs and the resistor there is sufficient space to attach a lead but I can't make it trigger an interrupt. My question is, can I add my own 2K resistor between this lead and the GPIO pin?
circuit diagrams
Edit: managed to solder a lead between the resistor and the IC. Project deployed and works well. Thanks for your help
Yes you can. Just make sure your device has a common GND wit your ESP32. Also measure the voltage there and check the required resistor resistance..
EDIT: If I am right, this will connect GND to the digital pin, that should be pulled HIGH, then you can detect the GND.
Also connecting a transistor to switch 3.3V when gnd is given by the IC can be a good solution.

Program a pic32mx250f128b with pic32prog on an arduino uno

I'm currently trying to burn the pinguino bootloader in a pic32mx250f128b which is 5V tolerant with an arduino uno. I'd want to try pic32 chips, but I haven't a pickit3 now, I can only access to pickit2.
So to burn the bootloader I'm using an arduino uno, and use the bitbang sketch from pic32prog to try to burn it.
For the wiring I did this :
All VDD and the VUSB3V3BUS pins are wired to the 3V3 regulator of the arduino uno.
All VSS pins are connected to the ground of the arduino uno.
Arduino D2 (PGC) is directly connected to PGEC1
Arduino D3 (PGD) is directly connected to PGED1
Arduino D4 (MCLR) is directly connected to MCLR
But actually, when I launch pic32prog I always have this output :
Programmer for Microchip PIC32 microcontrollers, Version 2.0.218
Copyright: (C) 2011-2015 Serge Vakulenko
(ascii ICSP coded by Robert Rozee)
Adapter: ... OK1 OK2 - ascii ICSP v1E
No target found.
I tried also with the couples PGEC2/PGED2 and PGEC3/PGED3.
I haven't tried to use a crystal yet, but I think from what I read it's not needed for ICSP programming.
For now here is what I've done on my breadboard :
photo of the pic on the breadboard
I don't know what could cause this detection problem,
Thank you very much for your help :)
Edit : I tried several things and here is where I am :
I added the pull-up on MCLR, capacitors on VDD pins, and others recommended : Still the error No target found.
I saw that pic32prog add compatibility with pickit2 so I tried it : this time the pic is detected but I get this error : Unknown CPUID : ffffffff. I tried also with a new pic32mx250 on the pickit2 to be sure it wasn't the first which was damaged.
Finally to recheck my connections I found another version of the datasheet. In this one it seems that PGECx and PGEDx pins aren't 5V compatible... -> So I'll test with 3.3v compatible circuit this time
you need 3k3 pullups to the 3v3 supply rail on both PGC and PGD. these two outputs are 'open collector' (simulated) and the 3k3 resistors define the logic '1' voltage fed to the PGC and PGD pins of the target PIC32.
as mentioned by others, you also need a 10k pullup on MCLR. in addition, you need to ensure that all Vcc pins (13 and 28) are connected together, all ground pins (8, 19 and 27) are connected together, and that there is a 10uF low ESR ceramic capacitor from pin 20 to ground (a 22uF tantalum will do).
see the "ascii ICSP construction guide" article here:
http://www.thebackshed.com/docregister/Browse.asp
the article includes a schematic of what is required.
cheers,
rob :-)
the 10uF low ESR ceramic capacitor on pin 20 is crucial. pin 20 connects ONLY to this capacitor, nothing else. without it, the core of the PIC32 will not run and programming will be impossible.
the reason for this is that the core of the PIC32 runs at 1.8 volts, and the capacitor on pin 20 is part of the circuitry that generates this supply. in your photo it looks like pin 20 is not connected to anything.
cheers,
rob :-)

Sending fixed voltage to serial port

I need to monitor if a door is opened. I have a sensor that continues to generate +5V DC as long as the door is shut but drops down to 0V once the door is opened.
I now need to connect the sensor's output wire to PC's serial port and write a program that continuously polls the port.
My thought is that various serial-io parameters such as baud rate, etc., does not matter in my case. For each byte that I read, I expect the value to be 255 (logical 1s) when the door is closed. Otherwise, I will assume that the door has been opened. Is there any flaw in this logic?
I went through Sending a voltage to RS232. It appears I just need to connect the wire to pin 2 (RX). However, for the serial port to receive a logical 1, it seems the voltage needs to be between -3V and -12V. As the voltage my sensor generates is positive, I am thinking I will connect the sensor wire to pin 5 (GND) instead and connect pin 2 to ground. In effect, I inverted the voltage. Will this work?
If this logic is flawed, I may have to buy a voltage inverter.
Finally, I was told that one should not connect anything to pin 5 on a motherboard's serial port. Apparently, it is hardwired to get grounded to the chassis. Is this true? Regards.
Like mentioned in the comments, constant high would not produce 255 bytes.
I would implement this by connecting the GND to GND and connecting the +5 Vdc to the CTS pin, which can be queried for his HIGH / LOW state.
But this is only a hack, you really should use some microcontroller.

Unable to communicate with ESP8266 via Arduino Uno

I recently bought an ESP8266 (ESP-01, 1M) yet I have been unsuccessful in making it respond at all.
I have attempted to communicate with it using an Arduino Uno running the built-in BareMinimum script (and also the script described here) to work like an FTDI.
However, when any AT commands are sent to it via the Serial Monitor there is no response whatsoever using either approach.
The red power LED is on, yet the blue LED is always off.
My wiring:
GND - GND
RX - RX
TX - TX
VCC - 3v3
CH_PD - 3v3
I would love some clues as to how to solve this error,
Okay, seems like the same problem I spent hours.
Your Arduino TX has a high level of 5V. If you send a message to your ESP with this voltage you will (surely) destroy it. And I think thats happend to you.
So you have to buy a new ESP.
For the next try:
If you use a baudrate of 9600 you can just use two 10kOhm resistors to half your TX voltage. (I did this already and it worked without problems)
For sending a message to your Arduino 3.3V from your ESP are enought.
For higher baudrates you can use a logic level converter: https://learn.sparkfun.com/tutorials/using-the-logic-level-converter

Arduino Input pin from external system

Is possible for Arduino to receive a 5V into a inputPin from a external battery?
If I have a system that has it's own power supply and after an event fires 5V. How can Arduino read this input?
This is an electrical problem, no software issue I presume.
Here is how to proceed:
1) Make sure both boards have the same ground (connect GND together and make sure there is no conflict)
2) Connect your output to an input on the Arduino board (pin 2 e.g.). This connection is preferably done using a resistor, 1 kOhm will be ok.
On software side, just set this pin as input pinMode(2,INPUT); in setup() and then get its value status = digitalRead(2); in loop().

Resources