Continue to Site

Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

help in Avr program!!

Status
Not open for further replies.

karan123

Member level 3
Joined
Feb 2, 2009
Messages
55
Helped
0
Reputation
0
Reaction score
0
Trophy points
1,286
Activity points
1,710
Hi,

I have made ISP programmer given at.

PonyProg2000 - Download page.

I am successfully blink LED with that programmer but it takes

but i takes 1 to 2 min for loading hex file.

is it very slow??

now i have written program for serial communication and lcd as attachments

but they are not working


i am checking on hardware

my hardware in ok because ATmega8515 is pin to pin compatible with 8051

both things are working with 8051 code.

any other setting or mistake in program.

i m using AVR studio and WINAVR GCC.



--
Also ,

What are fuse bits? how to configure that and when to configure that?? (in AVR studio).

--
Karan
 

Attachments

  • programs.rar
    1.2 KB · Views: 59

pony prog is good software. check ur crystal. be cautious in using fuse bits of avr. it is the main complicated part of avr. read datasheets as many times as possible. check tis post if u wrongly programed avr https://www.edaboard.com/threads/131804/
 

Better go for usb based programmer, usbasp is one of the option.

Fusebits are used to set the options like oscillator, brownout, bootloader, lockbits, etc.

Be careful with fusebits or else you will need a parallel programmer to reset it
 
Thanks...

you have checked my attachment Program?


by karan
 

Check the fuse bits for oscilator ,in the program is not prezent do it like this:#define F_CPU 8000000UL // 8 MHz or else
then seee this page : AVR Fuse Calculator for ATmega8
and correct fuse bits.For slow programming with Pony -do you use calibration button from control panel?
 

Thanks

I have changed my X'TAL .Now programmer is fine.

After Writen :

#define F_CPU 8000000UL // 8 MHz

Serial communication working fine.

But LCD program still not running.

How to use calculator to calculate proper fuse settings..

Like i am using ATmega8515 with 8 MHz Crystal OSC.?


Karan
 
Last edited:

Post all code please for LCD,libraly from where?4 bits or 8 bit use for comunication wiht LCD?
Crystal i not a problem.Shematics for circut ,pins and ports?
 

Thanks for Reply..

Here is code.

I am using LCD 16 x 2 in 8 Bit mode..

i m using AVR studio and WINAVR GCC.

But my Serial Communication working fine.

karan
 

Attachments

  • lcd1.rar
    713 bytes · Views: 53

Thanks for Reply..

Here is code.

I am using LCD 16 x 2 in 8 Bit mode..

i m using AVR studio and WINAVR GCC.

But my Serial Communication working fine.

karan
 

I think that you are using 4 bit mode.I will test on my board ,but with atmega8535 and in BASCOM AVR ,and post a .hex file so you can try .
ports: Pin , Rs = Portb.0 , E = Portb.2 , Db4 = Portb.4 , Db5 = Portb.5 , Db6 = Portb.6 , Db7 = Portb.7
hex:
:100000000C942A001895000018950000189500001F
:10001000189500001895000018950000189500002C
:10002000189500001895000018950000189500001C
:10003000189500001895000018950000189500000C
:1000400018950000189500001895000018950000FC
:10005000189500008FE58DBFC0E4E8E34E2E84E0E4
:100060008EBFD4E0F4E05F2EEEEFF3E0A0E6B0E068
:10007000A89584B7082E877F84BF88E1992781BD22
:1000800091BD88278D933197E9F70E947700662408
:100090000E946900E1E0F0E00E946E00EAE0F2E018
:1000A0000E9460000E946700ECE1F2E00E946000A4
:1000B000E1E0F0E00E946E000C944800F894FFCF5D
:1000C0000E940101802D11F05AD0FACF089580ECE2
:1000D0005CC081E05AD008D080E857C088EE93E039
:1000E00081D03197D9F7089583E099277BC08AEFB3
:1000F00090E00E94F200BF9ABE9ABD9ABC9ABA9A4A
:10010000B89AC09885E090E00E94F200C298C79823
:10011000C698C59AC49AC29AEF93FF93E4ECF0E0B4
:100120000E94E600FF91EF91C29859D0C29AEF93D6
:10013000FF93E4ECF0E00E94E600FF91EF91C2989B
:100140004ED0C29AEF93FF93E4ECF0E00E94E600F9
:10015000FF91EF91C29843D0C498C29AEF93FF9356
:10016000E4ECF0E00E94E600FF91EF91C29837D0F6
:1001700088E20BD08EE009D086E007D00895C09ABF
:10018000829505D004D02BD00895C098F9CF8595DD
:1001900010F4C49A01C0C498859510F4C59A01C0A2
:1001A000C598859510F4C69A01C0C698859510F437
:1001B000C79A01C0C798C29AEF93FF93E4ECF0E0AE
:1001C0000E94E600FF91EF91C29808953197F1F7F0
:1001D0000895689462F80895E89462F8089581E0BB
:1001E00090E000C0EF93FF93EE27E82BE92B31F06E
:1001F000E0EDF7E03197F1F70197D1F7FF91EF913B
:100200000895C895319600200895A0C2BBB46170CE
:1002100063BAB820BE6F70BF61BB00002020BE6F04
:0A02200020706FB26FBFB8BA610022
:00000001FF
The LCD is in 4 bit mode.RW to -/gnd/.if is not working chek cables or LCD
If you are using pony prog for programming software ,you can not program fuse bits automaticly.
 

If u used PonyProg to programme your chip, the first important thing u have to think about is the Fuse bit. U need to know your fuse bit configuration. For example CKSEL0 bit, CKSEL1 bit...It decide frequency in which your chip is actived. If u make mistake with your fuse bit, your chip may not work.
By the way, 1 or 2 minutes is not problem with PonyProg. Your chip can work well if the programme inform sucessfull.
In this picture, u need to discover:
 

Attachments

  • up.bmp
    960.1 KB · Views: 55
Last edited:

OK..


But my Serial Communication code working fine..

After Writen :

#define F_CPU 8000000UL // 8 MHz


Why not LCD Program?? As previous Attachment.

After Reading from From Datasheet , I have first program the fuse bits from as .jpeg to loading .hex file?

is it the correct method for that?






hanks

karan
 
Last edited:

It is wrong. Becuase in PonyProg, let u see the notice below: Check items means programmed (bit=0). So if u want the chip work with external crystal, u have to config with all CKSEL uncheck. By defautl, the chip work with 1MHz internal.
Regards,
 

Hi,

My Code is working fine in Simulator.

but not on hardware.

I am using AVR stdio with AVR GCC compiler with ponypro programming software?

may be small problem.

any experience person in avr plz. reply..

what left?.. for running code in hardware



89_1286475261.jpg


karan
 

Attachments

  • lcd1.rar
    782 bytes · Views: 46

CKSEL 1111 SUT 11 to work with extal crystal or resonator High Freq.
See here:
**broken link removed**
Or program "AT90S4414/8515 compatibility mode" fuse
 

Simulation & real hardware differ in timings. Increase/ insert timing after sending first command (0x38) and following commands.

Nandhu
 

@nandhu0

I have changed Delay but no success!!!
 

The code is present in the first att. but ,I think that some wrong connection in the project or loss of signal,or some port of the MCU is damaged.Test the ports with LED and resistor wit simple on/off code.
 

Status
Not open for further replies.

Similar threads

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top