Bar Code Scanner #785
Replies: 16 comments
-
Posted at 2015-08-05 by DrAzzy Can you describe how everything is connected? (sanity checking) I would agree that that should work, based on the datasheet, but that gibberish totally looks like wrong-bandwidth gibberish. But you can't really tell as much as one would like to with console.log, because the non-printing characters don't get escaped, so you can't actually see what all the characters are. Try doing:
Then scan something Then do:
Each of those should print something, post the results - From that, you can sometimes figure out what's wrong with the UART settings (especially when you know exactly what the output is, as you do) |
Beta Was this translation helpful? Give feedback.
-
Posted at 2015-08-05 by @gfwilliams Just so you know (it shouldn't make any difference in this case though), you need to put quotes around the values of
In this case it's fine because If you do have a storage oscilloscope handy then I'd really recommend connecting it to the serial port data pin. By triggering when you scan a barcode you should easily be able to figure out exactly what the baud rate is. |
Beta Was this translation helpful? Give feedback.
-
Posted at 2015-08-05 by Cale DrAzzy: Unit is powered by it's own power plug in. rs232 pins 2,3,5 and connected to espruino. (rx,tx,gnd). I have tried switching the rx and tx and then nothing will produce.
And I don't have an Ocilloscope but have a good excuse to get one now. |
Beta Was this translation helpful? Give feedback.
-
Posted at 2015-08-06 by Cale So I used the configuration Manager for the ms146 and everything checks out. A few observations though. On my Chromebook computer once the ms is plugged in through the PICO the computer become unusable. The mouse pad no longer works and random things happen to the screen (programs will close etc.). So I've been forced to use the windows computer which does not have the same issue but it did have to restart randomly. (not 100% sure this caused it) There is a test pad with the config manager and again everything seems to check out. |
Beta Was this translation helpful? Give feedback.
-
Posted at 2015-08-06 by fdufnews As far as I understand the scanner has an RS232 interface. |
Beta Was this translation helpful? Give feedback.
-
Posted at 2015-08-06 by @gfwilliams
Well spotted. If you were putting 12v straight into the Pico, that might explain why your PC behaved really strangely. |
Beta Was this translation helpful? Give feedback.
-
Posted at 2015-08-06 by DrAzzy Check the voltage between idle RX or TX pin and ground of the barcode scanner, and see if it's actually 12v, not 5. It sounds like they make both versions from the docs you linked...? |
Beta Was this translation helpful? Give feedback.
-
Posted at 2015-08-06 by Cale Voltage is 7.54 volts between the RX and TX. |
Beta Was this translation helpful? Give feedback.
-
Posted at 2015-08-06 by DrAzzy Please measure between tx / rx and ground on the barcode scanner, with those wires connected to nothing else. So there will be 2 measurements, tx to ground, rx to ground. It sounds like it's RS232 though, so you're going to need something like a MAX232 to shift the voltage down to 5v levels. |
Beta Was this translation helpful? Give feedback.
-
Posted at 2015-08-06 by Cale Siting idle the tx to ground is 8.6mV and the rx to ground is -7.53 V. The wall adapter powering the barcode scanner is a 5V @ 300mA |
Beta Was this translation helpful? Give feedback.
-
Posted at 2015-08-06 by DrAzzy Looks like it's outputting at RS232 levels - though I'm surprised the TX is at ground, i'd expect it to be at the same level as the RX when idle... You need something like a MAX232 or equivilent to shift the voltage back into the range that can be safely interfaced with the Espruino. Hopefully nothing was permanently damaged by hooking it up directly. |
Beta Was this translation helpful? Give feedback.
-
Posted at 2015-08-07 by Cale Everything was fine with the Espruino. I built this. The voltage is now at 3.3 volts but it still causes my chromebook to freeze up. On the windows screen still cant seem to make it work properly. I might abandon this barcode scanner for now. |
Beta Was this translation helpful? Give feedback.
-
Posted at 2015-08-07 by @gfwilliams Great - glad the voltage levels are ok. Very strange about the freezing then. How about trying one of the latest firmwares like this? USB has had a lot of work done recently and it may fix your problems - there were a few things I needed to fix before I did a 'proper' release, but I think they're sorted now. |
Beta Was this translation helpful? Give feedback.
-
Posted at 2015-08-07 by Cale YES Got it to work. I actually some how had mixed up the capacitor and the diode...woops... and I also found that the voltage must come from the VBAT. |
Beta Was this translation helpful? Give feedback.
-
Posted at 2015-08-10 by @gfwilliams Great! Any idea what was happening before then? Were there too many volts going into the Pico? |
Beta Was this translation helpful? Give feedback.
-
Posted at 2015-08-20 by Cale Yeah I am pretty sure I was throwing it too much juice. I also received my oscilloscope the other day. It will take me a little time to figure it (oscilloscope) all out but ill do a little testing soon and fill you in. |
Beta Was this translation helpful? Give feedback.
-
Posted at 2015-08-05 by Cale
I am trying to connect a bar code scanner to my PICO.
The response I am getting is gibberish though?
I have tried various other baud rates and nothing seems to work. The code should read 0000027840200.
Any ideas??
Beta Was this translation helpful? Give feedback.
All reactions