Posts Tagged ‘I/O ports’

analogRead alternative (Part2)

Part 1, 2 Starting from the presentation of the parametric version of an alternate analogRead function, here is a lean version of the whole code. The header section of the code /* Sampling parameters */ uint32_t _interval = 200; /* Interval between two consecutive ADC reading cycles */ uint32_t _lastTime; Next comes the ‘setup’ routine […]

Range finder (Part 2)

Part 1, 2 As in most arduinoos posts, the examples given here differ from what is usually seen and read in terms of  code efficiency  and ruggedness of applications. Early tests performed on the HC-SR04 module proved its easiness of setup and interesting results obtained from scratch. However things are changing when accuracy is concerned and headaches […]

Bug Of The Day

And this is a strong one! We are using quite many UNO platforms for fast prototyping. In spite of their relative high price, we always bought boards from Arduino, not because we fear the ‘hall of shame’, but because we understand that that buying these boards contributes to the business model of the Arduino team and […]

I/O LED (Part 6)

Part 1, 2, 3, 4, 5, 6 Here is an amazingly simple and effective application that applies the photovoltaic properties of LEDs. Two identical extremly simple Arduino platforms are used. Each of them is fitted with a LED and a pushbuton. In idle mode, the LED is biased in photo sensing mode, waiting for potential signal. Each time the push […]

I/O LED (Part 3)

Part 1, 2, 3, 4, 5, 6 Additional works on I/O LED brought me to publish the next coming posts. Firstly, I observed that amongst the various LEDs tested from my stock, some were simply not suitable for I/O operation, while the high brightness red LEDs where performing optimally. Here is an illustration of the simplistic hardware that you may use […]

Relays (Part 1)

Part 1 Relays may look outdated in the world of microprocessors: they are big, greedy (in mA) and slow. However, some of their properties make them unavoidable still, when comes the question of: galvanic isolation and requirement for fully floating contacts. Driving relays is no big deal as long as we care about the fit […]

I/O Ports (Part 3)

Part 1, 2, 3, 4, 5 Let’s go one step further with this subject. Now that we have seen how efficient are the various options for setting I/O ports, I suggest that we try to encapsulate these functions and commands in convenient packages, nammely macros! Macros are managed by the preprocessor at compilation time (Check #define statement here). The correct […]

I/O Ports (Part 2)

Part 1, 2, 3, 4, 5 And now some results related to the performances measured while using one or the other options for setting PORTS. Brute force setting PORTB = 0x00; PORTB = 0x01; PORTB = 0x00; Takes 62 ns to generate a positive pulse Simple method PORTB = 0x00; PORTB |= 0x01; PORTB &= ~0x01; Takes 125 ns to […]

I/O ports (Part 1)

Part 1, 2, 3, 4, 5 Arduino’s IDE offers a set of functions in order to drive the I/O ports. As usual, their handyness has a price: speed! And an other drawback: lack of synchronisation. If you want to drive, say, digital pins 8 and 9, you will probably write the following code if you […]