Show Posts
Pages: [1] 2 3 4
1  Using Arduino / Microcontrollers / Re: Guide: How to use an Arduino as an In System Programmer (ISP) on: July 23, 2011, 04:12:22 am
I had hell of a time getting the programmer to work. The ArduinoISP example in Arduino-0022 does not allow more than 255bytes to be uploaded. To solve that you need to use ArduinoISP-dev04b (found at the MegaISP issues page.

Additionally, my Diecimilla mounted Atmega328 refused to act as an ISP with the reset-resistor in place. Removed the resistor and all was golden.


Moderator Edit: Corrected link.
2  Forum 2005-2010 (read only) / Troubleshooting / Re: Gentoo amd64 and serial comms in Arduino IDE on: January 24, 2010, 03:52:17 pm
NVM. Should have read the notification at the Arduino website. Needed to use rxtx ver-2.2
3  Forum 2005-2010 (read only) / Troubleshooting / Gentoo amd64 and serial comms in Arduino IDE on: January 24, 2010, 01:19:31 pm
Hi. I can upload and run the IDE fine in Gentoo but when it comes to using the serial tool it always crashes.

This is the error I always get, even if I run the app as root.

Code:
reg@funtoo-pc ~/Documents/arduino-0017 $ ./arduino
Experimental:  JNI_OnLoad called.
Stable Library
=========================================
Native lib Version = RXTX-2.1-7
Java lib Version   = RXTX-2.1-7
#
# A fatal error has been detected by the Java Runtime Environment:
#
#  SIGSEGV (0xb) at pc=0x00007f693639d88d, pid=12075, tid=140089848777040
#
# JRE version: 6.0_17-b04
# Java VM: Java HotSpot(TM) 64-Bit Server VM (14.3-b01 mixed mode linux-amd64 )
# Problematic frame:
# C  [librxtxSerial-2.1-7.so+0x888d]  read_byte_array+0x4d
#
# An error report file with more information is saved as:
# /home/jon/Documents/arduino-0017/hs_err_pid12075.log
#
# If you would like to submit a bug report, please visit:
#   http://java.sun.com/webapps/bugreport/crash.jsp
# The crash happened outside the Java Virtual Machine in native code.
# See problematic frame for where to report the bug.
#
./arduino: line 20: 12075 Aborted                 java -Dswing.defaultlaf=com.sun.java.swing.plaf.gtk.GTKLookAndFeel processing.app.Base

Any pointers? I've had this issue forever and thought i'd try this place.
4  Forum 2005-2010 (read only) / Troubleshooting / Re: Resources for Learning C with Arduino on: November 13, 2009, 10:28:08 am
Quote
Have  you looked at http://www.smileymicros.com/ ?

That is brilliant. I've briefly looked and this appears to be more or less what I was looking for.

Cheers!

[edit] I've just looked through month#9-12 and there's very little real-C. Mainly arduino code or c with the wiring library. All very basic stuff. I'm going to have a look at the ones before.

Do like his drawings. Very good.
5  Forum 2005-2010 (read only) / Troubleshooting / Re: Resources for Learning C with Arduino on: September 12, 2009, 10:27:36 am
@Mike Mc
That's a great find! I already bought one of Tom's books before and found it to be a good resource. Bit too much Processing for my tastes though.

@Andreas Grech
I've heard recommendations about that book so many times that I may actually buy it at some point. Right now i'm just looking for some web links. I might go and ask at avrfreaks as they seem an alright bunch.
6  Forum 2005-2010 (read only) / Troubleshooting / Re: Resources for Learning C with Arduino on: September 11, 2009, 01:20:55 pm
How about web resources? Does anybody know of some good sites?
7  Forum 2005-2010 (read only) / Troubleshooting / Re: Resources for Learning C with Arduino on: September 10, 2009, 05:03:01 am
Quote
sorry, but most specialized software books cost are in that range...
that suck, but it's always like that...

Tell me about it. Hopefully I'll never have to buy another book that cost me as much as this.
8  Forum 2005-2010 (read only) / Troubleshooting / Re: Resources for Learning C with Arduino on: September 10, 2009, 04:07:30 am
@ Udo

As far as programming experience i've used Python for over a year and would say i'm about intermediate level. Bit of vhdl and lisp. I've also done a bit of C but that was with beej's guide to C.

What i'm having difficulty with is finding resources for C with avr's in mind.

@Professor Chaos

Whew! That's an expensive book. Right now i'm skinter than skint but if I had the money i'd most likely get it. Cheers.
9  Forum 2005-2010 (read only) / Troubleshooting / Resources for Learning C with Arduino on: September 07, 2009, 10:41:59 am
Hi everyone.
I've been wanting to learn C for a while and i'd like to do it on my Arduino. The main reason is i'd like to not be completely locked into the Arduino platform for avr development.

Does anybody know of any good resources that could help me?
10  Forum 2005-2010 (read only) / Syntax & Programs / Re: Timer  Problems on: August 19, 2009, 06:26:49 am
Cheers for the info. Yeah, i'm trying to stray away from arduino code as I want to learn C and avr's.

The thing is this code is just an attempt at creating a signal based on scaling the clock which is to be incorporated in a different project. Problem there is that the timings are down to ~50us.

I can't use the util/delay.h library like this

Code:
void my_delay(uint32_t time) {
    _delay_us(time);
 }

void main(void) {
   my_delay(100);
   blinkon;
   my_delay(100);
   blinkoff;
}
 
as it create massive hexfile. The _delay_us has to be called with a constant, not a variable. That's why i'm creating my own.
11  Forum 2005-2010 (read only) / Syntax & Programs / Re: Timer  Problems on: August 18, 2009, 08:33:01 am
Bump
12  Forum 2005-2010 (read only) / Syntax & Programs / Timer  Problems on: August 17, 2009, 03:45:58 pm
Hi, i'm trying to learn how to use timers  on my arduino in C.

The problem I have is scaling the 16MHz clock. I am trying to scale it by 8 and then generate a 1MHz signal by creating an interrupt every other cycle. The reason why i'm doing this the delay library goes all screwy when I create a timer.

My code looks like this

Code:
#include <avr/io.h>
#include <avr/interrupt.h>

void realtimeclock_setup() {
      TCCR0A |= (1<<WGM01);
      TCCR0B |= (1<<CS01) ; // 0.5us or 2Mhz
      OCR0A = 0x01; // a 1MHz signal
      TIMSK0 |= (1<<OCIE0A);
}

volatile uint32_t clk1;

SIGNAL(SIG_OUTPUT_COMPARE0A) {
  clk1++;
}

int delay_us(uint32_t val) {
      clk1 = 0;
      while ( clk1 < val ){
      }
      return 0;
}

int main (void){
      realtimeclock_setup();
      DDRB |= 0x04; // an LED
      DDRD &= 0xFB;
      PORTD |= 0x04;  //enable pullup
      sei();
      
      while (1) {
                  PORTB ^= 0x04;
                  delay_us(500000); //500ms
      }

      return 0;
}

Problem is that instead of a 1Hz blinking LED I have 0.2Hz blinking LED. Any avr C whizzes can see what i've done wrong?
13  Forum 2005-2010 (read only) / Syntax & Programs / Re: How to Zero Pad? on: May 31, 2009, 02:27:38 am
Cheers. The code looks good from here even if it isn't a single line solution. Python + AVR would be awesome.
14  Forum 2005-2010 (read only) / Syntax & Programs / Re: How to Zero Pad? on: May 30, 2009, 05:09:20 pm
What I mean by zero pad is to format a number.
Say I have a range of expected numbers, say 0 to 100, and I want every single one to be shown as a 3 digit number i.e. 1 = 001
In python it's easy
Code:
>>> a = 1
>>> "%03d" % a
'001'


15  Forum 2005-2010 (read only) / Syntax & Programs / Re: How to Zero Pad? on: May 30, 2009, 02:08:04 pm
I thought the language in the Arduino IDE is wiring. That or some kind of C.
Pages: [1] 2 3 4