Datasheet
counter := 0;
while ( counter < 64 ) do // reading 64 bytes in loop
begin
PORTD := FLASH_Read_Byte(F_ADDRESS + counter); // demon-
stration of reading single byte
Inc(counter);
PORTB := FLASH_Read_Byte(F_ADDRESS + counter); // demon-
stration of reading single byte
Inc(counter);
Delay_ms(200);
end;
FLASH_Read_Bytes(F_ADDRESS, @dat_buff, 64); // demon-
stration of reading 64 bytes
for counter := 0 to 31 do
begin
PORTD := dat_buff[counter]; // output low byte to PORTD
PORTB := word((dat_buff[counter] shr 8)); // output
higher byte to PORTB
Delay_ms(200);
end;
counter := 0;
while (counter <= 63) do // reading 32 words in loop
begin
word_ := FLASH_Read_Word(F_ADDRESS + counter); // demon-
stration of reading single word
PORTD := word_; // output low byte to PORTD
PORTB := word(word_ shr 8); // output
higher byte to PORTB
counter := counter + 2;
Delay_ms(200);
end;
FLASH_Read_Words(F_ADDRESS, @dat_buff, 32); // demon-
stration of reading 64 bytes
for counter := 0 to 31 do
begin
PORTD := dat_buff[counter]; // output low byte to PORTD
PORTB := word((dat_buff[counter] shr 8)); // output
higher byte to PORTB
Delay_ms(200);
end;
end.
233
MIKROELEKTRONIKA - SOFTWARE AND HARDWARE SOLUTIONS FOR EMBEDDED WORLD
Libraries
mikroPASCAL PRO for AVR
CHAPTER 6