Skip to main content

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
11 votes
4 answers
21k views

How do the IO registers of Arduino Due work? On Arduino Uno just set DDRx, then PINx to read, PORTx to write, I'd like to do the same thing with an Arduino Due, but it has many more registers, such as ...
Alex's user avatar
  • 315
4 votes
1 answer
15k views

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
2 votes
4 answers
2k views

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
2 answers
7k views

I have an Arduino. I'm not sure if RX1 and TX0 the same thing as TX and RX? Will there be a difference in the way I program it? For example, do I treat RX1 and TX0 as RX and TX in the Arduino IDE ...
JoeB's user avatar
  • 51
2 votes
1 answer
1k views

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
2 votes
1 answer
562 views

I was looking into ATmega32u4 datasheet to configure the SPI, and there is initialization snippet for data transmission. void SPI_MasterTransmit(char cData) { /* Start transmission */ SPDR = ...
R1S8K's user avatar
  • 283
2 votes
1 answer
178 views

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
2 votes
1 answer
308 views

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
2 votes
1 answer
3k views

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

I own a Macbook running OS X 10.10.3 (Yosemite) I own a Min Seg. My Min Seg model is built on an Arduino Mega 2560. Problem When I connect the board to the Macbook, using either of the Macbook's ...
kando's user avatar
  • 141
2 votes
0 answers
81 views

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
2 votes
0 answers
222 views

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
1 vote
1 answer
2k views

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
1k views

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
  • 297
1 vote
1 answer
2k views

If I use direct port manipulation, what is the average number of clock cycles it takes to flip a pin on the arduino ie. void loop(){ PORTB |= 0b00010000; PORTB &= ~0b00010000; } So how fast ...
DarthRubik's user avatar
1 vote
1 answer
4k views

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 vote
2 answers
144 views

I'm learning about accessing ports directly on the ATMEGA 328 using an Arduino Uno. The program sets up pin 13 as an output and pin 2 as an input. I then enable the pull up resistor on pin 2. I read ...
Samee87's user avatar
  • 135
1 vote
1 answer
204 views

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
1 vote
1 answer
531 views

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
1 answer
2k views

I was modifying this ADC Touch implementation, namely switching analogRead and pinMode to what I thought would be port manipulation equivalents. I get very different readings (better and more stable ...
Wesley Lee's user avatar
1 vote
5 answers
6k views

Asking here cause I ran out of options in searching. My Arduino Nano clone isn't recognized by my computer anymore. It was, until I plugged into a Windows machine, that did not recognize it... and now ...
Hopeless Student's user avatar
1 vote
1 answer
177 views

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
1 vote
1 answer
998 views

How can I output a specific value on a pin using port manipulation? Example: I want to use this code but without any arduino functions, just with port manipulation: for (int i = 0; i < 255; i++){ ...
Adrian's user avatar
  • 13
1 vote
1 answer
412 views

I'm using an Arduino Uno board with an HP computer running Windows 10 and IDE version 1.6.8. Arduino was working fine for me until a few days ago, when (and I suspect this is the root of the problem) ...
Sam Albert's user avatar
1 vote
0 answers
715 views

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