Arduino uno bootloader issue and flashing of sketches

I used STK500 to write optiboot_atmega328.hex into top of flash and bottom I built this pointless sketch. It flashs LED every 500ms, outputs 'A' character over hardware serial at 9600 and may also ready a octet which it then uses as the echo character back to PC.

It works fine using the IDE serial monitor. I conclude that the serial interface and usb seems to work, so why can I not flash my sketches from IDE or burn boot loader?

void setup() {
Serial.begin(9600);
pinMode(13, OUTPUT);
}

void loop() {
static uint8_t c='A';
static uint8_t l=LOW;
Serial.println(c);

if (Serial.available()) {
c=Serial.read();
}
delay(500);
digitalWrite(13, l); // set the LED on
if (l==LOW) {
l=HIGH;
}else {
l=LOW;
}
}

Regards,

giggler