I'm new to electronics and assembly programming. I've been struggling for the past 24 hours trying to get a simple LED to turn on (not even blink) on PB0 but seem to be doing something wrong.
First of all, my code:
Code:
sbi DDRB,0
sbi PORTB,0
loop:
rjump loop
The fuse configuration on my Atmega8 is as follows: L: 0xFF, H: 0xC9 and lock bits: 0xFF
Finally, I put together a very basic circuit after burning the code using my Genius G840 programmer and ended up writing the following:
Supplied this with a 5v voltage source through USB but it doesn't work.
Any help in getting me started would be appreciated much!!!
In your original picture there were no power supply connections, I think I only see a ground
- - - Updated - - -
Ok, I see a positive supply and ground
- - - Updated - - -
Use this website to check or calculate your fuses
http://www.engbedded.com/fusecalc
You have set the mcu to work with an external crystal so now you need to connect a crystal and capacitors.
It would be better to leave the mcu operating with the internal RC (1,2,4 or 8MHz)
Sorry, ignore this rubbish:
You also have one side of the LED connected to ground, and your code is setting the pin on the other side of the LED to zero (=ground) also. So it has no potential across it.
Connect the grounded side of the LED to VCC instead of ground. Or, keep the connections as they are and change the code to set the pin to 1 to turn on the LED.
I don't think so.
I don't use ASM but I think sbi PORTB,0 sets bit0 of portB to 1
- - - Updated - - -
SBI – Set Bit in I/O Register
Description: Sets a specified bit in an I/O Register. This instruction operates on the lower 32 I/O Registers – addresses 0-31.
You have set the mcu to work with an external crystal so now you need to connect a crystal and capacitors.
It would be better to leave the mcu operating with the internal RC (1,2,4 or 8MHz)