Show Posts
Pages: 1 2 [3] 4 5 ... 8
31  Using Arduino / Microcontrollers / Re: TinyTuner, attiny85, serial over USB, how to connect ? on: February 12, 2012, 04:19:07 am
Yes, I do have a Duemillanove.
32  Using Arduino / Microcontrollers / Re: Ported working prog from Arduino board to attiny85, not working on: February 12, 2012, 04:18:04 am
However, wondering if I can use something like the SoftSerial + MAX232 to interface with laptop's Serial-USB converter, to try out the sketch within TinyTuner ?

Let's work through Tiny Tuner on the other topic.

Quote
However, I am thinking that it might be a good idea to stagger around that value itself, right ?

That's essentially how Tiny Tuner works.  The factory value is the starting point and it hunts in either direction for something more accurate.

Tiny Tuner does not check the other range.  I assumed that the Atmel folks picked a particular range for a reason and that it is best to hunt within that range.  My assumption about hunting within just one range could easily be wrong.

Fair enough.

Quote
My program is quite sensitive to timing, however, on Arduino, I use the standard Arduino micros() function, to determine valid (versus noise) RF signals and do the decoding, i.e. identify valid waveform vs noise.  ... As per my current (not-so-accurate) logic though, with factory defaults, I remember clocking around 501Hz, which is then effectively very good accuracy of 0.2%. ... My algorithms (my original program) have 5% timing tolerance built-in, so I guess the clock frequency shouldn't be an issue. Wonder what else could be going wrong ?

The granularity of micros is 4 when the processor is running at 16 MHz and 8 when the processor is running at 8 MHz.  Could the much courser granularity cause a problem?

Up to, 40us worth of variation is tolerated by my program.
33  Using Arduino / Microcontrollers / Re: Ported working prog from Arduino board to attiny85, not working on: February 12, 2012, 03:27:40 am
@CodingBadly, thanks for explaining this.

While reading the data-sheet, to understand more about OSCCAL and I did see the 2 ranges split but wasn't 100% clear on what it achieves, thanks to your explanation now I understand. I also did notice that the graphs were non-linear (somewhat expected).

Had forgotten about BlinkWithoutDelay and I had been redirected to it, for a very similar reason earlier. Will certainly try my experiement with it. However, wondering if I can use something like the SoftSerial + MAX232 to interface with laptop's Serial-USB converter, to try out the sketch within TinyTuner ?

As per my current (not-so-accurate) logic though, with factory defaults, I remember clocking around 501Hz, which is then effectively very good accuracy of 0.2%. I forgot to note the OSCCAL value when factory set. I will see what it is. However, I am thinking that it might be a good idea to stagger around that value itself, right ? Both in the lower and upper ranges.

If this doesn't work, I plan to try with a XTAL to see if that helps. My algorithms (my original program) have 5% timing tolerance built-in, so I guess the clock frequency shouldn't be an issue. Wonder what else could be going wrong ?
34  Using Arduino / Microcontrollers / Re: Attiny 85 IR problems on: February 11, 2012, 11:56:04 pm
@Will, looks like we are in the same boat, since I've done all those test-individual-parts-before-you-put-em-together, and I seem to have a similar issue with RF decoding, not so different from IR decoding.
See my current open post here.

Everything else being similar, my main attention at the moment is around clock's accuracy, since such decoding logic depends on accurate timing. While there are some tolerances built into the algorithm, with sufficient clock drift/skew, it can still be thrown off, and that is what I suspect is happening. I know my RF decoder algorithm inside out, and given all the other testing I've done around it, I see very few other possibilities... may be, barring the possibility of INT0 handling, not being exactly similar as one expects in 328p based Arduino, although possibility of that should be rather lean, since the logic for hooking an ISR to external interrupt should be a pretty lean-n-thin one.

I've got one suggestion to check/correct the clock accuracy issue thru calibration, and found CodingBadly's TinyTuner, but missing bits-n-pieces of how to rig-it-up. Details in my same thread, and also this one (which is more about the harness for calibration).

I shall be watching this thread as well.
35  Using Arduino / Microcontrollers / Re: Ported working prog from Arduino board to attiny85, not working on: February 11, 2012, 02:44:20 pm
Awaiting some further clarity on how exactly to hook up, I improvised (I think), but the results aren't very encouraging.

What I did was to write a small program that just toggles a pin, and does delayMicroseconds(1000) sleep, and toggle pin again. Then I attach my OLS logic-sniffer and measure the frequency of the entire capture. Without OSCCAL set, I notice a frequency of 501Hz. So I went ahead and introduced OSCCAL=0x60. Now the frequency dropped to 427MHz. Then I set OSCCAL=0x70, and frequncy became 478MHz. Then I tried used several iterations to try and narrow down the OSCCAL value to match frequency of 500Hz, however this didn't succeed, as with --

OCSCCAL = 0x75, frequency I get is 503, and with OSCCAL=0x74, the frequency I got is 497Hz, which means, that for no value of OSCCAL can I get precise 500Hz, and that effectively without user-caliberation of, the factory calibration is good enough. Thay thoughts, anyone ?
36  Using Arduino / Microcontrollers / Re: Ported working prog from Arduino board to attiny85, not working on: February 11, 2012, 10:41:07 am
@johnwasser, I do have a Duemilanove with the quartz crystal. However at the moment, I've very little idea, how I can use that, to do this caliberation. I mean, what would the physical connectivity between Arduino and the target ATtiny be like.

BTW, I've started another thread regarding the wiring-up required for TinyTuner.
37  Using Arduino / Microcontrollers / TinyTuner, attiny85, serial over USB, how to connect ? on: February 11, 2012, 10:38:05 am
Hi,

This topic deserves independent attention, so branching this off from my other open thread.

My development PC is a laptop, and it has no serial port. I do have a USB to serial converter based on an el-cheapo (and somewhat notorious) Prolific chip. Apparently, these are the cheapest, and used in the most common of such converters all over eBay. I run Ubuntu Linux on this laptop. This USB-to-serial converter surely works on this laptop, since I also use it for some work I do on an ARM board.

The instructions found for attiny85 in the Save_to_EEPROM.pde sketch under examples, bundled with TinyTuner, say thus --

Code:
 - Select the correct board / serial port
  - Upload this Sketch to the processor
  - Connect PB4 / Pin 4 to transmit on the serial converter
  - Connect an LED + resistor --> ground on PB0 / Pin 0
  - Start your favorite terminal program, open the correct serial port, change
    the baud rate to 9600

So now, I am wondering as to how exactly do I connect the female DB9 out from the USB-serial converter, to attiny85. While I do not know the details of RS232, I believe that they and ATtiny use different logic levels (TTL and CMOS), and I need a buffer in between. Is that right ? I think I do have some MAX232 samples, but those are SMD ICs, which I am not comfortable soldering. So I wanted to be sure if I really need to use those, or is there a simpler way. Or, maybe I have misunderstood the instructions, and all this mumbo-jumbo isn't required.

A schematic on how to connect this, would be really very helpful.
38  Using Arduino / Microcontrollers / Re: Ported working prog from Arduino board to attiny85, not working on: February 11, 2012, 10:22:27 am
The more I read of TinyTimer, the more I am certain that indeed it does what was recommended by you, @johnwasser.

CodingBadly has not only done a great job of writing that software, but also documenting it darn well -- very important for n00bs like me.

I found some easy/simple to follow instructions in: TinyTuner/examples/Save_to_EEPROM/Save_to_EEPROM.pde file, specific to attiny85.

Will try this out. Thanks @johnwasser, and @CodingBadly. Will report back on how it goes.

39  Using Arduino / Microcontrollers / Re: Ported working prog from Arduino board to attiny85, not working on: February 11, 2012, 10:00:10 am
Thanks @johnwasser. I guess, I've hit the limits of my knowledge of AVRs, but taking a hint from "clock recalibration", I did recollect having seen a tool on Arduino-Tiny google-code page, that might do something similar. It is called TinyTuner. It requires something that can pump in 'x' accurately at 9600bps into the target attiny85, on pin#0. The program does seem to update OSCCAL in the end. Could you confirm if this is something that could be useful in my situation ?

Can I use an Arduino to pump 'x's into the target attiny, at 9600bps. I guess, it should be possible, accurately enough. Some examples, or pointers to existing schematic for this purpose with help. BTW, at the moment I do not have an RTC IC, but will get one if there is no other way.
40  Using Arduino / General Electronics / Re: Where to buy Arduino wholesale on: February 11, 2012, 09:17:24 am
There are lot of great replies on this post, and I personally think jwatte's is closest to reality.
Couple of years back, 40% margin on hobby retail wasn't that big a deal, but with online stores who often hold little inventory, don't have any brick-n-mortar costs, and some even drop-ship from far-east, staying competitive with 40% margin means, you have some very (very) impressive volumes.
41  Using Arduino / Microcontrollers / Ported working prog from Arduino board to attiny85, not working on: February 11, 2012, 07:43:25 am
Seeking some advise and pointers on how to analyze and fix my program, which worked as expected on Arduino (Duemillanove), but once ported to ATtiny85, doesn't work any more.
My program decodes an ISM band (315MHz/433MHz) ASK/OOK, proprietary encoded signal on the MCU, using INT0 (external interrput), and based on detection of all transitions (high to low and low to high edges).

Some of the key differences, I can tell, are:

1. Arduino has XTAL (and thus higher precision) clock @ 16MHz, but my ATtiny is running at 8MHz using internal oscillator. My program is quite sensitive to timing, however, on Arduino, I use the standard Arduino micros() function, to determine valid (versus noise) RF signals and do the decoding, i.e. identify valid waveform vs noise. However on ATtiny85 side, I still use Arduino-Tiny, with the F_CPU rightly set (well, I trust Arduino IDE to do that for me, since I've the right Board type set), and fuse-bits blown accordingly (i.e. burn bootloader done). So, I think I am good on this part, i.e. shouldn't be an issue.

2. Pins used have obviously changed. On Arduino I was using DigitalWriteFast (user-contributed) library, that makes usage of digital Pins significantly faster compared to Arduino's standard lib for same. However, I couldn't get DigitalWriteFast to work on ATtiny85, so I made my own function, that directly uses DDRB, PORTB, PINB, with right set of masks. I've tested those functions of setting pin mode to OUTPUT/INPUT, and setting pin value HIGH/LOW etc., separately in a simple program, and they work fine. So I am ruling this aspect out (for the moment).

3. Since I depend on INT0 external interrupt, I am dependent on Arduino-tiny's support (i.e. correct implementation) for that via attachInterrupt(0,...) , and the RF data source is indeed connected to Pin#7 (INT0) on ATtiny85.

I am positive that the LED's on the outpin pins are wired up correctly. I've tested those using test program on exact same MCU using the direct port manipulation method (DDRB, PORTB... settings), and they work fine.

So I am at loss, as to what might be going wrong. Some obvious guesses (which I find tad hard to justify though) are --

A) The difference in clock is hurting me somehow on ATtiny85
B) INT0 interrupt handling in Arduino-Tiny isn't exactly correct, or maybe it's usage is bit different in ATtiny85.
C) Anything else... ?

Oh BTW, I do not have a DSO, but have a fairly functional OpenBench "Sump" LogicAnalyzer, so my troubleshooting tools are kind-of limited. Since I do not have a FTDI breakout board either, I can use Serial.print().

Thanks in anticipation.
42  Using Arduino / Microcontrollers / Re: Can EEPROM be written via ISP without overwriting/impacting flash on: February 09, 2012, 02:48:02 am
Thanks a ton, @CodingBadly. All questions clearly answered.
43  Using Arduino / Microcontrollers / Re: Comm between Arduino and a ARM SBC, what easy, reliable way ? on: February 09, 2012, 01:41:25 am
Thanks @CodingBadly.
44  Using Arduino / Microcontrollers / Re: Can EEPROM be written via ISP without overwriting/impacting flash on: February 09, 2012, 01:40:12 am
Thanks @retrolefy and @CodingBadly.

@CodingBadly, when you say "328 family bootloaders... do not support accessing the EEPROM", do you mean to highlight tha t as a current limitation of those bootloaders, and something to keep in mind if I plan to do anything with the bootloader code ? Does it mean that if a Duemilanove or Uno is used as the target (not as the "Arduino-as-ISP board"), directly connected to PC via Serial-over-USB, I can't directly write to EEPROM ?

Well, I am interested in both things, i.e. -

1. Use Arduino-as-ISP (or even willing to invest in that nice Pololu USB ISP), to program the target ATtiny85, and also write/read information on it's EEPROM from the PC.
    a. Is this possible ?
    b. Can I use avrdude command-line version using Arduino-as-ISP to read / write EEPROM ? Or I need a dedicated ISP ?

2. Somehow (not sure how), target Arduino board (Uno / Duemilanove)'s EEPROM, to be read / written from PC.
    a. Is this possible ?
    b. Can I use avrdude command-line version for this ? I guess not, because bootloader doesn't support it ?

Hopefully, I could reset the fuse-bits (if set) that erase EEPROM when programming the flash, using avrdude commandline, and either a standalone ISP or Arduino-as-ISP.

45  Using Arduino / Microcontrollers / Comm between Arduino and a ARM SBC, what easy, reliable way ? on: February 08, 2012, 11:52:39 pm
Would like to exchange some information (100 bytes/sec is enough), intermittently (e.g. once every few seconds), between Arduino and an an ARM9 SBC running Linux.

One viable way, I believe is I2C, but from my research so far, it looks like there isn't a well-tested / mature library on Arduino side to do client-side communication. Is this really (still) the case ?

Another approach could be USB. However, that is not preferred because the ARM SBC is short on USB ports, existing port is already occupied. Also, when I mention Arduino, I mean a possible low-cost bare-bones ATmega328 based custom board, which is unlikely to have USB.

What other options do I have ? Within multiple options, my preference would be for one, which has least overall complexity, and cost.

thanks,
F
Pages: 1 2 [3] 4 5 ... 8