I don't shy away from port manipulation when the library doesn't support something I want to do.įor example, on this page: Gammon Forum : Electronics : Microprocessors : I2C - Two-Wire Peripheral. So my "simpler" solution is easier to maintain, and just as real. Microsecond speed improvements are not required. As an example, a RFID security system I developed is supposed to unlock a door reasonably promptly after you present the correct card. The digitalWrite version is "real" and would be acceptable in all cases but the extreme ones where you are hitting speed limitations of the hardware. I submit that the latter is easier to maintain in the future, and personally I write with a view to re-using my code later on, and having other people understand it. is somehow more real than: digitalWrite (7, HIGH) You are implying that something like: PORTD |= B10000000 this type of simplification is 'acceptable'.until one starts doing real work. To find out the pathname hold down Shift and click the Verify button (top left). I read that it can be fixed setting the latency time in the advance setting of the COM port under Devices in windows, but its not my cas. Would love to.what tool are you using to produce the. Im fighting with some serial latency issues on my Mega 2560: as far as i can see with oscilloscope, i have always about 20ms delay during serial comunication between my PC (Win7 64bit) and the Arduino. Yes, for portability among many different platforms in a family, a perfectly acceptable abstraction. If one never programmed before, perhaps this type of simplification is 'acceptable'.until one starts doing real work. is as effective as var=PINx, however, from my pov, still inefficient. Yea, if one is dealing with a slow interface, then burn cycles with digitalReads, etc. If I were doing this in strictly assembly language, the data sheet is the only reference, however, it is not always clear what the mapping (code wise) is from the Atmel assembly to 'arduino-ese'. Um, what exactly are you (or are you suggesting) editing? I do that quite often if there is some doubt about whether code has been optimized away, or whether method A is better than method B. elf files produced by the compiler to see what machine code is generated. Maybe it's slightly slower, but it tends to be more reliable and easier to maintain.Īnother thing you can do is view the. Someone has gone to the trouble of working out which bits belong to which ports, and it saves having to get all the bit positions right every time.Īfter all, most people use device drivers supplied with their printers, video cards etc., treating them as "black boxes" and don't try to work out exactly how to address them. Reading pin by pin is inefficient and slow. I would read the datasheet for the processor. Hello We have an xBee Pro S2C that is using this library (GitHub - andrewrapp/xbee-arduino: Arduino library for communicating with XBee radios in API mode) very well on a Software Serial connection to ports 2 and 3 on an Arduino Uno. Some of the magic is used to make things work seamlessly on different platforms (like the Tiny, Mega etc.). I just use "find in files" in my favourite editor (Crimson Editor in my case) and search for something like digitalWrite in the appropriate sub-folders. "UA Error Timeout no acknowiedge from server opc.tcp://10.1.0.Can either of you point me to the 'magic code' that underlies some of the arduino port and bit r/w libraries/macros? There is way too much 'magic' being hidden at these high level port statements with no discussion about how to control pull ups/down, and how many instructions are actually used to do some of the actions. But the connection could not be established with an Error message like. I am trying to etablish a OPC UA connection from a test client to an OPC Server running with TCP communication on my Arduino Mega 2560.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |