Show Posts
Pages: 1 2 3 [4]
46  Forum 2005-2010 (read only) / News / Re: TellyMate Shield - TV output for Arduino on: April 28, 2009, 02:58:57 pm
The Batsocks TellyMate Shield is now available:

47  Forum 2005-2010 (read only) / Frequently-Asked Questions / Re: Maximum pin toggle speed on: June 15, 2009, 02:42:08 am
I've just used:

       avr-objdump -S mysketch.elf > mysketch.lss

in the applet directory of my sketch to produce a nice assembly listing (If you're not on Windows, replace '>' with the pipe mechanism for your OS).
Selfonlypath, I think you'll find it useful to pick through the .lss file. It should save you having to time everything to find your best solution. I have some sympathy with you doing cycle-counting - I've been cycle-counting video code recently to ensure jitter-free video output.

Re: using PIND to toggle bit-states.
It doesn't leave the cleanest of aftertastes. I think using this method has 2 downsides: a) It's the opposite of self-documenting code (self-obfuscating?) and b) It's not available on all Arduino hardware (e.g. Mega8). Hopefully the very smart people who develop avr-gcc will work out a way of optimising PORTD ^= 0b00001000 to the PIND equivalent one day (but I can see that being rather tricky to do).
48  Forum 2005-2010 (read only) / Frequently-Asked Questions / Re: Maximum pin toggle speed on: June 14, 2009, 06:54:41 pm
@selfonlypath:
The following code

    for(uint8_t i=0;i<250; i++){
        PORTD |= 0b00001000;
        PORTD &= 0b11110111;
    }

compiles (WinAVR-20090313, -Os) to the following instructions:

    
sbi      0x0b, 3      ; 11
    
cbi      0x0b, 3      ; 11
    subi      r24, 0xFF      ; 255
    cpi      r24, 0xFA      ; 250
    brne      .-10


sbi and cbi are 2 cycle instructions, according to my Mega88 datasheet.
This should therefore give a loop of 2 ticks ON, 6 ticks OFF, so 2Mhz output at 25% duty cycle.
I'd test this output, but the only test equipment I own is an ohmmeter, an LED and a damp finger (none of which help here).

Your original code (using while(1)) is slightly tighter, and should produce a 2.6666Mhz output at 33.3333% duty cycle (2 ticks ON, 4 ticks OFF).

I think that the best that is possible (without resorting to filling the chip with instructions) is the following code:
   while(1){
        PIND = 0b00001000 ;
    }

which results in a 2.6666Mhz output at 50% duty cycle (3 ticks ON, 3 ticks OFF)
The main caveat with this approach is it will only work on M88s and above.


If you know the state of the other pins on the port, then you could do something like:

    while(1){
        PORTD = 0b00001000;
        PORTD = 0b00000000;
    }

for a 4Mhz 25% duty cycle signal (1 tick ON, 3 ticks OFF)
or

    while(1){
        PORTD = 0b00001000;
        asm("nop");
        asm("nop");
        PORTD = 0b00000000;
    }

for a 2.6666Mhz 50% duty cycle (3 ticks ON, 3 ticks OFF) (e.g. similar to the earlier PIND example, except that in this case the state of the other pins must be known at compile time)

It would probably be useful to see the resulting assembly listing of sketches - does anyone know a simple way of getting a .lss file or similar from the arduino IDE?

Was there a real-world need for this square wave, or was it just a 'how fast can it go'?
49  Forum 2005-2010 (read only) / Frequently-Asked Questions / Re: Maximum pin toggle speed on: June 14, 2009, 02:31:58 pm
@selfonlypath:
Your code (or at least a variant using PORTB on my M8) compiles to:

sbi      0x18, 3
cbi      0x18, 3
rjmp      .-6

Each of these instructions are 2 cycles, hence this is a 6 cycle loop.
Note that it's not uniform though. The output will be on for 2 cycles, and off for 4 cycles.
50  Forum 2005-2010 (read only) / Frequently-Asked Questions / Re: Maximum pin toggle speed on: June 14, 2009, 01:14:29 pm
I think the new 'toggle' functionailty for pins works by writing a 1 to it's PIN register.
e.g. to toggle bit 3 of port B, you can do:

PINB = B1000 ;

[yup - M88 datasheet, section 13.1 : "writing a logic one to a bit in the PINx Register, will result in a toggle in the corresponding bit in the Data Register"]

This does NOT work on Mega8's.

I think this means a 3 cycle loop is possible (1 cycle for the OUT instruction, 2 cycles for the RJMP).
That results in a 2.666Mhz square signal.

In theory you can beat this by filling the memory space with that OUT instruction, and letting the program-counter roll-over at the end of flash, but there are problems with this solution, despite a theoretical 8Mhz output...
51  Forum 2005-2010 (read only) / Frequently-Asked Questions / Re: best way to turn off power on: August 08, 2009, 05:43:55 pm
For information:
Durability of 'normal' USB connectors is 1500 cycles according to USB.org's Cable and Connector Class 2.0 document.
(Although the wiki for Universal Serial Bus states 500 cycles)

What about using an extension cable - just disconnect at the 'centre'?
52  Forum 2005-2010 (read only) / Frequently-Asked Questions / Re: Sourcing more than 40mA on: April 21, 2009, 05:05:30 am
FETs that have a low turn-on voltage are often called 'logic level' FETs.
If you're scavenging, then computer motherboards often have ones that can switch whopping currents.
53  Forum 2005-2010 (read only) / Bar Sport / Re: TellyMate Alternatives??? on: October 08, 2010, 08:01:11 am
You can also run a second Arduino as a dedicated TellyMate...
http://www.flickr.com/photos/pixelfrenzy/3774232393/

I guess it boils down to wether your preference is for graphics or text.
The TellyMate is primarily a text output device. Any 'graphics' output is done by redefining the character set.
The TVout solution is primarily graphics output (but text is clearly possible!).

There's also a kit version of the TellyMate available now.
I would not call it a 'shield', but it will straddle the Arduino if required.
It's a few quid cheaper than the Shield - Google's currency conversion says it'd be around 20USD including P&P.

Here's a picture of it straddling my Roboduino variant:

54  Forum 2005-2010 (read only) / Bar Sport / Re: How do you say "Solder"? on: June 18, 2009, 05:57:57 pm
Quote
Are the syllables in English separated like that?
No. My intent on splitting it "Sold-er" was to split into a very common word, "Sold", which (as far as I know) is never mispronounced.
Stumbling across a few audio clips was quite alarming. I'm quite happy to wield a 'soldering iron', but I'd never want to go near a 'sod-ering iron'  :o

See this wiki page. The word 'sod' is commonly used in the UK, and (as far as I'm aware) the etymology is well known.



<Condemned now shuffles off again, stage left, for his nice cup of hot cocoa>
55  Forum 2005-2010 (read only) / Bar Sport / Re: How do you say "Solder"? on: June 18, 2009, 01:27:32 am
Sold-er. How else would you pronounce "Sold" ?!

<Condemned wanders off to have a nice cup of tea>
56  Forum 2005-2010 (read only) / Bar Sport / Re: Stupid question that lingers inside my mind on: June 19, 2009, 06:04:28 pm
I believe that Uzeboxes [Uzeboxen? Uzeboxi?] use overclocked AVR Mega644s at 28.636MHz, but I don't know if all the peripheral modules on the chip (such as USARTs) work at that speed.

#include <usual_caveats_about_overclocking.h>
57  Forum 2005-2010 (read only) / Bar Sport / Re: Atmega328 Shortage on: June 02, 2009, 02:34:06 am
Does that mean I shouldn't hold my breath for samples from Atmel?
That's so frustrating! I've just found a great use for a 328 (lovely 2kb SRAM).

I suppose you're going to tell me I can't get any XMegas or Mega1284s either smiley-wink
58  Forum 2005-2010 (read only) / Bar Sport / Re: logo for arduino? on: April 28, 2009, 03:40:35 am
Taking mem's simplification and reducing it even more...


Pages: 1 2 3 [4]