I have designed a mega128 development board. I tried to toggle LEDs but its not working. The schematic files (.jpg) are attached for reference.
Some board related info
Vcc = 5v, Crystal = 7.3728MHz
Peripherals present: FT232, DS1307, AT24C16
Few Components are not soldered on the board yet: These are as follows
1. Microcontroller reset circuit ( R10, C18)
2. pull ups for the I2C ( r2, r3)
3. LEDs ( D3,D4,D5, D6)
4. Ferrite bead L2 shorted ( due to non availability)
Fuse Bit Settings
I am using 7.3728 MHz crystal. The fuse bit settings, I have programmed are attached as .jpg file. Please see it
Q1. Is this setting correct for 7.3728MHz? If not please suggest the correct way.
I have verified that this is not a software (code) issue (by toggling LEDs on Mega32 board) using same type of code. It works fine.
The problem: Mega128 board
The port pins can be set or cleared. But they are not getting toggled.
Here is the code snippet to toggle LEDs.
PORTC =0xff; // line 1
delay_ms(1000); // line 2
PORTC =0x00; // line 3
delay_ms(1000); // line 4
Here in this code
1. if I comment the line 1 & 2 , LEDs switch on.
2. Similarly LEDs are off when line 3 & 4 are commented and line 1 and 2 active.
Q2. How can I identify where the problem is?
Q3. How to resolve this issue?
Thanks in Advance :)