asimlink
Full Member level 1
- Joined
- Jun 24, 2009
- Messages
- 96
- Helped
- 12
- Reputation
- 24
- Reaction score
- 12
- Trophy points
- 1,288
- Location
- Islamabad
- Activity points
- 2,288
Hi Friends,
I have an ATMEGA328P Custom designed Board. The microcontroller does not has bootloader installed. I am using Codeblocks IDE for Arduino and using an external usb programmer USBASP to program the ATMEGA328P microcontroller.
I am using following code to blink an led:
1. I correctly wire SPI signals of between my Custom Arduino Board and USBASP.
2. I select Arduino UNO in Codeblocks IDE,
3. and then press Build Button to compile
4. I then select upload via usbasp option from Tools > Upload Via USBasp
The code gets compiled successfully, and also gets programmed successfully. But the led blink runs very slow. It looks like as if the blink time is 10 times slower than what it should be.
If i change time from 1000 msec to something else the change gets reflected but the blink time is always very slow.
Can anyone suggest what may be wrong with Codeblocks IDE that it generate a code which is slow?
Kind Regards
Asim
I have an ATMEGA328P Custom designed Board. The microcontroller does not has bootloader installed. I am using Codeblocks IDE for Arduino and using an external usb programmer USBASP to program the ATMEGA328P microcontroller.
I am using following code to blink an led:
Code:
void setup()
{
//Serial.begin(9600);
// initialize the digital pin as an output.
// Pin 13 has an LED connected on most Arduino boards:
pinMode(13, OUTPUT);
}
void loop()
{
//Serial.println("Hello world!");
delay(1000); // wait for a second
digitalWrite(13, HIGH); // set the LED on
delay(1000); // wait for a second
digitalWrite(13, LOW); // set the LED off
}
1. I correctly wire SPI signals of between my Custom Arduino Board and USBASP.
2. I select Arduino UNO in Codeblocks IDE,
3. and then press Build Button to compile
4. I then select upload via usbasp option from Tools > Upload Via USBasp
The code gets compiled successfully, and also gets programmed successfully. But the led blink runs very slow. It looks like as if the blink time is 10 times slower than what it should be.
If i change time from 1000 msec to something else the change gets reflected but the blink time is always very slow.
Can anyone suggest what may be wrong with Codeblocks IDE that it generate a code which is slow?
Kind Regards
Asim