Shop OBEX P1 Docs P2 Docs Learn Events
AVR made uber EASY! — Parallax Forums

AVR made uber EASY!

codevipercodeviper Posts: 208
edited 2012-04-02 13:20 in General Discussion
things needed
`1 parallel port
4 220 ohm resistors
4 wires
db25 connector
arvdude
avrdude GUI
one AVR close to one used on the arduino boards (atmega8 16 32 64 are all good)


google BSD programmer schematics
construct the BSD programmer
download Arduino compiler
search your C drive for compiled files (name of file).cpp.hex (example BLINK will compile to BLINK.cpp.hex
you may need to enable search to look in hidden files and folders
upload program using AVRdude GUI unselect to write or read fuses if you are uncertain of setings, as an AVR will run just fine as is, but will be froze if you pick a bad setting and will be briked if you dont have a high voltage programmer.
if you do want to set the fuses use the AVR fuse calculators you can find via google.
i have loaded arduino compiled code to Atmega48v-10pu chips like this and it is super easy.

i had to do something while i wait to buy new props lol

and i just thought id share what i have found to be dead simplest way to get an AVR chip going
no make files no complex command line options
and best of all
almost as easy as a prop to program
why do i want avr's?
1 avr = 6 ADCs and another cpu to pre-process analog data and other stuff for anywhere from $1 and up

but an ADC is from like $3 and up and the prop has to work some
if i can use an AVR to prescale the analog and plus maybe do some math for the prop i say SWEET.

Comments

  • mindrobotsmindrobots Posts: 6,506
    edited 2012-03-22 11:37
    I'm with you until i get to that "parallel port" step. Then I'm our of luck!

    Looks like a fun adventure if you're properly equipped!
  • codevipercodeviper Posts: 208
    edited 2012-03-22 12:52
    a USB to parallel port converter should work too.

    Parallel data is my freind
    serial is good to send data
    but give me a good old LPT port anyday ^,^
    get one, use one, forever parallel, viva la parallel
  • Duane DegnDuane Degn Posts: 10,588
    edited 2012-03-22 13:12
    codeviper wrote: »
    forever parallel, viva la parallel

    You're preaching to the choir around here.

    I've used an AVR Dragon on the few AVR projects I've had. I thought it worked well.

    Leon had sugguested it. (Thanks Leon.)

    I use AVR Studio to write the programs (I think Leon suggested this too). I think it works fine.

    I suppose you method is probably less expensive.
  • codevipercodeviper Posts: 208
    edited 2012-03-22 13:49
    definite it is sooooo cheap that is why it is perfect lol
    plus, i just ordered my new PROPs and 4 AVRs one ATMEGA48 will get a firmware to emulate rs232 via USB so i can just run the ATMEGA at 3.3volts and its IO pins should put out rs232 at 3.3 volt logic allowing me to program the props VIA USB cheap :lol: yup im a :nerd: to be so excited over this, but i figure im in good company. lol
    what do you think? i can program VIA 3.3 volt rs232 directly just like i can program using my serial to PROP right?
    lol.... yup that is my war-cry for the good old LPT port i wish they will migrate it to the MOBOS and give us an option to get a DB25 connector if we want to, id put my LPT port on the front.
    the computer i use to program MCUs is facing backward :lol: the CD and buttons are sitting on top facing to me and well i have decked it out with a few goodies. :smile:
    there is something great about having those options to prototype new stuff. after all if you make a devive that just needs to get and send data you can later on add a chip to make it a USB device.
  • codevipercodeviper Posts: 208
    edited 2012-03-23 14:08
    was bringing up AVRs too taboo here? :lol:
    i got to thinking id like to see an AVRstamp wouldn't that be cool?
  • mindrobotsmindrobots Posts: 6,506
    edited 2012-03-23 15:33
    Andre Lamothe (Hydra creator), has the Chameleon AVR and Chameleon PIC on his XGameStation site. You could look into those. Generally, there's not a lot of talk around here of other processors. Some AVRs used as peripheral controllers and such.I think I read some place that this was the Parallax Forum :lol:
  • Martin_HMartin_H Posts: 4,051
    edited 2012-03-23 16:21
    I've only used AVR's via the Arduino tool chain. When I bring them up in this forum I'm always try to couch it in the context of a Parallax product. Like using them for A/D conversion or with a Parallax sensors. Basically when in Rome.

    What is funny is that lately I've been using the Basic Stamp a lot. I mostly just read sensors and pulse servos and it works well for that. Plus I've been giving my son programming lessons and PBASIC syntax is easier than C syntax. Although I may need to use a Propeller or AVR as a GPS preprocessor given the Stamps memory constraints.
  • codevipercodeviper Posts: 208
    edited 2012-03-28 20:04
    i just got android to talk to an arduino!!!!!
    now next step when i get my new PROPS and some AVRs in the mail
    i will load one AVR with the USB to RS232 CDC drivers matching the ones on the arduino, then connect the RX/TX lines to the PROP and i should get android to talk to the PROP via USB host!
    and the best part is i did this with the android scripting enviroment! and the LUA scripting! so i can write scripts right on the android device to talk to the prop device!
    is this new or am i reinventing the wheel?
  • Cluso99Cluso99 Posts: 18,069
    edited 2012-03-29 04:42
    FWIW Ihave posted a proop program that programs the attiny avrs. I have tested the attiny84.

    They make a nice peripheral chip to the prop.
  • Heater.Heater. Posts: 21,230
    edited 2012-04-01 05:06
    codeviper,

    This sounds like an excellent approach to the Prop-Android link problem. Are you reinventing the wheel? Well, over a year ago I posted the "Android-android" thread here fishing for ideas on how to do this. There were many suggestions forthcoming including the use of Bluetooth, WIFI and so on. Then we have the USB host software for the Prop but that takes a lot of resources.

    So it looks like you have a sound, small, cheap new idea for this and I look forward to your writing up the results.
  • codevipercodeviper Posts: 208
    edited 2012-04-01 12:07
    thanks unfortunately i had to return the Android tablet i bought as it did not keep linked to the SDcard during downloads, and it will be some time till i can get a new one.

    here is what i did.
    Supplies
    wonder media 8650 tablet with host USB
    Z4root (i used the temporary root to avoid voiding the warranty)
    android serial api demo program (it includes the feature to show you available serial devices and a terminal)
    ASE android scripting environment ( i downloaded and used the LUA plugin)

    STEPS
    first i uploaded to the arduino a demo that used the serial output via the onboard usb to serial chip wich is also just an atmega16u
    then i connected the arduino to the tablet turned on the tablet
    i used Z4Root
    i started the serial SPI demo
    i used the config and found a "dev/ttyACM0" device and also set it at the right baud
    i used the terminal to check if it worked, and got the values for the POTs i had connected to the arduino.
    then i used LUA in ASE and followed a tutorial on using SERIAL PORTS in linux with LUA
    i ran a short program that just looped reading the serial data and printing it to the screen.


    ASE gives use of android APIs so there is the possible future of talking to your Prop bots or i like the ideal of Props turning on and of lights with voice commands.
    if this helps anyone that will be great.
    i just got more props and atmegas but i had to return the tablet it was just $50 dollars but a bad internet connection and an unreliable SD card are to big to ignore.
  • Heater.Heater. Posts: 21,230
    edited 2012-04-01 12:48
    Great stuff.

    So the trick here is in finding a Android devices with USB Host Mode.
    Sadly that rules out my Galaxy phone. Still that's expensive and always in use as a phone.

    Now the question might be why do we need the atmega? A proppug would do. Although I guess the atmega solution might be cheaper or easier to build on board.
  • codevipercodeviper Posts: 208
    edited 2012-04-01 13:50
    Actually the galaxy phones should have the use of host mode with an adapter.
    google it cause tons of the small mini ports can do it with an adapter.
  • rod1963rod1963 Posts: 752
    edited 2012-04-01 19:15
    Could use the new 28 pin PIC32 (PIC32MX230F064) that Microchip has introduced for USB interfacing. Sells for about $3.70. Or use the PIC24(64pin) that is on the IOIO board that Sparkfun sells, with that one you get a boat load of IO options and lots of memory too, 98k of RAM to be precise.
  • codevipercodeviper Posts: 208
    edited 2012-04-02 13:20
    rod1963 wrote: »
    Could use the new 28 pin PIC32 (PIC32MX230F064) that Microchip has introduced for USB interfacing. Sells for about $3.70. Or use the PIC24(64pin) that is on the IOIO board that Sparkfun sells, with that one you get a boat load of IO options and lots of memory too, 98k of RAM to be precise.

    yes, but does the android drivers recognize this chip as a normal device?
    personally I don't want to write my own driver for one chip when another chip will work with current drivers.
    there are also 40pin AVRs with good IO that support the CDC usb drivers that should work to.
Sign In or Register to comment.