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.

[AVR] help for programming atmega8

Status
Not open for further replies.

farzinkalali

Newbie level 3
Joined
Oct 29, 2014
Messages
4
Helped
0
Reputation
0
Reaction score
0
Trophy points
1
Activity points
30
hi
I write a program on bascom for atmega8
that suppose to make 16 pulses when the pinb.1 is 0
I want to use calibrated internal RC oscillator for atmega8
I have tried the program on Proteus simulator and it works
but on the board doesn't work
I think the problem is on how to program the chip
anybody can help me please
I will be appreciate
thank you

this is my bascom program


Code Basic4GL - [expand]
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
$regfile = "m8def.dat "
 $crystal = 8000000
 
 Dim A As Byte
 Dim B As Byte
 Set Pinb.1
 Reset Pinb.4
 Start:
 Reset Pinb.4
 If Pinb.1 = 0 Then
 For B = 1 To 2
 For A = 0 To 15
 Set Pinb.4
 Wait 1
 Reset Pinb.4
 Wait 1
 Next A
 Next B
 Reset Pinb.4
 End If
 Goto Start
 End

 
Last edited by a moderator:

hi
I write a program on bascom for atmega8
that suppose to make 16 pulses when the pinb.1 is 0
I want to use calibrated internal RC oscillator for atmega8
I have tried the program on Proteus simulator and it works
but on the board doesn't work
I think the problem is on how to program the chip
anybody can help me please
I will be appreciate
thank you

this is my bascom program

$regfile = "m8def.dat "
$crystal = 8000000

Dim A As Byte
Dim B As Byte
Set Pinb.1
Reset Pinb.4
Start:
Reset Pinb.4
If Pinb.1 = 0 Then
For B = 1 To 2
For A = 0 To 15
Set Pinb.4
Wait 1
Reset Pinb.4
Wait 1
Next A
Next B
Reset Pinb.4
End If
Goto Start
End

Hi,

I use to code in Atmel Studio. But one step should be common for both of us, we need to configure the microcontroller Fuse to select internal oscillator at 8Mhz.

Atmel studio provides the tool (Tools-Device Programming) for the same where you can just select the right intended value from drop down for SUT_CKSEL. Some similar tool should be there for BASCOM too.

Hope it helps.
 

Status
Not open for further replies.

Similar threads

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top