LCD Wrong Characters - arduino

i'm very young in the world of Arduino and i'm having a serious problem with the LCD QC2004A and Arduino Mega because whatever i write in alphanumeric, is translated to chinese language and i really don't know what to do to change it.
I have already searched in too many websites and i saw nobody who has already discovered the solution for this thing.
As you can see on the figure bellow, the diference between the chinese alphabet and alphanumeric is only the first number of the upper 4 bits which is responsable for the alphabets is always "1" and i don't know how to put it in "0".
Table 4 Correspondence between Character Codes and Character Patterns (ROM Code: 0A)
I believe that DB4 is responsable for this number, but i don't know.
Is there any way to change the state of a DBx in the LCD, maybe try to define this DBx to be always 0 ?
I tryed to connect on the ground but it did not workd

Telling from this QC2004A datasheet your display uses a KS0066-compatible display controller which in turn should work with any HD44780 LCD software library.
If all 8 data lines (usually pins 7-14) on your LCD are connected, make sure your display library is configured for 8-Bit mode.
If only 4 lines (pins 11-14) are connected, then double check that your software is configured for 4-Bit mode.
If you are able to read what you expected the LCD to display by changing Bit 7 (not Bit 4) on each character (using your character table and a piece of paper), your software library might need to be configured to use the latin instead of the kana character set.
If that manual translation does not yield anything comprehensible, double check your wiring especially on LCD pins 7-14 (or 11-14 for 4-Bit mode). The IO pins on your arduino might be placed out of order.
If the text on your display is mixed latin-kana, you might be using the wrong ROM Code A00 instead of A02 (see HD44780 datasheet table 4).
If all that fails, try another LCD software library to rule out software issues.

Related

Decode RFID tag Hexadecimal values to Decimal Serial Number

I have around 10k+ devices, each with both a visible serial number printed on a label and a RFID tag from which the serial number can be read as well. My problem is that when I read a RFID tag I get a bunch of hexadecimal values and I am unable to retrieve the actual serial number value from them as it is not a straightforward decimal to hex encoding.
Here are a couple of information that I get when scanning the RFID tag with the Android App "NFC Tools":
- Tag Type: ISO 15693 NXP - ICODE SLIX
- Technology available: NfcV, Ndef
- Serial number: 3C:FB:88:14:50:01:04:E0
- DSFID: 0x00
- Data format: Unknown
- Size: 38 / 106 Bytes
- Writable: Yes
- Can be made Read-only: No
I have noticed that each and every RFID tag contains the same 'header' 50:01:04:E0, so it means there should exist a way to retrieve my serial number from 3C:FB:88:14. In this particular instance, the serial number is 11926214.
I have scanned about 30 units manually, but I would like to avoid having to scan all 10,000 as it is error prone to write down the hex values and the corresponding serial. Is it possible at all with the above information to figure it out ?
Section 9.2.1 of the datasheet for the chip might help
https://www.nxp.com/docs/en/data-sheet/SL2S2002_SL2S2102.pdf
Some App's might show the most significant bit first as it seems with this app (i.e. in reverse to the more normal orientation)
That actually puts 3C:FB:88:14:50 as the IC manufacturer serial number
or 50:14:88:FB:3C as the manufacturer defines it.
I've tried various Hex to Decimal converts like https://www.rapidtables.com/convert/number/hex-to-decimal.html and cannot get any combination and significant bit orientation to convert to the make the device serial number.
These chips also have user defined memory that App's has not been read and the Device Serial could be stored in here and not related to the Tag's serial number. (As the RFID serial is programmed by NXP at manufacture time it is unlikely to also be the devices serial number)
I suggest actually using the App TagInfo by NXP as this is by the Manufacturers of the Chip and can show you the all the raw memory blocks (It can on the card type I use)
BUT it seems that NXP have removed the TagInfo App very recently :-(
Update: Seems you might be able to side load the APK from https://apkpure.com/nfc-taginfo-by-nxp/com.nxp.taginfolite (with the associated risks)
Of course you can use the linked datasheet to write your own App to read the user memory area where the Device Serial might be stored.

How to program a pressure sensor using the SPI Bus

I am using the STM32 Microcontroller (as part of the LoRa node MB1296D). I want to connect a pressure sensor (MS5803) to the LoRa node and program the sensor via the SPI Bus. Basically, this is all very new to me, which is why I looked up an example code
I am trying to understand this code and a couple of questions have come up:
the macros that are defined in the very beginning, what exactly is their purpose, and are the hexadecimal numbers inherent to the used microcontroller? - If I was to write a code from scratch, I figured I would start by defining macros for the GPIO Pins corresponding to SPI_SCK, SPI_MISO and SPI_MOSI
the function unsigned long cmd_adc(char cmd) contains a switch command, which I have absolutely no clue as on what is does. I mean it looks to me as if I am trying to set the resolution of the ADC, but how do I know the corresponding delay and why does the switch command contain the 0x0f ?
So. If you could find some time to give me a useful answer, that'd be great! Also, if you know any good readings with special focus on this topic, please tell me! I am trying to tackle this problem with little time available.
Your questions are basic C programming questions and are not really specific to this pressure sensor or example.
The macros are defined with hexadecimal numbers to make it clear that the values represent bit fields. It's very easy (and second nature for embedded software developers) to convert hexadecimal to binary. Read the register descriptions in the sensor's datasheet. The bits set in the hexadecimal values will correspond to meaningful bits in the sensor's register description.
switch (cmd & 0x0f) performs a bitwise AND of the cmd with 0x0f. The hexadecimal value 0x0f has the four least significant bits set. So the code is ignoring (i.e., masking off or zeroing out) the four most significant bits of cmd and considering only the four least significant bits of the cmd value.

How many MAX7219 chips maximum can be cascaded?

I am trying to make a large moving sign that consists of Arduino (as the microcontroller), an 8x8 dot matrix (as the display) and MAX7219 (as the controller for the dot matrix display).
Is it possible to use 16 MAX7219 chips?
Thanks.
I don't know what arduino board are you using, and the answer may vary. Anyway:
If you have an Arduino UNO: you can't connect them directly, since the UNO has 14 digital I/Os, and you need at least N+2 pins to communicate with N MAX7219. Moreover I think you want to send commands to it, so the number of pins is drastically reduced. You can however use any port expander to have more I/Os and so communicating with it.
If you have an Arduino MEGA you will probably already have already all the I/Os you need.
In both cases probably the limiting factor will be the speed.. Just make some tests and you'll find it out

arduino (mega 2560) to graph numbers

i am currently studying 3rd year CSE and have little to no background in electronics but i have suddenly taken an interest in robotics
i just started using arduino and its exciting. i got a bit of understanding of to code it (i know c and java). unfortunately i am lost when it comes to interfacing it with anything else other than arduino software. my teacher gave me a project to do as a begineer.
MY QUESTION: i was told to send a number (or sequence of numbers) to the arduino board. the board should blink the pin 13 LED (i know how to do this part) when it receives a number. then it should divide the number by two and send the result back to computer. here the computer must use "processing tool" to graph the number.
1. any help/hints are appreciated.
2. any idea on what this "processing tool" is actually called? all i was told was it was a software to graph numbers.
3. how to take output from arduino into another program as input?
thanks in advance
The processing tool is literally called Processing. It is a Java-based programmatic screen-drawing system that is very easy to use. Take a look at it here.
Processing is much like Arduino in that it has the setup(), loop() architecture and is similar in syntax.
To get data from the Arduino to Processing, you will need to send serial data to the PC.

VHDL UCF - how to define a constraint that has no pin?

I'm working with some simple VGA driver code for use with the Xilinx Spartan 6 FPGA (via a Papilio Pro board). The code expects to have 4-bits of output per color, and so defines logic vectors for each color. However, my setup doesn't happen to provide the full 4 bits per color so I wanted to find a creative way to control this via the UCF.
The original UCF defined 4 pins for each color. In the case of blue, I only have two pins, so I chose to map the two I have to blues MSBs, thus:
NET Blue(0) IOSTANDARD=LVTTL; # N/C
NET Blue(1) IOSTANDARD=LVTTL; # N/C
NET Blue(2) LOC="P92" | IOSTANDARD=LVTTL; # to a pin
NET Blue(3) LOC="P87" | IOSTANDARD=LVTTL; # to a pin
(I totally omitted the first two constraints at first, and it still compiled and worked but complained about the inconsistent voltage standards (the absent ones defaulted to IOSTANDARD = LVCMOS25), thus throwing "WARNING:Place:838 - An IO Bus with more than one IO standard is found.")
The main warning is the one I'd like to know how to eliminate, preferably within the UCF:
WARNING:Place:837 - Partially locked IO Bus is found.
Following components of the bus are not locked:
Comp: Blue<1>
Comp: Blue<0>
What's the right way to map a net without a programmable pin location to a default value (logic '1' or '0', or perhaps a tri-state value) within the UCF in such a way as to eliminate this "Partially locked IO Bus" sort of warning?
My goal is that, in a setup with more or fewer bits per channel being driven by pins, only the UCF should need to change (not the source code). What I did works, despite the warnings... I'd just like to do it better and properly eliminate these warnings.
You've asked for pins within the top level of your code (on your entity). The tools therefore have to provide them. Hence you have to map them (otherwise it'll pick some random ones for you, which you usually don't want)
If those pins really have nowhere to go on the board and never will have, then remove them from the design completely (UCF and HDL).
Otherwise, you have to LOC them. You could add a PULLDOWN in the UCF to them to ensure they go to a low value.

Resources