MikroElektronika PIC Microcontrollers PIC16 Fiche technique Page 188

  • Télécharger
  • Ajouter à mon manuel
  • Imprimer
  • Page
    / 194
  • Table des matières
  • DEPANNAGE
  • MARQUE LIVRES
  • Noté. / 5. Basé sur avis des utilisateurs
Vue de la page 187
Programming PIC Microcontrollers in BASIC - mikroElektronika
next i
Flash_Write($0D00, toWrite) ' write contents of the
array to the address 0x0D00
' verify write
PORTB = 0 ' turn off PORTB
toRead = FLASH_ERROR ' initialize error state
for i = 0 to 63
toRead = Flash_Read($0D00+i) ' read 64 consecutive
locations starting from 0x0D00
if toRead <> toWrite[i] then ' stop on first error
PORTB = FLASH_ERROR ' indicate error
Delay_ms(500)
else
PORTB = FLASH_OK ' indicate there is no error
end if
next i
end.
For PIC16 family, the corresponding code looks like this:
' for PIC16
program flash_pic16_test
const FLASH_ERROR = $FF
const FLASH_OK = $AA
dim toRead as word
dim i as word
main:
TRISB = 0 ' PORTB is output
for i = 0 to 63
http://www.mikroelektronika.co.yu/english/product/books/picbasicbook/08.htm (6 sur 12)05/11/2004 02:28:30
Vue de la page 187

Commentaires sur ces manuels

Pas de commentaire