0

TLDR: Is there a way to create a hex value between 0x20 and 0x7E with 5 volts? Is there a cheap component on the market or circuit logic that can achieve this?

I'm not sure what the proper terminology for this is, but here's what I'm trying to do:

I have a bluetooth module connected to my pico via UART0 TX and UART0 RX. The use for this is a bit long to explain, but essentially, I want the bluetooth module to work without my pico attached to it. I have a device that outputs a signal, the pico reads the signal, then it tells the bluetooth module to transmit to the receiver. However, since the data to transmit isn't actually important, it makes sense to cut out the pico and simply have the bluetooth module read the signal directly then transmit.

I have the device that outputs exactly when I want, but it outputs the equivalent of 00 in hex. My computer is connected via bluetooth and can read it just fine. However, the pico, reading the input through RX, can't. I've found no way for micropython using UART to read 00 - UART.any() and UART.read() want a character, and 00 only corresponds to NULL.

So essentially, I need some way to transmit a hex value between 0x20 and 0x7E without using the raspberry pi pico. Is there some kind of component that is able to do this? In practice, the bluetooth module will be connected to 5V power with up to 5 amps.

Any idea on how to get the Pico to read 00 in hex through the RX pin is welcomed too. The purpose of this is to not need multiple Picos, since the receiver and the transmitter will be a good distance from each other.

zapshe
  • 228
  • 1
  • 8
  • Your bluetooth device does not expect a hex value, it does not even know what hex means. You are just displaying the binary value in hex format. What is the purpose of your application? Do you want to see if you are in range of the bluetooth module? There might be a better approach to your problem – Michael Kotzjan May 05 '21 at 04:28
  • I understand, I just used hex because it was what I was looking at on my terminal. The purpose is that I have a device which will give a signal. When it gives that signal (it will be a good distance away), I want to know about it. Since I only want to know that the signal was made, the transmitter can communicate anything to the slave module. The simple fact that it communicated lets me know the signal was made. This means it would be a waste to have a pico there. My idea would work if the pico could read 00 from the buffer. Any ideas? Thanks for the reply – zapshe May 05 '21 at 09:17
  • It would be best if you add the exact Bluetooth module to your question, but I assume it's not that simple. The module probably expects more from the pico than just one value to function correctly. – Michael Kotzjan May 05 '21 at 09:29
  • I'm using the HC-06. I've tested it and everything should work if I could find a way around the 00 issue. I connect it to power and will pair it with my device. Anything the HC-06 receives over RX is transmitted to the paired receiver. The issue is that the device sending the signal is only giving a high signal, there's no content to it. So it gets interpreted as 00. With no way around this issue, I'll have to use a microcontroller. – zapshe May 05 '21 at 09:37
  • 1
    I don't think you can 'fake' the serial connection required by your module. Maybe someone else can help you further – Michael Kotzjan May 05 '21 at 09:43
  • Thanks for trying, if there's no way to fake a signal, then I'll have to find a more creative solution. – zapshe May 05 '21 at 09:50

1 Answers1

1

I found the issue. The pico actually can accept 0 through the UART RX pin. The issue was me having a wire misplaced. My computer saw the 0 input which made me think the pico couldn't handle it, but in fact it was never receiving it. Thanks for the help Kotzjan. Would have been interesting to fake a value into the port though!

zapshe
  • 228
  • 1
  • 8