Arduino: Attach an interrupt to one of the higher pin numbers? - arduino

I have an Arduino Mega 2560. Is is possible to attach an interrupt on the higher pin numbers, for instance, D20 to D25? I tried PcInt, but it doesn't work with the higher pin numbers for some reason.
I have a custom board and it's using these pins, so my hands are tied in terms of what pins to use.

The pin mapping of the Mega2560 says that pins 20-25 aren't candidates for PCINTs (but 20 and 21 would have INTs). So the layout of the board makes it simply incompatible for this Arduino.

Related

Arduino SPI GPS NanoHornet 1411 PM04

Good afternoon.
I am new to the SPI protocol and Arduino. Recently I came across a GPS sensor, this one: Nano Hornet 1411 PM04 (Datasheet: https://www.origingps.com/wp-content/uploads/2014/11/Nano-Hornet-ORG1411-Datasheet2.pdf).
I have read already many information a lot of about SPI (including some tutorials from Sparkfun for Arduino), but I still can't make this GPS work...
I would really appreciate if someone could help me understand how to write code for Arduino Uno that can make this sensor run.
For further information:
The pins of this sensor are displayed on page 21 of the link provided before for the datasheet (block 17: INTERFACE of the index).
The electronics schematics I have implemented is the one from the lower picture on page 25 (block 18: TYPICAL APPLICATION CIRCUIT of the index, FIGURE 11 – REFERENCE SCHEMATIC DIAGRAM - PM04 ORDERING OPTION).
Option chosen is SPI assembled (No R1, R2, R3, R4 placed).
Vcc is the 3.3 V pin source from the Arduino Uno board.
Clock, MISO, and MOSI pins are 13, 12 and 11 respectively on Arduino Uno
Slave select would be at digital pin 10.
ON_OFF signal is controlled by a transistor linked to digital pin 8, which allows the 3.3 V to make the pulse to start the device.
My bigger misunderstanding for this specific implementation is the fact that I don't know/understand how I can read from the GPS sensor or what I should send to the sensor to start transmitting the position. Besides that, I don't also understand how the data is output...
Thank you very much!
The Hornet uses the NMEA standard. You should start by reading the information on this page, this should set you on the right path.
https://playground.arduino.cc/Tutorials/GPS

LinkitOne and 8-Bit Level Shifter

I want to connect LinkitOne with an LCD display requiring 5-volts in I/O. I opted for an 8-bit level shifter (TXB0108) from Adafruit to do this.
To start with, I made LinkitOne's 7 digital pins (D5-D11) as OUTPUT and DigitalWrite HIGH to each one and had consistently got 3.2 Volts.
However, when I connected D5-D11 in the LOW-side of the level shifter and had the VCCA hooked at 3.3V and VCCB hooked at 5V, the low-side pins registered varying voltages below 3.2 volts (some are below 1v and 2v while only 2 pins are in 3.2 V.
I read in some sites that the 5V must be supplied from other source as the LinkitOne is not giving enough power for the level shifter. So, I did that... as well as with the 3.3 volts but still the problem persists.
Please kindly help.
I did a quick check if picking other I/O pins in LinkitOne will resolve the issue and it did. The pins that work with the 8-bit level shifter are pins D5,D6,D9,D10,D11,D12 and D13.
I went through the LinkitOne pinout diagram here, and the only unusual thing about pins D4,D7 and D8 is that they are labeled GPIO40, GPIO50 AND GPI048 respectively which is unusually above GPIO2X. I'm still new with this board and guess that these pins have some 'specific' functions as stated here.

arduino board to monitor two sepearated encoders

I have two linear quadrature encoders controlling two stepper motors. These two stepper motors move a stage (one in x, the other in y). There might be a feedback between the two motors but I am not sure. I would like to use interrupt on arduino to monitor the changes in channels A and B of each encoder. Should I get an arduino board (e.g. mega) with more than 4 interrupts, each interrupt can handle a distinct ISR?
Thank you,

Does Ardunino serial need a common ground

I have a device running off a different power supply, that I'm trying to talk to serially, it has TX and RX lines, GND and 2.7+ line, its quite grunty so It has its own PS.
I'm getting some odd results at the moment, so wondering if I need to use a common GND between the Arduino GND and the PS GND and the device GND.
Does serial require a common voltage reference point?
Its a mega 2560 R3
All signals require a reference voltage. Ground is what provides this reference for single-ended signals such as those used by a UART.
UART signals are composed of low-level and high-level signals.
The receptor, at the other end, to be able to understand your UART signal, must be aware of what is that low-level and high-level signals.
So you must put your UART GND to the GND of the receptor, and the high-level voltage must correspond to the TTL input level of your receptor.
For example, if the high-level of your UART is 2.7v, and your receptor input-level is 5v, you could encounter bad level detections sometime, because 2.7v could be detected as a low-level input.
For the low-level inputs, this is no problem because 0v is always 0v.
Sorry but... didn't you break your 2.7V device? Besides using a common ground, like Ignacio pointed out, when you have to interface something to something else you should ALWAYS check what are the correct voltage levels expected.
So did you check that the high voltage levels and low voltage levels are fulfilled? I think not. Because:
Arduino Uno (i just have the 328P datasheet on hand, so i'll use this) has an Atmega328P powered at 5V. The datasheet says that the Vih parameter (the minimum voltage sensed as a "high" value) is 0.6Vcc, which means 3V. So if you send him a 2.7V signal.... You are doing something wrong.
The 2.7V device has probably an absolute maximum voltage allowed on any pin of Vcc+0.3V. This means that the maximum voltage for each pin is 3V; if you go above this current starts flowing through the protection diode and... you blow your device. Now you are giving it 5V, so.... Puff...
If the above criteria are not fulfilled you have to put between the two circuits something. Which is
a resistor divider if you have to make the voltage lower (just two resistors) and a couple of transistors to make it higher
Opto-isolators (and you can keep the grounds separated)
Voltage translators (such as TXS0102)
other...

Number of Digital Pins

Why "NUM_DIGITAL_PINS" returns 20 when I'm using Arduino Uno?
How can I get the number of digital pins in arduino?
I'm using Arduino 1.0.5 IDE
Thanks
If you are wondering why the number is 20 when the Uno's digital pins goes from 0-13, is because the six analog pins can actually act as digital pins as well. So the total digital pins is 20.
By convention, NUM_DIGITAL_PINS (all uppercase) is a macro. Its value is determined when you compile. It's in fact done by a literal text replacement. It doesn't "return" anything. Functions would return different values, but they tend to look more like GetNumDigitalPins().

Resources