Problem with PORT#

Hi, I've just started using the Mega2560 board and I want to write to the ports a byte at a time using the PORT feature.
I can set and clear a bit using digitalwrite but writing using PORTL or PORTF does nothing.
Any ideas?
Thanks

Please post the full code that's not working using code tags(</> button on the toolbar).

Here's the code, slightly abbreviated.
Basically using the PORT# doesn't work in read or in write.

//////////////////////////
// arduino includes
//
#include <LiquidCrystal.h>
//
//////////////////////////
/*
LCD RS pin to digital pin 12
LCD Enable pin to digital pin 11
LCD D4 pin to digital pin 3
LCD D5 pin to digital pin 2
LCD D6 pin to digital pin 1
LCD D7 pin to digital pin 0
LCD R/W pin to ground
LCD VSS pin to ground
LCD VCC pin to 5V
backlight to analogue pin 9

Leyboard
interupt digital pin 43 - PD0
Keyboard X0 scan o/p 19 - PB0
Keyboard X1 scan o/p 20 - PB1
Keyboard X2 scan o/p 21 - PB2
Keyboard X3 scan o/p 22 - PB3
Keyboard Y0 scan i/p 35 - PL0
Keyboard Y1 scan i/p 36 - PL1
Keyboard exit0 i/p 43 - PD0
#define DebugLED 13
#define backlight 9 // backlight pin
#define x0 19 //keyboard x columns
#define x1 20
#define x2 21
#define x3 22
#define y0 48 //keyboard y columns
#define y1 49
#define exit0 43 //exit key int0
// Drive outputs
#define op0 78
#define op1 77
#define op2 76
#define op3 75
#define op4 74
#define op5 73
#define op6 72
#define op7 71
//
void setup() {
// set i/o direction
pinMode(backlight, OUTPUT);
pinMode(x0, OUTPUT);
pinMode(x1, OUTPUT);
pinMode(x2, OUTPUT);
pinMode(x3, OUTPUT);
pinMode(y0, INPUT);
pinMode(y1, INPUT);
pinMode(exit0, INPUT);
pinMode(DebugLED, OUTPUT);
// set up the LCD's number of columns and rows:
lcd.begin(16, 2);
// Print a message to the LCD.
lcd.print("hello, world!");
analogWrite(backlight, brightness);
}

void loop() {
lcd.setCursor(0, 1);
//lcd.print(millis() / 1000);
//lcd.print(PORTL); // This doesn't work
//lcd.print(PORTF); // This doesn't work
PORTF = 0; // This doesn't work
PORTF = 255; // This doesn't work
PORTL = 0; // This doesn't work
PORTL = 255; // This doesn't work
//digitalWrite(x0,HIGH); // This works
//digitalWrite(x0,LOW); // This works

//lcd.print(digitalRead(y1)); // This works
}

Are you not seeing the sub-microsecond low pulses on pins 42-49 (PORTL) and pins A0-A7 (PORTF)? What is the bandwidth of the oscilloscope you are using? I would think that even a basic 10 MHz scope would show the pulses.

Note: You abbreviated a bit too much. The close of the comment is missing so the only active line in your sketch is:

#include <LiquidCrystal.h>

Good point about the bandwidth, I was using an old logic probe and assumed it would see everything.
The logic probe doesn't see the bits change if I toggle using PORT but it does if I use digitalwrite which must be slower which caught me out.
Cheers John.