Skip to main content
Share Your Experience: Take the 2024 Developer Survey

Questions tagged [port-mapping]

Port-mapping refers to directly accessing the hardware registers (ports), in particular the input/output ports. Use this tag for discussing direct port access.

Filter by
Sorted by
Tagged with
0 votes
0 answers
84 views

Can't upload to nano esp32

Recently bought a nano esp32 to play around with the small size and wifi module. However I'm plagued by the No DFU capable USB device available message. My efforts and deductions: I can connect to ...
Nebulous's user avatar
1 vote
1 answer
759 views

USB-C to USB-C cable Arduino is not responding even not powered by this cable

Hi I want to connect arduino NANO to my laptop with Type-C (USB-C) ports (on below image left side [4] and other side 3). Now I bought a USB-C to USB-C cable, because it appeared to be the right tool, ...
mehmet's user avatar
  • 287
1 vote
1 answer
247 views

Is there a definitive reference for the Arduino DUE?

I am looking for a reference document or documentation system that concretely relates at minimum: Screen printed pin name/number SAM3X8E pin number Register number Channel number Port name In my ...
J Collins's user avatar
  • 295
2 votes
1 answer
90 views

SparkFun RedBoard PTH Kit wrongly configured hardware

I have a SparkFun RedBoard PTH Kit. It's not made by SparkFun, but by https://inmotion.pt (that doesn't exist anymore). I soldered it, and bought a FTDI adapter, but when I try to upload the blink ...
Ayo Reis's user avatar
  • 121
2 votes
1 answer
262 views

Atmega2560 PWM on PH4

I am trying to convert the following code to output to pin 7 (PH4, OC4B) on an Arduino Mega. The code outputs to pin 6. This code is from a GitHub for the GRBL on the Mega "https://github.com/...
Mr.Spriggs's user avatar
1 vote
1 answer
113 views

Unable to use rising edge interrupt for external clock Arduino 2650

I'm messing about with an Arduino Mega2560r3 and failing to get timer 4 to trigger on the rising edge of an external clock. It only ever triggers on the falling edge. I've tried TCCR4B = (1 <&...
DrLoopyTunes's user avatar
2 votes
0 answers
49 views

About Corrupted LM35 IC and Arduino port problem

I have one Arduino Uno which was working fine by below circuit(link): But when I have connected the new bought the LM35 Ic by the below connection: The Arduino UNO don't be recognized by the my ...
Soheil Paper's user avatar
1 vote
1 answer
191 views

Why my arduino board does not blink properly?

I have two files blink1.cpp typedef unsigned char int8_t; typedef volatile int8_t * volatile port_type; port_type portB = (port_type) 0x25; port_type ddrB = (port_type) 0x24; void delay_500ms() { ...
ar2015's user avatar
  • 173
2 votes
1 answer
823 views

Configure input pullup through registers

I can set pin mode to input or output through the DDRx registers. How can I enable the internal pullup resister through a register?
iHnR's user avatar
  • 127
0 votes
1 answer
356 views

Valid options for output port on Mega 2560

I would like to adopt this library on an Arduino Mega2560: https://github.com/gueei/DShot-Arduino However, the macro DSHOT_PORT needs defined for the Mega2560 here: https://github.com/gueei/DShot-...
DrTarr's user avatar
  • 103
1 vote
2 answers
2k views

Can't upload code to Arduino board on Mac

I'm using a MacBook Pro with 10.13.6, an Official Arduino Uno Board and Arduino 1.8.13 IDE. I'm having troubles uploading code to the Arduino Board. I have 5 ports available: dev/cu.-AvnetaSPPPort ...
João Sacramento's user avatar
-1 votes
1 answer
216 views

Port manipulation

My UNO having some stability issues because of heavy memory use, I'm now optimizing the code now looking to reduce the digital read memory use with the help of port manipulation. I got the code for ...
user2037091's user avatar
2 votes
4 answers
1k views

Why do we use bitwise operators to assign PORTx, DDRx and Pinx?

I have come accross a lot of examples using ways similar to the ones shown below to assign values to the pins. PORTB |= (1<<PORTB2); //set bit 2 PORTB &= ~(1<<PORTB1); //clear bit 1 ...
ArduinoSap's user avatar
2 votes
1 answer
285 views

problems with Blue Pill (stm32f103c8t6) direct register manipulation

I'm trying to access registers but I keep getting the "was not declared in this scope" error message. I'm currently using the STM32F1xx boards from http://dan.drown.org/stm32duino/...
Beacon of Wierd's user avatar
0 votes
3 answers
244 views

ATMega328 functions, but will not output to any pins

Problem: ATMega328 Refuses to digitalWrite() to any pins, I can upload and run sketches using the board UNO from the ide on the 328 and can confirm it is working using the serial monitor (see code). I ...
Christopher Allen's user avatar
2 votes
1 answer
138 views

how to convert the following code into one using direct port manipulation

Following is the program for scanning a keyboard for MIDI transfer. At present the code works fine, but it could be faster. I need to know how to use direct port manipulation inside the for loop. ...
User's user avatar
  • 139
1 vote
0 answers
53 views

Port manipulation: Coding for two chips

I am using Arduino Nano to test a code that will be ported on an ATTiny chip, which will need to perform operations at a frequency near clock maximum, calling for a very succinct coding. My goal: to ...
B7th's user avatar
  • 167
1 vote
1 answer
646 views

Can analog pins be defined as either their analog name (A0) or their digital pin number?

Can analog pins be defined by their digital pin number, and be used for analog purposes? For example, instead of defining A0 for a pinout with the Uno, it could be 14? Where is this documented? Is ...
adamaero's user avatar
  • 198
-1 votes
1 answer
203 views

Data in two 8 bit shift registers won't change

I'm trying to output 16 bits of data to two 8 bit shift registers (74HC595), which drive a 8x8 led matrix. There is a problem with the way the code outputs data to the registers, its like no data is ...
sparpo's user avatar
  • 9
1 vote
0 answers
128 views

How can I add PWM to my BLDC code using port manipulation?

I have the following code, which currently uses 6 output pins (pins 8 - 13) from the Arduino to my inverter circuit, which controls a BLDC motor. The code is fine and it works, however I want to add ...
Daniel Bashy's user avatar
1 vote
1 answer
2k views

What is the equivilent of PORTx for Teensy (4.0)?

I've seen people use code like PORTB |= 0x1 << 6 to set the sixth bit of PORTB in arduino. I understand that this is significantly faster than using digitalWrite. How can this be done using a ...
Jachdich's user avatar
  • 123
1 vote
1 answer
406 views

Reading port register and print

I am playing with port registers directly to improve speed on a Arduino micro. I have no problem writing them, like PORTF &= B11101111 However, when I try to read and print it, things get funny ...
Jason M's user avatar
  • 113
0 votes
1 answer
408 views

Can't get OC1B (pin 10) to output

I'm trying to get this program to use channel B for the output waveform using the phase correct PWM mode and using OCR1A as the top. With a 50% duty ratio I'm attempting to get a 10 Hz freq. I'm able ...
Tomas Breit's user avatar
1 vote
0 answers
146 views

MKR 1000 not found in ports when MKR IMU Shield is connected

I am trying to connect my MKR IMU Shield to my MKR1000 by placing the IMU shield in the MKR1000. When I do this, however, the Arduino IDE and Simulink are unable to find the port that my Arduino is ...
tennis25's user avatar
0 votes
1 answer
397 views

Pin Mappings from Arduino Metro M4 Express Board to SAMD51

After looking through the internet, I coudln't find any document (not in the datasheet, no nice graphics on google image searches) that showed the mapping between the Arduino breakout board and the ...
Jonathan Wheeler's user avatar
-1 votes
1 answer
4k views

How come some Arduino Nano pins (D3, D4, A3, A4, A6, A7) cannot be set high?

I made a sketch to switch on all digital and analog pins, and found out several pins did not work as expected. Note: I manually put a jumper wire from each digital and analog pin (one at a time) to a ...
Michel Keijzers's user avatar
1 vote
1 answer
399 views

Can I disable the TX pin by setting its mode to INPUT while still receiving data on the RX pin of a UART?

I'm using the ATmega328PB in a personal project with MiniCore. My board streams data in on the RX pin from another microcontroller, but my board also has a DIP switch connected to the TX pin, that's ...
willem.hill's user avatar
1 vote
0 answers
601 views

Reading data by port manipulation (Arduino Due)

I have shorted the 23rd pin of port A with 3.3v output pin (i.e. tieing 23rd pin of port A to logic high). Now I am trying to read the 23rd pin of port A by using following code- void setup() { ...
user3862410's user avatar
0 votes
2 answers
280 views

Sharing serial output from one to many arduinos (plus a computer) via USB hub

I am trying to send rotary encoder output from an UNO to seven Trinket M0s and a computer via a (powered) USB hub. Currently the UNO → Laptop bit works great, serial monitoring works via the hub ...
laffan's user avatar
  • 25
1 vote
0 answers
49 views

Arduino Port randomly changes whenever I punch correct RFID tag

I was working on an Electronic Door Lock/Unlock system using Arduino Uno and RFID Reader/Tags on Ubuntu 18.04.02 lts. Now the problem is that whenever I punch-in the correct RFID tag to the RFID ...
Shubhank Tyagi's user avatar
0 votes
1 answer
317 views

Converting code for ATTINY85 to ATMEGA2560. Pin change interupts

I have code that compiles correctly for an ATTINY85 board using the ARDUINO IDE but I don't have an ATTINY85 board. I have an Arduino Mega ATMEGA2560 and when I select this board in the Arduino IDE ...
flipbeatz's user avatar
-1 votes
2 answers
1k views

Reading a rotary encoder using digital pins of Mega 2560 directly using port registers?

I'm trying to write an interrupt service routine for an Arduino Mega 2560 to decode a quadrature rotary encoder. I've got an ISR (Interrupt Service Routine) that responds to the falling edge of ...
Duncan C's user avatar
  • 5,702
1 vote
0 answers
298 views

Bit Bang I2C with port manipulation on AtTiny84: new pinout doesn't work

So I am trying to understand bit banging and port operations. I'm developing a breakout board with an ADXL343 IMU read by an AtTiny44 via i2c. I adapted this code from MIT's How To Make Almost ...
Oliver Appling Bucklin's user avatar
1 vote
0 answers
316 views

How to choose a port on Arduino Create

I have connected my Mega2560 Arduino to my computer; locally everything works fine - I have been able to upload and run programs. However, on Arduino Create, it shows that there's no connection to my ...
Pro Q's user avatar
  • 111
0 votes
1 answer
882 views

Two ports on Uno with ethernet shield

I am making an Arduino mod-bus device and I want to make a webpage as well that will allow me to reset the unit if there is any issues remotely. To do this I would need the mod-bus to operate on port ...
Michael H.'s user avatar
-1 votes
2 answers
141 views

Why does attaching Nokia 5110 LCD make my otherwise fine MKR1000 disconnect USB after 15 secs?

This problem just started after 3 days of working on a project. I am using Arduino IDE in Windows 10. When I go to upload "Blink," everything works fine. I connect the USB (sometimes I have to ...
garson's user avatar
  • 159
0 votes
1 answer
233 views

Switch two or more digital outputs of ESP8266 at the same time

I'd like to control some digital ICs with a ESP8266-12. How can I switch 2 pins to HIGH in the same moment? How can I switch one to LOW and the other to HIGH in the same moment? Is it possible with ...
Robert R.'s user avatar
  • 109
1 vote
1 answer
2k views

How do I configure a pin to be a bidirectional and open collector? [closed]

I want to communicate with a keyboard asynchronously through a single open collector, bidirectional data pin. As part of the protocol, the data pin is active low and is pulled low by either the host ...
ATL_DEV's user avatar
  • 113
1 vote
1 answer
252 views

Arduino Nano /Uno USB is not getting recognized

I have multiple Unos and Nano and recently due to some bad configuration the USBs are not getting recognised on my Mac Air Laptop. These were working models for almost 1-2 years. I used it to control ...
Shashi Kiran's user avatar
-1 votes
1 answer
4k views

Send SMS Arduino Uno + SIM900A shield

I am working on a module to send messages. I write the message on the serial monitor + phone number and I have to send the message to the line. Question: How to send messages through the SIM900A ...
R. Fernandez's user avatar
4 votes
1 answer
14k views

Arduino Uno R3 to Wemos D1 R2 project migration - Pinout problems

So i've chosen to purchase a Wemos D1 R2 board in order that my old Arduino Uno R3 projects can get some new IoT features. However, even if my code is working in Uno perfectly, i want to test it using ...
Galinho Salonica's user avatar
1 vote
1 answer
4k views

How to determine which pins_arduino.h file is used?

For some applications I need access to the registers that control the output/input and high/low state of pins. For example pin 10 on a adalogger is PORTB with a mask of _BV(6). This information can ...
Matt's user avatar
  • 205
-1 votes
1 answer
479 views

MKR FOx 1200 doesn't upload Sketch

My Arduino MKR Fox 1200 doesn't upload any sketches. First it worked, but now it doesn't. It compiles the bare minimum sketch (empty loop and empty setup) but then uploads forever and after a long ...
Flo's user avatar
  • 131
0 votes
1 answer
444 views

Arduino Uno - Multiple modules for HDMI switch device

I have an Arduino Uno device that uses the following modules: 16 PIN LED w/ Backlight RFID - RC522 (RFID Reader) HR911105A (LAN Module - HanRun) These three modules use every digital pin available ...
KababChi's user avatar
  • 165
2 votes
0 answers
212 views

No Socket Available message floods serial monitor

Serial Monitor get's flooded with "No Socket Available" message. This seems to occur even before I Try to communicate with my Hue bridge through my hub port. Does anyone see why this is occurring ...
The Tokenizer's user avatar
2 votes
2 answers
13k views

Arduino Mega 2560 interrupt pins and port mapping with rotary encoder

I am trying to use port manipulation in interrupts to read a rotary encoder. I found code for a Uno, so the port call for pins 2 and 3 are different. I think on the Mega they are PORTH3 and PORTH4 ...
kumquat's user avatar
  • 61
0 votes
1 answer
8k views

Using all ten capacitive touch inputs on the ESP32

I am using a Wemos Pro ESP32 development board and would like to be able to use all ten of the available capacitive touch inputs. I am able to get readings from nine of them but not T1. Here is the ...
juliusbangert's user avatar
2 votes
2 answers
13k views

Problems with I2C connection on ESP8266 - 12F, which pins should I use?

Previously I had pined the temp/hum sensor HDC1080 with an Arduino using this sketch and everything worked fine. Now I want to run it over an ESP-12F, I uploaded it but it has issues at the time of ...
Julio's user avatar
  • 113
2 votes
1 answer
2k views

Windows stops recognizing Arduinos

I've just got my first Arduino Pro Mini and a USB to TTL chip. When I try to upload the program I get the message The uploader process failed followed by avrdude: ser_open(): can't open device "\\.\...
Vladivarius's user avatar
2 votes
1 answer
1k views

Port manipulation in Arduino using byte value

I'm trying to write PORTB and PORTD in ATmega328P using byte system like this, // PD7 PD6 PD5 PD4 PD3 PD2 PD1 PD0 // N N N N N U U U // 7 6 5 4 ...
user_fs10's user avatar
  • 187