Show Posts
Pages: 1 ... 3 4 [5] 6 7 ... 464
61  Development / Suggestions for the Arduino Project / Re: Non blocking hardware serial on: August 28, 2014, 02:53:42 pm
I created
62  Using Arduino / Programming Questions / Re: Using the Z register in assembler on: August 28, 2014, 02:44:48 pm
   "ld r0, Z \n\t"
    "mov %0, r0 \n\t"
with "ld", You're reading RAM.  You need to use "lpm" to read from the flash.
(RAM at 7FFE doesn't exist; who knows what you'll get)
(also note that the normal Uno Fuse settings do no allow lpm in the application to read from the "boot section")
63  Community / Bar Sport / Re: How many times is someone not replying after asking question ? on: August 28, 2014, 02:39:47 pm
dude, if you don't do my homework for me by the time it is due, an answer is of no use!
64  Community / Bar Sport / Re: Gas carrying charged particles on: August 28, 2014, 02:15:05 pm
A charged thing stores some energy even in the absence of a second conductor, andthere's an equation for the capacitance of an isolated conductive sphere: Proportional to the radius...  (4*pi*epsilon*R)
65  Development / Suggestions for the Arduino Project / Re: Non blocking hardware serial on: August 28, 2014, 01:47:04 pm
(running on Arduino Due)   ...  I measured the time required to complete the "write" command: it is nearly the same than the transfer time of the bytes over serial port at 9600 baud (so 1 ms for every sent byte).

I can confirm from code inspection that the Due "Serial" implementation does NOT use interrupts for transmission.
That's just broken, IMO.  The AVR Serial Transmit has been buffered for a long time now (since 1.0?)
66  Development / Other Software Development / Re: Documentation error; char is unsigned on: August 27, 2014, 08:19:18 pm
It's apparently an ARM thing; the web is full of people going "Why does char default to unsigned on ARM?"
67  Development / Other Software Development / Re: New peek function for HardwareSerial on: August 27, 2014, 08:07:35 pm
elaborate on your rant, otherwise you just fall in to the category of "one of those C guys".
how about something so the code ends up looking like:
void loop() {
  char *p;
  int8_t cmd;
  int n;

  Serial.print(F("Enter command: "));

  int i = parseGetline();  // read a line of text

  do {
    enum {
      CMD_RED, CMD_GREEN, CMD_BLUE, CMD_RESET  // make sure this matches the string
    cmd = parseKeyword(PSTR("red green blue reset")); // look for a command.

    if (cmd >= 0) {
      n = parseNumber();
    switch (cmd) {
      case CMD_RED:
        red = n;
      case CMD_BLUE:
        blue = n;
      case CMD_GREEN:
        green = n;
      case CMD_RESET:
        red = green = blue = 0;
      case PARSER_EOL:
        Serial.print("RED = "); Serial.print(red);
        Serial.print(" GREEN = "); Serial.print(green);
        Serial.print(" BLUE= "); Serial.println(blue);
        Serial.println("Invalid command");
  } while (cmd >= 0);

It lets you have dialogs like:

Enter command: red 123
RED = 123 GREEN = 0 BLUE= 0
Enter command: blue 789
RED = 123 GREEN = 0 BLUE= 789
Enter command: green 456
RED = 123 GREEN = 456 BLUE= 789
Enter command: reset
RED = 0 GREEN = 0 BLUE= 0
Enter command:

The current code isn't ready for publication, but it's about 600bytes of code, and 82bytes of RAM, which includes an 80byte line buffer and editing (backspace/del, ctrl-u, ctrl-r :-))   And no modifications to the arduino core.
68  Using Arduino / Microcontrollers / Re: Adding support for ATmega32c1 (Verification Error) on: August 27, 2014, 12:06:49 am
I am currently using a altered version of the optiboot code for my bootloader.
Which version of optiboot, and altered how?
Note that the current optiboot "master" version on theoretically supports ATmega32 without modifications (but you will have to build your own .hex file.)
69  Using Arduino / Programming Questions / Re: Problem with interrupts, can't figure out why it won't work on: August 21, 2014, 05:26:52 pm
the error is occurring before I ever get there.
 // enable timer compare interrupt:
 what you see is currently all of my code.

Where is the timer1 compare ISR?
Enabling an interrupt without having an ISR will cause a continuous reset loop; is that what you're seeing (I don't think you ever said exactly what is happening, beyond "it's not working."
70  Using Arduino / Microcontrollers / Re: issue with ArduinoISP when writing to target-EEPROM on: August 21, 2014, 10:13:24 am
avrdude -v -c arduino -v -C bin\arduino.conf -p atmega328p -P COM5 -U eeprom:w:eeprom_%1.hex:i -F
For talking to ArduinoISP, your avrdude command shoud look like:
avrdude -v -c stk500v1 -v -C bin\arduino.conf -p atmega328p -P COM5  -b19200-U eeprom:w:eeprom_%1.hex:i -F
71  Development / Other Software Development / Re: New peek function for HardwareSerial on: August 21, 2014, 02:28:11 am
These are awful.  Typically the buffer used for serial IO at the hardware level would be separate from the buffer used for parsing, even though that is somewhat memory inefficient.  Something like:

String token = Serial.readStringUntil('\n');
if (token == "RED") {
  // light red
} else if (token == "BLUE") {
  // light blue
} else if (token == "GREEN") {
  // light green
(Insert warning about String not being a great idea, given its current state, and maybe using Serial.readBytesUntil() and strcmp() instead.)
72  Using Arduino / Microcontrollers / Re: Upload hex file using bootloader on: August 21, 2014, 02:14:44 am
Leonardo uses "caterina" as the bootloader.
73  Using Arduino / Programming Questions / Re: (byte*)(void*)&value ??? on: August 21, 2014, 02:09:54 am
There could have been any number of casts between "&value" and "(byte*)", but the outcome would have been the same.
IIRC, C++ has some casting rules that are more complicated than those of C, so that there are SOME pointers or circumstances where you could not cast to a byte pointer ((byte*)) without first doing the cast to the generic pointer ((void*))
I am not enough of a C++ person to understand the details.
74  Using Arduino / General Electronics / Re: Best PCB degign for beginner. on: August 21, 2014, 02:03:09 am
Whether a part needs a "value" or not is something that you can control when you create the part via the radio button in the lower left corner of the "Device" panel.

In any case, it's not so much that everything reported by the ERC/DRC had to be FIXED, so long as they're understood.  That's why there is an "Approve" button.

Um, you should look at my tutorial on modifying design rules:
And be aware that switching regulators can be REALLY FUSSY about the PCB layout.

75  Using Arduino / Microcontrollers / Re: sketch bigger on MICRO? on: August 20, 2014, 09:43:29 pm
Feel like sharing your smaller driver?
It's depressing that so many of the libraries for dealing with "intelligent" chipsets (CC3000, Wiznet) end up being close to the size of full TCP stacks.
Pages: 1 ... 3 4 [5] 6 7 ... 464