Show Posts
Pages: [1] 2 3 ... 22
1  Using Arduino / Microcontrollers / Re: Atmega328 - 28PU bootloader issues with USBasp | DIY arduino on: August 14, 2014, 01:04:09 pm
I keep getting the same error which is "cannot get sck period".  I have some experience flashing speed controllers for quadcopters using the USBasp and from my experience when you get this error it is usually because of a connection error.

no.  you are the 401 thousandth person to say that. in fact that is not an error at all. just a warning and should be ignored.

from my experience all the cheapest usbasp from ebay work fine. since  yours works with other avr chips it is virtually impossible thats the problem. your chip is maybe defective or wired wrong. pay attention to the other hints in this thread.

or more likely you have the wrong part selected. there are many variations of m328. i suggest using avrdude from the command line and try to read fuses with -F option. post results here to find what your problem really is.


A multimeter on Ebay costs 4 dollars, but they can be 20% inaccurate.

i disagree. ive obtained dozens of those same cheap meters from harbor freight and a few from  ebay. every time theres a coupon in a mag i pick one up for free. worth the trip just for that 9v battery. anyway they test accurate to withing a fraction of a percent every time. even if they didnt there is a trimpot inside that would allow dead on calibration at least as good as the $100 ones. a modern technological marvel.
2  Using Arduino / Microcontrollers / Re: Is it possible to program an Attiny85 with a USB-to-TTL converter? on: August 07, 2014, 07:19:43 am
I'm actually a Linux guy. Could you tell me a bit more, it sounds interesting!

What messages and  protocol is used for the serial communications?

no protocol at all. simply send a file out serial. 5ms or so pause every 32 bytes might be nice but even that can be skipped if baud is low enough. the big advantage to adding something like this to avrdude is can work with hex, elf, binary, s19, or whatever, depending on what the target wants. the program dont care whats actually in the file.

i agree about wimpy windows. other description might be more accurate but this is a public forum, lol. unfortunately its defacto os so we are stuck. i could probably do this myself but considering the nightmare toolchain and the current  utility works for me personally so not worth it for hobby use. mostly this is for the other guys out there who need a tiny serial bootloader. it was a cinch under msdos as can be seen here:


Code:
/*    binld1xx.c    reset then send serial bytes w/pause every 16words*/

#include <stdio.h>
FILE *RD,*WR;
unsigned int Port=0x3f8;
  
main()
 { unsigned int g,i,j,k,Count=0,Len;
   unsigned char c,d,s[81],t[81],A[81];
   unsigned long h;
   printf("v1.02  BINLD (c) 1998 JPS Engineering\n");
   RD=fopen("t.hex","rb"); if (!RD) { puts("No file!\n"); exit(1); }
   outportb(Port+4,0); dlyms(100); outportb(Port+4,3); dlyms(100); /*reset*/
   while (1)
    { t[2]=0; i=0; while (1) /*fil2buf*/
       { if (!fgets(s,81,RD)) break;
         if (s[8]=='1') break;
         if (s[8]=='0')
          { s[7]=0; sscanf(s+3,"%x",&h); s[3]=0; /*hex2bin*/
            sscanf(s+1,"%xl",&Len); j=9; k=0; while (k<Len)
             { t[0]=s[j++]; t[1]=s[j++]; sscanf(t,"%02x",&g); A[i++]=g; k++; }
          }
       }
      Count=i; if (!Count) break; /*buf2ser w/pause every 16wrds*/
      i=0; while (i<Count) { if (!(i&0x1f)) dlyms(10); serout(A[i]); i++; }
    }
   puts(""); fcloseall(); return(0);
 }

dlyms(ms)
unsigned int ms;
 { unsigned long l;
   l=ms; l=l*475L; while (l--) inportb(Port);
   return(0);
 }

serout(chr)
unsigned char chr;
 { while (!(inportb(Port+5)&0x40)); outportb(Port,chr);
   return(0);
 }
3  Using Arduino / Microcontrollers / Re: Is it possible to program an Attiny85 with a USB-to-TTL converter? on: August 06, 2014, 03:44:41 pm
some time ago i wrote a 64 byte bootloader for tiny13 that also works unmodified on tiny24, tiny25, etc. (works on the mega versions too but theres little point to that). unfortunately my most convenient programming software only runs on real mode os so probably not of great interest to windows users. if anyone can produce a utility that simply wiggles dtr then sends a file out serial or modify avrdude to do this i will gladly post the avr code.
4  Using Arduino / Microcontrollers / Re: Pro Mini programming with USBasp on: August 05, 2014, 05:42:25 am
this might be another case of the blind monks and the elephant with me only feeling up the "good" part. ive had less experience with the fischel version and the only ones that ive personally seen fail were $7-$10 ebay units which account for only a small fraction of the listings.

many dozens of $2 cheapies purchased for my own use and for others worked flawlessly with raw chips and with large m2560 images. from what i can tell nearly all internet complaints for those boiled down to bad wiring or failure to follow instructions. or using some of those queer and buggy gooey shells. the cli batch files i provide work flawlessly time after time.

so we do agree re-flashing these is not for noobs. "six wires' and "schematic". lol. the devil is in the details.
5  Using Arduino / Microcontrollers / Re: Pro Mini programming with USBasp on: August 04, 2014, 08:48:52 pm
all these issues have been discussed here a million times. well... maybe thats an exaggeration... really only half that many. 400k tops.  in my experience there is no problem as long as you go for the cheapest $2-$3 usbasp and avoid those oddball fancy metal case with built-in coffee maker versions. out of literally hundreds of cases the only real issues were caused by those who felt the need to update firmware that didnt need updating. a complicated and expensive procedure that often results in a truly bricked programmer.

"if it aint broke then fix it til it is" syndrome. or maybe ive just been unbelievably lucky.

and btw there never was a usbasp problem with >128k memory. maybe you are confusing it with mkII or tinyisp which did have some noobs jumping through hoops..
6  Using Arduino / Microcontrollers / Re: Pro Mini programming with USBasp on: July 31, 2014, 10:44:33 pm
Ah, I see, thanks. What does that "cannot set SCK period" error even measn then?

there is no sck "error". it is a warning only and should be ignored. there are literally thousands of complaints about this on the internet and in many cases programmers are returned to seller for no reason. lots of them are bricked trying to fix a problem that does not exist.  they should change that warning but unfortunately most sellers dont even know what usbasp is or whats its for.
7  Using Arduino / Microcontrollers / Re: Serial baud rate on: July 28, 2014, 08:03:19 pm
you tell me to go and learn

my mistake. i see now unlikely to happen.
8  Using Arduino / Microcontrollers / Re: Serial baud rate on: July 28, 2014, 06:10:18 pm
google is your friend. i notice many are from this very website. heres a couple crossroads posted here recently:

http://ucexperiment.wordpress.com/2013/05/31/arduino-blink-using-gcc-inline-assembly/
http://ucexperiment.wordpress.com/2013/06/03/gcc-inline-assembler-cookbook/
9  Using Arduino / Microcontrollers / Re: Serial baud rate on: July 28, 2014, 05:46:56 pm
i can see now that as suspected you are not reading these posts carefully. anyway fyi this is for a 64 byte version of optiboot which will run fine on arduinos.

ps, it will also work within any arduino sketch when properly integrated.
10  Using Arduino / Microcontrollers / Re: Serial baud rate on: July 28, 2014, 05:17:56 pm
performance...lol. i dont thinks it has any performance advantage except smaller and more accurate for reasons described above.

Code:
RxByte: ldi r23,0x80
 ldi r24,15
l1: sbic pinb,3
 rjmp l1
l2: rcall l3
 ldi r24,31
 sbic pinb,3
 sec
 ror r23
 brcc l2
l3: subi r24,1
 brne l3
 ret

this is from a bootloader im working on. iirc we can drop at least 2 more bytes but there was some drawback i dont recall atm. i think this is about half the size of atmels demo,  btw its not my invention but from a fellow a lot smarter than me. crazier too if thats possible. many others have taken advantage of his creativity.
11  Using Arduino / Microcontrollers / Re: Serial baud rate on: July 28, 2014, 03:20:25 pm
if you dont understand that uart baud is limited to 2 clk resolution while nops adjust to 1, all avrs have a portb but minority have uarts, and hw cant do 3/9/16 bit protocols, etc then references wont help. if you really twist my arm i can post code for serial in that is 3/4 the smallest hw routine.
12  Using Arduino / Microcontrollers / Re: Serial baud rate on: July 28, 2014, 02:57:38 pm
Software serial has issues even running with a crystal, so its not a great comparison to start with.

if by twice as accurate as hardware uart (2x resolution), more portable, less code, and more flexible protocols then you are correct. in fact its about the only way to guarantee reliable operation of 115k at 8mhz. the only place where uart excels is when doing many other things concurrently. even then, using pin ints in conjunction w/softserial reduces that problem.

specially comes in handy on avrs that have no uart. lol.
13  Using Arduino / Microcontrollers / Re: Serial baud rate on: July 28, 2014, 10:45:59 am
actually using internal osc has nothing to do with uart or softserial. generally 99.9% of new avrs work fine for either w/o any trimming. default osccal is very close to 8mhz. older ones like mega8 which have level 2 type internal osc still pretty close. in my experience 95% require no tuning. calibration is so easy though it dont make too much sense to avoid that step.
14  Using Arduino / Microcontrollers / Re: Using atmega 8 on: July 27, 2014, 08:34:03 am
all m8 chips work fine with 16mhz crystal on 3.3v or 5v. ng baud with that crystal is 19.2k. with 8mhz crystal 9.6k works fine. going from one clock to the other its not necessary to change bootloader. only change 16mhz/19.2k to 8mhz/9.6k in boards.txt.
15  Using Arduino / Microcontrollers / Re: Serial baud rate on: July 27, 2014, 08:22:56 am
at 8mhz 115k the internal oscillator is capable of providing more accurate timing than a crystal. uart divisors have too much error at exactly 8mhz but with slight adjustment of the internal clock can be right on for that baud rate. 1mhz is mentioned a lot lately but cable issues and operating system incompatibilities often prevent communication with a pc . imo 57k is the best choice for all hardware configurations including 8mhz xtl.
Pages: [1] 2 3 ... 22