Une approche interdisciplinaire des grandes masses de données (Défi Mastodons)

Une approche interdisciplinaire des grandes masses de données (Défi Mastodons) - Revenir à l'accueil

 

 

Branding Farnell element14 (France)

 

Voir également :

[TXT]

 Big-DATA-effet-de-mo..> 20-Dec-2014 17:28  8.2M  

[TXT]

 Big-Data-Alchemy-Cap..> 20-Dec-2014 17:57  8.1M  

[TXT]

 Big-Data-Analyse-des..> 20-Dec-2014 17:28  8.2M  

[TXT]

 Big-Data-Institut-Lo..> 20-Dec-2014 18:00  8.2M  

[TXT]

 Big-Data-Introductio..> 20-Dec-2014 17:53  4.1M  

[TXT]

 Big-Data-La-Chaire-A..> 20-Dec-2014 17:54  4.0M  

[TXT]

 Big-Data-Le-big-data..> 20-Dec-2014 18:09  4.5M  

[TXT]

 Big-Data-Les-cahiers..> 20-Dec-2014 18:00  8.3M  

[TXT]

 Big-Data-Mastere-Spe..> 20-Dec-2014 17:29  8.1M  

[TXT]

 Big-Data-Synthese-du..> 20-Dec-2014 17:53  4.1M  

[TXT]

 Big-Data-TACKLING-TH..> 20-Dec-2014 17:54  4.0M  

[TXT]

 Big-Data-Telecharger..> 20-Dec-2014 18:09  4.4M  

[TXT]

 Big-Data-Un-etat-des..> 20-Dec-2014 18:07  4.5M  

[TXT]

 Big-Data-un-Master-c..> 20-Dec-2014 18:07  4.5M  

[TXT]

 White-paper-Big-Data..> 20-Dec-2014 17:57  8.1M
16/05/2014 1 1 Une approche interdisciplinaire des grandes masses de données (Défi Mastodons) Mokrane Bouzeghoub DAS INS2I / MI Emergence du Big Data Exemple : Linked Open Data Accès à plusieurs BD scientifiques et culturelles interconnectées sur le Web Ini$ée en 2007 avec une dizaine de sources de données interconnectées Aujourd’hui, plusieurs centaines de sources connectées et ouvertes16/05/2014 2 Qu’est-ce qu’une (très grande) masse de données ? VLDB XLDB Big Data Very Big Data Massive Data Data Deluge Grandes Conf du domaine: VLDB, XLDB, ICDE, EDBT, … Les grandes questions du Big Data • La science est-elle dans les masses de données ? – La valeur de ces données réside dans les indicateurs, les pa@erns et les règles/lois qui peuvent en être dérivés (connaissance) – Ces données sont importantes non seulement en raison de leur quan$té mais aussi en raison des rela$ons existantes entre elles (séman$que) – Les données peuvent être source de plus-value scien$fique mais aussi source de bruit et de pollu$on (qualité, hétérogéneité, manipula$on) • Les masses de données nous parlent-elles de notre société ? – Nous disent-elles quelque chose que nous ne sachions déjà ? – Diront-elles quelque chose de nous aux généra$ons futures ? – Ont-elles une objec$vité en elles-mêmes ou sont-elles biaisées par des transforma$ons subjec$ves ? • Les masses de données génèrent-elles une valeur économique ? – Quels sont les secteurs privilégiés ? – Quel retour sur inves$ssement ? – Quel rôle pour ces données (ma$ère première, produits dérivés, capital, …) ? – Quel statut pour ces données (propriété privée, domaine publique, objet commercial)? 16/05/2014 3 La complexité multidimensionnelle du Big Data • La Volumétrie – Un défi pour les architectures de stockage (au delà du PB) • La Variété – Diversité des contenus – Forte hétérogénéité des formats et des données • La Vélocité – Défi pour les nouveaux réseaux de communicaHon – Nouveaux modèles de calcul sur des données en flux • La Validité / Véracité – Qualité des sources de données: fraîcheur, exacHtude, … – Qualité des processus de producHon/transformaHon Les grands challenges scientifiques du Big Data • Stockage dans le Cloud – Performance des accès, disponibilité – Sécurité des données et des traitements • Complexité du calcul – Analyse en temps réel de flux conHnus de données émanant de différentes sources – Requêtes mulHdimensionnelles sur des grands ensembles de données • Séman$que des données – IndexaHon sémanHque (ontologies), indexaHon parHcipaHve (folksonomies) – ExtracHon et interprétaHon de connaissances • Consomma$on d’énergie – Ressources à énergie limitée (ex. capteurs) – OpHmisaHon du transfert des données • Impact sociétal – ProtecHon de la vie privée, Droit à l’oubli – A qui apparHennent les données, les connaissances? è 120 kWh/an/Tera-octet stocké par CCIN2P3 è 1M€ /an facture électricité pour l’IDRIS16/05/2014 4 Caractéristiques du domaine • Un domaine très vaste, – en interaction permanente avec les autres disciplines scientifiques • Un domaine qui se repositionne périodiquement – En revisitant ses solutions à la lumière de nouvelles technos et de nouvelles idées – En intégrant de nouveaux besoins et de nouveaux problèmes • Une recherche dominée (ou presque) par des labos industriels : – Google, Facebook, Yahoo!, Amazone, IBM, Oracle, Microsoft … Quelques initiatives en Big Data • USA : Plusieurs acteurs dont – Gouvt US: Big Data Research and Development Ini$a$ve (Mars 2012) ü 250M$ / an dont 60 pour les projets de recherche ü mis en œuvre par NSF, NIH, DOD, DOE, USGS) – Accel Partners: fond d’inves$ssement ! 60 M$ / an de sou$en à la créa$on de startups dans le Big Data • UK: Plusieurs ini$a$ves dont – ESRC Big Data Network (2012) : 3 phases, PHASE 2 AVR 2013: 60M£. – BBSRC (2012): 75 M£ pour améliorer la disponibilité des Big Data • France – PIA: Appel ‘Cloud Comp & Big Data Ministère de l’Industrie (juillet 2012): 25 M€ – CNRS: Ini$a$ve interdisciplinaire (Mastodons): 700K€/an sur 4/5 ans? 16/05/2014 5 Objectifs du défi Mastodons Produire des concepts et des solu$ons qui n'auraient pu être obtenus sans coopéra$on entre les différentes disciplines Favoriser l’émergence d’une communauté scien$fique interdisciplinaire autour de la science des données, et produire des solu$ons originales sur le périmètre des données scien$fiques. Focus de l’appel Mastodons • Stockage et gestion de données (par exemple, dans le Cloud), sécurité, confidentialité • Calcul intensif sur des grands volumes de données parallélisme dirigé par les données • Recherche, exploration et visualisation de grandes masses de données • Extraction de connaissances, datamining et apprentissage • Qualité des données, confidentialité et sécurité des données • Problèmes de propriété, de droit d’usage, droit à l’oubli • Préservation/archivage des données pour les générations futures16/05/2014 6 Les critères de sélection • Vision scien$fique de l’équipe/consor$um sur les thèmes du défi • Les verrous scien$fiques et les axes de recherche à moyen terme, avec un focus par$culier sur la première année • Les acquis scien$fiques dans le domaine ou dans un domaine connexe suscep$ble de contribuer aux problèmes scien$fiques ou sociétaux posés (publica$ons significa$ves, projets passés ou en cours, applica$ons réalisées, logiciels, brevets...) • Les différentes disciplines impliquées et leurs contribu$ons respec$ves au projet • Une liste de 3 à 5 chercheurs seniors impliqués de façon significa$ve dans la recherche. ! l’interdisciplinarité doit être une réalité et pas un alibi Indicateurs de suivi • Pérennité de la coopéra$on • Publica$ons communes • Co-encadrement de thèses • Plateformes de test et d’expérimenta$on • Montage et soumission de nouveaux projets • Dynamique pour faire émerger une communauté interdisciplinaire sur la science des données.16/05/2014 7 Mastodons : Chiffres clés • Défi lancé en 2012, avec un second appel en 2013 • Projets de 3 à 5 ans • Budget : environ 700 à 850 K€/an • Nb de soumissions: 57 – Nb d’UMR impliquées: + 100, Couvrant les 10 ins$tuts • Nb de projets retenus: 20 – Nb d’UMR impliquées: 69, couvrant les 10 ins$tuts – Nb de CH/EC impliqués: près de 300 – Montant alloué/projet : 30 à 80 K€ • Partenaires hors CNRS – INRIA, INRA, IRSTEA, INSERM, CEA, ONERA – Universités et écoles Types de données visés dans les projets retenus • Cosmologie, astrophysique – Dynamique de la Cartographie céleste • Sciences de la terre et de l’univers (traitement d’images) – Modélisa$on, déforma$on de la croute terrestre • Environnement, climat, biodiversité – simula$on • Biologie – Génome, phénotypage • Réseaux sociaux – RI, analyse d’opinions, santé 16/05/2014 8 Deux ans après… Gros projets phares • PetaSky+Gaia +Amadeus – Cosmologie • Aresos – Réseaux sociaux • Phénotypage, Sabiod – Biologie végétale, Bio-acous$que Projets ciblés excellents • Comotex – Cde Tps réel de syst op$que • Display – Distr proc. For VLA in Radioastronomy • Mesure-HD – Mesures hautes résolu$on • Prospectom – Etude interac$ve des protéomes par appren$ssage stat. et intégr de données spectrométriques + Un projet émergent sur le crowdsourcing: CrowdHealth Mastodons : La suite … • Comment pérenniser la communauté – Réflexion générale sur les regroupements de projets ü Théma$que ü Par domaine d’applica$on – Structura$on et anima$on de la communauté ‘Big Data’ ü Emergence d’un GDR « Big Data, Science des données » • Comment la financer au delà du programme CNRS – CNRS, au delà de 2015? – ANR ? – COST / H2020 ? – Autre ini$a$ve ? 16/05/2014 9 Conclusion • La recherche en Big Data ne peut être fructueuse sans un rapprochement des chercheurs des grands centres de produc$on et d’exploita$on des données (existants ou à créer) – Avec un sou$en fort en ingénierie – Une véritable interdisciplinarité – Un code clair sur l’accès aux données et leur u$lisa$on Big Data, la déferlante des octets | CNRS le journal 04/03/14 12:30 file:///Users/Mokrane-CNRS/Desktop/Big%20Data,%20la%20déferlante%20des%20octets%20%7C%20CNRS%20le%20journal.webarchive Page 1 sur 10 Donner du sens à la science Suivre Rechercher Se connecter / S'inscrire      Types VIVANT MATIÈRE SOCIÉTÉS UNIVERS TERRE NUMÉRIQUE MES THÈMES Rechercher  Partager l'article 1" MASTODONS Un défi CNRS sur les « Big Data » Mokrane Bouzeghoub Séminaire DUs INSHS - 6/12/2012 Qu’est qu’une (très grande) masse de données ? VLDB XLDB Big Data Very Big Data Massive Data Data Deluge Grandes Conf du domaine: VLDB, XLDB, ICDE, EDBT, …Exemples I Link Open Data Initiative Accès à plusieurs BD scientifiques et culturelles interconnectées sur le Web Youtube 60h de vidéo/mn Facebook 40 Mds de photos GoogleEarth 70 TB LSST 16 TB toutes les 8 heuresLes dimensionnalités des masses de données • Nombre dʼattributs (de variables) • Nombre dʼoccurrences/objets • Nombre de sources de données • Fréquence dʼacquisition des données • Degré de réplication des données • Volume des méta données, annotations, indexes • Volume de données déplacé par les requêtes ou les calculsDiversité des sources de données et des types de données • Données structurées – Tableaux – Objets (données, codes) • Données semi/non-structurées – Documents (XML), ressources (RDF) • Données multi-média – Images – audio – video • Autres données – Graphiques, diagrammes – Séries temporelles – Flux de données / événements – …. BD et fichiers d’entreprises Données WEB et Réseaux Sociaux Données de Capteurs Données d’expériences scientifiques (ex: simu) Grands corpus culturels et scientifiques (Digital Libraries) Objec&fs)du)défi)Mastodons) Produire)des)concepts)et)des)solu&ons)qui)n'auraient) pu)être)obtenus)sans)coopéra&on)entre)les) différentes)disciplines)du)CNRS.)) Favoriser)l’émergence)d’une)communauté) scien&fique)interdisciplinaire)autour)de)la)science)des) données,)et)produire)des)solu&ons)originales)sur)le) périmètre!des!données!scien/fiques.))Pilotage)et)res&tu&on) • Coordina&on)étroite)de)l’ensemble)des)projets) – Augmenter)la)synergie)entre)projets) • Res&tu&on)des)résultats) – Publica&ons)de)qualité) – Colloques)! déjà"4"avec"près"de"300"par2cipants" • Financement)sur)4)à)5)ans) – Selon)contraintes)budgétaires)CNRS) – Selon)impact)et)résultats)des)projets) !!l’interdisciplinarité!doit!être!une!réalité!et!pas!un!alibiApports spécifiques des SHS • Sémantique des données – Méta données, annotations, interprétation • Protection de la vie privée – Confidentialité, droit à lʼoubli – Éthique, réglementations • Aide à lʼanalyse à grande échelle (très grands corpus) – Réseaux sociaux, Open data • Apports linguistiques – Outils formels, constitution dʼontologies • Préservation à long terme – Connaissances scientifiques, patrimoine culturel • …Cartographie)des)projets)retenus)) en)2012) 9" 74)UMR) 44)UMR) 37)projets) soumis) 16)projets)) sélec&onnés)Les)projets)retenus)en)2012) • Physique)des)par&cules:)1) – Stockage)à)grande)échelles)de)résultats)d’expériences) – Simula&on,)analyse)et)visualisa&on)) " !))))env 15PB/an • Sciences)de)la)terre)et)de)l’univers:)5) – Masses)de)données)sismologiques) – Origine)et)évolu&on)de)notre)galaxie:)données) d’observa&ons)astronomiques)grand)champ)))) " !))140)terabytes)/)5)jours) • Environnement,)climat,)biodiversité:))4) – Analyse)de)MdD)urbaines)et)environnementales)Les)projets)retenus)en)2012) • Biologie:)3) – Défis)computa&onnels)de)séquençage)haut)débit) – Fédéra&on)de)données)en)imagerie)biomédicale) – Etude)visuelle)et))interac&ve)des)protéomes) • Réseaux)sociaux:)2) – Reconstruc&on)et)analyses)de)réseaux)sociaux,) cartographie)séman&que,)) – Social)compu&ng,)intelligence)collec&ve) • Préserva&on)des)données:)1) – Enjeux)technologiques,)sociétaux,)coûts,)risques)Projets)impliquant))des)UMR)INSHS) Titre du projet Porteur UMR Impliquées Instituts/ Organism es Projet SENSE : Socialized Network Science Pablo Jensen LP, LIP, IXXI, Max Weber INP, INS2I, INSHS ARESOS: Reconstruction, Analyse et Accès aux Données dans les Grands Réseaux Socio‐ Sémantiques Patrick Gallinari LIP6, CAMS, LIG, LIRIT, LATTICE INS2I, INSMI, INSHS AMADOUER: Analyse de MAsse de DOnnées de l’Urbain et l’EnviRonnement Attila Baskurt LIRIS, EVS, CETHIL,LGCIE INS2I, INSHS, INEE, INSIS PREDON: La préservation et l’exploitation des données scientifiques à long terme Cristine Diacanou l CPPM, LPCCG, LAPP IN2P3 ET L CHARTE ET ET BIG FACIILITER LA CR L’E LA DIFFUSION DES D THIQUE G DATA REATION, ECHANGE DONNEES1 Sommaire UN TRAVAIL A PLUSIEURS VOIX .................................................................................................................................. 4 CONTENU DE LA CHARTE ............................................................................................................................................ 4 COMMENT UTILISER CETTE CHARTE ? ........................................................................................................................ 4 LICENCE.. .................................................................................................................................................................. 4 ENGAGEMENT ............................................................................................................................................................ 5 LES DONNEES ............................................................................................................................................................ 7 TRAÇABILITE ............................................................................................................................................................. 9 PROPRIETE INTELLECTUELLE .................................................................................................................................... 13 REGLEMENTATIONS SPECIFIQUES ............................................................................................................................. 15 PREFACE 2 3 La disponibilité des grandes masses de données (Big Data) permet d’en extraire des connaissances impossibles à appréhender autrement. Cela leur confère une importance stratégique et établit une barrière entre ceux qui peuvent y accéder et les autres. Dans l’objectif d’en garantir l’accès au plus grand nombre pour les besoins de la recherche, des initiatives ont été lancées au plan international pour partager ces données (Data Sharing). On peut mettre dans cette notion de partage une simple idée de distribution la plus ouverte possible, mais on peut aussi l’étendre à la production, la validation et l’enrichissement collaboratifs des données, et à leur utilisation pour développer et évaluer les technologies dans beaucoup de domaines. Cela passe par l’identification et la trace de l’utilisation de ces données, dans une approche qui doit être coordonnée et internationale pour pouvoir être effective. La myriadisation du travail parcellisé, ou crowdsourcing, peut être mise au service des activités de production et d’enrichissement des données. Elle apporte la possibilité d’établir un contact avec la « foule » internationale, et toute la force de travail qu’elle représente, mais soulève en même temps les problèmes éthiques d’une activité qui échappe aux règles habituelles du droit du travail. Consciente de ces enjeux et de l’urgence de les traiter, les rédacteurs se sont saisis ces questions et propose aux chercheurs et aux industriels cette charte afin d’encourager les aspects hautement positifs liés au Big Data, et décourager les effets potentiellement néfastes qui pourraient les limiter ou les inverser. J. Mariani Directeur de l’Institut des technologies Multilingues et Multimédias de l’Information (IMMI-CNRS) La création, la maintenance, la diffusion et l'utilisation de données de toutes sortes est un enjeu économique majeur. Qu'il s'agisse de données démographiques, personnelles, de relevés de capteurs, de documents, thésaurus, ontologies. Ces bases de données sont essentielles à la création et la maintenance de nouveaux services. L'apparition du Cloud computing, de l'Open Data et du Big Data rendent ces questions particulièrement sensibles. Cependant, l'utilisation ou la réutilisation des données se heurtent trop souvent à des freins qui en empêchent l'exploitation optimale : provenance parfois opaque (en particulier dans les cas de " crowdsourcing "), traçabilité inexistante, protection intellectuelle incertaine, une qualité difficile à évaluer a priori. Dès lors, sécuriser la création de données est un facteur de compétitivité. Cette charte Ethique & Big Data se donne comme objectif de fournir des garanties concernant la maintenabilité des données, leur traçabilité, leur qualité, l'impact sur l'emploi, réduire le risque juridique. Cette charte vise à harmoniser les rapports entre producteurs, fournisseurs et utilisateurs de données sur le plan du respect des lois, de celui de l'éthique, et garantir la confiance dans les rapports entre l'ensemble des acteurs impliqués. Alain Couillault, APROGED, Professeur associé Université de La Rochelle 4 Un travail à plusieurs voix Cette charte a été conçue à l’initiative de l’APROGED, de l’ATALA, de l’AFCP et de CAP DIGITAL. Plusieurs associations et partenaires ont collaboré à sa rédaction et à sa diffusion. Contenu de la charte La Charte Ethique & Big data comprend quatre volets principaux qui concernent la description des données, la traçabilité, la propriété intellectuelle et les réglementations spécifiques. Pour chacun de ces volets, la charte considère ce qui se passe avant, pendant, et après la constitution des données. Comment utiliser cette charte ? La Charte Ethique & Big data fournit une trame de description des corpus de données et sert de memorandum des points à décrire lorsque l'on met à disposition des données, que ce soit à usage commercial ou académique, payant ou gratuit. Les éléments prévus dans la charte sont à remplir par le fournisseur, qui s'engage ainsi sur son contenu. Il arrive, fréquemment, qu’un jeu de données soit construit par rassemblement, enrichissement, altération d’un ou plusieurs jeux de données existants. Dans ces cas, il convient de remplir les éléments de la Charte pour le seul jeu de données auquel elle correspond, en y faisant référence, le cas échéant, aux chartes des jeux de données utilisés. Licence Cette Charte Ethique & Big data est distribuée sous licence Creative Common CC BY-N 3.0 FR, avec attribution suivante : « Rédacteurs Gilles Adda, AFCP, CNRS-LIMSI, Christelle Ayache, Cap Digital, Alain Couillault, Apoliade, Aproged, Université de La Rochelle, Karën Fort, ATALA, Loria / LIPN, Pierre-Olivier Gibert, Digital Ethics, François Hanat, Cap Digital, Hugues de Mazancourt, Aproged, Eptica-Lingway. Animateur du groupe de travail « Ethique et Big Data » organisé par l’Aproged : Alain Couillault, Contributeurs : Daniel Bourcier, CNRS CERSA, Marie-Odile Charaudeau, Aproged, Primaveri de Filippi, CNRS CERSA, Olivier Itéanu, Aproged, Benoît Sagot, Aproged, INRIA/Paris VII, Joseph Mariani, CNRS Limsi/IMMI, Jamel Mostefa, ELRA/ELDA, Laurent PREVEL, Aproged. » La charte est disponible en ligne à l’adresse http://wiki.ethique-big-data.org 5 Engagement Charte Ethique et Big Data pour une activité générale non réglementée Par l’adhésion à la présente Charte, je m’engage dans mes activités relatives à l’accès, à l’extraction, à la réutilisation de données dans le cadre d’une activité faisant appel à des jeux de données, à respecter les principes suivants : • exercer mon activité dans le respect des principes éthiques, et ce, envers les individus auxquels ces données sont liées, les personnes et entités intervenant à la collecte, la transformation ou la diffusion de ces données • garantir autant que possible la traçabilité des données et d’informer l’ensemble des acteurs qui peuvent avoir à connaître des informations de traçabilité • respecter l’ensemble des droits attachés aux données, que ces droits soient liés à l’acquisition ou à la transformation des données • respecter les législations afférentes à la diffusion de données, qu’elles soient générales ou spécifiques à la nature des données concernées. A cette fin, je remplis la présente Charte Ethique et Big Data et m’engage sur les informations qu’elle contient. A _______________, le _________________ LES DONNEES LES DONNEES 6 7 Les données Nom du recueil de données : Nom et coordonnées de l’institution ou de la personne responsable des données : Personne(s) à contacter : Responsable(s) de la charte : Disponibilité des données (site Internet, CD-ROM...) : Quelle est la nature des données fournies? Décrire les support, mode de fourniture (cf. support physique vs. flux d'informations) Si possible, indiquer précisément les références du document qui décrit les données fournies TRAÇABILITE TRAÇABILITE 8 9 Traçabilité La notion de traçabilité couvre l'ensemble des aspects permettant de connaître le contenu d'une source de données, et de retracer le processus de fabrication, Origine des données S'agit-il :  de données primaires (créées directement par le fournisseur),  de données consolidées de différents fournisseurs  de données construites à partir de données tierces (enrichissement) ? Dans les deux derniers cas, fournir, pour chacune des sources la charte correspondante ou les coordonnées de l'organisation d'où viennent les données, ainsi que le contact permettant d'obtenir les informations afférentes, ou la mention explicite et argumentée que la charte ne s'applique pas. Auteurs, processus de recrutement Dans le cas de données primaires provenant de contributeurs humains, préciser la typologie des contributeurs la nature des relations contractuelles avec le fournisseur le mode de rémunération Dans le cas d'utilisation de crowdsourcing, préciser : les critères de sélection des travailleurs, la ou les plateformes utilisées, le mode et le montant de la rémunération. Si les données contiennent des données liées aux contributeurs humains, préciser : si un consentement a été demandé, si une trace matérielle existe de ce consentement. la nature de l'information fournie afin que le consentement soit éclairé, 10 Processus de fabrication ou de transformation des données : A. Si les données dont l'origine a été spécifiée dans la section Origine des données ont subi une quelconque transformation: Décrire les processus de transformation. B. pour les processus d'enrichissement de données, décrire la nature de l'enrichissement. Préciser pour chaque processus, s'il s'agit d'un travail manuel ou automatique C. Dans le cas où un travail manuel est impliqué, indiquer : la typologie des intervenants, la nature des relations contractuelles, le mode de rémunération. D. Dans le cas d'utilisation de crowdsourcing, préciser : les critères de sélection des travailleurs, la ou les plateformes utilisées, le mode et le montant de la rémunération. E. Dans le cas où un outil informatique est impliqué, décrire : la nature et la fonction de l'outil, la nature de la propriété intellectuelle et la nature de la licence attachées à cet outil. F. Dans le cas où les données contiennent des informations personnelles, préciser : les moyens permettant de s'assurer que la transformation est compatible avec le consentement décrit dans la section Auteurs, processus de recrutement, si une anonymisation a été effectuée, et la manière dont elle a été faite. 11 Processus de validation des données G. Préciser si un processus de validation des données a été appliqué. Dans la négative, dire pourquoi un tel processus n'a pas été nécessaire Dans l'affirmative, décrire le processus de validation, et en particulier : o le pourcentage des données validées, o le mode de sélection des données validées, o si la validation a été faite en interne ou en externe,  si la validation a été externe, la nature de l'organisme de validation. o si la validation a été faite à l'aide d'outils automatiques, ou a nécessité une intervention humaine,  décrire la nature des outils,  préciser le profil des validateurs. o décrire la méthode de validation, et en particulier :  les critères de validation,  si ces critères impliquent l'utilisation de métriques, décrire ces métriques. o donner le résultat (qualitatif et quantitatif) de la validation, o s'il s'agit de données évolutives, indiquer :  si la validation est identique sur les données archivées, et les données nouvelles,  la fréquence de validation. PROPRIETE INTELLECTUELLE PROPRIETE INTELLECTUELLE 12 Propriété intellectuelle Licence d'utilisation de(s) source(s) H. En cas de réutilisation de données, décrire les restrictions légales ou contrac exemple, nature de la licence, la source doit La fourniture respecte des licences affectées aux sources d'information. Par exemple, les sources sont elles libres et ouvertes (OpenData...) Sont-elles soumises à une licence particulière Droits du fournisseur sur les données I. En cas d'utilisation de données tierces, le signataire de la charte a particulier, l'origine des données (copyright) doit Altération de licence liée au traitement des données J. En cas d'intervention d'un tiers sur les donn stagiaire...), préciser le cas échéant quels sont les droits de chacun sur les données (dans la mesure du possible, utiliser une licence pour de chacun). Licence d'utilisation Préciser la (ou les) licence(s) attachée(s) aux données fournies. (on veillera à ce que la licence précise s'il existe des restrictions quant à la rediffusion de ces résultats). Propriété intellectuelle d'utilisation de(s) source(s) En cas de réutilisation de données, estrictions légales ou contractuelles sur les données utilisées (par exemple, nature de la licence, la source doit-elle être citée? Etc. La fourniture respecte-t-elle ces restrictions ? On veillera notamment à la vi des licences affectées aux sources d'information. Par exemple, les sources sont elles libres et ouvertes (OpenData...) ? elles soumises à une licence particulière ? à droit d'auteur Droits du fournisseur sur les données En cas d'utilisation de données tierces, le signataire de la charte a-t-il des obligations par rapport à ses fournisseurs? En particulier, l'origine des données (copyright) doit-elle être mentionnée licence liée au traitement des données En cas d'intervention d'un tiers sur les données (salarié, contractant, préciser le cas échéant quels sont les droits de chacun sur les données (dans la mesure du possible, utiliser une licence pour préciser les droits et les obligations Préciser la (ou les) licence(s) attachée(s) aux données fournies. (on veillera à ce que la licence précise s'il existe des restrictions quant à la rediffusion de ces 13 tuelles sur les données utilisées (par elle être citée? Etc. ) On veillera notamment à la viralité des licences affectées aux sources d'information. Par exemple, les sources sont- ? à droit d'auteur ? il des obligations par rapport à ses fournisseurs? En elle être mentionnée ? ées (salarié, contractant, préciser le cas échéant quels sont les droits de chacun sur les données (dans la préciser les droits et les obligations Préciser la (ou les) licence(s) attachée(s) aux données fournies. (on veillera à ce que la licence précise s'il existe des restrictions quant à la rediffusion de ces REGLEMENTATIONS SPECIFIQUES REGLEMENTATIONS SPECIFIQUES 14 15 Réglementations spécifiques Certaines données peuvent être soumises à des réglementations d’ordre public qui s’imposent pour des raisons impératives de protection, de sécurité ou de moralité. Les fournisseurs ne peuvent y déroger. Le non-respect de ces réglementations peut donner lieu à des sanctions pénales ou prononcées par des autorités administratives indépendantes (CNIL, AMF, Autorité de la Concurrence). Le respect de ces réglementations est donc une des conditions de la légalité de l'utilisation ou la réutilisation des données. Préciser si la nature des données fournies ressort d'une ou plusieurs réglementations spécifiques. Si oui, préciser la ou lesquelles. le fournisseur respecte-t-il ces réglementations ? Il est de la responsabilité du fournisseur de rechercher les réglementations applicables. Pour information, il existe des réglementations d’ordre public qui visent explicitement les données : Loi informatique et libertés relatives aux données personnelles Sur le site de la CNIL Droits des producteurs de bases de données (LIVRE III - Titre IV du Code de la Propriété intellectuelle) Par ailleurs, suivant les secteurs d’activité, des réglementations spécifiques peuvent nécessiter de modifier les conditions de collecte d’utilisation et de réutilisation des données. Préalablement, à la mise en œuvre du traitement, une recherche sur les réglementations applicables s’impose. En particulier, les activités traitant des données personnelles, financières, de santé ou couvertes par un secret doivent faire l’objet d’une vigilance particulière. Le correspondant informatique et libertés (CIL), présent dans de nombreuses entreprises, administrations ou collectivités locales est par exemple à même de renseigner ou d'instruire ce type de demandes. Comportements culturels et données personnelles au cœur du Big data Entre la nécessaire protection et une exploitation au service des nouveaux équilibres économiquesSommaire 1. Faire parler le Big data : un nouveau pouvoir p. 7 dans le secteur médiatique et culturel • Du Big data au Worthy data p. 8 • La donnée personnelle culturelle au cœur de l'émergence p. 14 d'un marché stratégique 2. Pouvoirs en équilibre et responsabilités partagées : p. 19 les nouveaux contours du Big data • La réglementation, impulsion économique p. 21 pour les acteurs de Big data en Europe • Quelle fiscalité 3.0 pour l'économie digitale ? p. 33 • Responsabilités citoyennes p. 37 3. Vers un nouveau paradigme économique p. 39 propice à l’innovation et la création • Opposer le principe de précaution au Big data : p. 40 un risque réel pour l’innovation • Le temps de l'action p. 42 • La nouvelle chaîne de valeur de la donnée personnelle culturelle p. 47 La donnée personnelle culturelle au cœur du Big data p. 50 Infographie La présente publication peut être téléchargée sur les sites d’EY (www.ey.com/mediaentertainment) et du Forum d’Avignon (www.forum-avignon.org).Comportements culturels et données personnelles au cœur du Big data | 3 Avant-propos Depuis 2008, EY analyse les grandes thématiques inscrites au programme du Forum, pour leur donner, en capitalisant sur son expertise et son expérience reconnue dans le secteur, une traduction concrète à travers l’identification d’enseignements majeurs. Année après année, EY a observé et décrypté les mouvements à l’œuvre dans l’industrie des médias et des contenus, face à une révolution digitale qui a rebattu les cartes des forces en présence, à travers le prisme de la propriété intellectuelle (« La propriété intellectuelle à l’ère du numérique »), de la monétisation (« Monétiser les médias numériques ») ou encore de la vitesse de diffusion (« Maîtriser le tempo, organiser la relation entre le temps et la valeur dans l’industrie des médias et du divertissement »). L’écosystème qui s’est progressivement structuré semblait tendre jusqu’à présent vers un point d’équilibre entre les opérateurs de l'Internet, de télécomunications et les groupes médias. Néanmoins les enseignements de nos dernières études laissaient déjà entrevoir la déferlante Big data, qui pourrait introduire un nouveau facteur de déstabilisation, laissant un nombre restreint d’acteurs, capables de faire parler le Big data, détenir le pouvoir de contrôler et de prévoir. La donnée personnelle culturelle, autour de laquelle se structure aujourd’hui un marché à la recherche de nouveaux équilibres, est à l'origine d’une ruée d’acteurs des secteurs numérique, médiatique et culturel, parce qu'elle vaut de l'or. Méthodologie de l’étude : Pour mieux comprendre, analyser et interpréter ces nouveaux enjeux de contrôle et la structuration d’un nouveau marché autour de la donnée personnelle culturelle, EY a rencontré et interrogé des dirigeants d’institutions et d'entreprises représentatives du secteur, dont la Réunion des musées nationaux - Grand Palais, l’INA, Solocal (PagesJaunes), Criteo, InterCloud, Kantar Media... Cette étude qui a mobilisé nos experts du secteur Médias et Divertissement, se fonde sur leurs points de vue, notre recherche sectorielle et nos propres analyses. 6 ans de partenariat entre EY et le Forum d’Avignon La vocation première du Forum d’Avignon est de se faire l’écho des enjeux qui comptent pour les industries de l’art et de la création. Le partenariat qui lie depuis maintenant six ans EY au Forum témoigne d’un engagement commun, aux côtés des grands acteurs de l’univers des médias et du divertissement. Remerciements EY tient à remercier vivement pour leurs éclairages : Roei Amit (Directeur adjoint chargé du numérique, Réunion des musées nationaux - Grand Palais), Christophe Benavent (Professeur, Responsable du Master Marketing opérationnel international, Université Paris Ouest), Julien Billot (Directeur général adjoint en charge du segment média, Solocal - ex PagesJaunes), Jérôme Dilouya (Fondateur et Président-directeur général, Intercloud), Denis Gaucher (Directeur exécutif Ad Intelligence Europe, Kantar Media), Alban de Nervaux (Directeur de la stratégie et du développement, Réunion des musées nationaux - Grand Palais), Alexandra Pelissero (Directrice de la communication, Criteo), Stéphane Ramezi (Responsable des éditions multimédia, INA). Nous tenons aussi à remercier, pour leur apport lors des groupes de travail : Benoît Tabaka (Directeur des politiques publiques, Google France), Pierre Geslot (Responsable Projets Lectures numériques, France Télécom Group), Laure Kaltenbach (Directrice générale, Forum d'Avignon), Olivier Le Guay (Responsable éditorial, Forum d'Avignon).4 | Comportements culturels et données personnelles au cœur du Big data C’est l’évolution de l’humanité tout entière qui est indissociable des traces, empreintes et autres indices que nous laissons derrière nous. Avec l’avènement de l’ère numérique et l’apparition des traces immatérielles dont nous marquons la toile et que nous pouvons désormais collecter, stocker et analyser à l’infini1, nous est aujourd’hui donné un pouvoir inédit. Au pouvoir régalien, détrôné peu à peu par l’ouverture du savoir au plus grand nombre à travers l’imprimerie, la radio et la télévision - et duquel le règne d’Internet a semblé définitivement nous affranchir - succède aujourd’hui le pouvoir de contrôler et de prévoir, grâce à l’ouverture de données publiques et personnelles de tous à un nombre d’acteurs restreints, capables de faire parler le « Big data ». Volume, variété et vélocité : c’est en ces trois mots que peut se résumer le Big data, pour exprimer le volume inédit de données produites et échangées par un nombre croissant de canaux (web, objets connectés au web et entre eux, plateformes), la variété de ces données (avec une part croissante de données non structurées et volatiles2) et enfin la vélocité, qui désigne la vitesse, toujours plus grande, de ces échanges. Le Big data représente une formidable matière première pour qui saura en extraire la substantifique moelle, avec à la clé des opportunités de création de valeur qui pourront irriguer l’ensemble des secteurs d’activité de l’économie réelle… et en particulier celui de l’industrie médiatique et culturelle. Car au cœur de cette masse de données vertigineuse brille une catégorie de données qui vaut de l’or : la donnée personnelle culturelle. Lorsque nous observons le bouleversement des rapports de force entre opérateurs Internet, opérateurs de réseaux et groupes médias, sous l’effet de l’explosion des traces et informations liées à la révolution digitale, force est de constater la ruée de tous ces acteurs vers cette donnée personnelle culturelle, nouveau sésame qui leur ouvrirait les portes de l’intimité de l’être. À la fois miroir de nos goûts et de nos aspirations et reflet de l’image sociale que nous souhaitons renvoyer, la donnée personnelle culturelle représente en effet un fragment de notre identité. Une donnée d’autant plus précieuse qu’elle introduit un rapport inédit en réconciliant l’empreinte et le calcul3 : si, à la manière d’une photographie, la donnée numérique conserve la trace de notre activité digitale, elle s’en distingue toutefois par sa disponibilité au calcul. Contrairement à une simple photographie, qui comme le rappelait Roland Barthes4, « ne se distingue jamais de son référent, de ce qu'elle représente. [Le référent] s'entête à être toujours là, il adhère », la donnée personnelle numérique est détachable et calculable. Empreintes, fresques, statuettes, parchemins, hiéroglyphes et toute autre forme de production culturelle ou artistique sont autant de traces matérielles laissées à la postérité, de façon consciente ou non, qui nous ont permis de reconstituer des pans entiers de l’histoire de nos civilisations, pour forger notre savoir et notre culture. 1 Un yottaoctet est la capacité annoncée du nouveau data center de la NSA (National Security Agency) pour 2013, soit mille fois la totalité des données enregistrées en 2011 dans le monde - Sarah Belouezzane et Cécile Ducourtieux, « Vertigineux "Big data" », Le Monde, 26 décembre 2012 2 Données de géolocalisation, événementielles 3 Louise Merzeau « Faire mémoire des traces numériques », E-dossiers de l’audiovisuel, Sciences humaines et sociales et patrimoine numérique, INA, mis en ligne en juin 2012 4 Roland Barthes, La chambre claire - éd. Gallimard, 1980 ÉditoComportements culturels et données personnelles au cœur du Big data | 5 5 Kord Davis, "Ethics of Big data – Balancing risk and innovation" - ed. O’Reilly Media, Septembre 2012 6 René Trégouët, Sénateur, « Des pyramides du pouvoir aux réseaux de savoirs - Tome 1 », Rapport d'information 331 - 1997/1998 - Commission des Finances, site internet du Sénat, consulté le 10 octobre 2013 Bruno Perrin Associé EY Responsable du secteur Technologies Médias Télécoms en France En effet, la dimension révolutionnaire du "Big data bang" réside dans l’autonomisation des processus de production et d’échanges massifs, continus et toujours plus rapides de données ubiquitaires. Dans le domaine des contenus culturels, l’offre devient alors pléthorique. Mais à travers le téléchargement, le visionnage, l'échange de ces contenus culturels, les données personnelles du consommateur, tendent à se disperser de façon incontrôlée. Et alors qu'Internet peut apparaître comme un lieu de normalisation et de surveillance, se pose avec acuité la question du pouvoir de contrôle que permet la connaissance intime des comportements et des données personnelles culturels. Et avec elle, la question du respect de ces données et de la nécessité de développer des réponses concertées impliquant les acteurs de l’écosystème des contenus culturels numériques et des alliances autour de valeurs et impératifs communs : "Big data is ethically neutral, the use of Big data is not5". Ainsi, si le Big data apparaît comme une rupture majeure qui nous ferait définitivement quitter une ère, dont l'épuisement des ressources fait poindre les limites, pour entrer dans une économie du savoir et de la connaissance prometteuse, il est urgent d’apprendre à préserver la fragilité de cette ressource qu’est la donnée personnelle culturelle, dont la pérennité repose sur les équilibres subtils et les responsabilités partagées, qui jetteront les premiers jalons de ce nouveau marché en pleine structuration. C’est à travers la protection de cet écosystème par un filtre de confiance que ses acteurs pourront conserver un équilibre entre liberté et contrôle. Un contrôle qui implique également de ne pas se soumettre à la tyrannie de la donnée, dans une tentative de profilage qui, poussée à l’extrême, enfermerait chaque individu dans des résultats qui ne laisseraient aucune chance à la sérendipité ; au risque de tomber sous la domination d’une culture unique… Des craintes qui, en leur temps, avaient déjà été imputées à l’imprimerie, ou au latin à la Renaissance6… Au-delà des gains d’efficacité et de performance espérés, à travers une connaissance affinée du comportement de ses publics et usagers et donc d’une plus grande capacité d’anticipation de leurs attentes, les données personnelles culturelles représentent pour le secteur de l’industrie médiatique et culturelle une formidable opportunité de révolutionner leur modèle économique pour stimuler la création... à l'infini.| 7 1. Faire parler le Big data : un nouveau pouvoir dans le secteur médiatique et culturel8 | Comportements culturels et données personnelles au cœur du Big data 1 « Big data, nouveaux défis », Revue de l’Association Telecom ParisTech Alumni, n° 169, juillet 2013 2 Une pile de DVD de la hauteur de la tour Montparnasse = 1 pétaoctet (équivalences : 1 zettaoctet = 1021 octets ou 106 pétaoctets) - Sarah Belouezzane et Cécile Ducourtieux, « Vertigineux "Big data" », Le Monde, 26 décembre 2012 Une explosion des traces numériques Depuis quelques années, les données numériques connaissent une croissance exponentielle et forment une masse gigantesque de data, autrement appelée Big data. L’augmentation de cette masse de données s’explique par trois facteurs, connus sous la formule des 3V : • Le boom du volume de données émises : l’individu, de plus en plus nomade, produit davantage de données, laissant derrière lui en temps réel des traces numériques toujours plus fraîches. En parallèle, les capacités de stockage augmentent également de façon exponentielle, ce qui permet de conserver un historique de toutes ces traces numériques. En 2013, les volumes de données créées ou manipulées auront dépassé les 4 zettaoctets1, soit l’équivalent d’une pile de DVD mesurant la hauteur de… 4 millions de tours Montparnasse2. • La variété des outils connectés s’étend : du portable au réfrigérateur, de la tablette à la voiture intelligente en passant par la smart TV, le nombre d’objets connectés explose, comme en témoigne la demande croissante d’adresses IP. Capables de communiquer entre eux, ces objets qui forment « l’Internet des objets », peuvent tracer leurs utilisateurs et envoyer des informations précises sur leurs mouvements et habitudes, même quand ceux-ci ne les utilisent pas. Une variété qui qualifie également la masse non structurée des données produites par ces multiples sources, qui émettent des données présentant autant de codes, langages et formats différents. • La vélocité de l’information, à savoir la vitesse à laquelle les données sont traitées simultanément, augmente elle aussi : ces données circulent toujours plus vite, émises par des sources toujours plus interconnectées et interdépendantes, dans des réseaux qui fonctionnent de moins en moins en silos. En naviguant sur Internet, un utilisateur laisse des traces de natures variées. Ces données sont collectées selon différents modes opératoires et lui sont rattachées a priori ou a posteriori, selon qu’il se sera identifié volontairement, ou qu’il sera identifiable par recoupement (ex. : cookies, adresse IP, adresse MAC). Aux 3V du Big data s’ajoute la valeur que représentent ces données, pour l’entreprise mais aussi pour l’utilisateur. En effet, l’exploitation de ces « traces » numériques peut offrir aux utilisateurs un réel confort de navigation et leur fournir des services de qualité (mise à disposition d’une boîte mail, obtention d’applications gratuites, jeux gratuits, etc.), sans contreparties financières directes. Conscientes de la forte valeur de ces données, les entreprises tentent d’instaurer ou de gérer une relation donnant-donnant, visant à récompenser les utilisateurs qui transmettent leurs données personnelles, en leur offrant des produits ou services pour les inciter à révéler leurs préférences de consommation et des centres d’intérêt, via, par exemple, des commentaires sur les réseaux. Toutefois, proposer des services additionnels contre les données cédées suppose un équilibre délicat pour les entreprises : les consommateurs, pas toujours conscients de la portée de ce rapport donnant-donnant, peuvent se montrer réticents à l’idée d’être considérés comme des produits monétisables. D’où l’importance de porter à leur connaissance ce qu’ils sont en mesure de faire pour contrôler leurs données personnelles. • En savoir plus p. 37 Cette masse de données numériques, à l’instar de la masse monétaire, aurait-elle atteint un seuil suffisamment critique pour faire fonctionner un système économique à part entière ? Existe-t-il une hiérarchie de valeur entre ces traces numériques ? Quelle est la valeur de cette donnée numérique ? Du Big data au Worthy data Des traces à l’ADN de l’être numériqueComportements culturels et données personnelles au cœur du Big data | 9 Octet 1 o Kilo-octet (Ko) 1 000 octets 30 Ko Une page de texte Word Exaoctet (Eo) 1 000 Po Mégaoctet (Mo) 1 000 Ko 5 Mo Un morceau de musique Gigaoctet (Go) 1 000 Mo 1 Go Un film de 2 heures Téraoctet (To) 1 000 Go 1 To 6 millions de livres numérisés Pétaoctet (Po) 1 000 To 1 Po Une pile de DVD de la hauteur de la tour Montparnasse Zettaoctet (Zo) 1 000 Eo 1 Zo La totalité des données enregistrées en 2011 Yottaoctet (Yo) 1 000 Zo 1 Yo Capacité du data center de la NSA exaoctets de données générées depuis les premières mesures 5 jusqu’en 2003 2 En 2011, il fallait 2 jours pour les générer 2 En 2013, il faut 10 minutes pour les générer 24 h 24 h 10 min De l'octet au yottaoctet, l'échelle des données Source : chiffres CNRS Quelles traces laissées par une simple recherche culturelle sur le web ? Exemple : réservation d’une entrée pour une exposition au Grand Palais Source : EY © Logiciel • Navigateur • Système d’exploitation Physique • Équipement (smartphone/ tablette/ordinateur) • Type de connexion • Adresse IP/Adresse MAC • Localisation (ADSL) : DSLAM • Géolocalisation (mobile, wifi) Action utilisateur Services en contrepartie Traces numériques à caractère majoritairement personnel • Rapidité de navigation • Confort d’utilisation • Richesse des informations et des services en ligne • Gratuité des informations obtenues et accès aux services Session utilisateur • Moteur de recherche • Messagerie • Site tiers • Réseau social… • Données de contact (âge, sexe, coordonnées…) • Données de connaissance (CSP, intérêts, relations, profil de consommation…) • Niveau d’équipement (type, résolution d’écran…) • Vitesse et données techniques de connexion • Statistiques/comportement de navigation • Pays/zone géographique/localisation • Environnement logiciel • Informations collectées par cookies • Favoris, historique, paramètres, préférences de navigation 145 milliards de mails envoyés 4,5 milliards de recherches sur Google 104 000 heures de vidéos mises en ligne sur YouTube 400 millions de tweets postés 552 millions d’utilisateurs se connectent à Facebook 24h dans la vie du Big data Source : CNRS10 | Comportements culturels et données personnelles au cœur du Big data « Avec le Big data, le nerf de la guerre est le contexte. Dans les années 90, le contenu était roi, désormais, c’est le bon contenu dans le bon contexte qui est roi, ce que l'on peut résumer par la formule "content is king, but context is King Kong". L’Institut National de l’Audiovisuel a parfaitement pris conscience que la donnée numérique, enrichie d’éléments de contexte, voyait sa valeur augmenter sensiblement du fait de services et de contenus proposés mieux personnalisés et plus pertinents. » Stéphane Ramezi, Responsable des éditions multimédia à l’INA Donner de la cohérence aux traces numériques Individuelles, hétérogènes, multiples et éparses, les traces numériques collectées en temps réel n’ont, prises isolément, aucune valeur. Leur valeur vient du sens qu’on arrive à en tirer, en termes de corrélation ou de prédictibilité. Il est possible de donner du sens à ces données en les rattachant à leur cause commune : le comportement d’un être humain. De cette façon, on peut non seulement espérer comprendre le comportement d’un individu à travers les traces qu’il laisse, mais aussi, in fine, recomposer l’ADN de son « être numérique ». Il arrive que les images physique et numérique d’un individu se recoupent. Le simple achat d’une carte de transport par exemple : un individu qui passera, tous les soirs à 18h sauf le week-end, le portique du métro avec son titre de transport et laissera dans le même laps de temps des traces de recherches sur Internet à partir de son téléphone portable, sèmera suffisamment d’indices pour permettre de décrypter ses habitudes ; il s’agit sans nul doute de son trajet à la sortie du travail. Mais il arrive parfois que l’être physique et l’être numérique projettent des images différentes. On peut par exemple avoir une interprétation erronée d’une information transmise sur un réseau social, telle que « j’aime » ou « j’y étais » : prise isolément, une telle information sera non seulement trop parcellaire pour prétendre décrypter un comportement ou une personnalité, mais surtout, elle ne correspondra pas forcément à l’identité de l’être physique en termes de niveau social, d’éducation, etc. Dans tous les cas, que l’image projetée de l’être numérique se recoupe ou non avec l’image réelle de l’être physique, l’image numérique aura un sens si elle s’inscrit dans une cohérence dans le temps. C’est à cette condition que les traces laissées par l’être numérique pourront donner un caractère prédictif aux modèles statistiques, et ainsi générer de la valeur. Recomposer l’ADN de l’être numérique à travers des algorithmes toujours plus pointus Au-delà de la collecte de données et de leur stockage, l’intelligence algorithmique est indispensable pour donner un sens à la masse de données que forment les « traces » laissées par chaque individu connecté. Cette intelligence algorithmique vise à regrouper et confronter des données numériques issues de sources diverses pour créer et caractériser l’ADN d’un être numérique, afin de décrypter et d’anticiper ses comportements dans des environnements différents. Il faut donc contextualiser la donnée qui, seule, n’aura aucun sens, mais prendra toute sa valeur dans la mise en relation avec une multitude d’autres données. C’est ce pouvoir de contextualisation qui permettra à l’entreprise de proposer la bonne offre à la bonne cible, au bon moment, à travers le bon canal... en somme d’enrichir, personnaliser et valoriser son offre de contenus et services. Comportements culturels et données personnelles au cœur du Big data | 11 Prévoir le comportement de l’être numérique Parallèlement, ou au-delà de la corrélation avec le contexte, l’intelligence algorithmique vise à établir des liens de cause à effet pour mieux prévoir les comportements de l’être numérique. C’est en ce sens qu’œuvrent les informaticiens et data analysts qui élaborent les algorithmes. Ces modèles à visée prédictive sont déjà largement utilisés. Les recommandations de sites d’achats de biens et services culturels en ligne tels que Netflix ou Amazon reposent sur des modèles capables de prévoir ce qu’un individu serait en mesure d’apprécier au regard de ses achats antérieurs, mais aussi d’achats similaires effectués par d’autres consommateurs, afin de lui proposer des produits en conséquence. La valeur d’une trace numérique : un arbitrage entre cash-flow futur et coût de collecte/analyse Le décryptage de l’ADN d’un être numérique a un coût (collecte de la donnée, stockage, décryptage de l’information via des algorithmes performants). Le défi majeur réside ainsi dans les coûts et investissements élevés que représentent les infrastructures de traitement de données volumineuses, en trouvant notamment un moyen de valoriser et monétiser les nouvelles analyses rendues possibles grâce aux données issues du Big data. Avec, à la clé, l’optimisation des cash-flows générés par la justesse des prédictions des comportements numériques, tout en gardant la maîtrise des coûts de développement d’algorithmes, d’achat informations, de collecte et de stockage. Face à la déferlante des données et au phénomène de ruée vers ce nouvel or numérique, il faut garder à l’esprit que toutes ces données n’ont pas la même valeur. Une échelle de valeur va donc s’établir, la valeur d’une donnée variant selon ce qu’elle révèle ou non sur l’ADN de l’être numérique. Si, par exemple, une adresse ou un numéro de téléphone pouvaient avoir de la valeur à l’époque du télémarketing de masse, ils se révèlent aujourd’hui bien moins précieux que des données sur les centres d’intérêt ou les dernières recherches d’un individu. C’est pourquoi, dans cet amas enchevêtré de données de toutes natures, se détache aujourd’hui une pépite prometteuse de laquelle on pourra extraire des worthy data : il s’agit de la donnée personnelle culturelle. Le Big data implique le traitement de données volumineuses (nombreuses sources d’historiques, bases de corrélations, etc.) en un temps raisonnable, voire en temps réel. Bien souvent, une combinaison de méthodes statistiques classiques (statistiques descriptives, segmentation, scoring, etc.) et de solutions de calcul permettent de résoudre ces difficultés. Par exemple, la parallélisation des calculs répète les mêmes calculs sur des groupes de données séparés, des séquences, avant de les réconcilier, afin qu’ils soient globalement effectués de manière plus rapide. Cette méthode de calcul est combinée avec des estimateurs statistiques pour converger vers une réponse la plus juste possible dans le délai imparti. Il est à noter que les formes de statistiques descriptives auxquelles on aboutit aujourd’hui sont plus pures qu’à l’époque où l’on ne disposait que d’échantillons de données qu’il fallait extrapoler (du fait des coûts de récolte, de stockage et de traitement). Raison pour laquelle la quantité de données disponibles et leur traitement ne sont aujourd’hui plus une limite, permettant ainsi de travailler sur des données plus exhaustives. Évolution des modes calculatoires12 | Comportements culturels et données personnelles au cœur du Big data La donnée personnelle culturelle : une data qui vaut de l’or Une forte demande en données personnelles culturelles numériques Bien plus que la consommation de biens et services matériels, qui satisfont les besoins fondamentaux et primaires, celle de biens et services culturels en dit beaucoup sur nos préférences, nos centres d’intérêt et nos aspirations. Elle touche ainsi à notre identité, non seulement dans ce qu’elle a de plus intime, mais aussi dans ce qu’elle a de plus social et communautaire : les biens et services culturels que nous consommons, ou nos comportements culturels, participent en effet largement de l’image que nous souhaitons renvoyer dans notre environnement social. C’est pourquoi nous partageons volontiers notre expérience et notre avis sur un livre, un film, un jeu, un concert ou une exposition avec nos amis ou communautés en ligne, tout comme avec les éditeurs de contenus en ligne. La donnée personnelle culturelle renferme des informations contextuelles fortes et permet de qualifier de façon assez précise le pouvoir d’achat de l’être numérique mais aussi de prévoir son comportement. C’est pourquoi, en raison de sa valeur intrinsèquement élevée, elle figure aujourd’hui au centre de toutes les attentions des acteurs du Big data. Il existe d’ores et déjà une demande sur le marché de la donnée personnelle culturelle, largement portée par des groupes tels que la Fnac et Amazon. Ils valorisent ces données personnelles culturelles pour packager, adapter et cibler leurs offres en conséquence. Mais, si la demande est bien là, qu’en est-il de l’offre ? Comportement culturel de l’homo conexus à l’origine de la donnée personnelle culturelle Depuis plusieurs années, le temps consacré à la consommation de contenus culturels ne cesse d’augmenter, une tendance amplifiée par le fait que le consommateur est désormais un homo conexus, connecté, mobile et multitâches. Un phénomène à l’origine de l’explosion des traces personnelles culturelles laissées par l’homo conexus, parallèlement à l’augmentation des données émises par l’Internet des objets, qu’elles soient produites par son comportement culturel… : • … numérique : moteurs de recherche, transactions de biens et services culturels (billeterie, livres, musique…), consultation et partage de vidéos/musique/séries en streaming, réseaux sociaux, portails médias, etc. ; • … ou physique : une séance de cinéma ou la visite d’une exposition peuvent laisser des traces via les moteurs de recherche, les images et commentaires postés sur les réseaux sociaux, la géolocalisation. Mais aussi, une simple soirée devant la télévision : aujourd’hui, 52 % des commentaires sur Facebook portent sur les programmes diffusés à la télévision. Comportements culturels et données personnelles au cœur du Big data | 13 Si, du côté de l’offre, la donnée personnelle culturelle est longtemps restée cantonnée à l’analyse des paiements, on observe aujourd’hui chez les entreprises et établissements du secteur médiatique et culturel un prolongement de l’expérience culturelle en-deçà et au-delà des transactions de paiement. Ces acteurs tendent à enrichir leurs offres de services culturels via un continuum de services. Ceci permet de prolonger l’expérience culturelle des clients et de nouer une relation d’engagement avec eux. Une relation qui fournira de précieuses informations client, à condition d’être capable d’engranger et de lier efficacement une quantité et une variété inédites d’informations, générées dans des espaces et temporalités différents. 1 Selon une définition consacrée, est une « donnée publique culturelle » la donnée produite ou détenue par un établissement, organisme ou service culturel ayant une activité culturelle réelle et effective (Source : Guide Data Culture). Ex. : inventaire du fonds artistique, horaire d'ouverture, catalogue d'exposition, œuvre du domaine public... 2 Données sur les actes d'achats de biens et services culturels. Ex. : nombre d'entrées en salle, vente de disques, entrées aux musées, détenteurs de cartes d'abonnement, ventes Amazon... 3 Données de contact et qualification collectées au travers des opérations des acteurs de l'industrie culturelle. Ex. : abonnés de l'espace personnel du Louvre, participants aux jeux-concours de promotion musicale, abonnés newsletters, données de navigation... 4 Ensemble des données permettant de connaître les préférences culturelles des consommateurs. Ex. : discussions dans des forums, réseaux sociaux, avis et commentaires sur des œuvres/artistes... Benchmark de données : la donnée personnelle culturelle se distingue Données marketing3 Moyen Fort Moyen Moyen Moyen Données personnelles culturelles4 Fort Moyen Fort Fort Fort Volume de données Degré de digitalisation Variété de format Intimité Multiplicité des sources Données publiques culturelles1 Faible Faible Fort Faible Fort Données transactionnelles2 Fort Moyen Faible Moyen Moyen Les comportements culturels, davantage que les traditionnels CSP, apportent de la valeur aux profils numériques. Une production de données toujours plus exhaustive, pour une meilleure appréhension du comportement culturel de l’être numérique Source : EY ©14 | Comportements culturels et données personnelles au cœur du Big data La donnée personnelle culturelle au cœur de l'émergence d'un marché stratégique Un marché en pleine structuration, sous l’effet de lourds investissements 1 « Social TV : Facebook partagera ses données avec TF1 et Canal+ », Le Monde, 7 octobre 2013 2 GAFA désigne les Big 4 du numérique : Google, Apple, Facebook, Amazon 3 Début 2012, Google avait numérisé plus de 20 millions d’ouvrages (Jennifer Howard, “Google Begins to Scale Back Its Scanning of Books From University Libraries”, 9 mars 2012, site visité le 10 octobre 2013) et le coût de numérisation de l’intégralité du catalogue de la Bibliothèque nationale de France (BNF), soit environ 15 millions d’ouvrages, est estimé à 750 millions (selon Yann Gaillard, rapporteur spécial de la Commission des finances pour la mission « Culture » et auteur du rapport intitulé : « La politique du livre face au défi du numérique. ») La valeur élevée de la donnée personnelle culturelle numérique est source d’importants mouvements d’acteurs et fait l’objet de lourds investissements. Un marché hautement stratégique est en train de se dessiner à la faveur d’un double phénomène de rapprochement et de convergence, avec : • D’une part (tendance 1), les entreprises et établissements médiatiques et culturels qui innovent pour proposer un continuum de services, afin d’enrichir et de prolonger l’expérience culturelle en recueillant des informations précieuses sur les préférences de consommation de biens et services culturels. Exemple : grâce au partenariat signé entre TF1 et Facebook en octobre 2013, le réseau social partagera ses données avec le groupe audiovisuel français qui bénéficiera des outils Facebook dédiés au suivi et à l’analyse des conversations autour des programmes TV. Ces outils permettront à TF1 de mesurer le nombre de publications autour d’un sujet précis et de les analyser, mais aussi d’afficher et de mesurer, pendant la diffusion de ses programmes, le taux de conversations en temps réel sur le réseau social, qui rassemble 26 millions d’utilisateurs en France et génère « 52 % des commentaires sur la télévision1 ». • D’autre part (tendance 2), les leaders du numérique, les GAFA2, qui possèdent déjà des infrastructures de données et sont utilisateurs de données personnelles culturelles, investissent pour se rapprocher de la production de données personnelles culturelles, mais aussi pour produire et diffuser eux-mêmes des contenus culturels. Exemple : l'Institut culturel de Google intègre différents projets dont Google Art Project, qui permet de se promener dans les galeries de 151 musées ou lieux culturels en ligne à travers le monde (Versailles, Quai Branly, MoMa, The National Gallery à Londres, Fondation Neslon Mandela, etc.). Ce service repose sur des bases de données utilisant différentes technologies de l’opérateur et collectant des données personnelles culturelles à l’échelle internationale, avec un effet multiplicateur fort via les réseaux sociaux. Et avec une volonté forte de développer des standards communs ou interopérables pour les musées à travers le monde. Cette invitation dans le monde la culture vient compléter les investissements du groupe dans les secteurs de la vidéo (rachat de YouTube pour 1,65 milliards de dollars en 2006), du livre (plusieurs centaines de millions d’euros3 ), des contenus audiovisuels (films et séries provenant des catalogues de grands studios américains ou de chaînes de télévision telle que BBC, etc.). Amazon s’invite également dans le marché de l’art en lançant, en août 2013, Amazon Art, une plateforme proposant à la vente plus de 40 000 œuvres en provenance de 150 galeries à travers le monde, des plus exceptionnelles aux plus accessibles, avec la volonté clairement affichée de toucher une audience plus large. Structuration d’un nouveau marché stratégique Tendance 1 Être à la fois producteur et utilisateur de données personnelles culturelles Tendance 2 Entrée des GAFA2 sur le marché des données personnelles culturelles Infrastructure Big data Serveurs, data centers, bases de données, algorithmes… Producteurs de données personnelles culturelles • Établissements culturels • Créateurs de contenus créatifs et culturels Ex. : musées, bibliothèques Utilisateurs de données personnelles culturelles • Groupes de médias - Producteurs, diffuseurs, distributeurs de contenus culturels Ex. : diffuseurs TV, éditeurs • Sociétés de marketing digital Distributeurs de produits et services culturels en ligne Ex. : Amazon, La Fnac Les champions du numérique Ex. : Amazon, Apple, Google Acteurs des Infrastructures de données Acteurs des échanges de données personnelles culturelles Source : EY ©Comportements culturels et données personnelles au cœur du Big data | 15 Infrastructure Big data : de quoi parle-t-on ? L'information sur la localisation géographique des data centers est très difficile à obtenir et jugée stratégique par les grands acteurs du secteur. Sur la base des informations publiques disponibles et pour les data centers vendant leurs services, EY a réalisé une carte anamorphose des data centers, qui montre l'avancée des États-Unis en matière de capacité de stockage de données, par rapport à l'Europe et aux autres régions du monde. Les capacités de stockage dont se dotent les grands collecteurs de données sont bien supérieures aux besoins à très court terme comme en atteste la capacité du dernier data center de la National Security Agency (NSA), qui atteint 1 yottaoctet4. En outre, l’analyse des charges et revenus des GAFA montre que si la R&D, le stockage et le traitement des données constituent une part significative des coûts, l’exploitation directe des données Big data ne constitue qu’une faible partie des revenus, l’essentiel5 de ces derniers provenant de la publicité ou de la distribution. 4 Sarah Belouezzane et Cécile Ducourtieux, « Vertigineux "Big data" », Le Monde, 26 décembre 2012 5 Les revenus issus de l’exploitation directe des données Big data sont issus de la vente de services de stockage, de traitement et analyses de données Big data, Jeffrey Kelly, David Floyer, Dave Vellante, Stu Miniman, "Big Data Vendor Revenue and Market Forecast 2012-2017", Wikibon, octobre 2013 Si on compare, par grande zone géographique, les pourcentages de data centers dans le monde aux pourcentages de PBN mondial, on constate que certaines régions sont surreprésentées en data centers par rapport à leur poids économique (% de leur PNB/PNB mondial). Ainsi, l’Amérique du Nord a généré 26 % du PNB mondial en 2012 tandis qu’elle abritait 44 % des data centers proposant des services commerciaux. Europe 33 % 25 % Asie 10 % 32 % Autres pays 8 % 4 % Afrique 1 % 2 % Moyen-Orient 2 % 4 % USA/Canada 44 % 26 % Amérique du Sud 2 % 7 % Part de data center Part du PNB mondial Carte en anamorphose des data centers Source : EY ©16 | Comportements culturels et données personnelles au cœur du Big data Caractéristiques du marché de la donnée personnelle culturelle Pour mieux cerner le marché du Big data et en comprendre les règles du jeu, il convient d’analyser les caractéristiques des principales forces en présence. Des coûts marginaux dégressifs Les investissements initiaux sont principalement relatifs à « l’infrastructure Big data » : serveurs, data centers, algorithmes. Si la collecte massive de données personnelles, ainsi que le développement des algorithmes pour les exploiter nécessitent de lourds investissements de départ pour fournir le service au premier client, les coûts nécessaires à l'acquisition de clients supplémentaires sont dégressifs. Un marché où seuls quelques acteurs pourront survivre à moyen terme Toutes les entreprises n’ont pas les moyens d’investir dans cette infrastructure dont le niveau déterminera la qualité de l’exploitation des data. Ainsi, les chances de réussite d’un nouvel acteur sont loin d’être certaines, d’autant que celui-ci risque d’encourir des sunk costs importants. Par ailleurs, l’acteur qui possède la plus grande masse d’informations (réseau social, application, operating system, etc.) et dispose des algorithmes les plus puissants attirera davantage de clients et collectera d'autant plus de données fiables additionnelles. Ceci aura pour conséquence de renforcer la qualité de ses analyses et de ses algorithmes et, in fine, sa position sur le marché. Cet effet « boule de neige » (winner-take-all effect) ajouté à la barrière du coût initial, aux fortes économies d’échelles et à un niveau important de sunk costs tend inévitablement à concentrer le marché à moyen terme. Un marché touchant au « bien commun » Le marché de la donnée personnelle culturelle est sensible car les informations concernant les comportements culturels d'une population donnée et leur exploitation sont souvent issues de statistiques ou d’enquêtes publiques et traitées/analysées à l’échelle nationale, par les instituts de statistiques publics. Rappelons par ailleurs que la propriété intellectuelle culturelle tombe dans le domaine public après une longue période d’exploitation par les auteurs et producteurs de ces données/ contenus1. « Les opérateurs tels que Google, Amazon ou Microsoft construisent leurs propres data centers. Google construit même les machines à l’intérieur de ses data centers. » Jérôme Dilouya, Fondateur et Président-directeur général d’Intercloud 1 « La propriété intellectuelle à l’ère du numérique – Défis et opportunités pour le secteur Médias et Divertissement », EY, Novembre 2011 « Nous sommes face à l’enjeu suivant : qui va gagner la course au CRM du web ? […] Celui qui aura atteint la masse critique de données aura gagné la course de vitesse du CRM digital. » Roei Amit, Directeur adjoint chargé du numérique à la Réunion des musées nationaux - Grand Palais (Rmn-GP)Comportements culturels et données personnelles au cœur du Big data | 17 Des caractéristiques de marché proches de celles d’une infrastructure essentielle ? Investissements initiaux important puis coût marginal faible, sunk costs élevés, fortes économies d’échelle, winner-take-all effects, domaine touchant au bien commun, traditionnellement animé par des organismes publics, etc. : ces éléments, caractéristiques des monopoles naturels, sont longuement décrits dans la littérature économique. Au regard des grandes tendances qui ont marqué certains secteurs avec monopoles naturels, comme les télécoms ou les chemins de fer, l’enjeu consiste à identifier l'infrastructure essentielle et ses marchés Amont et Aval afin de favoriser la concurrence et la diversité des acteurs sur ces marchés. Dans cette optique, l’infrastructure et l’échange de données constituent-ils un marché pertinent ? Est-ce une infrastructure essentielle ? Existe-t-il des acteurs dominants sur ce marché qui doivent être régulés ? De tels marchés ont besoin d'éléments de structuration pour arriver à leur point d'équilibre à moyen et long termes. En outre, au cœur de ce marché en construction, ce sont les données de milliards d’individus connectés, générant des zettaoctets de données numériques collectées et utilisées par un nombre relativement restreint d’acteurs économiques, qui sont en jeu. Là aussi, dans un souci d’équilibre à long terme, la réglementation a un rôle à jouer pour instaurer une relation de transparence et de confiance entre les entreprises et les individus. C’est en leur donnant un droit de regard et de contrôle renforcés sur leur identité numérique que ces êtres numériques continueront à avoir une existence et à produire des données créatrices de valeur. Les caractéristiques d’une infrastructure essentielle • Caractéristiques techniques - Indivisibilité technique (indivisibilité des investissements) - Longue durée de vie - Produit faisant l’objet de peu d’échanges - Produit faisant souvent partie d’un tout, difficile à isoler techniquement • Caractéristiques économiques - Fonction de coûts sous-additive (existence d’économies d'échelle) - Coûts irrécupérables importants (investissements non réversibles) - Externalités de réseau (prime au leader, effet boule de neige, importance d'une masse critique de consommateurs, anticipations auto-réalisatrices...) - Guerre des standards empêchant d'avoir des produits substituables • Caractéristiques socio-économiques - Coordination et planification centralisées - Traditionnellement détenue par l'État - Traditionnellement considérée comme touchant au « bien commun » « Plusieurs milliards d'individus génèrent et échangent des informations personnelles en temps réel tout autour de la planète, bouleversant la science, l'économie et les relations de pouvoir. La gestion des données s'affirme ainsi comme une infrastructure essentielle de la mondialisation, qui doit être régulée alors qu'elle s'affranchit des États et des frontières. » Nicolas Baverez, « La révolution Big data », Le Point, mai 2013| 19 2. Pouvoirs en équilibre et responsabilités partagées : les nouveaux contours du Big data20 | Comportements culturels et données personnelles au cœur du Big data La masse de traces numériques disponibles est désormais suffisante pour permettre de suivre et de modéliser des « êtres numériques » rationnels et cohérents. Dans cette course à l’extraction et à l’analyse de données pertinentes, se dessinent les contours d’un marché à part entière : il s’agit du marché des données personnelles culturelles numériques. S’il ouvre des perspectives économiques prometteuses et étonnantes, ce nouveau marché doit cependant être accompagné dans sa structuration et son développement. En effet, pour garantir son développement harmonieux à moyen et long termes et favoriser un nouvel écosystème économique innovant et créateur de valeur pérenne, il faut s’assurer que l’échange et l’utilisation massive des données personnelles culturelles se fassent dans le respect de la vie privée de chaque individu, premier producteur de données personnelles culturelles. Mais aussi favoriser les investissements des entreprises quant à la collecte et à l’organisation des données et enfin instaurer une saine concurrence économique. « Si l’on veut construire une innovation durable, qui ne soit pas rejetée par l’utilisateur, les entreprises doivent apporter des garanties en termes de protection des données personnelles. Ce n’est pas un coût, c’est un investissement. » Isabelle Falque Pierrotin, « Data, la nouvelle ruée vers l’or », Enjeux Les Échos, mars 2013 Comportements culturels et données personnelles au cœur du Big data | 21 La réglementation, impulsion économique pour les acteurs de Big data en Europe La protection comme facteur de confiance Un fort besoin de confiance quant à la gestion des données personnelles Les réseaux sociaux se font souvent écho des manquements en matière de respect de la vie privée ou de sécurité informatique et propagent souvent le « buzz » autour de pratiques contraires à la loi sur la protection des données. La protection des données personnelles apparaît ainsi au centre des préoccupations des consommateurs, qui questionnent de plus en plus les entreprises et responsables du traitement sur les garanties et la sécurité qu’ils peuvent garantir aux données personnelles qu'ils leur confient. Les questions les plus fréquemment posées sont relatives à la localisation de ces données, aux mesures de sécurité mises en place pour les protéger contre des accès non autorisés, à l’usage qui en est fait par le responsable de traitement, à qui elles sont destinées, etc. Dans un contexte où les questions de confidentialité et de vie privée suscitent un intérêt grandissant chez l’ensemble des parties prenantes, de plus en plus d'entreprises intègrent cette dimension dans leurs actions de communication, tentant ainsi de démontrer l'importance qu'elles attachent à la protection de la vie privée de leurs clients. Au-delà de l’aspect juridique, la conformité à la réglementation en matière de protection des données personnelles devient un moyen efficace pour les entreprises de communiquer sur leur engagement éthique et sociétal. Le respect des bonnes pratiques en matière de protection des données à caractère personnel constitue indéniablement un avantage concurrentiel pour les entreprises, quel que soit leur secteur d'activité, mais également un moyen de se prémunir du risque de réputation. Partant du postulat reconnu que la rétention d’un client requiert un investissement bien moindre que son acquisition, les entreprises déploient des stratégies pour maintenir et entretenir la fidélité de leurs clients. Celle-ci repose essentiellement sur la confiance, laquelle ne peut être construite qu’en s'appuyant sur les deux notions fondamentales que sont la connaissance et la reconnaissance. La connaissance enregistre « l’historique du client », c'est-à-dire ses interactions avec les différents services de l’entreprise, auxquelles s’ajoutent des informations relatives aux produits. La reconnaissance est la réponse personnalisée selon le client : il s’agit donc de s’appuyer sur la connaissance du client pour lui apporter une réponse ciblée, voire de devancer ses attentes. L'évolution constante des technologies qui a rythmé les dix dernières années, à laquelle s’ajoute le décalage qui existe encore trop souvent entre les engagements, volontaires ou imposés, en matière de protection des données et les pratiques de traitement des données, ont pour effet de renforcer les attentes des consommateurs en matière de confiance et de transparence.22 | Comportements culturels et données personnelles au cœur du Big data Comment définir aujourd’hui une donnée à caractère personnel ? Définir la notion de « donnée à caractère personnel » n'est pas chose aisée en raison de son caractère mouvant, parfois subjectif ou relatif, mais avant tout contextuel. La directive 95/46, qui constitue le socle communautaire en matière de protection des données personnelles, définit une « donnée à caractère personnel » comme « toute information concernant une personne physique identifiée ou identifiable (personne concernée) ; est réputée identifiable une personne qui peut être identifiée, directement ou indirectement, notamment par référence à un numéro d'identification ou à un ou plusieurs éléments spécifiques, propres à son identité physique, physiologique, psychique, économique, culturelle ou sociale ». D’autres définitions existent : « nous ne devrions plus parler de données personnelles, mais de données relationnelles et transactionnelles. Nous devons abandonner la vision des données personnelles comme une chose définie.1 » En effet, les données qui, prises indépendamment, peuvent sembler insignifiantes, sont assemblées et analysées pour recréer des profils individuels ou définir des identités numériques à partir d’éléments de personnalité réels. Souvent, il suffit d’une date et du lieu de naissance pour identifier un individu. Mais l’usage des réseaux sociaux, ainsi que des moteurs de recherche ou des services de messagerie peuvent donner une vision précise de cet individu à travers le prisme de ses goûts, de ses habitudes, de ses projets ou de ses croyances. Au risque de voir toutes ces données combinées afin d'identifier un individu, sans même connaître précisément son nom. La quantité de données qui sont désormais collectées, traitées et stockées sur chaque personne permet d'aller beaucoup plus loin et contribue à un profilage très précis des individus avec la possibilité - en fonction des catégories de données traitées – de produire des modèles probabilistes pour en apprendre davantage sur leur croyance religieuse, leur opinion politique, leur mode de vie, leur orientation sexuelle et bien d'autres aspects de leur vie personnelle et intime. La question se pose donc de redéfinir les catégories de données qui doivent être considérées comme sensibles et donc réglementées plus strictement par la loi. En effet, des données collectées à partir de ce que peut lire, écouter ou regarder un individu peuvent fournir des indications sur son orientation politique, ses croyances religieuses ou même son orientation sexuelle, et de facto relever du statut juridique protecteur des données sensibles. Force est de constater que les données culturelles, qu’elles répondent ou non à la définition des données sensibles, doivent faire l’objet d’une protection en cela qu’elles relèvent de l’intimité d’un individu. Cette question est d'autant plus cruciale dans le contexte du développement de Big data et du cloud computing qui, par économie d'échelle, peuvent induire une augmentation de tous les risques soulevés par les questions suivantes : • Où sont stockées les données personnelles ? • Les données personnelles sont-elles sécurisées ? • Est-ce qu’un individu possède encore le contrôle de ses données ? • Comment un individu peut-il s’opposer au traitement de ses données ? • Comment un individu peut-il récupérer ses données ? La question de la confiance devient encore plus fondamentale lorsqu’il est question de bâtir une relation durable avec les utilisateurs et clients, afin de répondre à des doutes ou des craintes qui pourraient freiner le développement de ce qui semble être appelé à devenir un levier majeur de création de valeur dans l’industrie médiatique et culturelle. Conjointement à ces initiatives privées, les acteurs publics doivent mener les actions qui s’imposent afin d’assurer un niveau adéquat de protection des données personnelles et soutenir la croissance du secteur, à l’image des politiques adoptées dans de nombreux pays pour offrir un cadre au commerce en ligne. 1 Dominique Boulier, Vie Privée à l’Horizon 2020, Cahier IP n° 1, CNIL, novembre 2012Comportements culturels et données personnelles au cœur du Big data | 23 Comment les données personnelles sont-elles collectées et traitées ? Boîte à outils ÉVALUER LE RESPECT DE LA VIE PRIVÉE Privacy Score attribue une note aux sites web en fonction de leur niveau de conscience et du respect de la vie privée. www.privacyscore.com TRAQUER LES TRACKERS The Guardian a mis en place une application en ligne afin de permettre aux internautes de comprendre comment ils sont suivis en ligne et par qui. Les cercles rouges sont les dix premières sociétés de tracking les plus prolifiques ; les cercles bleus se réfèrent aux 100 sites les plus populaires qui les utilisent. www.theguardian.com QUELLE EST LA VALEUR DES DONNÉES PERSONNELLES ? Le site du Financial Times permet de calculer combien de commerçants feraient payer des données personnelles sur la base de nombreux critères comme l'âge, le travail, la famille, les maladies ou les activités potentielles. www.ft.com CONTRÔLER L’INFORMATION - CONFIGURER SON NAVIGATEUR WEB Tous les navigateurs permettent le blocage des cookies de suivi. Certains navigateurs comme Mozilla Firefox permettent de choisir une option spécifique, laquelle consiste à informer les sites web qu’on ne souhaite pas être suivi par des annonceurs et autres tiers. Respecter ce paramètre est facultatif, les sites web n’étant pas tenus de respecter la volonté des internautes. Il est également possible de mettre en œuvre des plug-in supplémentaires pour surveiller l’intégralité des données recueillies à partir des appareils, la façon dont elles sont traitées et éventuellement, s'opposer à toute collecte de données.24 | Comportements culturels et données personnelles au cœur du Big data États-Unis/Europe : deux approches différentes de la protection des données personnelles En termes de politique publique, des approches différentes peuvent être mises en avant afin d’aborder la question de la vie privée et de la protection des données personnelles, à l’instar des États-Unis et de l’Europe qui ont une conception radicalement différente des concepts de « protection de la vie privée » et de « donnée à caractère personnel ». La première différence entre ces deux approches réside dans la spécificité du système américain où les lois fédérales coexistent avec les lois de chacun des cinquante États, ce qui place les ÉtatsUnis au premier rang des pays ayant adopté le plus grand nombre de lois dans le domaine de la protection de la vie privée et des données à caractère personnel. La deuxième différence consiste dans le fait qu’aux États-Unis, il n'existe pas un corps unique de règles protégeant la vie privée (à l’exception du Privacy Act de 1974 qui donne aux citoyens le droit de connaître les informations que le gouvernement fédéral détient à leur sujet et de corriger ou d’obtenir réparation si leurs données sont utilisées de manière non autorisée). Aux États-Unis, la protection de la vie privée est déclinée par secteur d’activités, industrie, ou toute autre segmentation qui concernent par exemple le secteur de l’enfance ("Children's Online Privacy Protection Act" - COPPA) de 1998 qui protège les données personnelles des enfants de la collecte et du détournement de leurs données sur les sites internet commerciaux), le secteur financier ("The Financial Services Modernisation Act" ou "Gramm-Leach-Bliley Act" de 1999 qui règlemente les conditions de communication à des tiers d’informations personnelles détenues par les institutions financières) ou encore des lois qui protègent la santé comme le "Health Insurance Portability and Accountability Act" (HIPAA) de 1996 qui met en place des standards pour l’échange électronique d’informations médicales afin de protéger la vie privée des patients. De nombreux textes vont protéger les données mais de manière sectorielle et non de manière transversale. Dans le secteur des médias, on peut citer le "Cable Communications Policy Act", le "Telecommunications Act" ou le "Videotape Privacy Protection Act". Au-delà de l’aspect législatif, la principale différence entre le droit à la vie privée aux États-Unis et au sein de l'Union européenne est d’ordre philosophique. Alors qu’aux États-Unis, la loi sur la vie privée est axée sur la protection du consommateur et vise à atteindre un équilibre entre la vie privée et l'efficacité de l’entreprise, l’Union européenne considère le respect de la vie privée comme un droit fondamental du citoyen, supérieur à tout autre intérêt commercial. La loi américaine sur la protection de la vie privée entend protéger le consommateur plutôt que l'individu et sanctionnera les manœuvres déceptives ou trompeuses plutôt que le non-respect de règles de protection des libertés publiques. Enfin, une autre différence marquante est certainement l’accent particulier mis par la réglementation nord-américaine sur la protection de la sécurité des données, notamment à travers l'obligation de notifier les failles de sécurité. Plusieurs États nordaméricains ont depuis longtemps édicté des lois qui mettent à la charge des organisations des obligations de notifier les failles de sécurité. Ainsi, la grande majorité des États américains dispose de lois qui vont imposer aux entreprises la mise en place de procédures particulières en cas de vol ou de perte de données personnelles. Cette réglementation contraint les entreprises à renforcer leurs mesures de sécurité internes, et cela afin d’éviter des procédures coûteuses et préjudiciables à leur image de marque en cas de publicité voulue ou subie. Au niveau européen, l'obligation de notifier les failles de sécurité ne fait aujourd’hui pas encore partie du droit positif en matière de protection des données dans le cadre de la directive européenne 95/46, même si elle existe déjà pour les prestataires de communication électronique en application de la directive 2002/58 sur la vie privée. Toutefois, le projet de règlement pour la protection des données publié par la Commission européenne devant refondre le cadre européen de la protection des données prévoit une obligation similaire qui s'appliquera à tous les responsables de traitement et sous-traitants en Europe.Comportements culturels et données personnelles au cœur du Big data | 25 À cet égard, il est intéressant de souligner que les différences entre ces deux approches ont vocation à se réduire compte tenu des enjeux d’interopérabilité nécessités par l’augmentation croissante des flux transatlantiques de données. En effet, au moment où la Commission européenne a publié le projet de règlement pour la protection des données le 25 janvier 2012, la Maison Blanche publiait un mois plus tard le projet de loi relatif au respect de la vie privée des consommateurs. La comparaison entre ces deux projets de réforme constitue une brillante illustration des ambitions d’harmonisation entre les deux approches. « L'Union européenne et les législations américaines commencent à utiliser le même langage en ce qui concerne la loi sur la protection des données, tant sur la définition juridique proposée que sur les grands principes mis en œuvre.1 » Donc si les deux projets de réforme sont issus de sources de droit différentes, ils convergent par l’émergence actuelle de dénominateurs communs et notamment la prise en compte de l’importance d’une responsabilisation des opérateurs (concept d’accountability qui va être introduit en droit européen) et la nécessité de fournir des garanties adéquates pour les personnes afin de maîtriser les menaces pour la vie privée issues des technologies. 1 Traduction libre de Gabriela Zanfir - "European Integration Realities and Perspectives: EU and US Data Protection Reforms. A Comparative View." RÉGLEMENTATION EN EUROPE Sources • Un corps unique de règles protégeant la vie privée et les données personnelles des citoyens. • Directives transposées dans les 28 États membres. Philosophie/Objectifs • La défense du droit à la vie privée comme droit fondamental supérieur à tout autre intérêt commercial. • Une prise en compte à géométrie variable des risques liés à la sécurité informatique, notamment s'agissant des obligations de notification des failles de sécurité aujourd'hui limitées aux seuls prestataires de communications électroniques. RÉGLEMENTATION AUX ÉTATS-UNIS Sources • Absence de corps unique de règles protégeant la vie privée mais des réglementations sectorielles. • Lois différentes dans les 50 États sur les questions de sécurité informatique et de protection de la vie privée. Philosophie/Objectifs • La protection du consommateur et la poursuite d'un équilibre entre protection de la vie privée et intérêt business. • La sécurité informatique au cœur des dispositifs réglementaires de protection des données notamment au travers des obligations de notification des failles de sécurité imposées à toutes les entreprises.26 | Comportements culturels et données personnelles au cœur du Big data Ce qui va changer en Europe en matière de protection des données personnelles : des droits renforcés pour les individus, une responsabilisation accrue des organisations, des technologies respectueuses de la vie privée et plus de sanctions Le projet de Règlement (proposition de la Commission européenne avant la prise en compte des amendements du Parlement européen) sur la protection des données personnelles renforcera les droits des citoyens en introduisant les règles suivantes : • Création d'un « droit à l'oubli » pour aider les citoyens à gérer les risques en matière de protection des données en ligne. Lorsque la personne concernée ne voudra plus que ses données soient traitées et qu'il n’existe pas de motif légitime d’en maintenir le traitement, les données seront effacées. Ces règles ont pour visée de renforcer les droits des individus. Il ne s’agit pas de supprimer des événements passés ou de restreindre la liberté de la presse. • Création d'un droit à la portabilité des données personnelles d'un fournisseur de service à un autre. • Renforcement du principe du « consentement », lequel lorsqu’il est nécessaire doit être donné de manière explicite. • Obligation mise à la charge des entreprises et des organisations d’avertir sans délai injustifié les particuliers des failles de sécurité relatives à leurs données personnelles qui seraient susceptibles de leur nuire. Ils devront également informer l'autorité compétente de protection des données. • Amélioration des voies de recours administratives et judiciaires en cas de violation des droits de protection des données. • Responsabilité accrue et application du principe d’accountability (« obligation de rendre compte aux parties prenantes ») des responsables de traitement - à travers des évaluations des risques en matière de protection des données, des délégués à la protection des données et à travers les principes de « privacy by design » et « privacy by default ». Les démarches « privacy by design » et « privacy by default » vont également venir renforcer l’effectivité des règles européennes en matière de protection des données - ce qui signifie que les garanties de protection des données seront intégrées au sein des produits et des services, et que des paramètres respectant la protection des données personnelles deviendront la norme - par exemple sur les réseaux sociaux. Ces règles vont renforcer les droits des personnes d'une manière pratique. Grâce à ces règles plus strictes de protection des données, la Commission européenne a pour objectif de contribuer à accroître la confiance dans les services en ligne, afin que les citoyens soient en mesure d’utiliser les nouvelles technologies avec plus de confiance en bénéficiant des avantages du marché intérieur. Les autres avancées du projet de règlement sont les suivantes : • Un seul corps de règles sur la protection des données, valable dans toute l'UE. • Un interlocuteur unique : les entreprises n'auront en principe qu'à traiter avec une seule autorité de protection des données au niveau national, à savoir l’autorité compétente dans l'État membre où elles ont leur établissement principal. • Les personnes auront le droit de se référer à leur autorité nationale de protection des données, même lorsque leurs données personnelles sont traitées en dehors de leur pays d'origine. • Les règles de l'Union européenne s'appliquent aussi aux sociétés non établies dans l'Union européenne, si elles offrent des biens ou des services au sein de l'Union européenne ou si elles surveillent le comportement en ligne des citoyens. • Des responsabilités accrues et l’avènement du principe d’accountability pour les responsables de traitement des données personnelles. • Les contraintes administratives telles que les exigences de notification systématiques pour les entreprises responsables de traitement des données personnelles seront supprimées. Source : Commission européenne - le projet est encore en discussion (processus de codécision entre le Parlement européen et le Conseil)Comportements culturels et données personnelles au cœur du Big data | 27 Big data et protection des données personnelles culturelles La question de la protection des données personnelles est au cœur du marché du Big data culturel, puisque les données personnelles culturelles reflètent la personnalité d’un individu. Le culturel, c’est la « donnée de l’intimité », pour autant la donnée culturelle n’est pas spécifiquement réglementée par le droit positif (directive européenne de 1995) et n’est pas appréhendée par le projet de Règlement sur la protection des données personnelles en cours de discussion à Bruxelles (le vote, initialement prévu au premier semestre 2014, pourrait être reporté en 2015 - Conseil européen, 25 octobre 2013). Par ailleurs, et c’est aussi un enjeu fondamental, il est important que le droit reconnaisse la valeur patrimoniale de ces données. Le nouveau cadre réglementaire européen en matière de données personnelles demeurera certainement plus ambitieux par rapport aux règles en vigueur dans le reste du monde. Il pourrait contribuer au développement des acteurs de Big data en Europe dans la mesure où il va renforcer le niveau de sécurité et confiance apporté que les acteurs européens seront tenus d’offrir aux individus dont ils traitent les données. La protection et la valorisation des données personnelles en tant qu’actif des entreprises Les données personnelles sont aujourd’hui au cœur de l'innovation et de la publicité en ligne et constituent « un type d'actif pour les entreprises1 ». Appelées à devenir l’un des moteurs de l’économie numérique, elles font l’objet d’investissements massifs. Paradoxalement, les outils juridiques à disposition des entreprises pour protéger et valoriser leurs données semblent aujourd’hui trop limités pour appréhender de manière adéquate cet actif stratégique. Les outils juridiques existants • La protection des bases de données Les bases de données sont définies comme des recueils d’œuvres, de données disposées de manière systématique ou méthodique et individuellement accessibles par des moyens électroniques ou tout autre moyen. La protection légale des bases de données est double : • Le droit d’auteur protège la structure de la base de données si celle-ci peut être considérée comme originale au regard de l’organisation du choix des rubriques et de leur disposition. Il n’a pas vocation à protéger le contenu informationnel de la base. • ►Le droit sui generis des producteurs de bases de données permet quant à lui de protéger l’investissement réalisé pour compiler le contenu de la base et pourrait donc palier, dans une certaine mesure, les limites du droit d’auteur. Pour autant, cette protection est limitée dans sa portée dans la mesure où elle n'offre que la possibilité d’interdire la reprise d’une part quantitativement ou qualitativement substantielle du contenu de la base. Ces deux régimes de protection ont des objets différents (originalité du contenant c’est-à-dire de la structure, de la présentation de la base vs. investissement dans le contenu c’est-à- dire dans la constitution de la base). Pour autant, leur articulation ne permet pas de couvrir réellement l’intégralité de la valeur de l’information même structurée au sein d’une base de données : • ►Le droit d’auteur protège une « coquille vide », la structure et l’organisation de la base et non pas l’information qu’elle contient (sauf si celle-ci est protégeable indépendamment de son inclusion dans la base, par exemple des titres d’œuvres protégées par le droit d’auteur). • ►Le droit sui generis permet la protection indirecte de l’information dans la mesure où elle octroie au producteur de la base de données le droit d’en interdire l’exploitation par un tiers, mais sous réserve d’apporter la preuve du caractère (qualitativement ou quantitativement) substantiel de la réutilisation ou de l’extraction du contenu de la base de données et surtout de la consistance des investissements réalisés en amont pour la constituer. Le droit des bases de données ne permet donc pas la protection de tout type d’information, des informations potentiellement stratégiques peuvent ne pas être éligibles à la protection prévue par le droit des bases de données. 1 Competition and personal data protection, Joaquin Almunia, Vice President of the European Commission responsible for Competition Policy, Privacy Platform event: Competition and Privacy in Markets of Data, Brussels, 26 November 2012, SPEECH/12/86028 | Comportements culturels et données personnelles au cœur du Big data • La protection des informations par le biais du savoir-faire Le savoir-faire est une notion à géométrie variable, dont la définition peut beaucoup varier d’un pays à l’autre. En France par exemple, il n’existe pas de définition juridique précise de cette notion. Elle se trouve donc limitée à une valeur qui peut faire l’objet d’accords de licence ou de cession auprès de tiers souhaitant bénéficier des connaissances qu’il recouvre. Pour autant, elle n’est pas directement protégeable par un titre de propriété industriel qu’il serait aisé de défendre. Le savoir-faire est un bien économique pouvant être valorisé dans le patrimoine d’une entreprise. Mais il n’est pas un bien juridique et ne peut être considéré isolément comme l’objet d’un droit privatif. Le savoir-faire entendu comme connaissance technique transmissible et non immédiatement accessible au public n’est visé par les textes que sous l’aspect pénal très particulier de la violation du secret de fabrique. Or cette notion ne désigne que les seuls secrets utilisables dans le domaine de l’industrie, sous forme de méthodes, de procédés ou matières utilisées (Cass. Crim., 24 juin 1985, n° 83-92.873). En revanche, elle n’appréhende pas les méthodes commerciales ou les secrets de commerce (fichiers clients par exemple). La valeur économique résultant des investissements effectués afin de développer un savoir-faire n’est donc protégeable que sur le terrain du droit commun de l’action en concurrence déloyale ou en parasitisme, qui sont susceptibles de révéler deux types de difficultés : • ►La nécessité de faire la preuve d’une faute, d’un préjudice et d’un lien de causalité entre la faute et le préjudice (à l’inverse la violation d’un droit de propriété intellectuelle qui ne requiert que la preuve de l’existence du droit et de l’acte de violation). • ►L’octroi de dommages-intérêts ne couvrira que très rarement l’intégralité des préjudices subis par le titulaire du savoir-faire et cela d’autant qu’une fois le savoir-faire divulgué, il perdra une grande partie de sa valeur et ne bénéficiera plus d’aucune protection. La faiblesse du régime de protection du savoir-faire, des innovations non éligibles à la protection par le droit d’auteur ou la propriété industrielle est un frein à la valorisation du patrimoine immatériel des entreprises. Pourtant les accords ADPIC qui ont pour objet de définir les règles minimales de protection de la propriété intellectuelle par les pays membres de l’OMC opèrent un rapprochement entre secret et savoir-faire et couvrent la notion plus large de « renseignement non divulgué ». Cette notion permet de fonder une interdiction générale d’usurpation et d’usage d’informations, de renseignements confidentiels ou de techniques et procédés ayant une valeur commerciale, qui ne sont pas généralement connus et ne sont pas aisément accessibles. Si la conception française du secret est très étroite et que des incriminations pénales ne sont retenues qu’en ce qui concerne les secrets de fabrique, parallèlement, d’autres pays ont retenu une notion plus proche de la lettre des accords ADPIC, permettant ainsi une protection plus large du patrimoine informationnel des entreprises, comme par exemple : • En ►Italie : protection des informations relatives à l’entreprise et à son expérience technico-industrielle, y compris son expérience commerciale si ces informations sont secrètes et ont une valeur économique. • ►Aux États-Unis : protection des informations financières économiques ou commerciales.Comportements culturels et données personnelles au cœur du Big data | 29 De nouveaux outils juridiques à développer pour protéger les actifs des entreprises Une réflexion globale sur la protection juridique des investissements effectués pour valoriser le patrimoine informationnel des entreprises doit être conduite, afin d’élaborer des outils juridiques permettant aux acteurs de Big data, y incluant les entreprises du secteur culturel, de valoriser les investissements réalisés autour de Big data pour mieux connaître leurs clients et leur proposer de nouveaux services. Une logique de droit d’auteur pour valoriser les actifs résultant des données personnelles Outre la question de la protection purement juridique, plusieurs réflexions ont été menées à un niveau gouvernemental sur la distorsion existante entre la valeur réelle et la valeur comptable des données personnelles. Du point de vue des États, cette distorsion crée aujourd’hui un obstacle du point de vue de la fiscalité des GAFAdont le modèle économique repose essentiellement sur l’exploitation des données de leurs utilisateurs et dont les profits ne sont pas toujours correctement appréhendés par les États où leurs services sont distribués. Nicolas Collin et Pierre Colin, les auteurs du rapport sur la fiscalité du numérique, proposent de calquer la protection des données personnelles sur le régime du droit d’auteur. Pour mémoire, le droit d’auteur présente deux composantes distinctes : • ►Des droits moraux d’autoriser ou d’interdire la diffusion d’une œuvre. • Des droits patrimoniaux garantissant aux auteurs une juste rémunération au titre de l’exploitation commerciale de leurs œuvres. Sur cette base, le rapport propose de reconnaître la composante patrimoniale des données à caractère personnel en permettant aux personnes concernées d’appréhender la valeur réelle des données les concernant comme contrepartie des services « gratuits » disponibles sur Internet pour le grand public. La composante droit moral serait, quant à elle, calquée sur la réglementation en matière de protection à caractère personnel. Ainsi, les entreprises qui pourraient démontrer le respect de la loi Informatique et Libertés, pourraient bénéficier de l’application d’un taux de fiscalité réduit. • En savoir plus p. 3730 | Comportements culturels et données personnelles au cœur du Big data Droit de la concurrence et structuration des marchés sur l’échange de données personnelles Un marché « biface » selon la Commission européenne Jusqu'à présent, du point de vue du bon fonctionnement des marchés, le point de convergence entre les données personnelles et le droit de la concurrence a rarement été traité. En effet, le terme d'« actif » pour qualifier les données personnelles a été utilisé pour la première fois par la Commission européenne dans l’affaire de la fusion entre Google et DoubleClick en 20081. Pour la Commission européenne, les acteurs du marché de la publicité en ligne, tels que les moteurs de recherche, opèrent sur un marché biface2. D'un côté du marché, le fournisseur de services en ligne propose des services gratuits (moteurs de recherche, e-mails, le contenu, etc.) aux utilisateurs. De l'autre côté du marché, le fournisseur de services en ligne propose des services payants pour les annonceurs. En d'autres termes, sur le premier côté du marché, les utilisateurs bénéficient de services gratuits en échange du recueil de leurs données et de l'autre côté du marché, ces données sont monétisées auprès des annonceurs3. Les profits des nouveaux acteurs du numérique ne proviennent pas directement des services qu'ils fournissent aux utilisateurs mais sont issus de leur activité publicitaire ou de la distribution. • En savoir plus p. 15 Un marché à analyser selon le droit de la concurrence À l'heure actuelle, une grande majorité des données personnelles sont collectées par une poignée de fournisseurs de services en ligne qui, en tant que leaders de l'innovation sur leur marché, ont la capacité de recueillir de grandes quantités de données. La législation relative à la protection des données à caractère personnel et le droit de la concurrence ne poursuivent pas les mêmes fins : la réglementation relative à la protection des données vise à la protection de la vie privée alors que le droit de la concurrence vise à assurer une concurrence effective sur le marché. En conséquence, la possibilité de contrebalancer la montée en puissance des principaux fournisseurs de services en ligne quant à la collecte et à l’usage de données personnelles doit être recherchée tant dans le droit de la concurrence que du droit de la protection des données. Diverses pratiques pourraient être qualifiées, en vertu du droit de la concurrence, d'ententes anticoncurrentielles ou d'abus de position dominante. De telles pratiques peuvent se manifester au moment de l'acquisition de données personnelles ou lorsqu’une entreprise empêche d'autres d’acquérir de telles données. Pourrait également être qualifié d’abus le fait, pour une entreprise, de détenir à elle seule des données considérées comme indispensables pour les autres opérateurs (selon la doctrine des « infrastructures essentielles ») et de s’en réserver l’usage, en se prévalant éventuellement du droit de la propriété intellectuelle, notamment ici du droit spécifique sur les bases de données. Enfin, les données personnelles, comme « actifs », peuvent être prises en compte dans l'analyse d’impact sur la concurrence d’une opération de fusion ou de rapprochement de deux ou plusieurs entreprises, analyse dite de « contrôle des concentrations ». 1 Décision de la Commission européenne du 11 mars 2008 déclarant une opération de concentration compatible avec le marché commun et le fonctionnement de l’accord EEE, Affaire n° COMP/M.4731 - Google/DoubleClick 2 Commission européenne, Affaire n° COMP/M.5727 – Microsoft/Yahoo! Search Business, 18/02/2010, §100 3 Personal data, will Competition Law collide with privacy? – Competition law and personal data: Preliminary thoughts on a complex issue, D. Geradin and M. Kuschewsky, Concurrences n° 2-2013Comportements culturels et données personnelles au cœur du Big data | 31 Deux exemples de pratiques anticoncurrentielles peuvent être mis en avant : tout d’abord, des accords d'exclusivité conclus entre les fournisseurs de services en ligne et les éditeurs avec pour effet d'empêcher d'autres fournisseurs de services en ligne de recueillir des données et ensuite le fait d’empêcher les utilisateurs de transférer leur données d'un fournisseur de services en ligne à l'autre. • Les accords d'exclusivité Les fournisseurs de services en ligne peuvent conclure des accords avec des éditeurs prévoyant que l'éditeur utilise exclusivement les services du fournisseur, comme un moteur de recherche, sur son site Internet3. Conformément à ces accords, l'éditeur ne peut pas recourir aux services prestés par d'autres fournisseurs de services en ligne. En conséquence, surtout lorsqu’une multitude d’accords d’exclusivité est conclue entre éditeurs de services et un fournisseur de services en ligne unique, les autres fournisseurs de services en ligne sont empêchés de recueillir des données auprès des éditeurs qui, liés par leurs accords exclusifs, ne peuvent pas conclure d'autres accords3. Ces accords d'exclusivité peuvent également être conclus entre des fournisseurs de services en ligne et des fournisseurs de logiciels ou de matériels informatiques lorsque les services prestés par le fournisseur de services en ligne sont paramétrés par défaut sur ce type de matériel4. • Interdiction de la portabilité des données L'interdiction de la portabilité des données fait référence à la pratique mise en œuvre par les prestataires de services en ligne qui consiste à interdire aux utilisateurs de transférer leurs données à caractère personnel à un autre fournisseur de service en ligne. La portabilité des données constitue l'une des nouveautés du projet de Règlement sur la protection des données générales (article 18)5. L'interdiction de la portabilité des données pourrait empêcher les annonceurs d'exporter les données d’une campagne de publicité d'une plateforme à une autre3. 4 Ces accords d'exclusivité « sont susceptibles d’exclure les concurrents sur le marché, surtout quand ils sont conclus par des entreprises en position dominante », et a fortiori si un ensemble d’accords de cette nature a été conclu 5 Proposal for a regulation of the European parliament and of the council on the protection of individuals with regard to the processing of personal data and on the free movement of such data (General Data Protection Regulation), 2012/0011, 25/01/2012 Dans l'analyse des fusions Dans le cas de la fusion entre Google et Doubleclick, la Commission européenne a examiné l'effet de l’accroissement de la quantité de renseignements personnels obtenus par l'entité issue de l’opération. Dans ce cas, « l'enquête a révélé que la combinaison des informations sur les comportements de recherche et le comportement de navigation web ne donnerait pas un avantage concurrentiel dans le secteur de la publicité tel qu’il ne pourrait être reproduit par d'autres concurrents qui ont accès à des données d'utilisation du web similaires ». Si cet élément a bien été pris en compte dans l’analyse de l’opération de fusion impliquant notamment Google, il n'a pas abouti ici à la conclusion que la fusion pourrait avoir un effet anticoncurrentiel. Pratiques anticoncurrentielles dans l'acquisition de données : empêcher d’autres opérateurs d’acquérir ces données 32 | Comportements culturels et données personnelles au cœur du Big data Quels facteurs d’équilibre possibles ? Dans le cas où des acteurs dominants seraient identifiés sur ce marché, comme ayant des caractéristiques proches d'une « infrastructure essentielle », certains outils existent pour réguler ces situations et ont été largement testés dans d’autres secteurs, comme celui des télécoms. Une Autorité peut, par exemple, réguler le marché ex-ante en obligeant la publication d’offres de référence, fixant certains tarifs (ou les fixant à moyen terme), en favorisant l’entrée d’acteurs sur des marchés de niche, en favorisant la portabilité des données ou en obligeant les acteurs dominants à réaliser certaines séparations fonctionnelles. On peut imaginer également que le régulateur mette l’accent sur les utilisateurs, obligeant les acteurs à une concurrence par la qualité. Pour ce faire, l’Autorité de la concurrence a identifié des mesures en vue de renforcer l’usage des données personnelles comme levier de différenciation concurrentielle : • Le droit à la portabilité des données peut limiter le risque de blocage par la promotion d’une adhésion cumulative ou alternative aux divers réseaux sociaux par exemple. • La durée de stockage des données doit être proportionnée à l'objectif poursuivi par le responsable du traitement et raisonnable ; la limiter pourrait abaisser les barrières à l'entrée. • La transparence sur la nature des données collectées, sur la finalité du traitement et les destinataires de l'information donnerait aux utilisateurs les moyens de comparer les offres sur la base du critère de la protection des données personnelles, leur donnant le pouvoir de contrôler l'utilisation de leurs données personnelles1. 1 « Données personnelles, le droit de la concurrence doit-il prendre en compte la protection de la vie privée ? – Le point de vue de l’Autorité française de la concurrence », Bruno Lasserre, Président de l’Autorité française de la concurrence, Concurrences n° 2-2013, p. 28Comportements culturels et données personnelles au cœur du Big data | 33 Quelle fiscalité 3.0 pour l'économie digitale ? Au-delà des défis que pose l’adaptation de la fiscalité internationale aux enjeux de l’économie numérique, le sujet de la fiscalisation des données est désormais clairement identifié. Les questions qui se posent à cet égard sont multiples et complexes : • Doit-il y avoir un lien direct entre fiscalité et data et si oui pourquoi ? (justification économique, contrainte budgétaire, protection de la concurrence, émergence de champions nationaux, partage de la valeur entre les opérateurs et créateurs). • Faut-il mettre en place une fiscalité spécifique au numérique en général et aux data en particulier ? Si oui, comment taxer les data ? • La fiscalité doit-elle vraiment être un instrument de contrepouvoir dans le cadre de l’ère numérique ? Ou doit-elle simplement s’adapter aux nouvelles réalités ? 2013, un momentum pour la fiscalité de l’économie numérique Jamais les efforts menés par les États pour restaurer l’équilibre de leurs finances publiques n’ont été aussi intenses, se traduisant par des hausses d’impôts généralisées dans la plupart des pays matures. L’économie du numérique est particulièrement visée, dans le cadre d’une volonté clairement affichée par les États de réaligner les recettes fiscales avec le lieu de génération du chiffre d’affaires, voire même de destination des services et biens numériques. En parallèle, les déficits budgétaires réduisent le financement public en faveur de la culture en général, et du développement de la création en particulier. Le constat est désormais unanime : il est nécessaire d’adapter les règles de la fiscalité internationale aux nouvelles réalités du monde numérique et des nouvelles technologies, principalement en ce qui concerne les règles de territorialité de l’impôt sur les sociétés et les taxes indirectes assises sur le chiffre d’affaires. En effet, par l’effet combiné de la dématérialisation systématique des services et des biens et de modèles d’affaires bipolaires2 (fondés principalement sur les incorporels et les technologies de l’information), il n’y a souvent plus de nexus suffisamment caractérisé permettant d’allouer le droit d’imposer aux États sur le territoire desquels les services sont délivrés ou bien le chiffre d’affaires se trouve généré par l’utilisation (payante ou non) d’Internet par des consommateurs toujours plus connectés3. 2 Modèle d’affaires adossant une activité dite « gratuite » à une activité rémunérée, localisée le plus souvent dans des territoires différents 3 Nicolas Collin et Pierre Colin, Mission d’expertise sur la fiscalité de l’économie numérique, janvier 201334 | Comportements culturels et données personnelles au cœur du Big data En outre, les différences de régimes fiscaux (taux, bases, régimes fiscaux dits de faveur etc.) entre les pays, parfois au sein de mêmes zones économiques (ex. : Union européenne) créent des disparités fiscales entre les acteurs de l’économie du numérique en fonction de leur taille (multinationales versus PME/ETI) et localisation (États-Unis, Europe, pays émergents). Elles se traduisent également pour les États par des déperditions significatives de recettes dont l’effet est aggravé par une compétition fiscale accrue entre ces mêmes États comme parfois par des pratiques optimisées de la part des opérateurs globalisés. Les États ont réagi vigoureusement depuis 2012 et ont convenu en 2013 d’un plan d’actions ambitieux à court terme, incluant notamment : • Le Programme « BEPS » en 15 points de l’OCDE, visant à lutter contre l’érosion de la base d’imposition et le transfert des bénéfices (juin 2013), lequel intègre précisément la prise en compte des défis fiscaux posées par l’économie numérique comme point d’action n° 1. • L’harmonisation au sein de l’Union européenne des règles de TVA en matière de traitements et services rendus par voie électronique (nouveau régime unifié à partir du 1er janvier 2015, généralisant l’imposition dans l’État de consommation). • Compte tenu de l’envergure internationale et politique de cette approche, il s’écoulera un certain temps entre le lancement de ces plans d’actions et réformes et leur impact dans l’économie réelle. De même, l’harmonisation au sein de l’Union européenne des règles de TVA soulève encore certains problèmes d’application et il n’a pas été possible d’accélérer son entrée en vigueur avant 2015, alors même que cette problématique est connue de longue date. Ce sujet de l’économie numérique est récemment venu à l’ordre du jour du Conseil de l’Union européenne, lors d’une réunion qui s’est tenue les 24 et 25 octobre 2013. Ces difficultés théoriques comme pratiques s’expliquent principalement par la complexité et la spécificité des modèles d’affaires de l’économie numérique qui ne sont toujours pas parfaitement appréhendées par les concepts et outils fiscaux traditionnels. À cet égard, un mouvement d’opinion de plus en plus fort se fait jour au sein des acteurs et experts de l’économie du numérique pour contester la nécessité d’une fiscalité spécifique au monde numérique, les technologies digitales imprégnant en effet tous les pans de l’économie (industries, services, secteurs marchand et non marchand, privé et public) et nécessitant donc un approche globale, si ce n’est de droit commun.Comportements culturels et données personnelles au cœur du Big data | 35 1 Taxe sur les recettes publicitaires proposée par M. Le Sénateur Marini (France) dès 2010 2 Taxes sur les téléphones mobiles intelligents préconisées par le Rapport de la Mission Lescure en 2013 (France), mais non retenues par le gouvernement français 3 Par exemple : niveau d’information de l’utilisateur sur ses droits à la protection des données personnelles, recueil de consentement et facilité de l’exercice de ses droits via l’interface, ouverture à la concurrence et nouveaux services, accès des données à des tiers, etc. Plusieurs acteurs publics ont milité pour la mise en place de mesures fiscales spécifiques au numérique et/ou touchant plus spécifiquement les géants internationaux de l’Internet. Les buts poursuivis étaient multiples et divers : • Financement de la culture, pour les pays dotés d’une politique fiscale volontariste en la matière. • Restauration des finances publiques. • Équilibrage du taux effectif d’imposition entre les acteurs nationaux et multinationaux. • Restauration du lien direct entre territorialité de l’impôt et source de la valeur économique à l’ère digitale. La France est sans doute le laboratoire d’idées le plus dynamique en la matière, comme l’a révélé l’étude des Politiques Fiscales dans le domaine de la Culture menée par EY pour le Forum d’Avignon sur la période 2009-2012, identifiant près de 50 incitations fiscales et 15 taxes spécifiques au domaine culturel. La question de la fiscalisation des données y avait dès lors suscité un vif débat, qui trouve désormais écho au plan international. Après les concepts, rapidement abandonnés, de taxe assise sur les recettes publicitaires générées sur Internet1, de taxation de la bande passante, de taxe « au clic » ou de taxe assise sur les activités de fabrication et ventes de téléphones mobiles2, c’est le concept de taxe assise sur les données lancé en France qui a été le plus novateur, et sans doute le plus polémique au plan international. Imaginé par Nicolas Collin et Pierre Colin dans leur rapport, ce concept visait à créer une fiscalité propre liée à l’exploitation des données issues du suivi régulier et systématique de l’activité des utilisateurs sur un territoire donné. Reposant sur le constat de l’importance de la collecte et de l’utilisation des data et données dans la chaîne de valeur et le chiffre d’affaires des opérateurs du numérique, ce concept a, sur le papier, le mérite d’un fait générateur simple et garantissant la neutralité du prélèvement. De façon plus novatrice, cette proposition ne visait pas tant à maximiser le volume des recettes fiscales nouvelles mais, de manière très ambitieuse, à renforcer les libertés individuelles et la concurrence en favorisant les comportements vertueux des opérateurs utilisant les datas (via l’application de taux d’imposition réduits ou dégressifs selon les comportements observés à l’aune de critère de conformité prédéfini3). Toutefois, bien que séduisant intellectuellement, ce concept de taxation « vertueuse » des données a été largement critiqué au plan international, notamment car il pose, au-delà des débats idéologiques, des difficultés extrêmes et non résolues d’application et de mise en œuvre et pourrait par ailleurs se traduire dans les faits par une augmentation du coût final pour le consommateur. Il n’a dès lors pas été retenu par le Conseil National du Numérique (septembre 2013) dans son avis n° 2013-3, lequel a privilégié une stratégie de négociation politique pour une réforme internationale des règles de la fiscalité des entreprises. Le sujet reviendra peut-être sur le devant de la scène, notamment au plan européen, par exemple sur le fondement d’une justification à taxer les exportations de données à partir du territoire de l’Union européenne. Consensus autour de la non-taxation des données36 | Comportements culturels et données personnelles au cœur du Big data 1 EY Global Survey Report "Tax Considerations in cloud Computing", March 2012 Une récente étude EY1 observait que les problématiques et enjeux liés à l’utilisation croissante de services via le Cloud dans l’économie numérique étaient encore très largement ignorés ou laissés de côté, notamment : • Une fiscalité inadaptée ou complexe dans de nombreux pays, règles non uniformes. • La caractérisation des revenus générés via le Cloud au regard des règles de retenues à la source (withholding tax). Dans le contexte globalisé et hautement technologique de l’économie numérique, il est plus que jamais nécessaire de privilégier une action coordonnée au plan international, afin d’adapter et d’uniformiser les règles de la fiscalité. Au plan local, et sans brider l’action des législateurs nationaux, il semble clair que les efforts devront d’abord porter, d’une part, sur la simplification des régimes fiscaux, bien trop complexes à ce jour, et d’autre part, sur une meilleure sécurité des opérateurs confrontés à des changements de législations permanents. Sans nier la véritable nécessité d’améliorer et harmoniser les régimes fiscaux et de restaurer les finances publiques des États, les opérateurs du numérique, petits comme grands, restent toujours dans l’attente de politiques fiscales claires et lisibles axées sur le long terme et permettant d’assurer le développement des champions de demain. Plutôt que de créer de nouveaux impôts ou de nouvelles normes, ne faudrait-il pas tout simplement appliquer ceux existants et, si besoin, se contenter de les adapter ou de les améliorer ? Les pistes de réflexions de l'OCDE devraient désormais privilégier à court terme la mise à jour de la définition fiscale de l’établissement stable et la réforme des standards internationaux en matière de prix de transfert. À moyen terme, les États souhaiteront sans doute revisiter les principes de territorialité de l’impôt sur les sociétés en matière de services numériques, compte tenu en effet de ce que les États devraient être logiquement tentés, au plan national, de privilégier l’imposition sur le lieu de destination des services. Dans ce contexte, tout le défi des travaux désormais lancés au niveau de l’OCDE sera de prendre en compte les réalités du numérique pour créer enfin une fiscalité 3.0 adaptée au nouveau monde digital et ce sur la base d'un socle commun et homogène, afin d'éviter des approches disparates au niveau national. Prochaines étapes pour la fiscalité 3.0Comportements culturels et données personnelles au cœur du Big data | 37 Responsabilités citoyennes Contrôler ses propres données Face à la montée du contrôle des données émises par les individus ou leurs objets connectés, une prise de conscience s’impose, tout en excluant le renoncement à toute activité numérique, qui ne concerne qu’une partie infime de la population. Les recommandations de la Commission européenne en matière de droit à l’oubli, de renforcement des principes de consentement et d’amélioration des voies de recours administratif et judiciaires vont dans le sens d’un contrôle du contrôle. Les recommandations et le renforcement de la notion de responsabilisation (accountability) des « opérateurs d’accès/ services Internet » vont de pair avec la confiance et l’e-réputation – actif clé pour l’ensemble des acteurs du marché. • Voir schéma ci-dessous Les effets conjugués d’une conscience plus aiguë du nécessaire contrôle sur ses propres données d’une part et de la Directive européenne d’autre part, redonneront confiance et pouvoir de contrôle aux citoyens. Comment contrôler ses propres traces et données numériques a priori et a posteriori ? Traces numériques à caractère majoritairement personnel • Niveau d’équipement (smartphone, résolution d’écran…) • Vitesse et données techniques de connexion • Statistiques/comportement de surf • Pays/zone géographique/localisation • Données anonymes brutes • Environnement logiciel • Informations collectées par cookies • Favoris, historique, paramètres, préférences de navigation (rattachés à un login) • Données de contact (âge, sexe, coordonnées…) • Données de connaissance (CSP, intérêts, relations, profil de consommation…) Contrôler ses données Actions techniques et légales • Droit d’accès et de rectification aux données personnelles (loi informatique et libertés) • Droit d’opposition • Droit de sortie de fichier client (se désinscrire) OPT-OUT • Demande de droit d’utilisation (géolocalisation, données personnelles..) • Demande d’acception cookies • Avertissement niveau de confidentialité sur réseaux sociaux OPT-IN Comportement • Non création de comptes utilisateurs (rarement possible) • Non utilisation des nouveaux services online/ cloud (de moins en moins possible) • Automodération (réseaux sociaux) Anticipation utilisateur Physique • Équipement (smartphone/ tablette/ordinateur) • Type de connexion • Adresse IP/Adresse MAC • Localisation (ADSL) : DSLAM • Géolocalisation (mobile, wifi) Logiciel • Navigateur • Système d’exploitation Session utilisateur • Moteur de recherche • Messagerie • Site tiers • Réseau social Action utilisateur Source : EY ©| 39 3. Vers un nouveau paradigme économique propice à l’innovation et la création40 | Comportements culturels et données personnelles au cœur du Big data Opposer le principe de précaution au Big data : un risque réel pour l’innovation Masse critique d’informations et niveaux d’analyses : l’exploitation économique de la data est-elle réellement incompatible avec le respect de la vie privée ? La thermodynamique La thermodynamique, qui a permis le développement de l’industrie du XIXe siècle en basant ses analyses uniquement sur des indicateurs « macro », vise à comprendre les échanges d’énergie et de chaleur. Elle est riche en applications pratiques que nous utilisons tous les jours : moteurs, réfrigérateurs, turbines ou encore réacteurs. Les modèles ont besoin de très peu de grandeurs pour décrire le comportement des systèmes et leur évolution, principalement Entropie, Température, Pression, Volume. L’efficacité de ces prédictions macroscopiques est tout à fait étonnante quand on sait qu’au niveau microscopique, ces comportements sont la résultante des particules composant les gaz et les liquides et que chaque particule est définie a minima par son vecteur vitesse (3 données) et sa position (3 données) soit des milliards d’informations nécessaires. Cette efficacité de l’analyse macroscopique réside dans le fait qu’un grand nombre d’états microscopiques sont possibles pour un même état macroscopique. Aussi, la température est la résultante d’un niveau d’agitation de molécules, qui peuvent se trouver dans des milliards de configurations possibles pour une même mesure de la température. Ainsi, la thermodynamique nous enseigne que l’on est capable de prendre des décisions sur la base d’une mesure d’un indicateur « macro » comme la température sans pour autant avoir besoin de mesurer toutes les grandeurs au niveau « micro » (positions, mouvements des milliards de molécules à l’origine du niveau de la température). Par exemple, il est possible de pasteuriser du jus de pomme en maintenant une température de 75° . Pour ce faire, il n’est pas nécessaire de modéliser ce qui se passe au niveau de chaque molécule (niveau « micro »). Par analogie avec le Big data, il est possible de prendre des décisions en analysant les comportements « macro » d’un groupe d’individus sans avoir besoin d’identifier parfaitement le comportement intime de chacun. A-t-on besoin de tout connaître de M. ou Mme X pour faire des prédictions sur une population de grande taille ? En d’autres termes, est-il nécessaire d’associer la somme d’informations collectées à une personne clairement identifiée (nom, adresse…) afin de lui proposer de façon plus adaptée certains produits ? On pourrait imaginer que les grandeurs de mesures sont « macro » et très précises pour permettre une adaptation parfaite à la demande. Cependant la demande, grandeur macroscopique, est la résultante de nombreuses demandes individuelles (microscopiques) qui peuvent rester anonymes. Le retour au niveau « micro » pour l’acte d’achat peut s’analyser de la même façon : une campagne de publicité avec les bons messages envoyés à la population idoine pourrait s’avérer plus efficace qu’un envoi ciblé personnel.Comportements culturels et données personnelles au cœur du Big data | 41 La physique quantique La physique nous enseigne que l’analyse microscopique, domaine de la physique quantique du XXe siècle, est aléatoire par nature et que la précision infinie de la mesure est vaine (on ne peut connaître en même temps la position et la vitesse d’une particule). Enfin, à ce niveau, l’observation interfère avec l’expérience. En d’autres termes, l’observation modifie le comportement des particules. La génomique Si la cartographie du génome d’un individu ne permet, au niveau « micro », que d’émettre des probabilités de réalisation (maladies, etc.), au niveau « macro », la combinaison de ces probabilités individuelles permettra de révéler, sur une population de grande taille, les risques et opportunités réels, justifiant ainsi des investissements d’ampleur permettant d’améliorer la santé des individus (R&D, vaccins, traitements). On peut comprendre que si l’on respecte la confidentialité des décryptages individuels permettant, par leur combinaison, d’aboutir à des découvertes et des décisions d'investissement, l’équilibre entre progrès et respect de la vie privé est atteint. Par analogie avec le Big data, il en ressort que l’observation « microscopique » d’un individu modifierait son comportement. Lorsqu’une personne se sait « observée », elle tend à modifier son comportement, rendant ce dernier moins prédictible. D’où l’importance d’un environnement sécurisé, de confiance, afin que les individus se sentent libres et décisionnaires de leurs comportements et ne soient pas réticents à échanger ou communiquer leurs données. Ce que nous enseigne la science Applications au Big data : Big data et respect de la vie privée peuvent être conciliables dans un environnement réglementé et sécurisé. La thermodynamique Il est possible de prendre une décision sur la base d'une mesure d'un indicateur « macro » sans avoir besoin de mesurer toutes les grandeurs au niveau « micro ». La physique quantique L'observation microscopique modifie le comportement des particules, rendant aléatoire et vaine la précision infinie de la mesure. La génomique La combinaison de décryptages au niveau « micro » permet, dans le respect de la confidentialité, d'aboutir à des découvertes sources de progrès. Source : EY ©42 | Comportements culturels et données personnelles au cœur du Big data Le temps de l'action Il serait illusoire d’imaginer pouvoir ignorer le « Big data bang », voire s’en barricader : la vitesse exponentielle avec laquelle la masse de données générées augmente et est stockée, la progression des outils d’analyse et de rapprochement de ces données ainsi que la capacité et l’intérêt que suscitent ces résultats rendent irréaliste un moratoire. Si l’avenir n’est pas totalement clair, il est cependant certain que ceux qui n’auront pas su considérer le défi dès maintenant seront les grands perdants. Ainsi, il est urgent d’opposer le « principe d’innovation » au « principe de précaution ». Invoqué face aux dangers, certes réels, que l’exploitation du Big data ferait courir à notre intimité ou à notre identité numérique, le « principe de précaution » n’apparaît pourtant pas comme une réponse adaptée. Nous devons en passer par une nécessaire phase d’expérimentation test & learn, et les erreurs, voire abus, propres à cette phase de transition, devraient éveiller les consciences, en particulier chez ceux qui ont subi l’expérience désagréable d’une mise à nu en ligne de leur vie « privée ». Ces écueils obligeront parfois certains à déployer leur capacité de rebond pour faire peau neuve, en renonçant à leur identité numérique première et aux traces qui pouvaient y être associées.Comportements culturels et données personnelles au cœur du Big data | 43 1. Établir un diagnostic • Dresser une cartographie des données disponibles, qu’elles soient internes (données métiers) ou externes (sites web, réseaux sociaux, open data). • Évaluer la qualité et la pertinence des données au regard des priorités de développement (ex. : financement de la création, innovation, services, étude ou segmentation des publics/ clients, valorisation des données, efficacité opérationnelle, etc.) 2. Se doter d’une structure décisionnelle et de compétences clés • Définir l’organisation et la gouvernance adéquates pour l’exploitation de données en pensant l’organisation de façon transverse. • Renforcer les compétences analytiques, mathématiques, statistiques et sociologiques pour la gestion et l’exploitation des données - que ce soit en croissance organique, par rachat de sociétés digitales ou via des partenariats. En d’autres termes, les entreprises devront se doter de data scientists, ces experts « capables de traiter le déluge de données et d’en tirer toute la quintessence décisionnelle et managériale1 ». 3. Se doter d’une stratégie et d’un plan d’action • Identifier et mettre en œuvre des leviers d’enrichissement de la connaissance client, notamment en : - Incitant les clients encore non connus (lecteurs achetant en point de vente, public des salles de spectacle et de cinéma, etc.) à s’identifier via un programme de fidélité, en favorisant les actes d’achat sur Internet. - Analysant les comportements clients : contenus générés sur les réseaux sociaux, parcours client web, historique des transactions et contenus consultés. • Identifier le niveau de moyens adaptés à la stratégie : il est indispensable de bien déterminer la donnée utile pour éviter un stockage systématique coûteux et inexploitable, et de privilégier les approches test & learn éprouvées par les grands acteurs du digital, consistant à lancer des chantiers tests et mesurer régulièrement et systématiquement leur efficacité afin de les améliorer rapidement, voire à les suspendre si besoin. 4. Développer et insuffler en interne une culture de la data Dans le secteur médiatique et culturel, le niveau de maturité face à la data diffère selon les acteurs : ceux qui ont un accès direct à leurs publics, avec des bases de clients ou d’abonnés (groupes de presse, exploitants de salles…) ont déjà une bonne appréhension de ces sujets et une culture du marketing direct. L’enjeu d’une approche Big data est de consolider et d’exploiter des données dans un contexte de croissance en volume, en vitesse et en variété des sources - notamment digitales - difficiles à réconcilier avec les données historiques. C’est une opportunité, mais aussi un défi de taille à relever, pour des acteurs tels que les diffuseurs audiovisuels et les créateurs de contenus, qui, traditionnellement n’avaient pas de lien direct avec leurs audiences. Le développement de la culture et des compétences d’exploitation de la donnée client varie également en fonction des services : les métiers marketing ont déjà intégré ces logiques, tandis que les équipes éditoriales et créatives se l’approprient plus difficilement – voire y sont réticentes, pouvant considérer que l’exploitation des données est incompatible avec leurs règles éthiques. Or les outils d’analyse des audiences et d’identification des tendances doivent être envisagés comme des sources complémentaires visant à alimenter leurs contenus et non à se substituer à leur travail de recherche et de hiérarchisation. Et le succès rencontré par les infographies, fortement relayées sur les réseaux sociaux, montre que l’audience est réceptive à l’information quantitative visuelle. Engager cette mutation interne ne suffira probablement pas à extraire toute la quintessence de la data. C’est en nouant des alliances que les acteurs de l’écosystème culturel pourront capitaliser sur les données personnelles culturelles pour innover et créer de nouvelles propositions de valeur. Entrer dans l’ère du Big data : par où commencer ? 1 « Big data – nouveaux défis », Telecom ParisTech, N° 169, juillet 201344 | Comportements culturels et données personnelles au cœur du Big data Enrichir la donnée collectée La gestion de la donnée et son exploitation sur le mode du Big data sont au cœur du modèle économique des grands acteurs globaux du digital. En dépit de l’intérêt que représente l’enjeu de la valorisation des données personnelles, les acteurs français sont en retard par rapport aux acteurs globaux du numérique, qui se sont positionnés comme des distributeurs ou diffuseurs de référence de la création. Citons par exemple Amazon, qui utilise ainsi les données (pages consultées, historique d’achat, listes de souhaits…) pour recommander des contenus et produits à ses clients : 35 % de ses ventes seraient liées à cette mécanique. Ou encore Apple, leader de la distribution de musique avec iTunes, qui analyse les bibliothèques musicales de ses utilisateurs (composition, titres les plus écoutés…) pour recommander de nouveaux artistes ou disques. À l’image d’autres industries, les acteurs de l’industrie médiatique et culturelle peuvent imaginer valoriser les données personnelles afin d’affiner la connaissance de leurs publics, à travers par exemple : • L’analyse rationnelle de la propagation et des contenus des messages (positifs ou négatifs) sur les réseaux sociaux, à l’image des travaux réalisés dans les transports (Quantas Airline, RATP) ou dans le secteur bancaire (Bank of America) ; L’identification d’opportunités de diffuser des créations en fonction des centres d’intérêt et des goûts avérés des utilisateurs ou des communautés. • L’anticipation des comportements, comme l’analyse de la fréquentation d’une zone touristique ou d’une salle de concert. • L’analyse croisée de données externes (réseaux sociaux, etc.) et internes (données de navigation, historiques de consultation/achat, centres d’intérêt, etc.) pour mieux connaître les attentes et les intégrer dans la conception des contenus et services proposés. C’est en adoptant une « approche data », comme levier d’optimisation de la valeur client, que les acteurs de l’industrie culturelle pourront relever les trois défis que sont la relation avec les publics et audiences, la diffusion des créations et contenus ainsi que le financement de la création. 1. Assurer la diffusion et l'interaction des œuvres avec leur public Dans le secteur médiatique et culturel, le développement de la « connaissance client » permet de répondre à un défi majeur qui consiste à instaurer une relation privilégiée et pérenne avec les publics. C’est en particulier le cas pour la production d’événements, de contenus et de créations, afin de créer des projets et contenus au plus près des publics visés. Dans les médias, des outils d’analyse des tendances comme Trendsboard utilisent les données issues des réseaux sociaux et blogs pour identifier les sujets qui commencent à faire l’actualité, permettant ainsi aux rédactions d’anticiper des « buzz » ou de couvrir certains événements, jusqu’alors imprévisibles. Proposer une interaction personnalisée en fonction des données analysées apparaît alors comme un levier clé pour créer ou renforcer la relation de proximité avec son public : • L’exploitation des données est un levier de promotion de la diversité culturelle, aussi bien dans les lieux que via les supports numériques. La proposition de contenus sur la base de l’analyse des centres d’intérêts, sur le modèle des moteurs de recommandation, suscite ainsi la rencontre entre les œuvres et leur public. • La collecte et l’exploitation de données personnelles sur les publics permet de prolonger la relation au-delà d’un événement donné (spectacle vivant, visite d’un musée, visionnage d’un film…), à travers l’animation de communautés et la proposition de services et contenus complémentaires. • Dans l’industrie audiovisuelle, les offres proposées sur les supports numériques permettent de développer et de valoriser une connaissance individualisée des audiences. Focus : Acquisition de droits Une société comme Netflix combine deux sources d’information pour définir sa stratégie d’achat de droits pour son offre de vidéo par abonnement : l’analyse des contenus les plus regardés (thématiques, acteurs, formats, etc.) et celle des contenus les plus piratés.Comportements culturels et données personnelles au cœur du Big data | 45 2. Obtenir une vision globale du parcours des publics Les outils utilisés pour la collecte et l’exploitation de données sont souvent inadaptés et/ou fragmentés du fait de logiques de fonctionnement d’activités en silos. Ainsi, un établissement public comme la Rmn-GP1 ne peut, à ce jour, savoir si une personne qui a acheté un livre donné dans une de ses 40 librairies ou boutiques pourrait être intéressée par une exposition au Grand Palais, au Musée du Luxembourg ou tout autre service, comme un abonnement à une newsletter ou un parcours à thème autour d’un artiste précis. En effet, les informations qui permettraient d’établir de tels liens ou prédictions ne sont actuellement pas disponibles, soit parce qu’elles ne sont pas collectées, soit parce qu’elles sont dispersées au sein de différentes bases de données gérées par divers systèmes d’information, non encore interopérables à ce jour. L’enjeu est donc double : il faut non seulement investir pour se doter des compétences nécessaires en CRM mais aussi assurer la transversalité entre les services impliqués dans la collecte et le traitement de données. Cette vision globale est indispensable pour proposer une expérience plus personnalisée et contextualisée et espérer ainsi la prolonger dans le cadre d’une relation d’engagement. De même les lieux culturels (galeries, sites touristiques, musées…) deviendraient plus accessibles grâce à l’utilisation de données sur le trafic ou la fréquentation. Si les projets sont nombreux dans le domaine des transports publics, il reste encore beaucoup à faire sur les lieux culturels. L’analyse de la fréquentation permet d’informer en temps réel les potentiels visiteurs, par exemple, sur la durée d’attente à l’entrée d’une exposition, et elle pourrait également permettre de définir des tarifications fines en fonction du remplissage. La construction d’une vision globale du parcours des publics pourra également s’appuyer sur l’ouverture et la réutilisation des données publiques culturelles. L’open data culturelle doit s’inscrire en complément des actions que les acteurs des industries culturelles et créatives mèneront pour utiliser et valoriser leurs données. Offrir la possibilité à des acteurs tiers, et notamment des start-ups, d’utiliser les données des acteurs de la culture élargit considérablement le champ des possibles, notamment pour créer des services pour les usagers ou clients. 3. Assurer le financement de la création Les données peuvent être mises à la disposition d’autres acteurs de la culture, de la distribution, des réseaux sociaux, etc. pour qu’ils puissent les utiliser en l’état ou les intégrer dans d’autres combinaisons de données, dans une approche d’ouverture des données (open data) ou dans une logique commerciale. Une utilisation commerciale des données permet ainsi de créer des offres de contenus gratuites ou partiellement gratuites grâce à la publicité. Pour les annonceurs, les audiences ont d’autant plus de valeur qu’elles sont qualifiées et permettent un ciblage efficace, d’où l’importance de la donnée récente, même anonyme. Les données personnelles culturelles ont, dès lors, un rôle majeur à jouer dans un contexte où le secteur culturel cherche et invente de nouveaux modèles de financement. Dès aujourd'hui, ces données sont au cœur du financement participatif, dont le modèle repose sur la création de communautés identifiées, d'individus connectés qui s'engagent personnellement pour financer un projet créatif. Le crowdfunding est aussi générateur de données (d'un genre comparable aux réseaux sociaux) et, si les sites ne monétisent pas cette donnée sur un mode publicitaire, ils peuvent s'en servir pour animer le réseau et faire des recommandations et contribuer à accroître les financements. Demain, les données personnelles culturelles seront sans nul doute un nouveau relais de financement, dans un contexte marqué par la raréfaction des financements publics. Un projet culturel pourrait demain valoriser, au moment de son financement, sa capacité à générer des données pour le distributeur, au même titre qu'il peut générer des ventes. Les plans de financement de projets cinématographiques ou discographiques pourraient, par exemple, intégrer la valorisation des données nouvelles collectées : un producteur exécutif céderait à un co-producteur le droit d’administrer la communauté de fans de l’œuvre créée, et les revenus publicitaires éventuellement générés. 1 Réunion des musées nationaux - Grand Palais46 | Comportements culturels et données personnelles au cœur du Big data En France, plusieurs entreprises et établissements publics ont déjà rendu publiques leurs données culturelles Depuis l'ouverture en 2011 du portail data.gouv.fr, le ministère de la Culture et de la Communication s’attache à recenser et mettre à disposition des développeurs différents jeux de données tels que la liste des établissements publics culturels géolocalisés et de leur offre éditoriale, les données de la médiathèque de l'architecture et du patrimoine (liste des immeubles protégés au titre des monuments historiques, liste des objets mobiliers propriété publique classés au titre des monuments historiques), ou encore une trentaine de jeux de données du Centre national du cinéma et de l’image animée (CNC), comme par exemple les recettes à l’international des films français ou la liste des établissements cinématographiques. De nombreuses villes et régions ont quant à elles initié l’ouverture des données publiques, qui peuvent être des statistiques démographiques (anonymisées), aussi bien que la liste des lieux de tournage de film et les statistiques de consultations d’ouvrages en bibliothèques. L’ouverture de ces données, croisées avec les centres d’intérêt d’individus ou de communautés, représente non seulement l’opportunité de développer de nouveaux services et usages, mais aussi de faciliter la promotion et l’accès à la culture. De nombreuses applications s’appuyant sur les données culturelles ouvertes existent déjà : • Les cartes interactives, comme le module développé par le ministère de la Culture et de la Communication représentant l’ensemble des lieux culturels français sous forme de galaxie, ou Cartographone, carte regroupant les lieux de tournage de film à Paris. • Les interfaces de visualisation de données, avec par exemple un article du journal Le Monde contenant un module permettant de visualiser de façon interactive les statistiques de consultation des ouvrages dans les bibliothèques parisiennes. • Les applications utilitaires, permettant par exemple de trouver la bibliothèque la plus proche, des informations sur les musées de la ville (comme Musambule à Marseille), ou encore des agendas culturels multi-éditeurs (tels que Cibul en région PACA). • La visite augmentée : comme Culture Clic, proposant non seulement des informations pratiques sur les musées français mais aussi un catalogue de 900 œuvres visualisables en réalité augmentée.Comportements culturels et données personnelles au cœur du Big data | 47 La nouvelle chaîne de valeur de la donnée personnelle culturelle Nouveaux acteurs Le marché de la donnée personnelle culturelle est en pleine structuration : tout au long de la chaîne de valeur de la data se déplacent et se positionnent producteurs, agrégateurs et utilisateurs de données personnelles culturelles. Un marché qui devrait continuer à évoluer et faire émerger de nouveaux acteurs et de nouveaux métiers : des pure players qui se spécialiseront dans la production/sourcing de data, d’autres dans l'agrégation et l’analyse de data (croiser les données des sourceurs entre elles et avec d’autres données, afin de les contextualiser et de fournir l’analyse nécessaire aux utilisateurs) et les utilisateurs de données personnelles qui vont développer des services et applications ciblés et à plus forte valeur ajoutée. Tous ces services auront besoin de l’infrastructure Big data, faisant intervenir une autre catégorie d’acteurs. Le bon fonctionnement de l’ensemble de l’écosystème de la donnée personnelle culturelle dépend de ce que nous appellerons le « filtre de confiance ». Le marché devrait donc évoluer vers une séparation entre la data et son utilisation, une évolution qui aurait le triple avantage d’apporter une réponse à un marché qui évoluerait vers un monopole naturel, à l’enjeu des données nominatives collectées/ échangées et de libérer tout le potentiel de la donnée en matière d’innovation. • Voir schéma p. 48 Les acteurs de la nouvelle chaîne de valeur de la data • Les producteurs de données : ils constitueraient de véritables bases de données fiables qui, grâce à leur capital confiance, pourraient être revendues à des tiers. • Les agrégateurs de données : ils agrégeraient, croiseraient et contextualiseraient ces données à des fins d’analyse. • Les utilisateurs de données : ils développeraient, à partir des analyses obtenues, des nouveaux services et nouvelles applications. Ces utilisateurs peuvent être des entreprises de média et des start-up développant des applications spécifiques et ciblées pour ces groupes de média ou des établissements culturels (application dédiée en marge de l'exposition Hopper au Grand Palais). • Les opérateurs d’infrastructures du Big data : nouveaux acteurs du numériques, opérateurs de télécommunications… • Les gestionnaires d’infrastructures : ils pourront louer, en plus de leurs capacités de stockage, des capacités de calcul à des sociétés ayant des besoins ponctuels en matière de traitement de Big data. • Des acteurs de confiance s’assurant du maintien de l’intégrité/qualité des données, depuis leur sourcing jusqu’à leur utilisation, rassurant ainsi utilisateur et consommateur finaux. Cette phase est indispensable pour garantir, par exemple, que la version électronique d’une œuvre, téléchargée en ligne (e-book) corresponde à l’œuvre originale.48 | Comportements culturels et données personnelles au cœur du Big data Acteurs des Infrastructures de données Les acteurs de la nouvelle chaîne de valeur de la data Où et comment se positionner Les champions du numérique et les entreprises culturelles vont chercher à étendre leur présence au sein de la chaîne de valeur de la data, horizontalement (de la production à l’utilisation de la data) et/ou verticalement (de l’infrastructure Big data aux services destinés aux utilisateurs et clients finaux). Ils procéderont par croissance interne ou externe, par des alliances avec des pure players, etc. Des business models (pure players) et univers de services innovants vont émerger/se développer : • Le Sourcing (producteur de données fiables). • La spécialisation dans le développement de services et d’applications mobiles ultra-ciblés (exemple du marché du jeu vidéo mobile). • La certification et l’audit liés à la sécurisation des données tout au long de la chaîne de valeur, pour répondre aux exigences de transparence et de confiance des consommateurs et utilisateurs, mais aussi prévenir le risque de réputation. « Filtre de confiance » - Réglementation et sécurisation de la data Données émises Données analysées Données améliorées (feedback) Source : EY © Infrastructure Big data Acteurs des échanges de données personnelles culturelles Producteurs de data (exemples) • Réseaux de transport • Collectivités locales/ territoriales • Établissements publics culturels • Exploitants de salles Croisement entre : données produites autres données de contexte (CSP des habitants/quartier, habitudes de déplacements pendant les vacances scolaires, météos locales, etc.) Agrégateurs de data Utilisateurs Prise de décision • + efficace • + rapide • + réactive Innovation • Nouveaux services • Développement d’applications Découverte (sérendipité)Infographie La donnée personnelle culturelle au cœur du Big dataLa donnée personnelle culturelle, une data qui vaut de l’or Du Big data à la Big value Un marché qui se structure autour de la donnée personnelle culturelle Vers un écosystème basé sur la confiance Collecte, stockage et mise à disposition (réseau, capacités...) Acteurs de confiance Réglementation Sécurisation Certification Homo conexus et objets connectés Émetteurs de data Production de données personnelles culturelles Open data Producteurs de data Établissements culturels, exploitants de salles, librairies Infrastructure Big data Data centers, serveurs, bases de données Traitement, calcul et analyses de données Agrégateurs de data Algorithmes, etc. Nouveaux services, applications, etc. Collecte, stockage, calcul, mise à disposition de capacités Utilisateurs Entreprises innovantes, créateurs de contenus Emploi Innovation (4,4 millions d’emplois créés d’ici 2015) Homo conexus 2, 3 milliards dans le monde en 2013 Internet des objets 20 milliards d’objets connectés dans le monde en 2013 + Explosion des traces numériques 4 zettaoctets de données en 2013, soit une pile de DVD de la hauteur de 4 millions de tours Montparnasse Big data Bang Données personnelles culturelles Données de l’intimité, issues du comportement culturel GAFA* Établissements culturels Industrie des médias et de l’entertainment 50 | Comportements culturels et données personnelles au cœur du Big data Source : EY © * GAFA : Google, Apple, Facebook, AmazonLa donnée personnelle culturelle, une data qui vaut de l’or Du Big data à la Big value Un marché qui se structure autour de la donnée personnelle culturelle Vers un écosystème basé sur la confiance Collecte, stockage et mise à disposition (réseau, capacités...) Acteurs de confiance Réglementation Sécurisation Certification Homo conexus et objets connectés Émetteurs de data Production de données personnelles culturelles Open data Producteurs de data Établissements culturels, exploitants de salles, librairies Infrastructure Big data Data centers, serveurs, bases de données Traitement, calcul et analyses de données Agrégateurs de data Algorithmes, etc. Nouveaux services, applications, etc. Collecte, stockage, calcul, mise à disposition de capacités Utilisateurs Entreprises innovantes, créateurs de contenus Emploi Innovation (4,4 millions d’emplois créés d’ici 2015) Homo conexus 2, 3 milliards dans le monde en 2013 Internet des objets 20 milliards d’objets connectés dans le monde en 2013 + Explosion des traces numériques 4 zettaoctets de données en 2013, soit une pile de DVD de la hauteur de 4 millions de tours Montparnasse Big data Bang Données personnelles culturelles Données de l’intimité, issues du comportement culturel GAFA* Établissements culturels Industrie des médias et de l’entertainment Comportements culturels et données personnelles au cœur du Big data | 51 Source : EY ©Contacts Bruno Perrin Associé, Ernst & Young et Associés Responsable du secteur Technologies, Médias et Télécoms en France Tél. : + 33 1 46 93 65 43 E-mail : bruno.perrin(à)fr.ey.com Fabrice Naftalski Associé, Ernst & Young Société d’Avocats Tél. : + 33 1 55 61 10 05 E-mail : fabrice.naftalski(à)ey-avocats.com Éric Fourel Associé, Ernst & Young Société d’Avocats Tél. : + 33 1 55 61 11 22 E-mail : eric.fourel(à)ey-avocats.com Solenne Blanc Directrice Associée, Ernst & Young Advisory Tél. : + 33 1 46 93 59 17 E-mail : solenne.blanc(à)fr.ey.com Louisa Melbouci Responsable Marketing Technologies, Médias et Télécoms Tél. : + 33 1 46 93 76 47 E-mail : louisa.melbouci(à)fr.ey.com Contact Presse EY Velislava Chichkova Tél. : + 33 1 46 93 45 06 E-mail : velislava.chichkova(à)fr.ey.com Cette étude a été réalisée par EY, sous la direction de Bruno Perrin, Fabrice Naftalski et Régis Houriez, avec la participation de Marie-Pierre Bonnet-Desplan, Solenne Blanc, Vincent Placer, Louisa Melbouci, Pierrick Vaudour, Guillaume Marcerou, Sébastien Bardou, Aurèle Tabuchi, Colin Garnier, France de Roquemaurel à la rédaction et Sandrine da Cunha au graphisme. EY | Audit | Conseil | Fiscalité & Droit | Transactions EY est un des leaders mondiaux de l’audit, du conseil, de la fiscalité et du droit, des transactions. Partout dans le monde, notre expertise et la qualité de nos services contribuent à créer les conditions de la confiance dans l’économie et les marchés financiers. Nous faisons grandir les talents afin qu’ensemble, ils accompagnent les organisations vers une croissance pérenne. C’est ainsi que nous jouons un rôle actif dans la construction d’un monde plus juste et plus équilibré pour nos équipes, nos clients et la société dans son ensemble. EY désigne l’organisation mondiale et peut faire référence à l’un ou plusieurs des membres d’Ernst & Young Global Limited, dont chacun est une entité juridique distincte. Ernst & Young Global Limited, société britannique à responsabilité limitée par garantie, ne fournit pas de prestations aux clients. Retrouvez plus d’informations sur notre organisation sur www.ey.com. © 2013 Ernst & Young et Associés Tous droits réservés. Studio EY France - 1309SG178 SCORE France N° 13-032 Photos : © Fotolia - © Gettyimages - © EY Document imprimé conformément à l’engagement d’EY de réduire son empreinte sur l’environnement. Cette publication a valeur d’information générale et ne saurait se substituer à un conseil professionnel en matière comptable, fiscale ou autre. Pour toute question spécifique, vous devez vous adresser à vos conseillers. ey.com/fr http://www.cirano.qc.ca/pdf/publication/2014RB-01.pdf 1/3 COMMUNIQUÉ DE PRESSE – LUNDI 1ER SEPTEMBRE 2014 L’École polytechnique et Télécom ParisTech créent un Master commun en Big Data L’École polytechnique et Télécom ParisTech ouvrent à la rentrée 2014 un nouveau Master 2 Mathématiques pour la science des masses de données. Ce Master national constitue la première formation de niveau M2 en Big Data associant plusieurs acteurs académiques majeurs et a vocation à devenir une référence dans le domaine des Data Sciences au niveau mondial. Un marché confronté à la pénurie de « Data Scientists » Le Big Data marque le début d'une transformation majeure, qui va affecter de façon profonde l’ensemble des secteurs (de l’e-commerce à la recherche scientifique en passant par la finance et la santé). L’exploitation de ces immenses masses de données nécessite des techniques associant mathématiques et informatique sophistiquées visant à extraire l’information pertinente. Les entreprises font aujourd’hui face à des difficultés croissantes pour recruter les « Data Scientists » capables d’appréhender ces enjeux et de gérer cette question stratégique pour leur développement. Le Big Data est un enjeu transverse qui impacte de nombreux secteurs de l’économie : grande distribution, services publics, industrie high-tech, secteur bancaire et financier ou encore secteur biomédical avec l’avènement de la médecine individualisée. Pour Frank Pacard, directeur de l’Enseignement et de la Recherche à l’École polytechnique, « la croissance exponentielle du marché du Big Data génère une forte demande de recrutement sur des profils rares. Ce Master, basé sur un enseignement équilibré entre mathématiques appliquées, informatique et formation professionnalisante, comblera ce manque en délivrant aux étudiants le socle scientifique de connaissances et les compétences techniques pour gérer des données massives. Nous nous félicitons de cette collaboration unique, tirant le meilleur de l’X, de Télécom ParisTech et de partenaires telle l’Université Paris-Sud pour former les profils polyvalents et pluridisciplinaires dont les entreprises ont besoin. » Pour Patrick Duvaut, Directeur de la Recherche à Télécom ParisTech, « ce Master vise à former des experts dans la science des données, capables non seulement de concevoir des nouveaux algorithmes d’analyse et de prédiction qui supportent le passage à l’échelle, mais aussi susceptibles de répondre aux besoins opérationnels des entreprises liés au Big Data. Il bénéficiera de l’effet d’entraînement des nombreuses chaires de recherche et d’enseignement autour des data sciences et du Big Data à l’X et Télécom ParisTech. Ce Master s’inscrit dans les initiatives (en formation, recherche et valorisation) destinées à faire de l’Université ParisSaclay une des plaques tournantes de la Science des Données en France et en Europe».COMMUNIQUÉ DE PRESSE – LUNDI 1ER SEPTEMBRE 2014 2/3 Un programme d’enseignement couvrant toutes les facettes du Big Data Le programme d’enseignement du Master 2 « Mathématiques pour la science des masses de données » associe des connaissances théoriques et le développement de savoir-faire pratiques liés au domaine d’application. Les enseignements théoriques se répartissent sur une session allant du 1 er octobre 2014 au 31 mars 2015. Ces cours sont complétés par des enseignements d’ouverture professionnalisants (« Séminaire Big Data » avec les principaux acteurs industriels du domaine) ou d’approfondissement en recherche (groupe de lecture « Data Sciences »). Cette formation prévoit un projet en groupe s’étalant sur 24 semaines et se conclut par un stage d’une durée de 5 mois. Les enseignements auront lieu à l’X (Campus de Palaiseau) et à Télécom ParisTech (Paris, 13e arrondissement). Ce Master, accrédité par le Ministère de l’Éducation, de l’Enseignement supérieur et de la Recherche, est un élément de réponse aux attentes du plan Big Data initié par le gouvernement et qui appelait la création de formations en Data Sciences. Le programme souhaite ainsi répondre aux besoins des entreprises et combler le déficit en experts dans un secteur aujourd’hui straté- gique. Les meilleurs candidats seront sélectionnés pour suivre cette formation qui à terme a vocation à s’inscrire dans l’offre de Masters de l’Université Paris-Saclay. Les cours du programme d’enseignement :  Technologies du Big Data (enseignement spécifique Master)  Statistique en grande dimension (partenariat avec l’Université Paris-Sud – Faculté des Sciences d’Orsay)  Apprentissage statistique avancé (Télécom ParisTech, École polytechnique)  Optimisation et calcul distribué à large échelle  Modèles graphiques (en partenariat avec le Master MVA)  Traitement automatique du langage naturel  Réseaux et Graphes  Visualisation analytique Inscriptions (date limite 30 septembre 2014) : http://bit.ly/MasterBigData Équipe Pédagogique  Télécom ParisTech : T. Abdessalem, S. Clémençon, F. d’Alche-Buc, A. Gramfort, E. Moulines (responsable formation), A. Sabourin, J. Salmon, M. Sauzio, F. Suchanek  École polytechnique : E. Bacry, S. Gaiffas, E. Le Pennec (responsable formation), M. Vazirgiannis  Enseignants associés : A. Allauzen (Université Paris-Sud), F. Bach (INRIA), S. Giraud (Université Paris-Sud), F. Yvon (Université Paris-Sud) Contact pédagogique : Alexandra Belus, Graduate School de l’École polytechnique: alexandra.belus@polytechnique.edu / +33 1 69 33 44 69 COMMUNIQUÉ DE PRESSE – LUNDI 1ER SEPTEMBRE 2014 3/3 CONTACTS PRESSE Raphaël de Rasilly Cécile Mathey + 33 1 69 33 38 97 / + 33 6 69 14 51 56 + 33 1 69 33 38 70 / + 33 6 30 12 42 41 raphael.de-rasilly@polytechnique.edu cecile.mathey@polytechnique.edu Dominique Célier + 33 1 45 81 75 17 / + 33 6 85 11 95 90 dominique.celier@telecom-paristech.fr À PROPOS DE L’ÉCOLE POLYTECHNIQUE / Largement internationalisée (30% de ses étudiants, 23% de son corps d’enseignants), l’École polytechnique associe recherche, enseignement et innovation au meilleur niveau scientifique et technologique. Sa formation promeut une culture d’excellence à forte dominante scientifique, ouverte sur une grande tradition humaniste. À travers ses trois cycles – ingénieur, master et doctorat – l’École polytechnique forme des femmes et des hommes responsables, capables de mener des activités complexes et innovantes pour répondre aux défis de la société du 21e siècle. Avec ses 20 laboratoires, tous unités mixtes de recherche avec le CNRS, le centre de recherche de l’École polytechnique travaille aux frontières de la connaissance sur les grands enjeux interdisciplinaires scientifiques, technologiques et sociétaux. www.polytechnique.edu À PROPOS DE TÉLÉCOM PARISTECH / Télécom ParisTech forme à innover et entreprendre dans un monde numérique. Ses cursus diplôment ingénieurs, docteurs et professionnels tout au long de la vie, attirent 55 % d’internationaux. Toutes les disciplines des sciences et technologies de l’information et de la communication sont couvertes par ses enseignements et sa recherche. Celle-ci présente une expertise originale sur 6 axes stratégiques - Big Data, Très Grands Réseaux et Système, Confiance numérique, Interactions Réel-Virtuel, Modélisation, approche interdisciplinaire de l'Innovation - lui permettant de faire face aux défis majeurs du monde numérique. Télécom ParisTech se positionne comme le futur collège de l’innovation par le numérique de l’Université Paris-Saclay, dont l’ambition est de devenir l’un des premiers pôles d’innovation mondiaux. www.telecom-paristech.fr POLICY PAPER Mai 2014 Faire entrer la France dans la troisième révolution industrielle : le pari de l’innovation #1 Le big data Observatoire de l’Innovation de l’Institut de l’entrepriseFaire entrer la France dans la troisième révolution industrielle : le pari de l’innovation Note thématique #1 : Le big data Observatoire de l’Innovation de l’Institut de l’entreprise présidé par Christophe de Maistre Pilote : Delphine Manceau Rapporteur : Julie Fabbri Note rédigée à partir des travaux de l’observatoire.www.institut-entreprise.fr 3 SOMMAIRE AVANT-PROPOS......................................................................................................... 5 SYNTHÈSE................................................................................................................. 7 BIG DATA, DE QUOI PARLE-T-ON ?....................................................... 11 LES 4V DU BIG DATA................................................................................................................... 12 DE NOUVELLES GÉNÉRATIONS DE DONNÉES ET DE TRAITEMENT......................................... 13 BIG DATA, LEVIER D’INNOVATIONS .................................................... 17 LES NOUVEAUX USAGES STIMULÉS PAR LE BIG DATA ......................................................... 17 SOURCE D’INNOVATIONS ORGANISATIONNELLES ............................................................... 27 BIG DATA, FACTEUR CLÉ DE PERFORMANCE ......................................................................... 324 Faire entrer la France dans la troisième révolution industrielle : le pari de l’innovation L’IMPACT DU BIG DATA SUR LES ENTREPRISES............................... 35 LE BIG DATA COMME NOUVEAU MARCHÉ............................................................................... 37 LES PRINCIPAUX POINTS DE VIGILANCE ................................................................................ 39 LES MUTATIONS À PRÉVOIR ..................................................................................................... 46 PISTES DE RECOMMANDATION............................................................................. 56 L’OBSERVATOIRE DE L’INNOVATION ...................................................................... 67www.institut-entreprise.fr 5 AVANT-PROPOS Cette note est le deuxième item d’une série de trois études issues du travail de l’Observatoire de l’Innovation de l’Institut de l’entreprise, portant respectivement sur le big data, l’efficacité énergétique et les nouvelles technologies de production, publiées séparément et précédées d’une note introductive générale. L’Observatoire de l’innovation est présidé par Christophe de Maistre, présidentdirecteur général de Siemens France et ses travaux ont été supervisés par Delphine Manceau, professeur à ESCP Europe, assistée de Julie Fabbri, doctorante au Centre de Recherche et Gestion (CRG) de l’Ecole Polytechnique, rapporteur de l’Observatoire. Eudoxe Denis, Directeur des études de l’Institut de l’entreprise, a supervisé le cadrage du projet et de l’ensemble des séances de l’Observatoire ainsi que la rédaction de la note introductive. L’Institut de l’entreprise tient à exprimer sa gratitude : › À l’ensemble des membres de l’Observatoire de l’innovation pour leur engagement dans ce projet : Frédéric Allard, Vice-président R&D, IBM Grégory Blokkeel, Responsable stratégie & open innovation, PSA Marie-Anne Broodschii, VP Innovation, Veolia Eric Conti, Directeur Innovation & Recherche, SNCF (également auditionné par l’Observatoire) Priscille Crozemarie, Chargée de mission - Secrétariat général, RATP Julie Fabbri, Secrétaire Générale, Institut pour l’Innovation et la Compétitivité i7, ESCP Europe et doctorante au centre de recherche et Gestion (CRG) de l’Ecole Polytechnique François Gerin, Directeur général adjoint, Siemens France François Grosse, Senior Vice-President Digital Services, Veolia Jakob Haesler, co-fondateur, Tinyclues (également auditionné par l’Observatoire) Frédéric Lefebvre-Naré, Consultant, Isée Pascal Lemoine, Directeur technique et de la recherche, FNTP Delphine Manceau, Professeur, ESCP Europe6 Faire entrer la France dans la troisième révolution industrielle : le pari de l’innovation Françoise Mercadal-Delasalles, Directrice des ressources et de l’innovation, Société Générale Jean-Yves Moreau, Directeur des relations gouvernementales et parlementaires, Sanofi France Michel Morvan, président et co-fondateur, The CoSMo Company (également auditionné par l’Observatoire) Jean Richard de la Tour, Directeur des études, de l’innovation et des affaires publiques, Carrefour (également auditionné par l’Observatoire) Martin Roulleaux-Dugage, Business transformation et Knowledge officer, Areva Bernard Salha, Directeur recherche et développement, EDF Jean-Christophe Saunière, Associé, PWC Vincent Schramm, Directeur général, Symop (également auditionné par l’Observatoire) Jérôme Weill, Associé, Oliver Wyman › Aux personnes auditionnées lors des séances de l’Observatoire : Philippe Berthier, Chef du département CRO, Innovation & Recherche, SNCF André Bouffioux, président-directeur général, Siemens Belgique-Luxemburg Eric Carreel, président fondateur de Withings, Sculpteo et Invoxia Gilles Grapinet, Directeur général adjoint en charge des fonctions globales, Atos Olivier Meunier, Directeur business development, Siemens Industry Olivier Siri, VP Head of system design, Cassidian (Groupe EADS) Claire Viguier-Petit, Directeur des opérations diabète, Sanofi France › Aux personnes auditionnées par les rapporteurs en dehors des séances de l’Observatoire : Alexandre Grux, Responsable de la recherche et de l’innovation, Kyriba Philippe Vappereau, Chairman d’Ixxi, filiale de la RATP L’Institut de l’entreprise remercie enfin, pour leur collaboration tout au long des travaux de l’Observatoire, François Gerin, Directeur général adjoint, Siemens France, Jérôme Weill et Reda Fettah, respectivement associé et analyste chez Oliver Wyman, ainsi que pour leur précieuse contribution Frédéric Allard, Robin Rivaton, Lauriane Contamin et Elise Schobel. Les opinions exprimées dans le présent rapport n’engagent ni les personnes citées, ni les institutions qu’elles représentent.www.institut-entreprise.fr 7 SYNTHESE Avec l’essor des réseaux Internet et Wi-Fi, des smartphones, des objets connectés et des réseaux sociaux, de plus en plus de données de formes variées sont générées. En parallèle, le développement d’outils de stockage et d’analyse – notamment le cloud computing – ainsi que de nouveaux outils de visualisation permettent la valorisation de ces données non structurées, variées et en très grande quantité : c’est un phénomène que l’on nomme le big data. Le volume croissant de données permet de s’abstraire des modèles prédéfinis et d’observer directement des corrélations entre données, qui peuvent ensuite être interprétées. De plus, de nouveaux outils permettent l’analyse simultanée de données nombreuses et variées, débouchant sur la microsegmentation des ensembles étudiés. La visualisation de tendances et de corrélations auparavant invisibles permet d’optimiser les prédictions, de détecter des variations et de prévoir l’impact d’une décision. Elle permet de tracer et cibler, via des outils de profiling, et par là d’améliorer des connaissances non plus statistiques mais individualisées. Cette microsegmentation permet aussi une gestion plus précise des risques et de la qualité. À l’échelle de l’entreprise, les applications du big data sont nombreuses pour optimiser la logistique, le marketing via la personnalisation, le développement et le suivi de produits plus proches des besoins des clients, la gestion et la qualité, ou encore les ressources humaines : le big data est donc source d’innovations dans tous les secteurs d’activité, mais aussi de performance et de productivité. Le big data représente indéniablement un marché : au sens large, il inclut tous les outils permettant le traitement des données (capteurs, espaces de stockage) ; de façon plus restrictive, il comprend les acteurs du cloud et les entreprises qui analysent les données. De nouveaux services peuvent aussi voir le jour, comme la revente de données. De plus, le big data peut accompagner de nouvelles démarches : l’open innovation, soit un mode d’innovation basé sur le partage et la coopération entre entreprises ; le yield management et l’automatisation de microdécisions ; de 8 Faire entrer la France dans la troisième révolution industrielle : le pari de l’innovation nouvelles solutions pour le développement durable ; l’essor des smart objects et smart services ; ou encore l’utilisation de nouveaux outils pour la recherche. Toutefois, le big data a beau être vecteur d’opportunités, il demeure avant tout un outil technique au service d’objectifs préalablement déterminés. La valorisation des données est encore peu effective en France. Si de plus en plus de données sont stockées, elles ne sont pas toujours complètes, de qualité, accessibles facilement et rapidement, interopérables et exploitables par des outils informatiques. Peu de démarches sont mises en œuvre pour valoriser les données qui pourraient l’être. Cet état de fait peut s’expliquer par plusieurs limitations qui trouvent leur source dans les entreprises elles-mêmes : des difficultés de coordination entre les différents services de l’entreprise, impliquant souvent la coûteuse mise en place d’un département de data scientists ; la complexité de l’évaluation des bénéfices en terme de productivité et de croissance des stratégies liées au big data, face à des besoins d’investissements importants ; ou encore la mise à niveau des compétences en statistique, informatique et management pour nombre de cadres. Les craintes liées à la sécurité et à la confidentialité des données ainsi qu’à une exploitation abusive des données personnelles doivent aussi être prises en compte. Certains de ces enjeux demandent l’implication des pouvoirs publics, comme les risques pour la vie privée, la formation, l’établissement de normes et de standards, et enfin la prévention contre l’éventuelle utilisation à mauvais escient d’analyses prédictives. Si le soutien public à l’innovation par le big data est présent en France, par l’ouverture de données publiques et des aides financières aux start-up et PME, deux erreurs sont commises : celle de considérer le big data comme une filière propre, alors qu’au contraire il doit être développé dans tous les secteurs d’activité, et celle de ne concevoir ces politiques de soutien que selon une approche purement technologique, alors que ce sont les usages qui doivent servir de point de départ. Pour lever les obstacles au développement du big data, l’accentuation de la politique d’open data publique est en premier lieu nécessaire. Ensuite, des mesures devraient être prises par les pouvoirs publics pour repenser l’encadrement des risques et la protection de la vie privée. De nouvelles expertises et institutions de régulation pourraient voir ainsi le jour : les démarches big datawww.institut-entreprise.fr 9 seraient soumises à des audits d’algorithmes et le respect des données personnelles par les institutions ainsi que leur transparence à propos de leur sécurité pourraient être notés par des tiers certificateurs. Cette transparence accrue pourrait s’accompagner d’un droit à l’expérimentation, permettant de déroger aux règles actuelles en matière de protection des données personnelles, tandis que de nouveaux droits tels que le droit à l’oubli ou le droit au refus du profilage pourraient voir le jour. Face à l’explosion du nombre de données échangées et au partage par tout un chacun du même bien commun qu’est le web, des normes internationales deviennent de plus en plus nécessaires. Du côté des entreprises, le développement du big data sera possible par une meilleure prise de conscience des gains offerts par celui-ci et de l’avantage compétitif apporté par les démarches de valorisation des données. La formation d’un département de data scientists dans les entreprises, département responsable du big data qui aura à identifier les démarches utiles d’ouverture ou d’exploitation interne des données et à quantifier les bénéfices en termes d’innovation, de productivité et d’image, en est une étape essentielle. Condition de cet essor, la culture de la donnée devra être diffusée, aussi bien dans les entreprises que dans les administrations.10 Faire entrer la France dans la troisième révolution industrielle : le pari de l’innovationwww.institut-entreprise.fr 11 BIG DATA, DE QUOI PARLE-T-ON ? Avec l’avènement des ERP, du CRM, du web, des réseaux sociaux, mais aussi la diffusion des capteurs, des smartphones et autres objets connectés1, nous faisons face aujourd’hui à une explosion du nombre des données disponibles. Ces données prennent des formes variées, comme des mails, des photos, des vidéos, des fichiers, des commentaires sur les réseaux sociaux, des signaux GPS, des transactions bancaires… 90 % des données dans le monde ont été créées ces deux dernières années ! Cette surcharge d’informations ou « infobésité » est parfois difficile à gérer pour les organisations. Néanmoins, selon 75 % des responsables Études interrogés lors de la première édition du Big Data Index EMC/IDC (septembre 2012), « le big data pourrait contribuer à renforcer d’une manière ou d’une autre la capacité d’innovation de leur organisation ». 40 % indiquent que le big data rend possible de nouveaux modèles économiques basés sur la réactivité et l’interactivité en temps réel. Techniquement, nous vivons un véritable phénomène de rupture, que le McKinsey Global Institute va jusqu’à qualifier de « nouvelle frontière de l’innovation de la compétition et de la productivité ». « Avec les big data, les données d’une organisation deviennent stratégiques. C’est la découverte d’une mine d’or gigantesque dont les ressources étaient jusque-là insoupçonnées. » Gilles Grapinet, directeur général adjoint d’Atos2 1. D’après Intel, 31 milliards d’objets seront connectés à Internet en 2020. Dans les pays occidentaux, un cercle familial composé de quatre personnes possède aujourd’hui dix objets connectés en moyenne : ce sera vingt-cinq en 2017 et cinquante en 2022 (source : « Les objets connectés : la nouvelle génération d’Internet ? », bulletin électronique 341, ambassade de France aux États-Unis). 2 Entretien réalisé par l’Observatoire de l’innovation12 Faire entrer la France dans la troisième révolution industrielle : le pari de l’innovation Illustrations de la diversité du big data 1- Décider l’arrêt ou la poursuite de l’exploitation d’une plate-forme pétrolière est une décision stratégique qui peut être prise, grâce au big data, sur la base des caractéristiques géologiques de la zone étendue, des données météorologiques passées et à venir, des rendements réalisés et estimés, et des marqueurs sociologiques et politiques de la population locale. 2- Les responsables marketing peuvent se servir d’informations glanées sur les réseaux sociaux – via Facebook par exemple – pour faire des mailings finement ciblés, par exemple auprès de femmes asiatiques de moins de 50 ans pratiquant une activité sportive extérieure. 3- Les organismes de crédit peuvent coupler un système Hadoop avec un data warehouse et un système de détection de fraude pour assurer le suivi en temps réel des transactions. LES 4V DU BIG DATA Le big data est une démarche (un ensemble de technologies, d’architectures, d’outils et de procédures) consistant à collecter puis à traiter en temps réel, ou presque, des données à la fois très nombreuses et très hétérogènes. Le big data se définit autour des 4V suivants : • Volume : la masse de données en constante croissance (ex : plus de 2 000 petabytes en Europe) ; • Vitesse : la collecte, l’analyse et l’exploitation des données en temps réel (ex. : 50 millions de tweets et 247 milliards d’e-mails envoyés par jour ; 100 heures de vidéos postées chaque minute sur Youtube) ; • Variété : l’hétérogénéité des formats et des sources (people to people, people to machine, machine to machine) ; • Valeur : la valorisation financière des données 3. 3. À ce sujet, Viktor Mayer-Schönberger souligne bien la difficulté de quantifier la valeur d’une donnée dans son ouvrage big data, A Revolution That Will Transform How We Live, Work and Think. En effet, la valeur d’une donnée augmente au cours du temps et dépend des multiples utilisations qui en sont faites : elle ne se résume pas à la valeur ajoutée issue de sa première utilisation. Sa valeur peut aussi se déprécier au cours du temps, et dépend grandement de la véracité de l’information, parfois difficile à évaluer.www.institut-entreprise.fr 13 L’interprétation de ce large volume de données constitue le principal défi du big data. Car l’information générée peut être à la base d’une connaissance nouvelle entraînant des opportunités de développement d’activités. Mais les dimensions « interprétabilité », « pertinence » ou « véracité » des données collectées ne doivent pas pour autant être mises de côté. C’est l’augmentation du volume de données qui modifie profondément les analyses possibles. On évolue ainsi d’un modèle probabiliste confirmé par l’étude d’un nombre restreint de données vers un modèle dans lequel les données sont exhaustives. Partant des données, des corrélations sont observées puis éventuellement interprétées. De plus, grâce au développement des outils d’analyse, le traitement de ces données peut être qualitatif quand auparavant des approximations et des catégorisations étaient nécessaires : les ensembles étudiés peuvent donc être « microsegmentés ». DE NOUVELLES GÉNÉRATIONS DE DONNÉES ET DE TRAITEMENT De multiples évolutions techniques parallèles ont convergé depuis vingt ans et ainsi permis l’éclosion du big data. Selon Gilles Grapinet, directeur général adjoint d’Atos, quatre phénomènes permettent aujourd’hui de traiter de la donnée structurée et non structurée de façon industrielle : 1) Les technologies de stockage de grandes quantités de données permettent d’envisager des volumes de stockage qui étaient auparavant inconcevables et d’offrir des accès toujours plus rapides à la donnée, à un prix de plus en plus abordable4. 2) L’essor du cloud computing5 permet le passage à l’informatique sur demande (ou à la demande) et de dégager de nouvelles capacités de traitement. Au lieu de dimensionner les infrastructures pour les pics de stockage ou de traitement, les organisations peuvent désormais ajuster la taille et donc le coût de leurs infrastructures de calcul et de stockage au gré de l’évolution de leurs besoins. 3) La mobilité et l’ubiquité génèrent de plus en plus d’informations car les connexions sont quasi continues. En 2020, la connectivité du monde sera 4. Le prix d’un gigaoctet pour un disque dur est passé d’environ 16 dollars en 2000 à 0,06 dollar en 2013 (source : http://ns1758.ca/winch/winchest.html). 5. Le cloud computing permet d’accéder librement à des ressources informatiques partagées via un réseau de télécommunications.14 Faire entrer la France dans la troisième révolution industrielle : le pari de l’innovation décuplée avec près de 8 milliards de smartphones et 50 milliards d’objets connectés. 4) Enfin, les réseaux sociaux fournissent une nouvelle source de données personnelles et communautaires, qui peuvent être utilisées à des fins économiques. Ces nouveaux types de données transforment les façons de traiter ces dernières. Auparavant, une donnée était créée pour un usage monodirectionnel avec une finalité unique, sans réutilisation possible. La nouvelle génération de « données en vrac » comprend de multiples sources de données (smartphones, comptes bancaires, passeports biométriques, titres de transport équipés de puces RFID, communications électroniques) qui sont utilisées par de multiples utilisateurs, potentiellement en même temps. De nouvelles techniques analytiques (pattern-based analysis ; développement du web sémantique), de nouvelles technologies de bases de données et de processing (essor des bases de données relationnelles et des outils de gestion des big data tels que Cassandra, Hadoop, GoogleFS, BigTable, Hive ou HBase), de nouvelles techniques de visualisation (par exemple le site Many Eyes d’IBM permettant de charger des jeux de données importants pour en tirer des visualisations innovantes) sont nécessaires pour exploiter commercialement ou non ces importants volumes de données. On accumule actuellement tous les dix-huit à vingt-quatre mois d’activité humaine presque autant de données que depuis les débuts de l’humanité. Si l’on imagine que cette croissance se stabilisera probablement un jour, le flux de déversement des données continue pour le moment de s’accélérer. Nous sommes dans une phase de stockage illimité de données, et ce sur des pé- riodes longues6 et sous tous les formats (image, son, conversation), afin de constituer un patrimoine informationnel. Les applications pour valoriser ce patrimoine restent encore majoritairement à inventer… 6. Si certaines données sont stockées sur de longues durées, ce n’est pas le cas de toutes. De plus, de nouveaux algorithmes en streaming permettent d’analyser les données à mesure qu’elles sont créées et ne nécessitent que très peu de mémoire (de l’ordre d’1 ko de mémoire vive).www.institut-entreprise.fr 15 Éléments de définition La définition du big data proposée est très ouverte, car le terme est de plus en plus largement utilisé. On pourrait cependant essayer de distinguer deux démarches du big data : d’une part, l’utilisation plus exhaustive et rapide, ou la valorisation plus systématique et transversale, de données existantes en améliorant et automatisant les outils analytiques et prédictifs ; d’autre part, l’utilisation de nouveaux outils d’analyse de gros volumes de données pour obtenir des informations autrefois impossibles à obtenir. De plus, il est important de comprendre le sens et l’implication en termes de big data des notions suivantes : Les « facilitateurs » du big data - L’Internet des objets décrit les interactions croissantes entre les objets de la vie courante et leurs représentations virtuelles, à l’origine via des étiquettes électroniques passives qui contiennent une information numérique relative à l’objet physique, et de plus en plus au moyen de capteurs qui connectent directement ces objets à l’Internet sans fil. Le développement de l’Internet des objets est notamment possible grâce aux puces RFID. - Le cloud computing, ou l’Internet en nuage, transforme les infrastructures de stockage et la puissance de calcul en services, par l’intermédiaire d’entreprises qui possèdent des serveurs et louent leurs capacités. Cette approche permet de mutualiser les besoins et d’accorder aux usagers une grande flexibilité de stockage et de rapidité de traitement de données. L’essor du cloud et l’émergence de nouveaux outils open source tels MapReduce ou Hadoop a permis le traitement de grands ensembles de données, sur plusieurs serveurs en parallèle. - Le data mining est un processus d’analyse informatique qui regroupe des méthodes d’intelligence artificielle, d’apprentissage automatique et de statistiques dans le but d’extraire des informations compréhensibles d’un ensemble de données. Le data mining traditionnel s’est développé et enrichi pour permettre l’analyse des nouvelles sources de données à l’ère du big data.16 Faire entrer la France dans la troisième révolution industrielle : le pari de l’innovation Un mouvement parallèle - Les données ouvertes, l’open data, sont des données dont la licence permet le libre partage et le réemploi. Pour que ce réemploi soit réel, elles doivent être interopérables et structurées. L’open data qualifie aussi le fait de rendre accessibles et réutilisables les données produites et détenues par des institutions, dans un objectif de transparence ou de création de valeur. C’est déjà le cas des données publiques dans le cadre de l’initiative Etalab et de la directive européenne 2003/98/CE, une nouvelle version étant actuellement discutée par l’Union européenne pour adapter l’accès aux données publiques aux évolutions récentes. Parmi les données concernées par le mouvement de l’open data, certaines ne représentent pas des volumes suffisants pour nécessiter un traitement statistique complexe et être qualifiées de big data à proprement dit, mais leur diffusion et leur exploitation sont rendues possibles par les nouveaux outils de visualisation développés face à l’augmentation du nombre de données. Vice versa, les big data ont tout à gagner à une large diffusion des données, notamment publiques. Les deux mouvements sont donc liés.www.institut-entreprise.fr 17 BIG DATA, LEVIER D’INNOVATIONS Les applications du big data sont nombreuses et constituent un facteur de renforcement de la capacité d’innovation des organisations, en jouant sur les deux dynamiques que sont l’exploration et l’exploitation. En tirant parti de données jusqu’ici non disponibles, la démarche big data rend possible le lancement de nouveaux produits et services, de nouveaux processus, et même de nouveaux modèles économiques. On parle de dynamique d’exploration ou encore de développement greenfield. Mais les big data peuvent également apporter des réponses à des défis business non résolus jusque-là permettant d’offrir des solutions d’amélioration et d’optimisation de l’activité traditionnelle de l’entreprise. On parle alors de dynamique d’exploitation ou de développement brownfield. LES NOUVEAUX USAGES STIMULÉS PAR LES BIG DATA Qu’ils permettent d’exploiter plus, mieux ou plus vite les activités existantes ou de générer de nouvelles opportunités de développement d’activité, les big data se révèlent un facteur clé d’innovation pour les petites comme pour les grandes entreprises de tous secteurs. Le big data permet de passer d’une analyse partielle à une économie prédictive. L’analyse actuelle des données, en mode réactif aux événements passés sur la base de lois statistiques à partir d’échantillons limités, offre aujourd’hui une représentation tronquée de la réalité. Il est désormais possible d’évoluer vers un modèle prédictif, fondé sur une analyse exhaustive des informations de différentes sources, afin de trouver des relations permettant de prédire un événement futur. Gilles Grapinet illustre ce propos en expliquant que la révision obligatoire des 15 000 kilomètres pourrait ne plus être utile dans un monde big data où chaque voiture pourrait être automatiquement rappelée au garage dès qu’elle en présenterait le besoin.18 Faire entrer la France dans la troisième révolution industrielle : le pari de l’innovation • Détecter et optimiser : le croisement en temps réel d’un grand nombre de données diversifiées autorise une meilleure connaissance des activités, de l’environnement et de l’écosystème d’affaires. Un contrôle accru est alors possible, permettant une meilleure aide au pilotage et à la prise de décision. Exemple : la société danoise Vestas Wind Systems, parmi les plus importants fabricants de turbines d’éoliennes au monde, utilise les solutions IBM big data analytics et IBM Systems pour décider de la localisation des éoliennes en croisant en quelques heures (vs quelques semaines) des données variées telles que des données météorologiques et géospatiales, les phases de la lune et de la marée, des cartes de déforestation et des images satellites. L’emplacement des éoliennes est un enjeu crucial pour optimiser la production d’énergie. Si les compagnies d’électricité installent les éoliennes à des endroits mal adaptés (pas assez ou trop de vent), elles risquent de ne pas produire assez d’électricité pour justifier les investissements dans l’énergie éolienne. Vestas espère ainsi conquérir de nouveaux marchés en accélérant la diffusion de l’énergie éolienne au niveau international. Exemple : l’Ingestible Event Marker est une nouvelle technologie, conçue par la société Proteus Digital Health et approuvée par la FDA en juillet 2012, qui permet d’insérer un capteur miniaturisé dans une gélule devenant alors une « smart pill ». Un message d’alerte en cas de non-respect de la prescription (délai ou dosage) peut ainsi être transmis à un récepteur externe, lorsqu’il est activé par les sucs gastriques, rendant possible un suivi et un contrôle en temps réel de la prise de médicaments. • Tracer et cibler : les big data permettent d’analyser la situation et le contexte de milliers de personnes en temps réel, favorisant ainsi une meilleure compréhension des réactions du marché et la proposition de messages et d’offres personnalisés. Exemple : de nombreux véhicules possèdent aujourd’hui des systèmes GPS et télématiques qui permettent aux constructeurs automobiles de collecter et monétiser une multitude de données sur les habitudes de conduite de www.institut-entreprise.fr 19 leurs clients. En 2007, le système télématique OnStar de General Motors Corporation et GMAC Insurance se sont associés pour créer une nouvelle offre se servant des données télémétriques afin de proposer des primes d’assurance aux clients qui roulent moins. Aujourd’hui, la tarification classique des assurances impose en effet le même prix à tous les clients, qu’ils conduisent bien ou mal, peu ou beaucoup… Ou, au contraire, discrimine des franges entières de population en fonction de l’âge (ex. : premium de plus de 50 % pour les plus jeunes conducteurs) ou du sexe par exemple, sans faire de détails à l’intérieur de ces groupes. La personnalisation de la prime d’assurance constitue une source de satisfaction client accrue et une innovation disruptive, d’autant qu’elle intervient sur un marché de reconduction. Exemple : comment utiliser les big data dans un aéroport ? D’un côté, les passagers doivent obligatoirement passer un certain nombre de checkings de sécurité (ce qui génère du stress, des temps d’attente) ; de l’autre côté, ils peuvent flâner dans les boutiques et autres restaurants occupant l’espace. Une application de géolocalisation dans l’aéroport pourrait offrir aux passagers, en retour de leurs données émises, un guide interactif du lieu, des informations sur les temps d’attente aux différents postes de sécurité, sur les horaires des vols et portes d’embarquement. L’aérogare serait alors en mesure de communiquer en temps réel avec des milliers d’individus, de diminuer le niveau de stress des passagers en leur permettant de mieux gérer leur temps et probablement par conséquent de les amener à consommer plus (on pourrait même parler « d’attente intelligente »). Les services présents dans l’enceinte de l’aéroport pourraient également avoir l’opportunité, via cette application, de « hooker » ces clients « captifs » avec des coupons promotionnels customisés en fonction de leur position dans l’aéroport, de leur situation de voyage et de leurs préférences. • Prévoir et prédire : l’analyse prédictive permet de faire des projections ultraréalistes pour identifier des nouvelles sources d’opportunités (ou des menaces) et ainsi anticiper les réponses adaptées à la situation réelle. Exemple : Flu Trends est un modèle de Google qui permet d’estimer la propagation des cas réels de grippe en fonction des recherches sur Internet 20 Faire entrer la France dans la troisième révolution industrielle : le pari de l’innovation faites autour de ce mot – prenant en compte le fait que tous les internautes qui tapent « grippe » sur leur clavier ne sont pas nécessairement malades. Au final, l’évaluation que fournit Google en temps réel sur la propagation de la maladie est étonnamment précise (cf. article publié dans la fameuse revue scientifique Nature) et souvent plus rapide que les réseaux de veille sanitaire. Les estimations du niveau d’activité grippale permettent d’évaluer l’ampleur de l’épidémie et de commencer à prendre les mesures qui s’imposent le cas échéant. Dans le même esprit, les Nations unies ont développé un programme anticipant les épidémies et les retournements de conjoncture économique à travers des mots-clés échangés sur Twitter. La démarche big data ouvre de nouveaux champs du possible en établissant des relations entre des ensembles de données hétérogènes pour trouver des informations pertinentes et être proactif, dans tous les secteurs d’activité. À ce titre, les gagnants sont les médias, l’électronique grand public, les services financiers et les administrations, et ensuite la distribution, le tourisme et le transport, les utilities et les acteurs du système de santé. La capacité d’un secteur à exploiter les big data varie en fonction des contextes culturels, réglementaires ou de compétences. En la matière, les services financiers, la distribution, le tourisme et le transport semblent plus en avance que le secteur public, l’énergie ou la santé. Exemple : dans la grande distribution, la géolocalisation en magasin ou la reconnaissance faciale dans des vidéos peuvent permettre à un distributeur d’analyser les parcours clients ou encore le temps passé dans chaque rayon et simuler en conséquence différentes options de merchandising. Exemple : dans la banque/assurance, l’analyse des flux de transactions peut permettre de détecter en temps réel des événements aberrants et de dé- clencher automatiquement des décisions telles que le blocage d’une carte de crédit, par exemple, en cas de suspicion de fraude bancaire. Exemple : dans le secteur de la santé, l’analyse prédictive permet de repérer des schémas récurrents de certaines maladies et d’accélérer la prise en charge des patients concernés, même si ces derniers ne sont pas en me-www.institut-entreprise.fr 21 sure de décrire leurs symptômes, ou encore de fluidifier le parcours d’hospitalisation des patients en améliorant l’échange d’informations et la coordination entre les différents services (entre les ambulanciers, les urgentistes, le médecin traitant, le chirurgien, la sécurité sociale). Les voies du big data à la SNCF Avec plus de 10 millions de clients par jour, la SNCF évolue de fait dans un univers de big data ; c’est pourquoi cette thématique a été naturellement identifiée comme l’un des axes majeurs de l’innovation au sein du groupe. Le soutien du top management est un des facteurs clés de succès de la démarche, avec des projets portés aujourd’hui par les hauts responsables de différentes entités comme SNCF Transilien ou SNCF Voyages. Les exemples d’application du big data au sein de la SNCF sont nombreux et concernent notamment : * La maintenance curative et préventive des caténaires, des 52 800 km de voies et de la signalisation à partir des données collectées par des capteurs ou des systèmes de mesure embarqués. Ainsi, aux trains métrologiques, qui scrutaient les voies à intervalles réguliers, vont se substituer progressivement l’ensemble des trains commerciaux, équipés de capteurs, permettant d’établir des points de comparaison dans le temps, entre lignes ou composants, grâce à des traitements statistiques massifs. * L’efficacité énergétique. La SNCF est le premier consommateur français d’énergie, depuis que les industries du nucléaire ont baissé leur consommation en améliorant les techniques de centrifugation. La SNCF utilise aujourd’hui les compteurs qui équipent les trains, et qui doivent être géné- ralisés7 , pour établir la facturation de sa consommation énergétique. À l’avenir, ces mêmes compteurs pourraient être utilisés pour optimiser sa 7. La SNCF prévoit ainsi d’équiper toute sa flotte de compteurs embarqués qui vont brasser une quantité de données gigantesque.22 Faire entrer la France dans la troisième révolution industrielle : le pari de l’innovation consommation, sa facture et son bilan carbone, trois enjeux aujourd’hui parfois divergents. * La régulation des flux de voyageurs. Le recours aux big data relève ici de l’aide décisionnelle, avec un comptage des voyageurs entrant et sortant à chaque arrêt commercial qui permet de mesurer en temps réel la charge des trains et la répartition des voyageurs. À l’avenir, on pourrait imaginer des applications mobiles permettant aux voyageurs de calculer la ponctualité de leur train ou de les orienter vers les voitures les moins remplies dans les rames. * La personnalisation de la relation client et un meilleur ciblage marketing, à travers l’analyse du trafic sur le site voyages-sncf.com, premier site de e-commerce en France avec 11 millions de visiteurs uniques (le e-commerce représente aujourd’hui 10 % du chiffre d’affaires du groupe). L’analyse fine de ses clients va amener la SNCF à proposer de nouvelles offres personnalisées, en se positionnant comme intégrateur global de la mobilité face aux défis de l’intermodalité. Des applications SNCF sur smartphone ou Internet, comme Mytripset, permettent déjà d’organiser ses voyages en Europe en train, en avion ou en voiture. Les obstacles au déploiement du big data sont de plusieurs ordres, actuellement, au sein de la SNCF : a) internes (liés à la complexité de l’organisation ou à la culture du groupe) ; b) externes (rôle de la réglementation et des autorités régulatrices, rôle de l’État actionnaire) ; ou c) liés aux limites mêmes du phénomène big data. a) La SNCF est un groupe de mobilité organisé autour de trois grands métiers : le transport de voyageurs, le transport de marchandises et les infrastructures. Ces trois segments impliquent des périmètres de données différents, qu’il n’est pas toujours évident de faire dialoguer. « Ce sont d’énormes chantiers pour faire se parler les DSI, créer les passerelles », explique Éric Conti, directeur de l’innovation et de la recherche de la SNCF. De plus, il importe de souligner les contraintes liées à l’interopérabilité et à la compatibilité des systèmes de production de données entre les diffé- rentes zones géographiques sur lesquelles opère la SNCF : « Quand le train passe de France en Belgique, ce n’est pas la même chose. Eurostar porte sept systèmes de signalisation à bord ! » « La » donnée est donc souvent www.institut-entreprise.fr 23 complexe, même si tout l’enjeu de la démarche big data est bien de prendre des données hétérogènes et de les amalgamer. Le premier enjeu du big data à la SNCF relève donc de la structuration des données et de « la construction d’une culture collective de la donnée ». Cette construction implique « un vrai changement culturel pour que la prise de conscience de la donnée s’infiltre dans l’entreprise ». Aujourd’hui, en effet, « la donnée est souvent un consommable, voire un jetable quand elle est acquise par des moyens non informatiques ». Au-delà des techniques, il faut user de pédagogie pour faire naître auprès des salariés la prise de conscience que la donnée est une richesse. Une autre transformation à mener est liée à la mise en œuvre de compétences (en termes d’analyse statistique, de data visualisation, d’optimisation) qui ne sont pas toujours disponibles en interne, ou alors en quantité insuffisante ; au-delà des réponses en termes de politique de recrutement, cette difficulté est aujourd’hui en partie levée grâce aux partenariats noués par le groupe auprès des start-up, notamment au travers du Camping, l’incubateur de Silicon Sentier. b) À ces transformations nécessaires en interne s’ajoute la complexité du paysage institutionnel. Ce dernier n’est pas encore complètement dessiné car le processus de libéralisation du rail est en cours au niveau européen. De plus, il existe une multiplicité d’acteurs dans le domaine du transport qui ne permet pas toujours d’avoir une relation directe avec le client. Dans certains cas, l’autorité régulatrice peut être propriétaire de la donnée (ex. : Stif). La stratégie actuelle de la SNCF consiste justement à devenir « un industriel des services B2C ». « Nous ne maîtrisons pas toute la chaîne des services, il faut des montages institutionnels très variés. Sncf.com fait du B2C, mais face au Stif nous sommes en B2B. Comment avoir une même politique de la donnée ? », s’interroge Éric Conti. Par ailleurs, la spécificité du statut de la SNCF – un Epic, établissement public à vocation industrielle et commerciale – induit un positionnement ambigu vis-à-vis de l’exploitation des données. Ainsi, en matière d’open data, la dimension « établissement public », qui renvoie à des missions d’intérêt général, incite à l’ouverture des données, tandis que la dimension « à vocation industrielle et commerciale » renvoie davantage au secret des affaires, et donc à une moindre transparence. La réglementation peut également se révéler être un obstacle à la mise en œuvre d’une démarche big data. L’usage de la vidéosurveillance, dans les gares notamment, pourrait être élargi au-delà des questions liées à la sécu-24 Faire entrer la France dans la troisième révolution industrielle : le pari de l’innovation rité des voyageurs. La vidéo est en effet une source très riche de data, et les caméras pourraient être utilisées pour compter et réguler les flux de passagers. Un tel usage se heurte toutefois aux limites de la réglementation actuelle en matière de conservation des images. c) Il convient également de noter certaines limites propres au big data. Ces limites sont de deux ordres. La démarche big data est souvent associée au développement des analyses prédictives et en temps réel. Ces dernières ont de nombreuses retombées bénéfiques, par exemple sur le réseau Transilien, où des décisions à prendre sur l’affectation des trains ou des circulations doivent l’être en moins d’une minute. Toutefois, dans certains cas, elles peuvent se révéler contre-productives si elles ne correspondent pas à un besoin réel des consommateurs. Ainsi, dans le domaine de l’information voyageur, l’actualisation trop fréquente des données peut être une source de stress pour les clients. Le big data ne doit donc pas être perçu seulement comme une technique qui devrait être poursuivie pour elle-même, mais comme un outil qui trouve sa valeur auprès des usages qui peuvent en découler. Les nouvelles offres permises par le big data viennent compléter une offre de service préalable, plus qu’elles ne viennent s’ajouter à cette dernière. La mobilité est d’abord physique et il est difficile de séparer la question du transport physique du service immatériel offert au client. Autrement dit, l’offre nouvelle qui pourrait naître du big data suppose que l’offre de base – celle du transport physique – soit correctement remplie. « À chaque fois qu’on a voulu offrir de nouveaux services, dès lors que le service de base n’était pas assuré, cela a été un échec », plaide Éric Conti. L’utilisation du crowdsourcing dans la maintenance des équipements a pu ainsi connaître quelques ratés dès lors que l’organisation physique pour tenir compte des alertes clients – soit réparer dans des délais très courts les dysfonctionnements signalés – était sousdimensionnée. La SNCF reste également vigilante à ce que ce potentiel d’automatisation des processus et des décisions n’aboutissent pas à de « nouveaux services déshumanisés, sans personne pour dialoguer en face ». En conclusion, la SNCF produit aujourd’hui un volume important de données ; l’exploitation de ces dernières avec des nouvelles données exogènes (météo, événementiel, etc.) constitue un gisement important d’accroisse-www.institut-entreprise.fr 25 ment de ses performances techniques et services. Le dilemme pour l’entreprise est de parvenir à concilier cette exploitation avec la réalité du ROI pour allouer au mieux ses investissements. Le big data et l’automobile Les voitures sont de plus en plus équipées de capteurs et de logiciels embarqués, qui leur permettent d’analyser leur environnement et d’agir en conséquence. Certaines voitures possèdent déjà des technologies qui permettent une conduite partiellement autonome, comme une option pour se garer automatiquement, ou une assistance aux embouteillages pour maintenir la distance nécessaire vis-à-vis des autres véhicules. La voiture se personnalise en intégrant et utilisant les données, devenant connectée, voire sans conducteur. Ces services personnalisés sont un nouveau moyen de fidéliser les clients, qui prend de l’ampleur par rapport au produit en lui-même. La voiture connectée Celle-ci repose sur un échange de données issues des capteurs présents dans le véhicule avec l’extérieur. Selon les chiffres d’ABI Research, 80 % des véhicules qui seront produits et commercialisés en Europe et aux ÉtatsUnis en 2017 seront connectés. Les interfaces homme-voiture, à l’origine les GPS et les smartphones, offrent déjà de plus en plus de services en lien avec les données collectées par ces capteurs. Ensuite, de nouveaux services exploitent les données issues des capteurs et les croisent avec d’autres sources : services de guidage qui allient le GPS avec la connaissance du trafic et les positions des parkings ou stations-service ; suivi de l’usure des pièces et télédiagnostic en cas de panne, autorégulation de la circulation. Le regroupement d’une multitude de données sur les habitudes de conduite des clients peut aussi être monétisé par les fabricants : si le système télé- matique OnStar de General Motors Corporation, par exemple, propose des 26 Faire entrer la France dans la troisième révolution industrielle : le pari de l’innovation services de sécurité, d’information et de diagnostic des véhicules aux automobilistes, il recueille également des données télémétriques. En 2007, OnStar et GMAC Insurance se sont associés pour créer une nouvelle offre qui se sert de ces données afin de proposer des primes d’assurance aux clients qui roulent moins que les autres : c’est le concept du « pay as you drive ». Pour répondre aux défis du big data, le Car Connectivity Consortium (CCC) regroupe plusieurs constructeurs dont PSA, BMW et General Motors, des équipementiers et des acteurs des technologies informatiques comme Samsung ou Nokia. Il a notamment lancé le projet Genivi, qui développe un socle commun pour les services d’information ou de divertissements dans les véhicules, en mutualisant les efforts dans le développement des logiciels enfouis et la standardisation des équipements. Les développements issus de ce projet sont sous licence open source. Genivi a aussi développé Mirrorlink, un standard commun permettant de reporter, via un raccord USB ou par Bluetooth, le contenu du smartphone sur l’écran de bord. La voiture sans conducteur Si des esquisses de voiture autonome ont existé depuis environ trente ans, comme le projet Eureka Prometheus de l’Union européenne, les nouveaux outils de collecte et de traitement des données permettent leur concrétisation. Ainsi, la Google Car, entièrement autonome, est testée depuis 2010 sur des routes américaines. Le logiciel qui permet sa conduite a été perfectionné par des outils d’apprentissage automatique, grâce aux données récoltées lors des centaines de milliers de kilomètres de test. De nombreux constructeurs dont Volvo, BMW, Daimler, Tesla Motors et Nissan soutiennent des projets de R&D sur les voitures autonomes. À terme, selon l’organisme américain de sécurité routière, les voitures autonomes permettraient d’éviter 80 % des accidents. En théorie, la voiture autonome n’a pas besoin d’être connectée à Internet : Mitsuhiko Yamashita, responsable en R&D chez Nissan, a expliqué que Nissan ne s’appuie quasiment pas sur les infrastructures (capteurs extérieurs et Internet) et que toute la technologie se trouve dans le véhicule. Cependant, une connexion Internet pourrait être utile pour obtenir des informations complémentaires, par exemple lorsque le relief ou la route sont masqués par la neige.www.institut-entreprise.fr 27 SOURCE D’INNOVATIONS ORGANISATIONNELLES La démarche big data met la donnée au cœur des activités des organisations, au-delà des fonctions informatiques ou statistiques. Les trois domaines privilé- giés des initiatives big data sont l’analyse financière (58 %), la connaissance client (53 %) et l’identification de tendances à long terme (prévisions) (47 %), selon le big data Index EMC/IDC. Cette démarche transversale que sont les big data n’est pas l’apanage d’une direction en particulier. Source : VINT big data research report Les implications big data pour les fonctions logistique et marketing apparaissent de façon assez évidente. La collecte et l’exploitation d’informations sur des produits connectés ou les comportements des consommateurs permettent d’améliorer le fonctionnement opérationnel de l’entreprise et de prévoir l’évolution des marché. Les prévisions temporelles des ventes croisées avec les données de stocks permettent de calculer précisément les besoins en réapprovisionnement et d’en optimiser la logistique. Le développement de nouveaux produits et services et leur adaptation au plus près des attentes et des usages sont facilités par l’apparition de microsegmentations. Combinées à la mobilité, les big data réinventent l’interaction avec l’utilisateur, cherchant à délivrer le bon service, à la bonne personne, au bon endroit et dans le bon timing.28 Faire entrer la France dans la troisième révolution industrielle : le pari de l’innovation Exemple : Lokad, start-up française éditrice de logiciels, a développé des algorithmes qui aident les distributeurs à optimiser quotidiennement leurs niveaux de stock en analysant les tickets de caisse et en se basant sur l’historique des ventes. Trouver le juste niveau de stock (ni trop, ni trop peu) permet aux clients d’optimiser leur marge. En adoptant les solutions Microsoft telles que la plate-forme Azure, Lokad a démultiplié ses capacités de stockage et de prévision statistique. « Nous comptons sortir cent fois plus de prévisions et atteindre les 100 millions de prévisions à l’heure », explique le fondateur de l’entreprise Joannès Vermorel. La précision des corrélations statistiques permet aujourd’hui à Lokad de détecter la saisonnalité d’un produit en vente depuis moins de trois mois. La société a ainsi pu diversifier son portefeuille de clients en s’adressant à de petites sociétés et à des ecommerçants caractérisés par de petits stocks à faible rotation, grâce à la technologie de « prévisions quantiles ». Lokad envisage désormais de s’attaquer à des marchés non traditionnels, comme celui de la gestion de projets de construction, qui pourraient bénéficier de son expertise d’optimisation des prévisions. Exemple : créée en 2010 par David Bessis et Jakob Haesler, Tinyclues pratique le « profiling prédictif » au sein de bases de données fournies par ses clients, e-commerçants ou médias digitaux, pour comprendre le profil et les préférences du consommateur à partir de « signaux faibles » (identité, adresse e-mail, mots-clés tapés et pages Internet consultées) et être ainsi en mesure de lui recommander des produits en ligne avec ses précédents comportements d’achat et ses envies actuelles. Le modèle économique de Tinyclues repose sur une logique d’abonnement mensuel basée sur le volume de la base de données traitée. L’ambition de cette start-up française serait d’égaler les performances de son aînée Criteo, moteur prédictif en temps réel lancé en 2005 pour analyser et prévoir les comportements des consommateurs et aujourd’hui leader mondial de la publicité en ligne. La stratégie de conquête des nouveaux marchés de ce spécialiste du retargeting, ou reciblage publicitaire basé sur un algorithme de recommandation, est confirmée par une récente étude qui affirme que 20 % des internautes cliquent sur les bannières publicitaires ciblées.www.institut-entreprise.fr 29 La gestion des risques et de la qualité est également plus fine. Les capacités de réaction en cas de pannes, d’incidents, de pics, de pandémies… peuvent alors être raccourcies et affûtées. D’autres fonctions, comme les ressources humaines, peuvent être favorablement impactées par l’essor du big data, via l’optimisation du recrutement, grâce à la lecture sémantique des CV par exemple. Exemple : PredPol (predictive policing) est un algorithme conçu pour prédire où et quand des délits ont le plus de probabilités de se produire. Grâce à une base de données recensant les infractions passées, les forces de police peuvent, comme dans le film de science-fiction de Steven Spielberg Minority Report (2002), se rendre sur les lieux avant même que les actions soient commises. Utilisé également pour prévenir les catastrophes naturelles comme les séismes, ce type d’analyse est une nouvelle façon de hiérarchiser les priorités et d’allouer les ressources humaines et financières. Exemple : Evolv, un spécialiste du recrutement et de l’optimisation des performances des employés, a récemment réalisé une enquête auprès de 20 000 employés. Sa principale conclusion : il n’existe aucune corrélation sérieuse entre la réussite d’un candidat dans le travail qui lui est proposé et l’expé- rience accumulée par ce même candidat dans les postes qu’il a occupés précédemment. Et inversement, ce n’est pas parce qu’un candidat a été inscrit au chômage pendant une période relativement longue (plus de six mois) qu’il ne sera pas capable de répondre aux attentes de son futur employeur. Evolv affirme en conséquence que les anciennes méthodes de recrutement sont dépassées. L’analyse de certaines interactions (ex. : les employés entretenant des relations avec au moins trois collègues restent plus longtemps dans leur entreprise que ceux qui n’y ont pas d’amis) ou de certaines pratiques dans les réseaux sociaux (ex. : un employé actif sur les réseaux sociaux est plus enclin à rester fidèle à son entreprise et donc à y rester longtemps) serait plus performante que l’étude du parcours du candidat. L’entreprise enjoint donc les recruteurs à s’intéresser aux nouvelles technologies analytiques pour améliorer l’efficacité de leurs employés et de leur recrutement. Selon cette même étude, l’utilisation des techniques analytiques et l’exploitation du big data renforceraient la relation de confiance entre employeurs et employés : la fidélité des employés recrutés via l’analytique augmenterait de 35 % et leur performance grimperait de 30 %.30 Faire entrer la France dans la troisième révolution industrielle : le pari de l’innovation « MagicBands », les bracelets Disney source de big data Depuis le printemps 2013, les parcs d’attractions et hôtels Disney équipent leurs clients de bracelets, les « MagicBands ». Ceux-ci sont munis de puces RFID et servent à la fois de tickets tout-en-un, de moyen de paiement sur place et de clé pour ouvrir sa chambre dans un Disney Resort. La RFID (radio frequency identification) est une technologie qui transfère à distance les données contenues dans une étiquette ou une puce émettant des ondes radio. Elle permet donc d’identifier et de suivre les objets équipés de ce système. Longtemps utilisée comme simple outil de suivi des inventaires, la RFID est aujourd’hui plus largement utilisée et équipe désormais les passeports, les badges d’entreprises et, depuis peu, les « MagicBands » de Disney. Dans ce dernier cas, la puce RFID peut contenir des informations sur le porteur du bracelet, comme son identité, ses préférences de consommation ou ses coordonnées bancaires. Ces bracelets nouvelle génération font partie d’une initiative plus large de Disney appelée « MyMagic+ » – développée depuis février 2011 – qui vise à rendre l’expérience consommateur plus interactive et personnalisée. L’investissement consenti est évalué entre 800 millions et 1 milliard de dollars – avec l’espoir qu’un client plus satisfait dépensera davantage… Thomas O. Staggs, président de Disney Parks and Resorts, explique : « We continually push the boundaries of creativity and innovation to deliver the best possible experience for our guests. […] Over the past few years, we’ve devoted considerable time and resources to create a more immersive, more seamless and more personal experience for each and every guest who spends time with us. » « MyMagic+ » rassemble : - « My Disney Experience », qui permet de planifier en avance ses vacances et qui se décline sous forme d’application mobile et de site Internet ; - « Fastpass+ », qui permet de choisir trois coupe-files dans les attractions de son choix ou de réserver des places VIP pour certains événements. En cas d’hésitation, le programme peut utiliser les données entrées par l’utilisateur pour lui faire des recommandations ;www.institut-entreprise.fr 31 - Le « MagicBand », permettant aux utilisateurs de payer ou de participer à des attractions sur simple présentation de leur bracelet, mais aussi à l’équipe Disney de suivre leur temps d’attente aux attractions et leurs consommations en temps réel au sein du parc. Ce bracelet sert également de clé d’hôtel, permettant ainsi une meilleure continuité des services entre les différents univers. Avec près de 42 millions de visiteurs dans ses parcs d’attractions en 2012, Disney a accès à un immense flux de données. Ces données portent sur l’identité des visiteurs, leurs parcours dans le parc, leurs achats et préfé- rences (via les coupe-files choisis par exemple). Ces informations sont collectées à partir de leur bracelet et via le site Internet et l’application « My Disney Experience ». Ces données seront utilisées par exemple pour faire face à des problèmes structurels de Disney comme des temps d’attente trop longs dans le parc pour les clients ou une difficulté pour Disney à allouer efficacement ses employés. Jusqu’ici les visiteurs entraient dans le parc sur présentation de tickets papier et circulaient ensuite librement dans le parc. Des kiosques vendaient des coupe-files sur place mais, pris d’assaut, ils étaient rapidement à court. Les temps d’attente pour la plupart des visiteurs se révélaient alors interminables. En traçant les parcours des visiteurs, Disney pourra être à même de réduire les pics d’affluence et d’améliorer la fluidité dans ses parcs en proposant par exemple à un client qui a réalisé la plupart des montagnes russes d’aller en faire une nouvelle car, à cette heure, le temps d’attente est inférieur à celui de l’attraction pour laquelle il patiente présentement. De même, le « Fastpass+ » et « My Disney Experience » proposent aux visiteurs de planifier davantage leur séjour en réservant à l’avance le bracelet, un dîner ou encore des coupe-files. Une fois sur place, les visiteurs peuvent encore utiliser l’application sur leur smartphone pour changer leur plan, se diriger dans le parc et recevoir des alertes sur la programmation (heure et lieu de passage des parades) ou les temps d’attente. En couplant ces données avec l’analyse du nombre de visiteurs par heure, Disney tentera ainsi d’optimiser l’allocation et le planning de ses employés. Mais, au-delà de l’optimisation de la gestion des ressources humaines et du temps d’attente, cette initiative offre de nouvelles perspectives au groupe. 32 Faire entrer la France dans la troisième révolution industrielle : le pari de l’innovation Ce dernier pourra offrir une expérience plus interactive à ses clients. Les personnages de Disney parcourant le parc seront à même, grâce aux données contenues dans les bracelets, de saluer les enfants par leurs prénoms en les croisant ou de leur souhaiter un joyeux anniversaire le cas échéant. Ces informations sont également un atout précieux pour le lancement d’opérations efficaces de marketing direct. Par exemple, si l’heure du déjeuner approche et que le temps se couvre, le visiteur recevra un coupon de réduction pour le restaurant le plus proche sur son smartphone. Une utilisation intelligente de ces big data générerait donc des revenus additionnels et une meilleure fidélisation des clients. Néanmoins, Disney doit faire face à des défis afin de faciliter l’adoption de ces nouveaux services, notamment l’acquisition de nouvelles compétences en interne, la sécurisation des données et la gestion des réticences des consommateurs désireux de protéger leur vie privée. Une formation sera dispensée à près de 60 000 employés. Le port du bracelet ne sera pas obligatoire et les visiteurs pourront choisir le niveau d’informations qu’ils souhaitent révéler. Les informations transmises à Disney par le bracelet seront sources de contre-valeur pour les clients. Par exemple, les visiteurs qui accepteront de communiquer leur numéro pourront recevoir des coupons de réduction sur leur smartphone. BIG DATA, FACTEUR CLÉ DE PERFORMANCE Dans une étude publiée en 2011, le McKinsey Global Institute démontre que les big data induisent des gains substantiels dans de nombreux secteurs d’activité. Le temps de développement pourrait être réduit de 25 % dans l’industrie du fait d’une meilleure productivité au niveau du design, de la production et de la distribution. Dans le retail, les revendeurs seraient plus en phase avec les goûts des consommateurs ; ils optimiseraient leurs stocks et pourraient accroître leurs marges nettes de 60 %. Dans le secteur public, ces techniques d’analyse des données fluidifieraient les processus administratifs, avec, à la clé, une baisse des coûts de 15 à 20 %, soit de 150 à 300 milliards d’euros rien qu’en Europe... Les big data devraient créer d’ici 2015, 4,4 millions d’em-www.institut-entreprise.fr 33 plois dans le monde et 1,9 million d’emplois dans le secteur informatique aux États-Unis, selon la société Gartner8. En comptant les emplois indirects géné- rés, ce sont même près de 6 millions d’emplois qui pourraient être générés à cet horizon pour les seuls États-Unis. Les big data sont susceptibles d’accroître la performance globale des organisations car ils permettent de : • Réduire les délais et les coûts grâce à des prévisions ajustées. • Améliorer la satisfaction client grâce à un feed-back continu sur les produits et l’état des relations client, à des communications marketing personnalisées et à une optimisation des offres commerciales. • Gérer mieux les risques en les détectant plus tôt et en ayant plus d’informations pour y remédier de façon adaptée. • Accélérer le développement de produits, services et processus innovants en renforçant les processus de décision. 8. « Gartner Says Big Bata Creates Big Jobs : 4.4 Million IT Jobs Globally to Support Big Bata By 2015 » (http://www.gartner.com/newsroom/id/2207915).34 Faire entrer la France dans la troisième révolution industrielle : le pari de l’innovation Big data et productivité Deux chercheurs du Massachusetts Institute of Technology (Sloan Business School), Erik Brynjolfsson et Heekyung Kim, en partenariat avec Lorin Hitt, chercheur à l’université de Pennsylvanie (Wharton Business School), ont publié une étude menée auprès de 179 entreprises cotées. L’étude montre que les organisations qui s’appuient sur l’analyse des données pour développer leur stratégie augmentent leurs niveaux de productivité de 5 à 6 %9. Une étude de l’université du Texas portant sur 150 entreprises de la liste « Fortune 1 000 » tente d’étudier les gains de performance financière, opérationnelle et commerciale qui peuvent être suscités par des investissements dans les données, donc dans l’amélioration de leur qualité. Les résultats montrent qu’une bonne utilisation des données favorise la productivité dans trois cas : - L’amélioration du caractère utilisable des données de 10 % permet des gains de productivité des employés : par exemple 15 % de ventes supplé- mentaires. - L’amélioration de la mobilité des données de 10 % entraîne une augmentation du ROIC (Return on Invested Capital) de 1,4 %, et une augmentation de la productivité des actifs de 7,28 % via une meilleure gestion et utilisation de ces actifs. - L’amélioration de l’intelligence des données de 10 % génère une augmentation de 18,5 % dans la précision des prévisions et de la programmation. Si l’accessibilité augmente aussi de 10 %, une augmentation moyenne des revenus est constatée, de 0,81 % grâce au développement de nouveaux produits, et de 0,7 % grâce à de nouveaux consommateurs10. 9. « Strength in Numbers : How Does Data-Driven Decisionmaking Affect Firm Performance ? », Social Science Research Network Working Paper Series, avril 2011. 10. Les résultats obtenus varient beaucoup selon les secteurs. Au niveau des bénéfices financiers et des bénéfices en termes de consommation, ils sont souvent plus élevés pour les entreprises des télécommunications, du conseil et de l’industrie pétrolière (aux investissements lourds).www.institut-entreprise.fr 35 L’IMPACT DU BIG DATA POUR LES ENTREPRISES Le big data est aujourd’hui une réalité émergente au sein des entreprises fran- çaises selon le Big Data Index France EMC/IDC réalisé à l’été 2012 auprès de 160 entreprises de plus de 200 salariés. Le terme big data n’évoque rien à 35 % des répondants et 91 % déclarent que leur entreprise n’a pas d’initiatives ou de réflexions dans ce domaine. Selon une enquête plus récente, réalisée par Steria à l’été 2013, 42 % des entreprises françaises considèrent le big data comme susceptible d’améliorer leurs processus de planification et de prévisions et 34 % comme susceptible d’accroître la connaissance et la maîtrise de leur activité. Toutefois, seules 7 % des personnes interrogées dans le cadre de cette enquête (au niveau européen cette fois-ci) considèrent le big data analytique comme un sujet très important pour elles. Pour tirer profit de la démarche big data, le top management doit comprendre et adhérer à cette révolution. Les décideurs et les managers doivent définir comment en tirer parti puis adapter les outils et processus big data à leurs ambitions. Les défis pour les organisations consistent à : • Considérer tous types de données, même celles dont on ne voit pas encore l’utilité ou dont tous les paramètres ne sont pas encore maîtrisés. • Stocker et sécuriser de gros volumes de données, et ce dès maintenant. • Analyser et donner du sens à ces données. • Exploiter et valoriser commercialement les nouvelles informations tirées de ces données. « En termes d’acquisition et de conservation des données, nous sommes au point ; en revanche, la valorisation de ces données ainsi que leur circulation dans le groupe restent à faire. » Directeur innovation d’un groupe du CAC4036 Faire entrer la France dans la troisième révolution industrielle : le pari de l’innovation Le big data, un outil au service de la « transformation digitale » pour la Société Générale Au sein de la Société Générale, le big data est considéré comme une source d’opportunités pour la lutte antifraude et l’amélioration de l’expérience client. Selon Françoise Mercadal-Delasalles, directrice des ressources et de l’innovation à la Société Générale, « l’exploitation des données comptables et commerciales recèle un potentiel de croissance colossal ». La démarche big data comporte deux avantages majeurs pour l’institution bancaire : faciliter la détection des fraudes et être un levier de lutte contre la cybercriminalité. Les données de l’activité bancaire d’un client pourraient par exemple être croisées avec ses données personnelles communiquées lors de l’ouverture du compte pour prévenir une utilisation frauduleuse de ses coordonnées bancaires. Surtout, le croisement de ces mêmes données permet d’affiner l’analyse comportementale des clients, en y intégrant une dimension prédictive, susceptible à terme de transformer en profondeur la relation des établissements bancaires avec ces derniers. Fin 2013, le groupe avait lancé deux projets pilotes d’analyse prédictive sur son réseau en France. Pour autant, le but de la Société Générale n’est pas de commercialiser les données. Une telle activité risquerait de nuire à ses deux atouts majeurs face à ses nouveaux concurrents proposant des services financiers exclusivement en ligne : la sécurité et la confiance. Pour la directrice des ressources et de l’innovation à la Société Générale, « les banques seront toujours plus prudentes que les autres prestataires de services dans l’utilisation des données de leurs clients ». Les freins de mise en œuvre de solutions intégrant les big data sont nombreux dans un groupe tel que celui de la Société Générale : * des obstacles culturels : les dirigeants actuels ne font pas partie de la génération des hyperconnectés et ne sont pas forcément convaincus des bénéfices potentiels du numérique ;www.institut-entreprise.fr 37 * des difficultés de coordination : les données collectées par le groupe ne sont pas ou très peu partagées à l’heure actuelle entre la banque d’affaires et la banque de détail, tout comme entre le siège français et les filiales étrangères ; * des difficultés informatiques, qui découlent souvent des précédentes : la Société Générale ne dispose pas de plate-forme de gestion de la relation client (Customer Relationship Management) ni de référentiel unique. Des efforts sont cependant en cours sur ce point ; la rationalisation des référentiels d’organisation et de structure devrait permettre l’analyse et la valorisation des données. Les banques sont désormais engagées dans une course au premier entrant en matière de big data. Si Wells Fargo avec sa banque virtuelle et HSBC font pour l’heure figure de précurseurs, la Société Générale a de vrais atouts à faire valoir. Un poste de chief data officer a été créé et l’entreprise peut s’appuyer sur ses compétences internes dans le domaine de l’informatique. En effet, ce dernier représente 11 000 à 12 000 collaborateurs en interne et 3 milliards d’euros de budget annuel. Cela lui a permis de conserver de précieuses compétences sur la collecte et l’analyse des données, contrairement à certains de ses concurrents qui ont pu pousser trop loin l’externalisation et perdre ce savoir-faire. LE BIG DATA COMME NOUVEAU MARCHÉ De nouvelles entreprises ou business units peuvent être créées qui s’appuient sur le big data : - Le big data au sens large : fabricants de capteurs11, services de location d’espace de stockage et de capacité de calcul, développeurs d’outils analytiques12, de plates-formes de mise à disposition des données et de services de visualisation des données… - Le stockage de la donnée. 11. Harbor Research estime que le marché mondial des Internet enabled devices sera de 10 milliards de dollars en 2014, contre 4,3 milliards de dollars en 2009. 12. D’après IDC, le marché mondial des programmes analytiques passera de 25,5 milliards de dollars en 2010 à 34 milliards de dollars en 2014.38 Faire entrer la France dans la troisième révolution industrielle : le pari de l’innovation Les modèles économiques de valorisation des données sont pour l’instant embryonnaires et restent difficiles à maîtriser pour ceux qui débutent sur ce marché. Deux types d’entreprises se distinguent : - Les entreprises qui analysent les données. - La société Gartner prédit l’émergence de « revendeurs d’informations » spé- cialisés, à qui la distribution pourra être sous-traitée, et de « gestionnaires de produit information » (internes) pour piloter cette nouvelle activité13. En effet, alors que les organisations produisaient et utilisaient jusqu’à maintenant leurs propres données, des data brokers revendent aujourd’hui les données d’entreprises ou encore de l’État à divers acteurs14. On estime ainsi que la socié- té américaine Acxiom, spécialisée dans le recueil et la vente d’informations, et qui a dégagé un revenu de 1,15 milliard de dollars en 2012, posséderait en moyenne 1 500 données sur 700 millions d’individus dans le monde15. Exemple : Ixxi, filiale du groupe RATP en charge de l’information voyageurs et des billets, a développé l’application Android « Your Tube Summer » lors des Jeux olympiques de Londres en 2012 pour que les touristes français puissent anticiper, préparer et organiser leur voyage dans la capitale londonienne, et ce grâce aux données librement partagées par le gouvernement britannique. Cette application propose de visualiser les stations situées autour de la position de l’utilisateur et les prochains départs des trains en temps réel, d’afficher les temps d’attente par station, ou encore d’effectuer des recherches par station, par lieu touristique et par manifestation sportive. 13. Voir « Gartner : vers la monétisation des big data », C’est pas mon idée !, blog de Patrice Bernard, 11 janvier 2013 (http://cestpasmonidee.blogspot.fr/2013/01/gartner-vers-la-monetisation-des-big. html). 14. Dans un rapport publié en 2012, la Commission fédérale américaine du commerce s’est souciée de l’essor de la profession d’information broker. Elle demande entre autres à ce que les citoyens puissent avoir accès aux informations que ces « vendeurs d’informations » ont sur eux (Federal Trade Commission, Protecting Consumer Privacy in an Era of Rapid Change, mars 2012). 15 Voir « Data brokers : aux États-Unis, votre vie privée est en vente », ZDNet.fr, 12 avril 2013 (http:// www.zdnet.fr/actualites/data-brokers-aux-etats-unis-votre-vie-privee-est-en-vente-39789295.htm).www.institut-entreprise.fr 39 LES PRINCIPAUX POINTS DE VIGILANCE Comme tout grand sujet de changement dans les organisations, les enjeux organisationnels et culturels associés au big data nécessitent le soutien et l’implication de la direction générale. Selon le Big Data Index France, 73 % des répondants n’associent pas de bénéfices au big data et 77 % estiment que ce n’est pas vraiment un sujet pour leur entreprise au-delà de nouveaux investissements et de nouvelles politiques de stockage et d’archivage. Or, nous avons vu que l’intérêt du big data est avant tout de croiser des données hétérogènes (météo, logistique, géolocalisation, trafic automobile) pour améliorer le rendement des activités existantes et en tirer des offres inédites. Les entreprises souhaitant prendre le virage stratégique du big data doivent combattre les doutes et les craintes associés à une telle démarche, assouplir les exigences de retour sur investissement en la matière pour permettre l’amorçage du changement et accorder les ressources nécessaires – ressources humaines aussi bien que financières – à un tournant d’une telle envergure. Le buzz du big data étant largement centré sur les aspects technologiques, l’enjeu de mise à niveau des compétences est souvent sous-estimé, particulièrement en France. 60 % des répondants à une étude mondiale réalisée au printemps 2012 sur les enjeux du big data identifient le déficit de compétences comme le défi principal, tandis que 6 % seulement des répondants au Big Data Index France mettent en avant la transformation des compétences comme un impact très fort du big data. Les compétences pertinentes à l’ère du big data sont variées : ce sont des compétences techniques, statistiques, analytiques et en gestion de projets, afin de développer, déployer et/ou maintenir les technologies et logiciels associés au big data. Michel Morvan, ancien VP Strategic Intelligence and Innovation de Veolia explique que « pour faire réellement parler les données, il faut des compé- tences spécifiques pour les nettoyer, établir des statistiques, modéliser ». Mais il faut aussi des compétences d’analystes métier, connaissant parfaitement le modèle économique de l’entreprise et son environnement, pour être à même d’interpréter les résultats. De nouveaux métiers hybrides apparaissent, comme les creative technologists, mélangeant technologie, créativité, marketing et communication, pour faire le lien entre les différents services d’une entreprise. Les entreprises seront probablement amenées à revoir leur organisation pour donner au big data la place stratégique qu’il requiert. De nouveaux métiers pour-40 Faire entrer la France dans la troisième révolution industrielle : le pari de l’innovation raient prendre de l’ampleur comme celui de chief data officer ou chief information officer. La question de l’environnement informatique ne sera pas non plus à occulter afin de se préparer aux exigences des grands volumes de données et de l’ère du cloud computing. Le rôle du directeur des systèmes d’information (DSI) sera alors amené à être revu et repensé, comme le préconise Gilles Grapinet : « la “ commoditisation ” du DSI ces dernières années et la pression sur les coûts ne doivent pas l’empêcher d’être un acteur central de la démarche big data ». Les Data Scientists dans l’entreprise, vus par l’Ensae « Comment récolter les fruits du big data en minimisant les risques ? • Pensez data science avant de penser big data. • Embauchez une équipe de data scientists. • Placez-les sous la responsabilité d’une autorité légitime. » Le big data n’est qu’un élément d’un nouvel ensemble d’outils et de techniques appelé data science. Une compréhension globale des données d’une entreprise et de leur potentiel – ainsi que la maîtrise des moyens d’exploitation – peut devenir un nouveau vecteur de performance. La data science permet d’effectuer une analyse fine de l’information qui permettrait d’être plus efficace dans les processus (conception, marketing, relation client), d’identifier les données disponibles et de distinguer les données utiles, présentes ou non. Elle permet l’étude des méthodes de traitement de l’information les plus efficaces pour aboutir à des réponses concrètes et opérationnelles aux questions posées par les pilotes des processus. À ce titre, le data Scientist doit avoir des compétences en mathématiques : l’analyse des données fait appel à des modèles statistiques ou des algorithmes complexes. Il doit aussi être capable d’extraire les données des systèmes informatiques, de programmer les algorithmes de traitement et de permettre la visualisation rapide des résultats, ce qui requiert des compé-www.institut-entreprise.fr 41 tences informatiques. Enfin, il ne peut se résumer à une simple fonction technique : au service de l’efficacité et de la rentabilité, il doit avoir des compétences d’expert métier et connaître les enjeux économiques de ses travaux. Si certaines entreprises explorent déjà les capacités du big data par des initiatives cloisonnées des départements informatiques, marketing, financiers, la création d’une équipe transversale de data scientists permet une démarche globale de valorisation des données. Face au risque de résistance des dirigeants de l’entreprise, confrontés à des mécanismes qu’ils ne peuvent entièrement maîtriser, un tel projet devrait être mis entre les mains d’une autorité explicitement reconnue par la hiérarchie de l’entreprise, par exemple en le rattachant à la direction générale. C’est l’esprit de la création du rôle de chief data officer aux États-Unis16. Enfin, les enjeux liés à la sécurité17, à la disponibilité, à l’accessibilité et à la confidentialité des données seront également de grands défis pour les organisations. La protection de la propriété intellectuelle ou encore la protection du consommateur constituent autant de zones d’évolution du droit, de la réglementation et de la norme dans un scénario de croissance continue du big data. Des efforts de normalisation seront nécessaires pour permettre le décloisonnement des données en toute sécurité dans les entreprises et les organismes publics. Pour encourager les échanges, des normes de sécurité des échanges sont progressivement mises en place entre les administrations et les usagers, comme le Référentiel général de sécurité (RGS) ou la Plate-forme d’échange de confiance (PEC). Des outils comme le Référentiel général d’interopérabilité (RGI), qui fixe les règles techniques permettant d’assurer l’interopérabilité des systèmes d’information, encouragent aussi le partage. Depuis 2010, le Centre d’accès sécurisé distant (CASD) donne accès aux chercheurs, de façon très 16. Source : Variance, n° 46, février 2013 (http://www.ensae.org/docs/2013162028_var46_webplanches_31-01.pdf). 17. Dans son rapport de novembre 2013, Analyse des big data. Quels usages, quels défis ?, le CGSP rappelle ainsi que la plupart des fournisseurs des technologies du cloud se ménagent des back doors qui leurs permettent l’accès aux données stockées sur leurs serveurs.42 Faire entrer la France dans la troisième révolution industrielle : le pari de l’innovation encadrée, à des données individuelles possédées par l’Insee et les services statistiques ministériels. Les craintes sur le non-respect de la vie privée constituent un autre obstacle important au développement du big data que les pouvoirs publics ne peuvent ignorer. Si le big data permet de mieux prévoir le futur proche pour y adapter au mieux les politiques publiques et optimiser la dépense publique, comme le fait par exemple le programme Global Pulse développé par les Nations unis18 en analysant les mots-clés échangés sur Twitter, certains redoutent le phénomène « Big Brother » de la surveillance à outrance. Certains experts estiment qu’à l’heure des big data, « l’anonymat est devenu algorithmiquement impossible ». Certaines entreprises ont été contraintes de prévoir une offre alternative pour répondre aux craintes de certains consommateurs. La formule Navigo Découverte de la RATP (coûtant approximativement 5 euros) permet depuis quelques années au possesseur de la carte de ne pas être inscrit dans un fichier client, contrairement à la formule classique. Le forfait est chargé sur une carte à puce et accompagné d’une carte nominative cartonnée où le voyageur indique luimême son nom, son prénom et colle sa photo d’identité. Les risques croissants portés par le big data sur la vie privée créent également de nouvelles inégalités, entre ceux qui maîtrisent les outils informatiques – par exemple les privacy enhancement technologies (PET) –, ceux qui contrôlent ou non leur dévoilement sur les réseaux sociaux, ceux qui peuvent payer pour des services protégés, et les autres. Ces enjeux sont d’autant plus sensibles que la plupart des fournisseurs de l’infrastructure physique du cloud et des services en ligne qui génèrent massivement des données d’utilisateur sont des entreprises privées américaines. Si la CNIL a engagé une procédure contre Google, dont les politiques de confidentialité ne correspondent pas aux normes françaises, son pouvoir punitif est limité à 150 000 euros. Face à ces enjeux, l’État français a financé, à hauteur de 150 millions d’euros, deux cloud computing nationaux sous la forme de partenariats public-privé : Numergy et Cloudwatt. Cependant, les moyens restent 18. Global Pulse permet d’anticiper et de suivre l’impact des crises socio-économiques locales et mondiales de façon rapide. C’est le cas par exemple pour les épidémies, qui sont ainsi détectées plus rapidement qu’avec les réseaux de veille sanitaire classiques. Global Pulse scrute également le chômage ou encore les crises alimentaires.www.institut-entreprise.fr 43 limités ; le programme de R&D Quaero, lancé en 2009 pour développer des outils de recherche d’information en ligne avec un financement public-privé d’environ 200 millions d’euros, n’a pas permis le lancement d’un moteur de recherche français indépendant. Au-delà, les débats sur la justice prédictive (cf. exemple de PredPol en page 26) font redouter à certains que demain des personnes puissent être punies pour leurs penchants, leurs relations, plutôt que pour leurs actions, ce qui remettrait en question un des principes fondateurs de la justice, celui de la pré- somption d’innocence. Cela amènera probablement les décideurs publics à redéfinir la notion de justice pour garantir la liberté de l’homme à agir. Plus largement, l’utilisation croissante d’algorithmes pour déterminer les préférences et prédire les comportements soulève la question de l’influence des données sur la liberté de choix, et l’importance croissante accordée aux données et aux corrélations qu’elles révèlent sans qu’une interprétation, un modèle humain y soient associés. En effet, la démarche big data inverse les démarches traditionnelles d’un modèle confirmé par les données, lui substituant l’observation de corrélations auxquelles peuvent être apportés des éléments explicatifs. Or, corrélation n’est pas interprétation, et encore moins science. La restitution des données personnelles aux États-Unis et au Royaume-Uni Dans plusieurs pays, le gouvernement engage des démarches pour redonner aux citoyens l’accès aux données personnelles que les entreprises stockent sur eux. Cette initiative peut avoir plusieurs avantages : créer des opportunités de dialogue et augmenter la confiance entre les entreprises et les individus ; faire apparaître de nouveaux services d’exploitation de ces données pour permettre aux particuliers d’optimiser leur consommation. MiData C’est le cas du programme MiData, lancé en novembre 2011 par le gouvernement britannique, qui rassemble de grands acteurs privés ainsi que des associations de consommateurs, sur la base du volontariat. Il réunit actuel-44 Faire entrer la France dans la troisième révolution industrielle : le pari de l’innovation lement plus de vingt-cinq entreprises, dont BarclayCard, MasterCard, HSBC, British Gas, Scottish Power, Google, EDF Energy. Après une phase de réflexion, le midata Innovation Lab (mIL) a été lancé le 4 juillet 2013. Il propose aux particuliers de stocker volontairement sur le site les données que les entreprises possèdent sur eux, de manière sécurisée. Ces données permettent à des développeurs de réfléchir à des moyens innovants de les exploiter, ces derniers étant ensuite disponibles sur le site – par exemple, aider le consommateur à choisir son forfait de téléphone, à organiser ses courses. Ce projet devrait permettre une réflexion très concrète sur les moyens de mettre à disposition les données tout en les protégeant. En France, le projet MesInfos, lancé en janvier 2012 par la Fondation Internet nouvelle génération (Fing), procède de même. L’expérimentation a été lancée en 2013 et regroupe 300 testeurs volontaires. Blue Button La création d’une plate-forme sécurisée pour stocker des données personnelles n’est pas nouvelle : aux États-Unis, l’initiative Blue Button du gouvernement permet depuis fin 2010 aux bénéficiaires de Medicare et aux anciens combattants de consulter en ligne et de télécharger leur dossier médical. Ils peuvent ensuite le transmettre aux divers organismes de santé. Des développeurs en ont profité pour proposer des services utilisant ces données, comme une application de Northrop Grumman qui permet aux anciens combattants de recevoir des conseils de santé adaptés à leur dossier sur leur téléphone. De nombreux organismes de santé se sont ensuite engagés à fournir la même offre à leurs clients. L’initiative Green Button a quant à elle été lancée en janvier 2012 à l’initiative de fournisseurs (eau, électricité, gaz). Elle permet aux consommateurs de télécharger leurs informations de consommation sous un format standardisé, afin de les étudier et de les optimiser à l’aide d’applications. Trentecinq entreprises proposent actuellement ce service.www.institut-entreprise.fr 45 LES MUTATIONS À PRÉVOIR L’Open Innovation. Le big data s’inscrit dans une démarche d’innovation ouverte qui incite les organisations à collaborer avec d’autres acteurs en dehors des frontières traditionnelles de la firme sur des sujets stratégiques ou inattendus (open innovation outside-in) et à réfléchir à la valorisation des projets et des données produites sur lesquels l’entreprise n’envisage pas de capitaliser directement dans son cœur d’activité (open innovation inside-out). Les spécificités de l’open data dans les entreprises Si de nouvelles entreprises apparaissent pour exploiter les données mises à disposition par le gouvernement, pour l’instant peu d’entreprises ont adopté elles-mêmes le mouvement de l’open data en publiant certaines de leurs données en accès libre. Pourtant, elles sont productrices de données par leur activité, et souvent consommatrices de données externes qui leur permettent d’analyser l’économie ou d’échanger avec leurs partenaires (facturation, prospection). Pour elles, l’ouverture des données est plus dépendante des opportunités en termes commerciaux ou d’innovation que d’enjeux de transparence, bien que cela leur permette aussi d’améliorer leur image. L’ouverture des données peut avoir les avantages suivants pour les entreprises : à destination des collaborateurs et des individus, elle peut accélérer le développement de produits et stimuler l’innovation en créant un écosystème dynamique de partenaires tout en améliorant la satisfaction client ; à destination de concurrents, elle permet par exemple de mieux comprendre les évolutions d’un marché. Cependant, il est difficile d’évaluer les opportunités commerciales directes ou indirectes de cette démarche, ce qui ralentit les investissements privés dans la valorisation des données. À ce frein s’ajoutent l’absence de cadre juridique de référence qui établirait les engagements de l’entreprise envers les utilisateurs de 46 Faire entrer la France dans la troisième révolution industrielle : le pari de l’innovation ses données (disponibilité, qualité, sécurité) et une crainte face à l’absence de contrôle quant à la réutilisation. De plus, il n’existe pas non plus de régime juridique unifié qui définisse la propriété de ces données « privées » et, selon les contextes, le réutilisateur doit aller vérifier dans des régimes spécifiques s’il existe des clauses concernant la diffusion et la réutilisation des informations19. Enfin, pour que la démarche soit un succès, elle demande un réel investissement de l’entreprise. En effet, il n’est pas évident d’assurer la qualité des données mises à disposition : celles-ci doivent être complètes, non alté- rées, accessibles à tous aussi rapidement que possible (en temps réel à l’idéal) et exploitables facilement. Exemple : le groupe Poult prend part à un projet d’échange de données de marché avec d’autres producteurs de produits alimentaires concurrents. Ce système leur permet d’obtenir des informations de marché très précises, tout en restant semi-ouvert en étant restreint à un certain nombre de partenaires choisis. L’échange peut passer par un tiers qui regroupe les données pour plus de sécurité. Exemple : PSA a développé le service d’applications d’infodivertissement embarquées « Peugeot Connect Apps ». Les données spécifiques du véhicule ont été mises à disposition pour que des tiers puissent aussi développer des applications. Parrot, Ford et General Motors proposent des services similaires20. Exemple : les badges de télépéage commercialisés par Vinci Autoroutes contiennent des monceaux de données sur les automobilistes, la fréquence de leurs trajets ou la catégorie de leur véhicule. Ces informations sont une mine pour les partenaires commerciaux des sociétés d’autoroutes, comme les stations-service, restaurants et hôtels des aires d’autoroutes, et les villes et villages aux abords des sorties. L’utilisation de ces informations pose évidemment le problème de la protection des données personnelles, mais aussi surtout celui de la mise en place de partenariats intelligents et gagnants-gagnants. 19. Dossier de synthèse de la journée d’étude du GFII, « big data, exploiter de grands volumes de données : quels enjeux pour les acteurs du marché de l’information et de la connaissance ? », 3 juillet 2012. 20. Source : « Open Data, quels enjeux et opportunités pour l’entreprise ? », Bluenove, novembre 2011www.institut-entreprise.fr 47 « Open Innovation is the formal discipline and practice of leveraging the discoveries of unobvious others as input for the innovation process through formal and informal relationships. » Professeur Frank Piller, MIT smart customization & RWTH, Aix-la-Chapelle • La démocratisation du yield management, soit l’analyse en temps réel de la demande pour moduler des prix algorithmiques, ajuster les promotions et les approvisionnements en fonction des évolutions (notamment dans les secteurs du retail et du tourisme). Le big data, via des étiquettes électroniques, permet par exemple de faire varier les prix en quelques minutes en fonction de la taille, de la couleur, de la localisation, de la météo, des stocks, etc. Aux magasins d’adapter en temps réel leur gestion des approvisionnements et des démarques ! Les retombées du big data sur les activités de pricing peuvent être à l’origine de nouveaux modèles économiques. L’automatisation de la prise de décision L’une des richesses du big data est sa granularité : si le rendement d’une information supplémentaire est souvent rapidement décroissant21, posséder un grand nombre de données permet une analyse plus fine des sous-ensembles. Ainsi, le nombre permet de calculer un plus grand nombre de modèles. Le big data permet donc d’appréhender les hétérogénéités des ensembles, et d’ajuster l’analyse en fonction des données en temps réel pour permettre une réponse plus appropriée. L’augmentation du nombre des données analysées dans des contextes très spécifiques sous-tend une prochaine étape dans la gestion des décisions, l’évolution d’une vision stratégique d’aide à la prise de décision vers une vision tactique, l’automatisation des microdé- cisions en temps réel. Cette automatisation nécessitera le développement d’une plate-forme décisionnelle, c’est-à-dire une capacité de production de règles de décision, des moteurs d’inférence, des simulateurs, en supplé- 21. Les réponses à une question oui/non d’un échantillon non biaisé de 1 000 personnes suivent déjà une distribution à faible variance, c’est-à-dire que si l’on interrogeait un plus grand nombre de personnes, on ne gagnerait quasiment pas en précision de réponses.48 Faire entrer la France dans la troisième révolution industrielle : le pari de l’innovation ment de la plate-forme de collecte et de stockage des informations. Si ces microdécisions permettent des gains très faibles à l’unité, l’accumulation de ces gains peut justifier un tel investissement. L’automatisation des décisions et la disparition de certaines tâches routinières ne sont pas sans risques. Sans se substituer à la stratégie de moyen et long terme, les big data sont surtout utiles pour améliorer des microdécisions opé- rationnelles. De plus, des mesures de sécurité pourront être mises en place, comme la possibilité de reprendre le contrôle des décisions à tout moment22. « Managing treasury in the cloud », nouveau business model permis par les big data23 Le développement des big data s’accompagne de nouvelles opportunités de modèles d’affaires que certains ont su saisir à l’instar de Kyriba. Créée en 2000, cette entreprise commercialise des solutions d’optimisation de gestion de la trésorerie (cash management). Kyriba travaille avec plus de la moitié des entreprises du CAC 40 et emploie 200 personnes dans le monde. Sa technologie repose sur un hub de communication bancaire qui intègre et uniformise les informations recueillies quotidiennement auprès des banques. Intégrant les créances et les diverses opérations comptables, l’entreprise fournit un monitoring global mais aussi des prévisions de liquidité et des flux financiers. Aujourd’hui, Kyriba s’affirme comme un acteur incontournable du marché des services applicatifs Internet de gestion de trésorerie à la demande. En 2012, la société réalise 35 milliards de dollars de chiffre d’affaires grâce à ses 700 clients groupes, ce qui représente plus de 30 000 entités servies. Le big data est au cœur de son activité : Kyriba gère en effet un flux de 15 000 envois par seconde quand Twitter ne comptabilise « que » 5 000 tweets par seconde. Alexandre Grux, responsable de la recherche et de l’innovation de Kyriba, explique que la société met à profit le big data en utilisant à 22. Sources : « big data, small decisions et smart organization », Christophe Benavent, septembre 2012 ; « big data – un œil sur les organisations », Christophe Benavent, mai 2011. 23. Ce cas a été recueilli avec la collaboration du cabinet Oliver Wyman.www.institut-entreprise.fr 49 la fois le data mining, c’est-à-dire la collecte et l’exploration de données, et le cloud computing, permettant de grandes capacités de stockage et de calcul, à prix abordables, pour traiter les données recueillies en temps réel. Description du service Kyriba propose un outil de gestion de trésorerie. L’entreprise donne à ses clients une image consolidée de leur situation bancaire et de leurs liquidités en temps réel. Il peut être en effet complexe pour une entreprise multinationale, qui a des participations dans d’autres sociétés et parfois des milliers de comptes diffé- rents dans plusieurs devises et institutions bancaires, d’avoir une vision globale de sa situation bancaire. Et ce, plus encore en temps réel ! Alexandre Grux témoigne : « Avant, pour avoir une image consolidée de tous les comptes, les trésoriers devaient remettre à zéro les comptes tous les jours et faire converger les cash flows sur un seul compte. Ce qui revenait à faire un reporting qui pouvait prendre une semaine voire plus selon la complexité des comptes. » Kyriba a su répondre à cette problématique en s’appuyant sur la technologie du cloud computing pour automatiser la collecte des relevés de comptes auprès des différentes banques de son client et leur consolidation. Kyriba communique ensuite l’image consolidée de l’état de trésorerie à son client avec différents niveaux de droit. De plus, ces informations sont disponibles en plusieurs devises dont les cours sont mis à jour en temps réel. Parallèlement à cette offre, Kyriba a développé un panel important de services qui vont du pilotage des flux bancaires et de la liquidité de l’entreprise à des outils d’aide à la décision en passant par le contrôle des conditions bancaires. Ces services sont accessibles via un logiciel en ligne, qui n’implique aucun déploiement et ne nécessite qu’une simple connexion internet. Ce format permet à un collaborateur d’utiliser les solutions Kyriba à distance, au cours d’un voyage d’affaires par exemple. En plus de la visualisation de leur situation bancaire, l’intérêt des données collectées par Kyriba pour les entreprises clientes est double. 1) Tout d’abord, ces données ouvrent de nouvelles perspectives pour les prévisions de flux de trésorerie (cash flow). Les directeurs financiers et tré-50 Faire entrer la France dans la troisième révolution industrielle : le pari de l’innovation soriers, qui bénéficient désormais d’une image quotidienne et précise de leurs comptes, pourraient intégrer les données de la trésorerie dans l’élaboration d’un plan stratégique à trois ans aux côtés des données traditionnellement prises en compte comme les ventes. 2) Dans un second temps, les clients pourraient bénéficier des résultats des recherches et des analyses faites par Kyriba à partir des données collectées. En effet, grâce aux clauses de confidentialité, Kyriba peut exploiter les données des clients et mettre son expertise à leur service en leur proposant par exemple de nouveaux indicateurs clés de performance pour piloter leur activité. Enjeux Si Kyriba est désormais leader dans son domaine, les défis auxquels l’entreprise doit faire face sont nombreux. Ces derniers sont liés aux risques traditionnels de la démarche big data : réticences des clients, nécessaire acquisition de nouvelles compétences, rôle ambigu de l’État. L’enjeu du big data est avant tout celui de la sécurisation et de la protection des données. Il s’agit donc d’identifier les risques liés aux données collectées et de mettre en place des solutions adaptées en fonction des supports utilisés (serveurs, ordinateurs personnels, mobiles, tablettes) ; leur démultiplication augmentant les risques d’infractions. Alexandre Grux explique que Kyriba possède ses propres serveurs de stockage et en assure la sécurité. Les données sont systématiquement dupliquées pour assurer une continuité d’activité en cas de panne. Kyriba doit également faire face à certaines réticences de la part de ses clients. La société a mené une enquête auprès de ses clients qui révèle que l’appétence pour les solutions informatiques chez les trésoriers est faible. Nombre de clients voient cette utilisation des données d’un mauvais œil, même si celle-ci est faite dans le cadre d’un accord de confidentialité : « Le client peut nous reprocher de faire du business avec ses données et cela même si on lui propose le service gratuitement », raconte Alexandre Grux. Proposer aux clients des améliorations sur leur pilotage financier à partir de l’analyse de leurs données, comme un nouveau KPI, se révèle encore délicat www.institut-entreprise.fr 51 pour Kyriba. L’entreprise doit donc développer des solutions simples et intuitives pour pallier cette difficulté. Il faut informer les dirigeants d’entreprise et leur faire prendre conscience des bénéfices liés à l’ouverture de leurs données dans un cadre légal bien défini. Une évolution de la culture d’entreprise, traditionnellement attachée au culte du secret, est nécessaire. Pour développer son offre, Kyriba doit recruter des collaborateurs compé- tents pour mettre en place des services liés aux big data. L’entreprise peine à trouver des profils à l’aise avec ces enjeux et capables de prendre des initiatives dans l’exploitation de données qui pourraient potentiellement générer de nouveaux services. Cette pénurie s’explique selon Alexandre Grux par une forte demande de telles compétences mais aussi par leur rareté. La formation universitaire doit donc évoluer pour s’adapter à cette nouvelle demande sur le marché de l’emploi. Enfin, Kyriba se doit de composer avec l’État dont la position vis-à-vis du big data est ambiguë. D’une part, l’État a lancé Etalab, une mission qui vise à mettre à la disposition de tous des informations publiques, exception faite des données à caractère personnel protégées par un droit de propriété intellectuelle ou de celles mettant en jeu la sécurité publique. En combinant ces données publiques avec celles dont l’entreprise dispose, Kyriba pourrait imaginer d’autres modèles d’affaires. L’État est donc source de nouvelles opportunités. D’autre part, il tient un discours souvent alarmiste sur la protection des données. L’État n’a pas encore différencié de façon claire les données individus des données entreprises, ni statué sur leur protection et utilisation respective, ce qui constitue un frein au développement des socié- tés dont l’activité est basée sur le big data telles que Kyriba. • L’avènement du développement durable : le big data constitue une source privilégiée d’optimisation de l’exploitation et de la consommation des ressources limitées (cf. la note de l’Institut de l’entreprise sur l’efficacité énergétique), même si le big data est lui aussi un grand consommateur d’énergie. Exemple : entre 20 % et 30 % de la consommation en eau est perdue, par fuite ou par gaspillage. L’introduction de capteurs embarqués dans des 52 Faire entrer la France dans la troisième révolution industrielle : le pari de l’innovation compteurs intelligents (cf. smart grids), tant sur les réseaux qu’au niveau des foyers, permet ainsi de récolter l’information en permanence et d’être potentiellement alerté en temps réel lors d’une consommation qui dévie de la norme, par exemple au travers d’une application mobile. Exemple : les data centers consomment énormément d’énergie pour refroidir leurs serveurs. Pour renverser cette logique, l’entreprise Qarnot Computing fabrique des radiateurs numériques qui contiennent des processeurs et se branchent simplement sur les prises internet. L’entreprise chauffe ainsi gratuitement des logements ou bureaux et vend la capacité de calcul nécessaire pour atteindre la température voulue par l’usager. Une centaine de logements seront équipés de ces radiateurs de calcul d’ici fin 2013. • L’essor des smart objects et des smart services : la mise en place de nouveaux produits, services et processus connectés, « intelligents ». Exemple : Sanofi propose en France depuis 2011 un lecteur de glycémie connecté, l’iBGStar, qui permet à la personne souffrant de diabète de mesurer son taux de sucre dans le sang, de l’enregistrer et de communiquer ses données en temps réel à son médecin. Cette application s’inscrit dans un projet plus large de Sanofi, Diabeo, solution de télémédecine innovante pour accompagner les patients diabétiques et les professionnels de santé dans une prise en charge globale. Le traitement du diabète nécessite de la part du patient un ensemble d’aménagements qui vont de la connaissance de la maladie et de son traitement à des compétences d’auto-observation, d’autosurveillance et d’autoadaptation du traitement en fonction des circonstances mêmes de sa vie. Pour l’aider dans cet effort, une application simple à utiliser au quotidien (pas de calculs, pas de retranscription papier, nombre limité d’alertes au patient et au médecin) a été développée pour automatiser une partie de la prise de décision. En identifiant à distance les patients en difficulté, ceci permet aussi de mieux utiliser le « temps médecin » et de personnaliser la prise en charge (ex. : adapter la fréquence des consultations plutôt que de décréter obligatoire une visite de contrôle tous les six mois).www.institut-entreprise.fr 53 Exemple : la nouvelle proposition de valeur faite par Lectra, numéro un mondial des solutions technologiques intégrées (logiciels, équipements de CFAO et services associés), à ses clients (entreprises qui utilisent des textiles, du cuir, des tissus industriels ou des matériaux composites dans la réalisation de leurs produits), grâce aux smart services, est l’application du concept de lean manufacturing (amélioration continue et réduction du gaspillage), issu de l’industrie automobile japonaise, à la salle de découpe. Les machines intelligentes de Lectra permettent d’optimiser et de sécuriser l’ensemble des opérations de production liées à l’activité de découpe automatique, quels que soient les besoins de production (de masse, diversifiée, petites et moyennes séries), grâce à un système de diagnostic et d’analyse en temps réel de la consommation de matière. Les experts des call centers internationaux de Lectra peuvent intervenir à distance en cas de problème ou pour former et conseiller les utilisateurs chez les clients, qui réalisent des économies significatives en termes de délai de fabrication et de consommation de matière, accélérant ainsi la mise sur le marché de leurs produits. Exemple : les vêtements « intelligents ». Le projet européen « EASY-IMP – Développement collaboratif de produits portatifs et intelligents dans le cloud » a été lancé à la mi-septembre au Centre allemand de recherche sur l’intelligence artificielle (DFKI) de Kaiserslautern (Rhénanie-Palatinat). Financé sur trois ans à hauteur de 4,4 millions d’euros, ce projet met en place une équipe interdisciplinaire d’experts de différents domaines : capteurs, informatique, programmation, biomécanique, rééducation et sport. Douze partenaires académiques et industriels prennent part au projet, notamment l’université Lumière Lyon-II pour la partie française. Un exemple typique d’application est le smartphone, qui propose une plate-forme à partir de laquelle différentes applications peuvent être personnalisées. Dans le cadre du projet, ce concept serait appliqué aux vêtements. Par l’intégration de capteurs, de nouveaux produits pourront être conçus. On peut imaginer la configuration d’un vêtement, grâce au smartphone, de manière à enregistrer les signaux vitaux d’un patient, pour son entraînement sportif ou dans le cadre d’une rééducation. Grâce à leurs capteurs, ces vêtements seraient ainsi capables de mesurer la respiration, le rythme cardiaque, mais aussi le nombre de calories brûlées, l’état émotionnel, ou encore, de manière plus classique, le nombre de pas effectués ou l’activité physique.54 Faire entrer la France dans la troisième révolution industrielle : le pari de l’innovation • D’autres tendances importantes se dessinent avec l’avènement du big data, comme la big research, qui risque de transformer les pratiques scientifiques toutes disciplines confondues, de la biologie à la sociologie, ou encore la big creativity, qui démultiplie les occasions de faire des ponts inattendus entre différentes idées, personnes ou faits, et dope ainsi la capacité d’innovation des organisations. « Les nouvelles technologies nous ont condamnés à devenir intelligents et imaginatifs car c’est tout ce qui nous restera. » Michel Serres Le big data, la révolution de l’assurance Le principe des assurances est de partager un risque à l’intérieur d’un groupe. Son fonctionnement est assuré par des systèmes probabilistes, qui permettent d’affecter un prix « juste » aux risques assumés. Cependant, ce principe ne peut fonctionner qu’avec une évaluation imparfaite du risque, tout au moins à l’échelle individuelle : les mouvements d’ensemble doivent être aussi bien évalués que possible, mais les risques individuels doivent rester flous, sans quoi l’individu n’a plus intérêt à la mutualisation. Impact sur l’efficacité commerciale La collecte et le traitement de données de plus en plus nombreuses permettent aux compagnies d’assurances d’améliorer leur efficacité commerciale, en assurant : • De nouvelles méthodes de segmentation, et donc de tarification. • Des créations de produits plus efficaces (meilleure étude de marché, tarification). • Une connaissance précise des habitudes des clients, d’où une meilleure gestion des campagnes publicitaires ou de prévention et du service personnalisé au client. • Une limitation du risque de fraude à l’assurance. • Une meilleure gestion des sinistres.www.institut-entreprise.fr 55 L’impact des données individualisées sur l’actuariat Pour certains, les nouvelles connaissances issues du big data affectent l’économie des assurances et mettent en péril son fonctionnement même : trop d’informations conduit à une sélection forte et peut détruire la mutualisation. Néanmoins, d’autres opinions moins pessimistes ne voient dans le big data qu’un nouvel outil puissant pour les actuaires, du moment qu’il respecte les normes éthiques sur l’anonymat des données : l’anonymisation des données sera un enjeu d’équilibre. Le big data pourrait aussi améliorer la qualité de l’actuariat : l’actuaire serait « un certificateur de la qualité, de la pertinence des données, et un vérificateur de leur usage24 », et l’augmentation de la démutualisation pourrait supprimer les « bon risques », assurés pour l’instant à prix élevés. Les réglementations dans l’usage du big data Les systèmes d’assurance sont soumis à de nombreuses réglementations25 ; l’utilisation des données personnelles est soumise au contrôle des individus et la segmentation des assurances est limitée par la protection contre les discriminations : ces considérations éthiques limitent l’utilisation des données personnelles et l’étendue de l’impact du big data sur les systèmes assurantiels26. De nouveaux acteurs dans la collecte de données L’abondance et la qualité des données étant des facteurs de différenciation compétitive pour les assureurs, à l’ère du big data, un nouveau rapport de force s’établit entre les compagnies d’assurances et les fournisseurs de données. Ces derniers sont en position de pouvoir pour capter une part importante de la valeur des données ; ils pourraient aussi eux-mêmes devenir assureurs grâce à l’avantage compétitif que leur confère l’exclusivité de leurs données. 24. Patrick Tourot, François Ewald, « big data, défis et opportunités pour les assureurs », Banque & Stratégie, no 315, juin 2013. 25. Le droit du contrat d’assurance, le droit des sociétés et le droit de la santé et de la Sécurité sociale. L’utilisation des données est notamment soumise au respect des libertés publiques (CNIL), du droit pénal (les discriminations), du droit communautaire et des règles européennes et internationales (ONU). 26. « big data, défis et opportunités pour les assureurs », art. cit.56 Faire entrer la France dans la troisième révolution industrielle : le pari de l’innovation PISTES DE RECOMMANDATIONS Afin de tirer tous les bénéfices de la révolution qu’est le big data, il est important que les pouvoirs publics, en partenariat avec les acteurs télécom, s’inté- ressent à l’attractivité numérique des territoires et cherchent à déployer l’ultrahaut débit fixe et mobile, en généralisant par exemple la 4G et en assurant une couverture Wi-Fi optimale, même dans les transports (train, avion, métro). Toutefois, les effets sur la santé des ondes électromagnétiques, bien que non avérés scientifiquement27, restent un sujet de préoccupation pour une partie de l’opinion publique qui doit être pris en compte. Les freins au développement du big data doivent être bien identifiés. Les freins inhérents au big data ont été cités plus haut : pour les entreprises, l’évaluation des apports du big data et le soutien de la direction générale, la nécessaire et coûteuse mise en place d’un département de data scientists, la mise à niveau des compétences, ainsi qu’une attention particulière portée à la sécurité, à la disponibilité, à l’accessibilité et à la confidentialité des données. Certains de ces enjeux concernent aussi les pouvoirs publics, comme les risques pour la vie privée, la formation, l’établissement de normes et de standards, et enfin l’éventuelle utilisation à mauvais escient d’analyses prédictives. Des freins plus génériques s’opposent aussi à certains développements : des freins liés aux spécificités des tissus économiques nationaux et à l’autonomie 27. L’Agence nationale de sécurité sanitaire de l’alimentation, de l’environnement et du travail (Anses) a ainsi rendu public en octobre 2013 un avis sur les effets des ondes électromagnétiques sur la santé. À la lumière de plus de 300 études scientifiques internationales publiées depuis 2009, l’Anses ne conclut pas à un « effet sanitaire avéré chez l’homme » et ne propose donc pas de « nouvelles valeurs limites d’exposition de la population ». Elle constate toutefois certains effets biologiques chez l’homme et chez l’animal – cassures de l’ADN, stress oxydatif susceptible d’altérer les cellules –, modifications qui « semblent être rapidement réparées ».www.institut-entreprise.fr 57 de décision dont disposent les managers de terrain28 ; des freins d’ordre réglementaire, ou inhérents aux politiques de protection des consommateurs29. Des freins fiscaux peuvent aussi émerger : conscients de la valeur de leurs actifs, certains détenteurs de big data pourront décider de ne pas autoriser l’accès à leurs données à des tiers, limitant ainsi les possibilités de croisements qui sont le vecteur de la création de richesses. Enfin, la concurrence déloyale du secteur public, qui détient d’importants gisements de données et peut être tenté d’en restreindre l’accès, pourrait ralentir le développement de start-up de valorisation des données. Propositions Deux lignes directrices peuvent être distinguées concernant le développement du big data. Premièrement, il importe de mettre le client ou l’usager au centre des politiques de soutien public au big data. Le big data bénéficie en France d’une attention soutenue des pouvoirs publics. Le rapport Lauvergeon identifie ainsi le big data comme l’un des sept domaines d’innovation que la France se soit de soutenir, et c’est l’une des 34 filières de la Nouvelle France Industrielle. Par ailleurs, le ministère de l’Innovation et de l’Economie numérique a annoncé en juin 2013 un plan de soutien à la filière du big data, inspiré des recommandations de l’Afdel (association française des éditeurs de logiciels et solutions internet). Dans le cadre des investissements d’avenir, plusieurs projets traitant des big data ont aussi été sélectionnés pour recevoir des financements. Si cette attention est évidemment bienvenue, le risque est toutefois que les pouvoirs publics n’envisagent le déploiement du big data que sous le seul angle de la technologie, quant ce sont les usages qui importent réellement. 28. Cette autonomie varie fortement selon les entreprises. Or, pour que le big data prenne toute sa mesure, les managers de terrain doivent se voir accorder suffisamment d’autonomie. « Le big data nécessite donc le développement de nouvelles compétences, et sans doute plus encore un véritable empowerment des unités opérationnelles : plus de données, plus de contexte dans les modèles et les indicateurs, donc plus d’autonomie dans la décision » (http://technologies.lesechos.fr/businessintelligence/big-data-c-est-le-chef-de-rayon-qu-il-faut-former_a-41-506.html). 29. Le rapport de la mission gouvernementale concernant la fiscalité numérique a été rendu public le 18 janvier 2013. Il préconise de taxer les entreprises en fonction du volume de données personnelles qu’elles collectent et exploitent, ainsi que du respect des libertés individuelles, et notamment du degré d’accès des utilisateurs aux données collectées.58 Faire entrer la France dans la troisième révolution industrielle : le pari de l’innovation Par ailleurs, il est nécessaire d’envisager le potentiel du big data dans toutes les filières. Les initiatives gouvernementales font souvent l’erreur d’identifier le big data comme une filière en soi. Au contraire, le big data est source d’innovation dans tous les secteurs d’activité, et il faudrait l’intégrer systé- matiquement dans les politiques d’innovation. Entreprises a) Développer une culture de la donnée dans les entreprises Le développement du big data nécessite le soutien de la direction générale, qui doit se traduire par la nécessaire et coûteuse mise en place d’un département de data scientists dépendant de la direction, mais aussi par la mise à niveau des compétences de l’ensemble des salariés. Il importe pour l’entreprise de comprendre que les données ne sont pas seulement l’affaire des spécialistes, mais celle de tous, et que les pratiques de chaque salarié s’en trouveront modifiées. Pour développer une culture de la donnée dans l’entreprise, il faut donc s’interroger sur les moyens de capter, conserver et stocker les données, et développer ces moyens en conséquence. b) Donner davantage d’autonomie de décision aux managers de terrain Cette autonomie varie fortement selon les entreprises. Or pour que le big data prenne toute sa mesure, et que les données disponibles soient comprises mais aussi débouchent sur des actions, les managers de terrain doivent se voir accorder suffisamment d’autonomie. Puissance publique a) Repenser la protection des données personnelles La loi informatique et libertés de 1978 protège des dangers liés à l’exploitation de données personnelles, mais toutes les nouvelles « data breach » www.institut-entreprise.fr 59 pourraient ne pas être toutes prises en compte à temps. Une politique de la donnée semble nécessaire aussi bien dans les entreprises qu’au niveau des pouvoirs publics. La propriété intellectuelle, les politiques de réutilisation des données, l’utilisation secondaire des données générant en général davantage de valeur que l’utilisation primaire, les droits d’accès et de rectification des utilisateurs, la durée de conservation des données, autant d’exemples de mesures auxquelles les responsables nationaux se doivent de réfléchir, tout en veillant à ne pas couper court à l’innovation promise par le big data. Pour autant, la protection par la réglementation reste souvent perçue comme une contrainte, parfois à cause du retard du droit par rapport aux évolutions technologiques, tandis que la définition d’un levier punitif est malaisée puisque les données n’ont pas de valeur intrinsèque. De plus, certains pré- disent des pressions croissantes, de la part de certaines entreprises et de la société, contre les mouvements de protection des données. 1. Instaurer un droit à l’expérimentation qui permette de déroger aux règles actuelles en matière de protection des données personnelles Aujourd’hui, la France manque d’un cadre conceptuel pour faire face au développement du big data. Elle hérite d’une réglementation sur les données personnelles excessivement restrictive qui pénalise le déploiement de nouvelles applications. Comme le suggère le rapport Lauvergeon, on pourrait imaginer la consécration d’un droit à l’expérimentation, sous l’égide « d’un observatoire des données ». Il s’agirait d’évaluer l’efficacité et le bien-fondé de certaines pratiques permettant l’exploitation des données, avant de réfléchir à un possible encadrement législatif. 2. Responsabiliser et encadrer Afin de garantir la transparence de l’utilisation des données personnelles par les entreprises et les administrations, on pourrait former des tiers-certificateurs qui appliqueraient un système de labellisation, 60 Faire entrer la France dans la troisième révolution industrielle : le pari de l’innovation imposer davantage de transparence sur les brèches de sécurité et soumettre entreprises et administrations à des « audits d’algorithmes ». Le projet de règlement européen en cours d’adoption vise aussi à imposer diverses obligations aux responsables de traitement informatique, comme celle de prendre en compte la protection des données dès la conception des systèmes (privacy by design). 3. « Empowerment » et transparence Afin de réduire l’asymétrie d’information entre les institutions et les individus, on pourrait créer une plate-forme d’accès individuel à ses données personnelles. On pourrait par ailleurs développer un système d’assurance pour éviter et ensuite résoudre les problèmes d’utilisations abusives des données. 4. Adapter la réglementation et les normes « À l’international, l’UE reste perçue comme un territoire offrant un haut niveau de protection pour les données », ce qui pour certains lui procurerait un « avantage compétitif ». 30 Ainsi il faudra adapter la réglementation tout en conservant ce haut niveau de protection. La définition de « donnée personnelle » nécessite d’être revue, l’anonymisation 31 des données rencontrant aujourd’hui ses limites. D’une part, en effet, l’anonymisation parfaite rend les données quasiment muettes, donc inintéressantes, d’où l’utilisation croissante de bases de données anonymisées relativement. D’autre part, de nouvelles technologies permettent aujourd’hui de réidentifier des données au départ anonymes en agrégeant plusieurs jeux de données. C’est ce que l’on nomme des inference attacks. 30. Compte-rendu: « Midis du GFII», Déjeuner-débat du 22 mai 2012 atour d’Isabelle Falque-Pierrotin, présidente de la CNIL 31. Selon la CNIL, l’anonymisation des données consiste dans la suppression de tout lien entre une donnée et une personne physique.www.institut-entreprise.fr 61 De nombreuses discussions sont aujourd’hui en cours au sein de l’UE pour définir un nouveau statut de la donnée qui soit intermédiaire entre la donnée totalement anonymisée et la donnée personnelle identifiante. Cela permettrait une réutilisation plus simple des données, tout en préservant leur lien avec une personne physique. En parallèle, la CNIL envisage la définition de nouveaux droits32 : droit à la personnalité, droit à l’oubli33, à la mémoire, à la portabilité des données, à un environnement non pollué par la publicité numérique, et au refus du profilage. De plus, il faudrait définir des normes internationales, autant pour encadrer les échanges que pour s’accorder sur la gestion du réseau internet qui constitue un bien commun international, un « global networked commons »34. b) Ouvrir les données publiques pour permettre l’essor de nouveaux business models dans le domaine de la protection sociale Le sujet de l’open data, lié à celui du big data, concerne en premier lieu les administrations publiques (obligation légale35) qui ouvrent les données qu’elles produisent dans le cadre de leur activité quotidienne (fonds de cartes, statistiques, mesures, horaires, dépenses). Lancée depuis les années 2000, cette dynamique de mise à disposition des données numé- riques accessibles en ligne, sous des formats ouverts et exploitables, accompagnées de licences, autorise la réutilisation des données par tous. 32. Vie privée à l’horizon 2020, 2012. 33. Une charte du droit à l’oubli numérique intitulée Droit à l’oubli numérique dans les sites collaboratifs et les moteurs de recherche a été signée par les représentants du secteur et des acteurs de la société civile sous l’égide du Secrétariat d’Etat à la prospective et au développement de l’économie numérique le 13 octobre 2010. Ni Google ni Facebook n’ont signé cette charte (http://www.alain-bensoussan.com/ avocats/charte-droit-a-loubli-numerique-dans-les-reseaux-sociaux/2010/10/30). 34. “Data, data everywhere, a special report on managing information”, The Economist, février 2010. 35. Pour les données publiques, le principe de « disponibilité » est inscrit dans la loi depuis 1978, auquel s’ajoute le principe de « réutilisation » (décret du 30 déc. 2005, en transposition de la Directive européenne 2003/98/CE) et le principe de « gratuité » (décret du 26 mai 2011 et circulaire du 26 mai 2011).62 Faire entrer la France dans la troisième révolution industrielle : le pari de l’innovation Pourtant, la France est à la traîne en matière d’ouverture des données publiques. Le rythme de diffusion de ces dernières dépend en effet entièrement des autorités publiques : il n’existe pas à l’heure actuelle de droit « opposable » à l’open data. Mais la retranscription en 2015 dans le droit français de la directive européenne de 2003 sur les informations publiques devrait permettre de modifier cet état de fait. Ce texte réaffirmera un certain nombre de grands principes, notamment ceux de la gratuité des données et du droit à la réutilisation, étendant le périmètre à toutes les données publiques, et pas seulement à celles ayant déjà été publiées. La directive doit également évoquer un droit opposable à la publication, mais encore imparfait. Celui-ci obligerait les administrations à publier toutes les données demandées par les citoyens. Axelle Lemaire, secrétaire d’Etat au numérique, a par ailleurs conclu les deux jours de débats de la Conférence de Paris sur l’open data et le gouvernement ouvert organisée par Etalab fin avril en faisant part de la volonté du gouvernement d’aller « plus loin, en matière d’ouverture et d’accessibilité », et en expliquant que la transposition de la directive offrait « un cadre juridique et une opportunité majeure d’évolution ». Elle a indiqué souhaiter que soit inscrite dans la loi, à cette occasion, le principe d’une ouverture par défaut des données publiques, et que toute fermeture soit explicitement expliquée, justifiée et réversible36. Cette ouverture serait particulièrement heureuse au vu des applications prometteuses liées au big data dans le domaine de la santé et de la protection sociale37. L’industrie de la santé se fonde sur quatre sources de données : les données de R&D d’entreprises pharmaceutiques ou académiques (essais cliniques par exemple) ; les données cliniques d’hôpitaux (dossiers médicaux électroniques) ; les rapports d’activité et les données de coûts 36 Ces déclarations rejoignent les propositions de l’Institut de l’entreprise 37. Voir notamment le Rapport sur la gouvernance et l’utilisation des données de santé, octobre 2013. http://www.sante.gouv.fr/IMG/pdf/Gouvernance_et_utilisation_des_donnees_de_sante_ septembre_2013.pdf. Le rapport Lauvergeon propose par ailleurs de lancer des programmes de valorisation par licence de cinq « stocks » de données massives dont l’analyse pourra apporter une plus-value à l’ensemble de la société : Pôle emploi, Sécurité sociale, éducation nationale, enseignement supérieur et aides à la valorisation du patrimoine touristique.www.institut-entreprise.fr 63 (données des caisses d’assurances maladies) ; le comportement des patients, données détenues par divers acteurs, en dehors de l’industrie de la santé, voire par le patient directement (préférences du consommateur, historique d’achats). Or les innovations issues de l’exploitation de ces données sont fondamentales. Elles permettraient d’évoluer vers une prévention plus ciblée, de mettre en place des soins appropriés tendant vers la médecine personnalisée, d’optimiser le médicament pour obtenir l’impact clinique attendu, de réduire les coûts pour une qualité de soin égale ou supérieure et enfin de favoriser la sécurité. Aux États-Unis, l’impact du big data sur la réduction des coûts de santé serait de l’ordre de 300 à 450 milliards de dollars (jusqu’à 17 % de baisse), principalement grâce à la prévention et à la médecine personnalisée. Il subsiste toutefois des obstacles soit techniques, soit liés à la propriété des données. Ainsi, si les deux premières sources de données sont en passe d’être ouvertes du fait de la demande de la puissance publique, cette dernière ne semble pas encore disposée à ouvrir ses propres données et celles des patients. Or il semble difficile de demander de tels efforts à l’industrie pharmaceutique si l’État ne prend pas sa part dans la démarche. c) Améliorer les procédures d’appels d’offres liés à une innovation dans les données Il pourrait être pertinent de diviser les procédures d’appel d’offres en plusieurs marchés distincts de taille plus petite. Ainsi, les petites entreprises - qui participent souvent aux procédures d’appels d’offres en tant que sous traitants de grandes entreprises - seraient moins dépendantes des grandes et pourraient participer aux programmes de marchés publics. Ces appels d’offres pourraient aussi mettre davantage l’accent sur l’utilisation de certaines méthodes ou procédés. Il s’agirait d’obliger les grandes entreprises à adopter et inclure la contribution d’une petite entreprise innovante dans leurs propositions lors d’une procédure d’appel d’offres. 64 Faire entrer la France dans la troisième révolution industrielle : le pari de l’innovation d) Développer des formations adaptées, en utilisant le potentiel démultiplicateur de l’enseignement en ligne Pour que les besoins des entreprises en spécialistes du big data soient comblés, il faut promouvoir l’enseignement supérieur en mathématiques, en technologie de l’information et en sciences. La formation continue doit également être encouragée. Cela permettrait aux individus de mettre à jour les compétences nécessaires pour l’analyse de données. De nouvelles compétences et de nouveaux profils sont indispensables à l’essor du big data. Les politiques publiques de formation devront donc s’adapter aux nouveaux besoins en la matière et accélérer la diffusion de profils de type « data scientists », alliant compétences techniques et managériales. Ces compétences croisées sont encore très rares aujourd’hui alors qu’elles sont cruciales pour imaginer les nouveaux business models issus des big data. Henri Verdier expliquait néanmoins que la France disposait « de très bons designers pour inventer de nouveaux modes de visualisation et [d’] une école mathématique de premier plan mondial »38. Selon le ministère de l’innovation et de l’économie numérique, on estimait début 2014 à 300 000 le nombre de data scientists nécessaires à l’Europe dans les années à venir. Cela implique de mettre en place dès aujourd’hui des filières de formation adaptées à ces profils. À ce jour, il existe encore peu de formations françaises en ce domaine : le Mastère Spécialisé « big data : gestion et analyse des données massives (BGD) » de Telecom ParisTech, a ouvert à la rentrée 2013, un Mastère Spécialisé en big data a été lancé par l’Ensimag (Grenoble INP) et l’EMSI Grenoble (GEM) pour la rentrée 2014. Par comparaison, plus d’une vingtaine d’universités américaines ont lancé ou devraient lancer des formations big data. L’Université Columbia (New York) a ainsi créé au sein de l’IDSE (Institute for Data Sciences and Engineering) un nouveau diplôme intitulé « Certification of Professional achievement in Data Sciences ». Ce programme, ouvert dès l’automne 2013, propose 4 matières principales : probabilités et statistiques, algorithmes pour big data, machine learning et exploration des données. L’Université de 38. «Quand ‘big data’ rime avec ‘big business’», Les Echos du 20 Mars 2012.www.institut-entreprise.fr 65 Stanford délivre quant à elle un cours en ligne depuis 2013 orienté vers les big data : « Mining Massive Data Sets ». Pour toucher davantage de personnes, on pourrait envisager de développer un MOOC français sur le sujet, sur la plateforme FUN lancée par le ministère de l’enseignement supérieur et de la recherche. Ce MOOC pourrait être sponsorisé par des entreprises. Cette formation pourrait valoir aussi pour le service public lui-même, où la présence de data scientists aiderait à valoriser les données publiques. e) Diffuser une « culture de la donnée » Pour ce faire, la culture de la donnée doit être diffusée dès la période de formation. Le renforcement d’une « culture quantitative » serait nécessaire dans les programmes de formation commerciale et marketing, afin que les futurs managers sachent interpréter les résultats des modélisations et comprendre le sens caché des données. La CNIL est à l’origine depuis l’été 2013 d’un collectif visant à déclarer l’éducation au numérique cause nationale. La révolution big data implique selon elle que chacun devienne un véritable « citoyen numérique », à la fois acteur informé et responsable du numérique, capable d’exercer de manière effective ses droits et devoirs dans cet univers. f) Repenser l’encadrement du risque De nouvelles formes d’expertises et d’institutions seront probablement nécessaires pour encadrer la révolution du big data, dont l’ampleur dépasse la compréhension humaine ordinaire et heurte notre besoin d’« explicabilité » selon le terme utilisé dans le domaine de l’intelligence artificielle. Alors qu’il permet de mieux tracer et cibler les usagers et consommateurs, le big data peut être perçu comme une « boîte noire » peu exploitable et inspirant la méfiance. Mayer-Schönberger et Cukier39 en appellent ainsi dans leur livre big data: A Revolution That Will Transform How We Live, 39. http://blogs.lesechos.fr/internetactu-net/comment-les-big-data-vont-transformer-notresociete-a13014.html66 Faire entrer la France dans la troisième révolution industrielle : le pari de l’innovation Work, and Think à la naissance d’“algorithmistes”, spécialistes capables de comprendre les données pour contrôler les entreprises de l’extérieur comme de l’intérieur – « tout comme les entreprises disposent en interne de comptables et d’auditeurs externes pour surveiller leurs comptes.» Car les auteurs rappellent que les chiffres ne sont pas infaillibles, qu’ils peuvent être manipulés, mal analysés ou utilisés à tort. Il existe selon eux un risque de discrimination et de catégorisation des populations auquel les pouvoirs publics devraient prêter la plus grande attention pour préserver les principes du libre arbitre.www.institut-entreprise.fr 67 L’OBSERVATOIRE DE L’INNOVATION LE PRÉSIDENT Christophe de Maistre est Président de l’Observatoire de l’Innovation de l’Institut de l’entreprise. Président de Siemens France, Christophe de Maistre est diplômé de l’école d’ingénieur Institut Supérieur de Mécanique de Paris. Il a obtenu un D.E.A. de l’Ecole Normale Supérieure de Cachan et un eMBA (Duke University). Christophe de Maistre intègre le Groupe Siemens en 1991 où il occupe diverses fonctions marketing en Allemagne et en France avant d’être nommé General Manager Automation & Drives Electrical Technologies de Siemens Ltd China (1998/2002). Il est ensuite successivement Corporate Account Manager Group de Siemens AG pour les Groupes de Distribution REXEL et SONEPAR (2002/2005), General Manager A&D Low Voltage (Systèmes & Produits) de Siemens Ltd China (2005/2008) et, enfin, Senior Vice-President Siemens Building Technology North-East Asia (2008/2010). Début 2011, Christophe de Maistre est nommé président de Siemens France. Il a exercé également les fonctions de Président Europe Sud et Ouest de Siemens entre 2011 et 2013. LE PILOTE Delphine Manceau est Pilote de l’Observatoire de l’Innovation de l’Institut de l’entreprise. Professeur à ESCP Europe, elle y a fondé l’Institut pour l’innovation et la Compétitivité i7 qui analyse les nouvelles pratiques d’innovation des entreprises. Elle est aujourd’hui Directrice Europe de la Division Corporate de ESCP Europe qui rassemble 68 Faire entrer la France dans la troisième révolution industrielle : le pari de l’innovation les activités de formation continue (programmes sur mesure et sur catalogue), l’Executive MBA et les relations avec les entreprises. Spécialiste de marketing et d’innovation, elle a réalisé en 2009 avec Pascal Morand le rapport Pour une nouvelle vision de l’innovation commandé par Christine Lagarde, alors Ministre de l’Economie, de l’Industrie et de l’Emploi, sur la capacité d’innovation des entreprises françaises et européennes. Elle est également l’auteur de l’ouvrage de référence Marketing Management avec Philip Kotler et Kevin Keller et de Marketing de l’innovation (avec Emmanuelle Le Nagard). Titulaire d’un doctorat en sciences de gestion et du diplôme d’habilitation à diriger des recherches, elle a été Senior Fellow à la Wharton School (University of Pennsylavania). Elle a également occupé les fonctions de Directeur académique de ESCP Europe et de Directeur du programme Master in Management Grande Ecole entre 2005 et 2008. LE RAPPORTEUR Julie Fabbri est Rapporteur de l’Observatoire de l’Innovation de l’Institut de l’entreprise. Secrétaire Générale de l’Institut pour l’Innovation et la Compétitivité i7 de ESCP Europe depuis 2011, elle organise et coordonne les événements et travaux de recherche d’i7 sur les nouvelles pratiques d’innovation des entreprises. Diplômée de ESCP Europe (Master in Management) et titulaire d’un Master Recherche en Gestion et Dynamique des Organisations de l’Université Paris X Nanterre, elle est aujourd’hui doctorante au Centre de Recherche en Gestion de l’Ecole Polytechnique (CRG) où elle s’intéresse au rôle de l’espace physique de travail et des tiers lieux (espaces de coworking, fab lab) dans les processus d’innovation de petites entreprises et d’entrepreneurs69 www.institut-entreprise.fr Toutes nos publications sont téléchargeables sur notre site internet : www.institut-entreprise.fr LES DERNIÈRES PUBLICATIONS DE L’INSTITUT DE L’ENTREPRISE Les réseaux sociaux d’entreprises : entre promesses et illusions Par Denis Moneuse (avril 2014) Royaume-Uni, l’autre modèle ? La Big Society de David Cameron et ses enseignements pour la France Par Eudoxe Denis avec Laetitia Strauch (mars 2014) Assurance chômage : six enjeux pour une négociation Par Bruno Coquet (janvier 2014) Smart Cities. Efficace, innovante, participative  : comment rendre la ville plus intelligente ? Par l’Institut de l’entreprise (novembre 2013) Entreprises et territoires : pour en finir avec l’ignorance mutuelle Par l’Institut de l’entreprise (octobre 2013) Mettre enfin la fiscalité au service de la croissance Par l’Institut de l’entreprise et l’Institut Montaigne (septembre 2013) Réformer vraiment la formation professionnelle Par Jacques Barthélémy et Gilbert Cette (septembre 2013) Allemagne : miracle de l’emploi ou désastre social ? Par Alain Fabre (septembre 2013) Service public 2.0 Par Elisabeth Lulin (juillet 2013)Créé en 1975, l’Institut de l’entreprise est un think tank indépendant de tout mandat syndical ou politique. Association à but non lucratif, l’Institut de l’entreprise a une triple vocation : être un centre de réflexion, un lieu de rencontre et un pôle de formation. Profondément ancré dans la réalité économique, il concentre ses activités sur la relation entre l’entreprise et son environnement. L’Institut de l’entreprise réunit plus de 130 adhérents (grandes entreprises privées et publiques, fédérations professionnelles et organismes consulaires, institutions acadé- miques, associations…). Ses financements sont exclusivement privés, aucune contribution n’excédant 2% du budget annuel. THINK TANK •La réflexion de l’Institut de l’entreprise s’organise autour de 5 thématiques prioritaires : compétitivité et innovation, emploi et prospective sociale, management, finances publiques et réforme de l’action publique. •Dans cette réflexion, la vision de l’entreprise – conçue à la fois comme organisation, acteur du monde économique et acteur de la société – tient une place prépondérante. Pour réaliser ses études et élaborer ses propositions, l’Institut de l’entreprise met à contribution un vaste réseau d’experts (universitaires, hauts fonctionnaires, économistes, politologues, dirigeants d’entreprise, think tanks partenaires étrangers…). La diffusion de ses idées s’appuie sur la parution régulière de rapports et de notes et sur la publication d’une revue annuelle, Sociétal – qui propose également des débats en ligne sur les questions d’actualité économique via la page Sociétal - Le Blog, intégrée au site internet de l’Institut de l’entreprise. Résolument tourné vers l’international et partenaire fondateur du Réseau International des Thinks Tanks Economiques (www.isbtt.com), l’Institut de l’entreprise intègre systématiquement dans sa réflexion l’analyse de modèles étrangers susceptibles d’inspirer les politiques publiques françaises. RENCONTRES Ouvertes à un large public ou réservées aux adhérents, les manifestations organisées par l’Institut de l’entreprise ont pour objectif d’animer le débat public et de stimuler la réflexion sur des sujets d’intérêt collectif, liés à l’entreprise. Dirigeants d’entreprise, personnalités politiques, experts issus de l’entreprise ou du monde universitaire sont invités à s’exprimer à l’occasion de déjeuners, de conférences et de débats. FORMATION L’Institut de l’entreprise propose des programmes pédagogiques visant à sensibiliser les publics appartenant à l’écosystème de l’entreprise aux enjeux économiques et sociaux. Dans ce cadre, l’Institut s’adresse prioritairement aux enseignants de Sciences économiques et sociales (SES), avec le Programme Enseignants-Entreprises; aux jeunes «hauts potentiels», avec l’Institut des Hautes Études de l’Entreprise (IHEE) et Le Cercle; aux représentants politiques avec le programme Elus & Entreprises. Pour en savoir plus : www.institut-entreprise.fr 29, rue de Lisbonne, 75008 Paris Tél. : +33 (0)1 53 23 05 40 / Fax : +33 (0)1 47 23 79 01 www.institut-entreprise.fr guide du big data l’ annuaire de référence à destination des utilisateurs guide du big data 2013 / 2014 2013 / 2014© C opyright 2013. IBM, the IBM logo , and ibm.com are tradema rks o f IBM C orp., registered in many jurisdictions w orldwide. Other product a nd ser vice names might be tradema rks o f IBM or o ther companies. A cur rent list of IBM tr adema rks is a vailable on the web at “C opyright and tradema rk information” a t www.ibm.com/legal/copytrade.shtml https://ibm.biz/BdxkwP Avec une croissance annuelle du volume des données de 56%, Passez au Big Data avec IBM : Big Data at the Speed of Business Big data n'est pas qu'une question de Volume. Il s'agit pour les organisations de saisir les opportunités qu'offrent l'exploitation de toutes les natures de données qu'elles soient internes ou externes. IBM a développé le portefeuille le plus étoffé pour gérer la donnée, la transformer en information puis générer des actions : Système pour Hadoop : traiter et analyser tout type de données sur des clusters de serveurs. Stream Computing : analyser en temps réel (flux) des volumes massifs de données. Data Warehousing : effectuer des analyses "in-database" poussées. Data Visualisation : chercher, découvrir et visualiser des données quelles que soient leur source ou leur format. Business Intelligence : accéder et analyser les informations nécessaires pour améliorer la prise de décisions. Analyse Prédictive : découvrir des tendances non visibles et anticiper avec précision les résultats de l'entreprise. Apparu il y a seulement trois ans dans la sphère décisionnelle, le Big Data s’est déjà imposé comme l’innovation business numéro 1 de ce début de décennie, à la frontière entre technologie et management. Dans tous les secteurs où la gestion des données représente un actif indispensable de l’entreprise, l’engouement a été immédiat avec à la clé la formation d’un véritable écosystème du Big Data : des fournisseurs IT, qui ont développé une offre variée autour des technologies Hadoop, aux utilisateurs finaux (grandes entreprises, start-ups), qui cherchent à construire un avantage concurrentiel sur l’exploitation de leurs données, en passant par des entreprises spécialisées « data » (éditeurs business intelligence, consultants Big Data…), le paysage français s’est étoffé et structuré en l’espace de deux ans. La ministre chargée de l’Economie Numérique, Fleur Pellerin, a d’ailleurs annoncé, au cours du premier semestre 2013, un plan de soutien à la filière du Big Data : 11,5 millions d’euros issus des Investissements d’Avenir seront ainsi alloués à des projets Big Data et un programme de formation et de financement sera mis en place. Pourquoi un tel engouement ? Parce que les promesses de croissance autour de l’exploitation des grands volumes de données sont immenses : réduction des coûts, augmentation des ventes, relance de l’innovation, aide à la décision… les espoirs liés à la « data-driven company » attirent de nombreux professionnels, dans tous les secteurs (télécom, finance, grande distribution, industrie… ). Mais ce nouveau modèle impose de réfléchir aux conditions de mise en œuvre : le choix de la technologie d’abord, l’organisation et les compétences ensuite. Ce Guide a pour vocation d’aider les professionnels désireux d’exploiter leurs données à appréhender l’environnement du Big Data et à comprendre les fondamentaux d’une démarche Big Data en entreprise. Quelles technologies choisir ? Qui sont les acteurs du marché ? Quels métiers mettre en avant ? Et quel est le cadre juridique ? Nous avons recherché pour vous les informations les plus récentes sur le phénomène Big Data, en faisant un état des lieux de l’offre et de la demande sur l’année 2013 et en photographiant le panorama actuel des fournisseurs, dans la deuxième partie du Guide. De nombreux experts ont également accepté de répondre à nos questions pour témoigner de leurs expériences et apporter leurs conseils. Vous trouverez donc dans ce guide les réponses aux questions les plus usuelles posées par les curieux du Big Data. Il vous permettra de mesurer l’impact et l’efficacité de cette démarche pour votre entreprise et d’envisager, peut-être, à terme, un basculement vers ces technologies et la maîtrise instantanée de l’information. édito Blandine LAFFARGUE Directrice de publication +33 (0)1 45 63 43 58 / blaffargue@corpevents.fr Le Guide du Big Data est réalisé par la société Corp Events 3 « Le Big Data s’est déjà imposé comme l’innovation business numéro 1 de ce début de décennie, à la frontière entre technologie et management »5 sommaire LE BIG DATA, UNE REVOLUTION DANS LE TRAITEMENT DES DONNEES ? . . . . . . . . . . . . . . . . . . . . . . . . . . 05 • Comment définir le Big Data ? . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 05 • Une matière première, les données . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 06 • Une Révolution technologique . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 07 • Les usages du Big Data . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 08 Interview de Mathias Herberts, Disruptive Engineer & CTO, Cityzen Data . . . . . . . . . . . . . . . . . . . . . . . . . . . . 09 UN MARCHE MONDIAL – BILAN ET PERSPECTIVES . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10 • Le marché Big Data en Chiffres . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10 • Les acteurs du Big Data . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11 Interview de Matteo Pacca, Partner at McKinsey&Company . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12 LES TECHNOLOGIES BIG DATA . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 14 • Petit Lexique des Technologies Big Data . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 14 • Tour d’horizon des briques fonctionnelles en lien avec le Big Data . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 14 • Les technologies Big Data face aux besoins de la DSI . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 15 Interview Isabel Drost, membre de l’Apache Software Foundation, co-Fondatrice et contributrice pour Apache Mahout . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 16 EXEMPLES D’APPLICATIONS EN ENTREPRISES . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 18 • Projet Big Data de customisation marketing: Monoprix et dunnhumby . . . . . . . . . . . . . . . . . . . . . . . . 18 • Projet Big Data d’optimisation du traitement industriel : La Poste . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 20 • Projet Big Data de Recherche : Projet DEUS de l’Observatoire de Paris . . . . . . . . . . . . . . . . . . . . . . . 22 • Projet Big Data de Localisation : Le géomarketing de SFR . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 24 • Projet Big Data d’Agrégation de Données : Le projet Ellicible de Coface Services . . . . . 26 LES METIERS DU BIG DATA . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 28 Quelles sont les nouvelles compétences liées au Big Data ? . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 28 Les nouveaux métiers du Big Data . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 28 Les offres de formation en France . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 29 L’impact du Big data sur l’organisation de l’entreprise . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 29 Interview de Jacques Froissant, président d’Altaïde . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 31 LES POUVOIRS PUBLICS FACE AU BIG DATA . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 32 L’Open Data . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 32 Soutenir le décollage du marché : les investissements publics dans le domaine du Big Data . . . . 32 La problématique de confidentialité des données . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 33 Interview de Thierry Dor, associé au cabinet Gide Loyrette Nouel . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 35 guide profils de société ACCENTURE . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 36 Actuate . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 38 Affini-Tech . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 40 BIME . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 42 CGI . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 44 Club Décision DSI . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 46 Data & Data Consulting . . . . . . . . . . . . . . . . . . . . . . . . 48 EXALEAD . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 50 FASTCONNECT . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 52 Hewlett-Packard . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 54 IBM . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 56 InterSystems . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 58 Jaspersoft . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 60 KEYRUS . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 62 MAPR TECHNOLOGIES . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 64 Neo Technology . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 66 ParStream . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 68 PENTAHO . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 70 QlikTech . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 72 QUARTET FS . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 74 SAS INSTITUTE . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 76 SEMSOFT . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 78 SENTELIS . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 80 SINEQUA . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 82 Sogeti High Tech . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 84 Splunk Inc. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 86 SRD CONSEIL . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 88 SYNCSORT . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 90 TABLEAU SOFTWARE . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 92 Worldline . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 94 YSANCE . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 96 45 On le voit, les définitions du concept sont en pleine évolution, en lien certainement avec le degré de mise en pratique du Big Data dans les entreprises. Si les premières expérimentations sont encore timides en France en 2013, l’intérêt des managers est bien réel et le Big Data pourrait dès lors très rapidement aborder son tournant économique. en informations que les managers sont capables de prendre les bonnes décisions et de créer de la valeur. Du coup, le Big Data sous-entend un renversement total de paradigme dans le mode d’organisation de l’entreprise, celleci devenant « data-centric », c’est-à-dire guidée par les données. Les métiers sont amenés à évoluer et à travailler davantage en synergie, tandis que les temps de décisions sont considérablement raccourcis, en raison des actualisations permanentes de l’information. Mettre en place le Big Data, c’est donc lancer une « démarche », plutôt qu’installer un outil. Une Révolution économique ? En cela, certains considèrent que le Big Data s’apparente à une véritable Révolution Industrielle parce qu’on se trouve en présence d’un vrai bouleversement qui se généralise à tous les secteurs économiques : la donnée joue le rôle de matière première, les technologies jouent celles d’outils de production, et le résultat est un changement de paradigme dans la manière d’organiser les entreprises et de générer de la valeur dans tous les domaines de l’économie. Une comparaison osée et peut-être excessive, mais qui traduit bien l’impact global du Big Data et sa nature autant économique que technologique. Comment définir le Big Data ? Si le Big Data est devenu un terme à la mode dans les milieux décisionnels, il est parfois difficile de s’accorder sur une définition unique : on parle tantôt de technologies de traitement, tantôt de modèle économique, voire de mode d’organisation spécifique de l’entreprise. La définition technologique La définition initiale donnée par le cabinet McKinsey and Company en 2011 s’orientait d’abord vers la question technologique, avec la célèbre règle des 3V : un grand Volume de données, une importante Variété de ces mêmes données et une Vitesse de traitement s’apparentant parfois à du temps réel. Ces technologies étaient censées répondre à l’explosion des données dans le paysage numérique (le « data deluge »). Puis, ces qualificatifs ont évolué, avec une vision davantage économique portée par le 4ème V de la définition, celui de Valeur, et une notion qualitative véhiculée par le 5e V, celui de Véracité des données (disposer de données fiables pour le traitement). Ces cinq éléments ont servi pendant longtemps de boîte à outils pour comprendre les fondements du Big Data, à savoir l’apparition de technologies innovantes capables de traiter en un temps limité de grands volumes de données afin de valoriser l’information non exploitée de l’entreprise. L’aspect organisationnel et stratégique Aujourd’hui, cette définition s’est amplifiée : on parle davantage de « démarche Big Data » pour signifier l’importance prise par les données dans l’univers de l’entreprise. Celles-ci deviennent un mode de décision, un actif stratégique pour se différencier de la concurrence : c’est grâce à ces données rapidement transformées Le Big Data, une révolution dans le traitement des données ? 4 « Du coup, le Big Data sous-entend un renversement total de paradigme dans le mode d’organisation de l’entreprise, celle-ci devenant « data-centric », c’est-à-dire guidée par les données » Les 5V du Big Data Volume Vitesse Variété Valeur Véracité6 7 en plus variées et de plus en plus distribuées (c’est-à-dire issues de sources disparates). Les données textuelles, les données de logs, les données mobiles, les vidéos, etc. sont ainsi venues perturber les technologies de traitement traditionnelles, car ce ne sont pas des données structurées telles qu’on pouvait en trouver auparavant (comme par exemple les données chiffrées ou transactionnelles…). On parle alors de données non-structurées ou bien multistructurées. Tout l’enjeu technologique des années 2000 a donc résidé dans la captation et le traitement de ces nouveaux formats de données. La question de la qualité des données Mais, passée cette interrogation, une autre problématique s’est installée : comment savoir si ces données sont intrinsèquement fiables et propres à l’utilisation ? Les données erronées, les doublons, les informations périmées sont en effet légion au cœur du data déluge ce qui signifie que, traitées de la même façon que les autres, elles peuvent fausser des analyses et des dé- cisions. Quels outils mettre en place dès lors pour empêcher ces altérations ? Ce risque lié à la qualité des données a fait dire à de nombreux experts que nous étions entrés dans l’ère de la « smart data » davantage que dans celle du Big Data : plutôt que de traiter en bloc tout l’univers des données disponibles, il s’agit de trouver la bonne donnée, fiable et utile, qui permettra d’obtenir de l’information et créer de la valeur. A la base du Big Data, il y a donc ces fameuses données… Un « data deluge » comme le dit le terme consacré, car la production de données numériques aujourd’hui se mesure en exaoctets, soit 1018 octets. Ce qui interpelle, c’est essentiellement la croissance exponentielle de ces données : on estime que tous les deux ans, il se crée autant de données que depuis le début de l’humanité, ce qui amène les prévisionnistes à parler de 40 zettaoctets (1021) pour 2020 ! Le data deluge D’où proviennent ces données et comment expliquer cette explosion soudaine ? Il y a bien sûr la mise à disposition généralisée d’outils numériques de plus en plus performants et connectés, tels que les ordinateurs et les smartphones reliés à Internet en permanence. L’accès à l’information instantanée s’est démocratisé par les réseaux sociaux et, dans un nombre important de pays, les administrations publiques lèvent le voile sur leurs données à travers le mouvement d’Open Data. Mais au-delà, on envisage de plus en plus la multiplication de données issues d’objets interconnectés, de type capteurs ou puces mobiles : ce qui avait été approché avec le RFID (par exemple au sein des cartes de transport ou par code-barre dans les chaînes logistiques) pourrait être généralisé dans les années à venir à travers l’Internet des Objets. Concrètement, il est aujourd’hui technologiquement possible de connecter entre eux les objets de son quotidien, par exemple son réveil avec son calendrier Outlook, ou bien son véhicule avec les applications de stationnement, ou encore son réfrigérateur avec son panier de courses en e-commerce. Des perspectives technologiques qui restent encore expérimentales mais pourraient vite exploser : Ericsson a ainsi estimé le nombre d’objets connectés dans le monde à 50 milliards en 2020 (12 milliards aujourd’hui). Une variété de données Les données multistructurées Cette mutation dans l’univers numérique n’est pas seulement quantitative : audelà de leur nombre, les données mises à disposition sont également de plus Une matière première, les données « Loi de Moore : Largement répandue dans la sphère scientifique, bien qu’elle n’ait pas été prouvée, la loi de Moore affirme que la capacité des ordinateurs (et notamment le volume des données) double tous les 18 mois. » octets 40 zettaoctets de données en 2020 50 milliards d’objets connectés à la même date 1 Mégaoctet = 106 octets 1 Gigaoctet = 109 octets 1 Téraoctet = 1012 octets 1 Pétaoctet = 1015 octets 1 Exaoctet = 1018 octets 1 Zettaoctet = 1021 octets6 7 L’influence du Cloud Mais c’est particulièrement avec l’apparition du Cloud que le Big Data a connu un développement accéléré : en mutualisant les données dans le nuage et en démocratisant ainsi l’accès des entreprises au stockage et au traitement de tous types de données, le Cloud a créé les conditions pour une généralisation du Big Data. Petites et grandes entreprises ont pu souscrire à des offres « as a service » pour explorer leurs données internes mais également d’autres données accessibles depuis le Cloud. Il est d’ailleurs très fréquent de voir des offres Big Data appuyées sur l’informatique en nuage. L’explosion des données numé- riques, en tant que telle, n’aurait eu aucune valeur sans accompagnement technique : toute l’innovation liée au Big Data a d’abord été une innovation technologique, portée par la mutation des outils de stockage et de traitement. L’augmentation des capacités de stockage Le stockage, d’abord : avec la croissance exponentielle des données, il est vite devenu indispensable de faire évoluer les baies de stockage traditionnelles pour les mettre en capacité d’absorber au fur et à mesure la multiplication de ces données. Une problématique d’autant plus réaliste que les coûts de stockage étaient en chute libre depuis le dé- but des années 2000, à moins de 1 dollar le gigaoctet… Technologiquement, ce besoin s’est traduit par l’apparition de la « scalabilité », c’est-à-dire l’ajustement progressif et continu de l’outil de stockage à la masse des données collectées. Une innovation majeure permettant aux DSI de stocker toutes sortes d’informations très rapidement, sans arbitrage sur leur utilisation future, et surtout sans la nécessité d’accroître (et donc changer) l’infrastructure existante. Aujourd’hui, de nombreux fournisseurs développent ce type de technologies au sein d’appliances (c’est- à-dire d’outils combinés de stockage et de traitement). Une révolution technologique « La mise à disposition de technologies a accompagné l’explosion des données. » Y2K Les années 2000 ont permis la captation et le traitement de nouveaux formats de données L’apparition de technologies de traitement adaptées Enfin, le dernier facteur technologique qui a permis au Big Data de décoller, probablement le plus célèbre, concerne la révolution des outils de traitement. Conjointement à l’explosion des données numériques, les années 2000 ont assisté à l’apparition de nouvelles bases de données, adaptées aux données non structurées (Hadoop), ainsi qu’à la mise au point de modes de calcul à haute performance (MapReduce) : c’est la révolution Hadoop/MapReduce (cf partie IV, Les Technologies Big Data). Ces deux innovations, portées par Google et Yahoo, ont posé les bases du traitement Big Data actuel : il est devenu possible, grâce à elles, de traiter d’importants volumes de données en un temps limité (réduit de près de 50 fois par rapport aux précédentes technologies), pour tous types de données, structurées ou non. Le fait qu’Hadoop soit mis à disposition en Open Source a probablement contribué à la généralisation rapide de l’outil et à l’explosion ultérieure du Big Data. Les conditions d’un essor du Big Data étaient donc réunies dès la fin des années 2000 : la mise à disposition de technologies a accompagné l’explosion des données. Plus qu’un effet cause-consé- quence, c’est davantage une évolution conjointe qu’il faut mettre en avant, à la manière d’un processus auto-entretenu. En revanche, peut-on parler de « révolution » dans les usages du Big Data ?8 9 • Dans le domaine de l’Information, tout simplement, qu’elle soit corporate ou grand public, le traitement des Big Data a profondément modifié la donne : pour une requête donnée, il est désormais possible d’accéder à un croisement d’informations très disparates, issues de sources jusque-là négligées. L’instantanéité des réseaux sociaux est à ce titre une innovation de taille : l’analyse des tweets est devenue une source de renseignements courante pour comprendre les comportements ou les goûts de populations segmentées. De plus, au-delà de la compréhension de phénomènes, la data s’avère un outil de communication efficace pour faire passer des messages factuels aux publics : c’est tout le rôle du data journalisme, qui vise à mettre en lumière des événements complexes au travers de la représentation de données multiples. On le voit, le Big Data a donc eu un effet profondément novateur sur de nombreuses activités : il a ouvert de nouveaux champs d’exploration, avec à la clé des informations et fonctions inédites. Mais, au-delà, le Big Data a également permis de créer intégralement de nouveaux services, de nouvelles filières fondées sur des données inexplorées jusqu’alors. • Dans le domaine du pilotage de l’entreprise, les usages sont également nombreux et porteurs d’innovation : en assurant une circulation immédiate et généralisée de l’information sur l’activité, le Big Data laisse entrevoir une optimisation complète des processus et des ressources métiers. Il réduit de facto le temps de réaction face à des erreurs ou des pannes et permet d’ajuster en permanence les équilibres offre-demande et temps-ressource. C’est une promesse importante dans des secteurs comme ceux de l’énergie ou des transports qui sont constamment portés par la logique de flux ; outre une réduction importante des coûts, le Big Data permet ici d’identifier au plus près les moteurs de l’activité, ce qui n’était pas possible avec les indicateurs traditionnels, soumis à des délais de latence bien plus importants. • Pour la Recherche, domaine d’application originel du Big Data, l’apport de celui-ci est assez évident : en autorisant le traitement de multitudes de données, le Big Data permet à la science de réaliser des avancées importantes, lorsqu’il s’agit d’explorer l’infiniment petit (ex : exploration géologique), de croiser des données complexes (ex : imagerie) ou d’effectuer des simulations (ex : domaine spatial). C’est d’ailleurs en géné- tique que le Big Data a fait ses premières armes car ce secteur réclamait une approche à la fois quantitative et qualitative avancée. La question agite en effet de nombreux experts : le Big Data est-il si révolutionnaire que le laissent entendre les journalistes et les acteurs du secteur ? L’utilisation de données à des fins de traitement et d’analyse est en effet inhérente à tout pilotage d’entreprise, et des outils anciens existent pour cela (depuis l’antique livre de comptes jusqu’aux tableaux de Business Intelligence, en passant par les traditionnelles bases Excel et Access). Beaucoup estiment donc que le Big Data n’est qu’un passage à l’échelle des traitements traditionnels : ce que l’on traitait auparavant en petite quantité, on le traitera en grande quantité avec une fiabilité renforcée. Les approches statistiques et la nature des résultats trouvés ne seraient en rien modifiés… C’est ici que les désaccords naissent car le Big Data, en traitant une multiplicité de données issues de sources variées et selon un quasi-temps réel, a ouvert la voie à d’autres utilisations de la donnée et à de nouvelles méthodes d’analyse : • En marketing, c’est tout le secteur qui se trouve renouvelé : le Big Data permet en effet aux professionnels du secteur de connaître leur client « à 360° », c’est-à-dire à la fois par son parcours internet mais également par ses achats en magasin ou ses préférences affichées sur les réseaux sociaux. Anticiper les besoins de celui-ci et cibler des offres personnalisées est devenu le credo du marketing « data-driven », qui met en avant des techniques inédites : le RealTime Bidding pour l’achat d’espaces en temps réel, le Retargeting pour le ciblage personnalisé ou encore l’analyse de sentiment pour la détection de comportements sur les réseaux sociaux. Le marketing se fait de plus en plus pré- dictif avec le Big Data, et l’on assiste à une éclosion de nouveaux modèles statistiques davantage inductifs. Les usages du Big Data8 9 • Les données mobiles, par exemple, dont le traitement temps réel est devenu un enjeu stratégique pour de nombreux secteurs, sont un important gisement d’innovation : en effet, la possibilité de géolocaliser des utilisateurs a ouvert de nombreuses perspectives aux annonceurs qui y voient une opportunité unique de placer leurs publicités à proximité des lieux d’achat. De la même façon, les opérateurs telecom travaillent avec les autorités publiques pour comprendre les flux de populations grâce à ces données et, dans le secteur du tourisme, des services inédits de localisation sont mis en place. Les usages du Big Data sont donc variés et très innovants, ce qui peut expliquer l’engouement suscité auprès des entreprises et administrations publiques. Le débat sur l’aspect révolutionnaire du Big Data reste cependant ouvert, car certains considèrent que, si les données ont changé, les algorithmes restent quant à eux assez similaires. L’évolution de ceux-ci reste probablement l’un des chantiers de ces prochaines années. 1) Vous êtes un des pionniers du Big Data en France… Comment (et pourquoi) avez-vous eu l’idée de mettre en place ce type d’outils ? Tout est parti d’une expérience chez Google, où je suis allé travailler quelque temps en 2008 et où j’ai découvert une toute autre façon de prendre des décisions. Google avait théorisé une philosophie de travail régie par deux principes : 1) ne pas arriver en réunion en disant « je pense que » mais « les données prouvent que », 2) ce n’est pas l’opinion de la personne la mieux payée qui compte. Cela faisait écho à un livre que je lisais à l’époque, qui s’appelait « Super Crunchers » et qui prônait le raisonnement par les chiffres et les données. Partant de là, je suis revenu au Crédit Mutuel avec la certitude que les données étaient fondamentales et qu’il était nécessaire de modifier nos processus de décision : pour éviter d’avoir une vision erronée de nos clients, de nos partenaires et de notre fonctionnement, il fallait remettre à plat notre socle technologique. 2) Pour vous, le Big Data correspond-il à une rupture technologique majeure ? Quels sont les éléments de nouveauté ? Sont-ils uniquement technologiques ? Pour moi, l’élément de nouveauté dans le Big Data, ce n’est pas tant la technologie que le pilotage : désormais, on a ré- duit les boucles de décision, tout est plus court dans l’information et la réaction. C’est là qu’il y a un tournant. Bien sûr, cela ne se ferait pas sans la mise à disposition d’outils particuliè- rement opportuns à ce moment-là. Ce sont des outils qui ont accéléré le changement de comportement vis-à-vis des données : désormais, il est possible de stocker sans savoir exactement l’utilisation qu’on fera des données, simplement parce qu’on considère qu’elles ont une valeur intrinsèque. 3) Quand on parle de Big Data, on parle d’Hadoop… pour vous, le lien est-il forcément évident ? Quels sont les apports de cet outil et, à l’inverse, que pouvez-vous lui reprocher ? Même s’il existe d’autres outils, Hadoop reste la référence du traitement Big Data. Certes, c’est un outil qui réclame de s’investir dans la programmation mais il permet vraiment de faire des choses nouvelles à des coûts restreints et sur un grand volume de données. Le principal reproche qu’on peut lui adresser, c’est d’avoir une courbe d’apprentissage assez longue et complexe ; mais une fois qu’on a compris comment fonctionnait la communauté Hadoop, et qu’on a pris le temps de rentrer dans les subtilités du code, c’est un outil très efficace. 4) Quels sont pour vous les principaux défis à relever au sein des organisations utilisatrices du Big Data ? Pour moi, le principal défi est organisationnel : la démarche Big Data est forcément transverse donc elle implique de casser les cloisons entre services, ce qui n’est pas toujours évident. En terme SI, cela signifie qu’il faut aller récupérer les données dans tous les recoins, ce qui a de grandes implications au niveau de l’urbanisation du système d’information. Autre défi : aujourd’hui, on a tendance à penser qu’il faut passer par des offres packagées plutôt que par le code open source Hadoop. Cela peut être un gain de temps mais ça n’apporte pas les solutions en interne. Pour moi, il faut avant tout avoir des équipes dédiées qui se plongent résolument, de façon personnalisée, dans l’intégration de l’open source au système d’information, et qui soient capables de comprendre les besoins propres de l’entreprise. Enfin, dernier challenge : l’utilisation de la donnée risque de remettre en cause pas mal de convictions et de straté- gies. Il y aura donc forcément des réticences face au pouvoir de la donnée. Aux équipes informatiques et business de montrer la voie en pointant la valorisation et le potentiel des données ! Interview « L’élément de nouveauté dans le Big Data, ce n’est pas tant la technologie que le pilotage » Mathias Herberts Disruptive Engineer & CTO, Cityzen Data « La démarche Big Data est forcément transverse donc elle implique de casser les cloisons entre services » Mathias Herberts (à droite) reçoit le prix de l’innovation Big Data10 11 Quelles sont les perspectives économiques du Big Data pour les fournisseurs et les utilisateurs ? Qui sont les acteurs qui dynamisent le marché ? Et dans quels secteurs les trouve-t-on ? Voici un petit panorama du marché du Big Data autour du monde pour l’année 2013. Le marché Big Data en Chiffres Depuis son décollage en 2011, le Big Data n’a cessé d’afficher des scores de croissance importants côté utilisateurs mais surtout côté fournisseurs : à ses débuts, on avait d’ailleurs parfois qualifié ce marché de « marché d’offre » pour souligner le fait que la demande était encore à la traîne. Qu’en est-il en 2013 ? Le marché des fournisseurs Plusieurs études menées par des cabinets de conseil soulignent la forte croissance du marché du Big Data : > Selon IDC, le marché du Big Data s’établirait à 24 milliards de dollars en 2016 (contre 3,3 milliards en 2010) avec un taux de croissance annuel de 31,7%. > Ce marché est constitué des produits et services liés au Big Data, avec le découpage suivant : • Serveurs : 27,3% • Logiciels : 34,2% • Stockage : 61,4% > D’après une étude IDC pour EMC de juin/juillet 2012, les trois technologies privilégiées dans le Big Data seraient les suivantes : • Les bases de données objets ou graphiques : 47% • L’indexation de contenus (moteurs de recherche avancés) : 38% • Les technologies en mémoire (in-memory database) : 37% Le marché des utilisateurs Côté utilisateurs, la situation est plus contrastée en fonction des zones géographiques : > Début 2013, le cabinet Forrester établissait sa prévision de croissance des budgets IT à 6% au cours de l’année en Europe, alors qu’elle est de 7,5% aux Etats-Unis > IDC estime que seulement 10% des entreprises françaises utilisent déjà des solutions Big Data, tandis que 70% d’entre elles n’ont engagé ni projets ni réflexions en ce sens (chiffres de septembre 2012) > Ainsi 58% des entreprises françaises estiment être en retard par rapport à leurs concurrents (et 47% estiment être très en retard) > En comparaison, 33% des entreprises britanniques et 18% des entreprises allemandes ont lancé une démarche Big Data > Parmi les freins évoqués, la problématique du coût est souvent avancée, tout comme celle du manque de ressources et d’organisation pour mettre en place le Big Data (64% des équipes IT estiment que la collaboration entre l’IT et les métiers devrait être renforcée). Enfin, la question de la qualité des données (41%) ou de leur utilité pour les analyses prévues (37%) est un autre point soulevé par The Economist. Un marché mondial Bilan et perspectives Les chiffres duBig Data >Un marché de 24 milliards de $ en 2016 >Taux de croissance annuel : 31,7% >Pourcentage d’entreprises lançant des projets Big Data ou envisageant de le faire • France : 10% • Allemagne : 18% • UK : 33% >Le Big Data fait partie des 5 secteurs clé de la croissance américaine >En France, le Big Data pourrait générer 2,8 milliards d’euros et 10 000 emplois directs (prévisions de l’AFDEL)10 11 nouveaux services grâce au traitement des données mobiles géolocalisées. Mais au-delà de ces secteurs habituellement réputés pour leur propension au Big Data, on voit germer des initiatives Big Data dans d’autres environnements : l’industrie française commence en effet à s’intéresser au phénomène, notamment sur ses qualités d’optimisation logistique et financière. Les médias sont également de plus en plus friands de traitement de données, d’abord parce qu’ils peuvent obtenir une information temps réel et aussi parce qu’ils peuvent mesurer les préférences de leurs audiences. Mais le secteur qui fonde les espoirs les plus nombreux sur le Big Data est probablement celui de la santé, où les perspectives dans la recherche mais aussi dans le ciblage des médicaments sont importantes. C’est d’ailleurs le terrain d’exploration originel du Big Data puisque c’est dans le domaine de la gé- nétique que les premières expérimentations avaient eu lieu. Actuellement, c’est le mouvement du Quantified Self qui focalise les attentions : mouvement orienté grand public, il vise à permettre aux individus de surveiller en permanence leurs indicateurs de bien-être (ex : poids, nutrition, fatigue) à l’aide de capteurs et de traitement de données temps réel. Encore au stade de l’expérimentation, cette activité pourrait être amenée à se développer rapidement à la faveur de l’essor des appareils mobiles. > Dans le secteur de l’analytique, de nombreux acteurs sont également présents : • Les éditeurs BI (ex : SAS, Micro- strategy, Qliktech…) • Des fournisseurs spécialisés dans l’analytique Big Data (ex : Datameer, Zettaset…) D’autre part, de nombreuses PME spé- cialisées dans le Big Data ont vu le jour, sur toute la chaîne de valeur du secteur. En France, les pionniers ont ainsi été : > Pour la fourniture d’équipements et logiciels Big Data : Hurence, Dataiku > Pour l’analyse de données : Criteo, Squid, Captain Dash, Tiny Clues > Pour le conseil : Ysance Ces fournisseurs établissent souvent des partenariats entre eux afin de fournir au client des solutions packagées intégrant à la fois l’infrastructure et les applications. Les utilisateurs La mise en place du Big Data est vécue différemment selon les secteurs : on a coutume de dire que les principaux secteurs d’application du Big Data sont les telecoms, la grande distribution (online et offline) et la finance. Ce sont en effet les premières activités qui se sont penchées sur la problématique du Big Data car la captation de grands volumes de données pouvait rapidement leur donner un avantage comparatif. Pour les opérateurs télécoms, c’était même une opportunité de création de Pourtant, les promesses sont nombreuses en matière de création de valeur : > En juillet 2013, Mc Kinsey estime ainsi que le PIB des Etats-Unis pourrait croître de 1,7% d’ici 2020 en s’appuyant sur le Big Data. Celui-ci ferait partie des 5 secteurs phare de la croissance américaine. > Les économies réalisées dans la santé et l’administration américaines pourraient atteindre 300 milliards de dollars ! > Dans le domaine de la grande distribution, le chiffre d’affaires pourrait croître de 40% en 5 ans, et de 30% sur la même période pour les télécoms ! > En France, le constat fait par l’AFDEL (association des éditeurs de logiciels français) est que le Big Data pourrait générer 2,8 milliards d’euros et 10 000 emplois directs si les conditions de son déploiement étaient réunies (c’est-à-dire avec un financement de 300 millions d’euros et la mise en place d’un écosystème). C’est cette estimation qui a d’ailleurs conduit la ministre à mettre en place un programme de soutien à la filière. > Les 3 principales motivations des dirigeants pour mettre en place des solutions Big Data sont évoquées par Mc Kinsey : en Europe, c’est l’aspect « détection des tendances » qui occupe la première position, suivi par « un meilleur engagement client » puis « une prise de décision plus rapide ». Dans les marchés émergents en revanche, cet aspect « prise de décision » est placé en première position. Les acteurs du Big Data Les fournisseurs De nombreux acteurs se sont positionnés rapidement sur la filière du Big Data, dans plusieurs secteurs : > Dans le secteur IT, on trouve ainsi : • Les fournisseurs historiques de solutions IT (ex : IBM, SAP, Oracle, HP…) • Les acteurs du Web (ex : Facebook, Google…) • Les spécialistes de solutions data et Big Data (ex : Teradata, MapR, Hortonworks, EMC…) • Les intégrateurs (ex : Atos, Sopra Group, Accenture, Cap Gemini…) RETAIL PRODUCTIVITY INCREASE % SALES INCREASE $ CONSULTING AIR TRANSPORTATION CONSTRUCTION FOOD PRODUCTS STEEL AUTOMOBILE INDUSTRIAL INSTRUMENTS PUBLISHING TELECOMMUNICATIONS 49 39 21 20 20 20 19 18 18 17 9.68 5.08 4.38 4.28 3.48 3.48 2.8 1.28 0.88 0.4812 13 1) Où en est le big data aujourd’hui en France et partout ailleurs dans le monde ? Quels sont les secteurs les plus moteurs ? Observez-vous une évolution significative ? Il y a aujourd’hui un consensus autour de l’immense valeur potentielle que présentent les masses de données que nous générons chaque jour dans le monde. Selon les études de McKinsey, à l’échelle mondiale, le marché du Big Data devrait dépasser les 30 milliards de dollars US en 2013. Si le big data présente un potentiel pour tous les secteurs d’activité, trois secteurs sont particulièrement bien positionnés pour en tirer le meilleur parti : la distribution, du fait de grandes bases de clients et d’historiques d’achats, la santé (pharmacie et assurance santé), pour l’analyse de la performance des médicaments (avant leur mise sur le marché, en phase de test, et après, pour mesurer leur efficacité), et enfin la banque-assurance, pour mieux cibler les produits financiers et surtout l’analyse du risque. Selon nos projections, le marché du big data devrait croître de près de 15 % par an, pour répondre aux besoins engendrés par une croissance estimée des données pouvant aller jusqu’à 40 % par an. Les dépenses des entreprises dans ce domaine devraient doubler d’ici cinq ans. Pour les entreprises, investir dans le big data représente une opportunité majeure d’améliorer leur performance ; des travaux récents de McKinsey montrent d’ailleurs que les entreprises innovantes croissent de 10 % par an, contre – 3 % pour celles qui n’innovent pas. Pourtant, les entreprises – notamment françaises – sont encore trop timides et n’ont pas mobilisé les ressources adéquates en regard de leurs ambitions, que ce soit en termes de moyens financiers ou de talents : elles se situent aujourd’hui derrière les entreprises américaines, britanniques, scandinaves et allemandes. Parmi les freins au développement du big data - au-delà des aspects techniques, des questions de sécurité et du débat public - se pose une question organisationnelle : afin de tirer le meilleur parti du big data, les entreprises vont devoir former et recruter les talents qualifiés, mais aussi repenser leur structure organisationnelle et leur management. En outre, pour en saisir tout le potentiel, le big data doit être défini comme priorité stratégique de l’entreprise et nécessite une allocation de moyens financiers et humains adéquats. Les autorités ont d’ailleurs pris la mesure de l’importance du sujet et la France s’est engagée pour développer le big data avec un plan comportant plusieurs volets, comme la formation de « data scientists », la mise à disposition de certaines technologies, des financements… Le développement du big data en France passera par la mise en place d’un véritable écosystème. *McKinsey Global Institute, Big Data : The next frontier for innovation, competition, and productivity, mai 2011 2) Le Big Data véhicule de nombreuses promesses de développement pour les entreprises utilisatrices… Comment évaluez vous le potentiel du Big Data pour les utilisateurs ? Pouvez-vous chiffrer ce développement ? Le McKinsey Global Institute, l’institut de recherche de McKinsey, a étudié le potentiel de transformation du big data dans cinq secteurs : la santé aux EtatsUnis, l’administration du secteur public dans l’Union Européenne, la distribution aux Etats-Unis, l’industrie mondiale, et la géolocalisation* . Ensemble, ces secteurs représentaient près de 40 % du PIB mondial en 2010 ; dans ces cinq domaines, nous avons identifié des leviers qui devraient permettre aux entreprises d’améliorer leur efficacité, grâce à une meilleure productivité et en accroissant la valeur ajoutée des produits et services qu’elles proposent. Le big data dans le domaine de la santé aux EtatsUnis présente par exemple un potentiel de création de valeur supplémentaire de près de 230 milliards d’euros par an, les deux tiers provenant d’une diminution des dépenses de santé nationales, soit près de 8 % des dépenses estimées en 2010. Dans le secteur manufacturier, le big data pourrait permettre de réduire de moitié les coûts d’assemblage et de développement de produits. Le secteur public européen pourrait voir ses coûts réduits de 15 à 20 %, diminuer la fraude et améliorer la collecte des impôts pour un total de 250 milliards d’euros par an. Pour les groupes de la grande distribution, le recours au croisement des données pourrait se traduire par un potentiel d’amélioration de 60% de leur rentabilité opérationnelle. Plus généralement, une meilleure utilisation des services de géolocalisation pourrait rapporter 100 milliards d’euros aux différents fournisseurs de services et 700 milliards d’euros aux consommateurs, qui béné- ficieraient par exemple de la possibilité d’acheter un produit moins cher et plus près de chez eux. Interview « Le big data est un levier de performance sur lequel les entreprises françaises doivent accélérer » Matteo Pacca Partner, McKinsey&Company « Le marché du big data devrait croître de près de 15 % par an, pour répondre aux besoins engendrés par une croissance estimée des données pouvant aller jusqu’à 40 % par an »12 13 des choix effectifs. Un tel plan repose sur trois étapes : d’abord, l’assemblage et l’intégration d’immenses volumes de données nouvelles afin d’identifier des informations intéressantes ; ensuite, la sélection de modèles d’analyse des données permettant d’optimiser les opé- rations et de prédire les conséquences des décisions business ; enfin, la création d’outils intuitifs qui transcrivent les analyses des modèles en actions réelles, et la formation des employés à l’utilisation du modèle. Une fois ce plan défini, pour le mettre en œuvre, il ne faut pas avoir peur d’expérimenter : choisir le domaine que l’on souhaite explorer, lancer un pilote et le tester, avec un esprit entrepreneurial et le courage d’une certaine prise de risque face à l’incertitude des découvertes qui seront faites. De fait, développer le big data au sein des entreprises implique une évolution du rôle des DSI : ceux-ci doivent désormais, tout en se construisant leur propre réseau technologique, être force de proposition pour les business units afin d’améliorer leur performance. Pivot de la mise en œuvre du big data dans l’entreprise, ils doivent favoriser le dialogue entre les métiers et la technologie, au service d’une meilleure performance. Enfin, pour les fournisseurs de technologie, cela implique également une évolution. Ceux-ci ont encore une approche trop technique, pas assez tournée vers le client. Ils parlent d’accélération des performances techniques et ont une vision orientée vers les systèmes d’information : l’enjeu est désormais de proposer une approche plus « métiers », de montrer aux entreprises comment le big data peut véritablement avoir un impact business. Dans un contexte économique morose, les entreprises sont d’autant plus à l’écoute de nouveaux relais de croissance potentielle. 3) Quelles sont les principales applications du Big Data dans les entreprises ? A l’heure actuelle, quelles sont leurs proportions respectives ? Y en a-t-il certaines qui n’ont pas encore été explorées ? Nous avons identifié cinq grandes applications du big data. Le big data permet d’abord la transparence et la circulation des données : dans le secteur public par exemple, une meilleure accessibilité des données entre différentes administrations ou services peut réduire les temps de recherche et de traitement des dossiers. Le big data permet également la facilitation des diagnostics : les entreprises peuvent ainsi identifier des variations de performance et mieux en comprendre les causes racines afin d’y remédier. Le big data permet encore la segmentation des clients afin de les cibler de manière plus fine : des distributeurs et des sociétés de services commencent à mettre en œuvre des techniques sophistiquées de big data telles que la micro segmentation en temps réel afin de mieux cibler les promotions et la publicité. Le big data permet aussi d’améliorer certaines décisions humaines par des algorithmes qui minimisent le risque et mettent en évidence des informations clés : les distributeurs peuvent ainsi optimiser certains processus, comme les inventaires ou le pricing. Enfin, le big data permet de concevoir de nouveaux produits et services, d’améliorer l’existant et in fine, d’inventer de nouveaux business models : par exemple, la localisation en temps réel a fait émerger de nouveaux types de services géo-localisés (navigation, assurances calculées sur la base des déplacements effectués, etc). Bien sûr, de nombreuses applications n’ont pas encore été explorées. 4) Que faut-il faire pour accélé- rer le développement du big data dans les entreprises ? Peu d’entreprises ont développé à ce jour un véritable plan big data, incluant des discussions au sein de la direction générale, avec notamment une réflexion sur les investissements prioritaires et Les promesses du Big Data par secteur >Santé : surplus de 230 milliards € / an >Industrie : réduction de 50% des coûts >Secteur public en Europe : création de valeur de 250 milliards d’€ >Grande distribution : amélioration de la rentabilité de 60% >Valeur de la géolocalisation : gain de 700 milliards d’€ pour les consommateurs « Peu d’entreprises ont développé à ce jour un véritable plan big data »14 15 base de données orientée colonnes de type NoSQL. Elle supporte le traitement MapReduce et est particulièrement reconnue pour sa capacité à faciliter l’accessibilité des données, quel que soit le volume géré. Des compatibilités avec Hadoop sont aujourd’hui possibles. > HBASE : de la même façon, HBase, développé par Apache, est un système de gestion de base de données distribué. Il est complémentaire d’Hadoop et particulièrement performant pour le traitement des très grandes tables (milliards de rangs X millions de colonnes). > PIG : également développé par Apache, il vise à augmenter les performances d’Hadoop/MapReduce en proposant un langage de programmation permettant un traitement plus rapide. > HIVE : issu de la recherche Facebook, Hive permet d’effectuer des requêtes sur un cluster Hadoop directement en langage SQL. A côté de ces briques complémentaires qui rendent Hadoop plus facile d’accès et plus rapide, on retrouve des structures de bases de données corollaires à Hadoop : > CASSANDRA : également développé par Facebook, Cassandra est une Tour d’horizon des briques fonctionnelles en lien avec le Big Data Au-delà de ces outils de base, le Big Data se doit d’être applicatif et de proposer des services en lien avec les besoins directs de l’entreprise. Il est donc possible et recommandé de rajouter des briques fonctionnelles aux spécifications initiales d’Hadoop/MapReduce : c’est tout l’objet de l’écosystème Hadoop qui s’est développé en parallèle de ces outils. Dans cet écosystème, on retrouve ainsi parmi les plus connues : Petit Lexique des Technologies Big Data L’univers technologique du Big Data s’appuie sur des outils bien identifiés qui constituent la base innovante de ce mode de traitement. A eux seuls, ces outils résument le vocabulaire technologique du Big Data et en constituent la référence. Mais de quoi parle-t-on exactement lorsque l’on évoque ces innovations ? Voici un petit lexique simplifié qui permettra même aux moins technophiles de comprendre les fondements techniques du Big Data. • Traitement massivement parallèle (MPP = massively parallel processing) : le Big Data repose sur des systèmes de traitement de données organisés sur plusieurs nœuds ou clusters parallèles. Généralisé dans les années 2000, ce type de traitement permet de générer des calculs à très haute performance sur des infrastructures (processeurs, serveurs) réduites. • HADOOP : emblème par excellence du Big Data, Hadoop est une architecture spécifique de bases de données, permettant de traiter en grand nombre tous types de données (y compris les données non structurées). On dit qu’elle est organisée sur un mode non-relationnel, c’est-à-dire que les données ne sont pas triées en fonction de leurs relations entre elles. Elle constitue en quelque sorte la librairie à partir de laquelle on pourra effectuer des calculs parallèles (via MapReduce), sachant que ces données sont distribuées (c’est-à-dire qu’Hadoop les « récupère » depuis diverses sources). Créé par la fondation Apache (voir interview d’I. Frost-Dromm), Hadoop est un framework Open Source, c’est-à-dire que son code et ses spécifications sont disponibles en libre accès pour ceux qui cherchent à l’implémenter dans leur système. • MAPREDUCE : couplé à Hadoop (qui est en fait son implémentation principale), MapReduce est le mode de calcul permettant de traiter les big data. Il présente une fonction Map (distribution des données sur plusieurs clusters parallèles où les calculs intermédiaires seront effectués) et une fonction Reduce (les résultats des calculs intermédiaires distribués sont recentralisés en vue du calcul final). MapReduce est issu de la recherche Google et a été développé au même moment qu’Hadoop ce qui explique l’association traditionnelle que l’on fait des deux outils. • NOSQL : on parle de NoSQL lorsque des requêtes sont effectuées dans un langage de programmation qui n’est pas limité au SQL. Ce dernier est en effet le langage le plus utilisé pour des traitements de données mais ses normes de définition, parfois trop strictes, ne sont pas adaptées aux données massives et non-structurées. Du coup, certaines requêtes sont effectuées indépendamment de ces normes et donc de ce langage propre, ce qui fait dire à certains que l’on bascule sur du NoSQL (littéralement : « au-delà du SQL »). Pour autant il est quasiment impossible de définir le NoSQL selon un corpus de règles puisqu’il représente précisément l’affranchissement par rapport à un ordre établi. • IN-MEMORY : on parle de traitement in-memory pour évoquer les traitements qui sont effectués dans la mémoire vive de l’équipement informatique, plutôt que sur des serveurs externes. L’avantage du traitement in-memory est celui de la vitesse puisque les données sont immédiatement accessibles. En revanche, ces données ne sont pas stockées sur le long terme, ce qui peut poser des problèmes d’historisation. Les technologies Big Data14 15 La question du stockage est également récurrente. Que choisir parmi les serveurs traditionnels, les appliances et les offres cloud ? Certaines entreprises privilégient le cloud pour rendre l’infrastructure plus flexible et mutualiser les données dans le nuage. Cependant, la migration n’est pas forcément adaptée à des gros volumes de données et les questions de sécurité restent prégnantes. La question de la sécurité Evoquée concernant le Cloud, la question de la sécurité est devenue un leitmotiv avec l’explosion du Big Data : en effet, la multiplication des données disponibles et leur valeur théorique sur le marché rendent encore plus présente la menace de cyberattaques. applications ? Pour répondre à ces questions, les fournisseurs ont eu à cœur de mettre en place des infrastructures plutôt légères qui s’adaptent à l’existant ; la manifestation la plus évidente de ce phénomène étant la croissance du marché des «appliances», ces outils mixtes «hardware/software» qui se branchent sur le système existant pour une utilisation immédiate. volumes de données ? Et quelle est la capacité d’adaptation de l’offre par rapport aux réels besoins de l’entreprise ? Cette problématique, évoquée très souvent par les DSI fait écho à la structuration très rapide du marché de l’offre par rapport à celui de la demande : tous les fournisseurs historiques de technologies se sont en effet lancés très tôt sur ce marché prometteur et ont ainsi proposé leur offre propre, ce qui multiplie d’autant le nombre de propositions commerciales faites aux utilisateurs. Quelle architecture mettre en place ? Cette question renvoie aux modèles d’organisation privilégiés par l’entreprise : faut-il centraliser les données ou bien disposer d’architectures réparties au sein des directions métiers ? (cf Les mé- tiers du Big Data). Ce qui est certain, c’est que, quel que soit le choix d’organisation retenu par l’entreprise, l’intégration des outils Hadoop/MapReduce ne relève pas seulement d’un arbitrage technologique mais plus d’une stratégie liée à l’utilisation des données. En fonction de cela, l’urbanisation des systèmes d’information peut profondément évoluer : accès aux données, gestion des entrées et des sorties, formats de données et métadonnées, etc. D’autre part, une des interrogations des DSI concerne l’acquisition progressive ou non des technologies Big Data : faut-il faire un « Big Bang » du Big Data par rapport à l’architecture existante, ou bien peut-on construire à partir de cette dernière ? Et faut-il nécessairement tout installer dès le premier jour ou peut-on rajouter progressivement des montré que 61% des CIO préféraient s’équiper de solutions extérieures plutôt que de développer leur propre infrastructure, et cela en raison du trop grand investissement en temps et en personnel représenté. Le problème est qu’il est parfois difficile de reconnaître les atouts d’une solution par rapport à une autre : comment choisir entre une offre mettant en avant la rapidité de traitement par rapport à une autre qui se focalise sur les gros Bien souvent ces différentes applications fonctionnent de manière packagée avec Hadoop : on parle donc davantage de « plateforme » Hadoop pour évoquer la structure constituée des différentes briques. Les technologies Big Data face aux besoins de la DSI Comment choisir les outils adéquats parmi les nombreuses offres disponibles ? On le voit, les bases du Big Data sont assez simples du fait qu’elles soient limitées à un nombre restreint d’outils. Pourtant les offres sur le marché sont très nombreuses : les fournisseurs de technologies proposent en effet des offres variées appuyées sur Hadoop. L’avantage de ces solutions packagées et applicatives tient souvent dans la facilité d’utilisation : comme Hadoop est un framework complexe qui réclame des efforts de programmation pour son inté- gration dans l’architecture de l’entreprise, les fournisseurs proposent des solutions directement utilisables qui épargnent ces efforts à l’utilisateur. Une étude réalisée pour Infochimps a ainsi STOCKAGE Nœud 1 Nœud 2 Nœud 3 FILE SYSTEM HDFS Reduce 1 Reduce 2 Reduce 3 Map 1, 2, 3 Map 4, 5, 6 Map 7, 8, 9 Résultat Final TRAITEMENT REQUETAGE Pig Hive Schéma simplifié d’une architecture Hadoop/MapReduce « 61% des CIO préfèrent s’équiper de solutions extérieures plutôt que de développer leur propre infrastructure »Avec le Cloud et l’apparition du BYOD, les possibilités d’infraction externes dans le système d’information de l’entreprise sont de plus en plus nombreuses. Voilà pourquoi la segmentation et la restriction des accès aux données deviennent des éléments de régulation importants. Mais au-delà, les fournisseurs se penchent de plus en plus sur le perfectionnement d’outils de sécurité en lien avec le Big Data : et l’ironie de la manœuvre est que, pour cela, ils utilisent précisément… le Big Data ! En effet, l’intérêt du Big Data est de pouvoir détecter des anomalies, même les plus infimes, parmi les événements remontés. Dans les journaux de sécurité, le Big Data est donc un atout de taille pour prévenir les attaques et guérir les failles analysées ! Une étude réalisée par Varonis a ainsi montré que le Big Data permettait de détecter des données sensibles, d’identifier des activités malignes et de déterminer les utilisateurs dotés de droits d’accès excessifs… mais que seulement 54% des DSI le savaient ! La sécurité a été l’un des thèmes phare de 2013, au même titre que la qualité des données, l’objectif étant pour les deux de maitriser le data deluge et de garantir l’intégrité de l’utilisation. Les questions liées à l’implémentation du Big Data au sein de la DSI restent donc nombreuses car le phénomène est encore jeune, sans retours d’expérience de long terme, et les compétences sont encore balbutiantes en interne pour apprivoiser rapidement le phénomène. Pourtant, 81% des CIOs déclarent que le Big Data fait partie de leurs cinq principales priorités en 2013, ce qui montre la volonté palpable des entreprises à s’équiper rapidement. Du coup, les cabinets de conseil et d’intégration se sont positionnés rapidement pour apporter une expertise opé- rationnelle sur la mise en place de ces infrastructures. Des études montrent ainsi que les recrutements en SSII sur la thématique Big Data ont considérablement augmenté au cours de l’année écoulée. 1) La fondation Apache est l’organisation qui a vu naître Hadoop… Pouvez-vous résumer pour nous les origines d’Hadoop ? Si l’on se plonge dans les origines lointaines d’Hadoop, tout a commencé au début des années 2000 avec un projet appelé Apache Lucene : il s’agissait de mettre en place une bibliothèque numérique en open source, qui serait dédiée à la création d’index pour la recherche textuelle (exactement comme l’index que l’on trouve à la fin des livres et qui indique le numéro de la page contenant tel ou tel terme…sauf que Lucene indiquerait le document contenant ce terme). Alors que Lucene avait simplement pour objet de répertorier des textes afin de faciliter les recherches, l’idée s’imposa peu à peu qu’il fallait créer un moteur de recherche de grande échelle, sur l’ensemble de la Toile. Pour cela, il fallait récupérer deux éléments : un outil d’indexation pour les nouvelles pages découvertes sur Internet en suivant des liens connus (web crawling), et un outil d’extraction de contenu (pour les pdf, le contenu html, les documents Microsoft Word…). La réunion de tous ces éléments a donné naissance au projet « nutch ». Nutch s’est construit progressivement entre 2002 et 2004 ; comme il visait à fournir un moteur de recherche pour l’ensemble d’Internet, on comprit vite qu’il fallait recourir au traitement distribué sur plusieurs machines et non plus une seule. Heureusement, c’est à peu près au même moment que Google publiait son article sur le Google File System ainsi que sur le traitement MapReduce… De tout cela: Lucene (l’index), Nutch (le “collecteur de données”) et MapReduce (le système de traitement), toutes les conditions pour le Big Data étaient réunies! En 2005, des premières expérimentations pour un système de fichiers distribués (« nutch distributed file system ») furent lancées au sein de nutch (celles qui mèneraient ensuite au HDFS, le système de fichiers à la base d’Hadoop). Lorsqu’Hadoop fut converti en un sous-projet de Lucene, indépendant de nutch, Yahoo! décida de l’adopter pour accroître ses capacités de cartographie du web et de contribuer au projet. C’est finalement en 2008 que le projet acquit un statut de priorité (« top-level ») menant à la création d’une communauté autonome pour le gérer ! Interview « L’Open Source implique un grand nombre de défis » Isabel Drost-Fromm Co-Fondatrice / Contributrice, Apache Mahout. Membre de l’Apache Software Foundation De tout cela: Lucene (l’index), Nutch (le “collecteur de données”) et MapReduce (le système de traitement), toutes les conditions pour le Big Data étaient réunies! 16 Capture d’écran de la page Issues d’Apache Hadoop *https://issues.apache.org/jira/browse/HADOOP#selectedTab=com. atlassian.jira.plugin.system.project%3Aissues-panel 2) Selon vous, quels ont été les bénéfices d’une approche open source pour la gestation d’Hadoop ? Et ses limites ? Le grand atout de l’Open Source a été d’aider le projet à atteindre sa maturité : plus le projet attirait de contributeurs (comme Yahoo!, Facebook, Linkedin et autres), plus il s’améliorait. Mais bien sûr, il s’agit d’être prudent avec ce type d’approches car l’Open Source implique un grand nombre de défis : comme chacun apporte sa pierre à l’édifice, vous devez faire attention à ce que l’ensemble reste cohérent, à ce que le but initial soit toujours poursuivi et à ce que les contributeurs comprennent qu’ils travaillent sous l’enseigne Apache, et non pas pour leurs entreprises d’origine, dont les stratégies pourraient se trouver en conflit avec les développements du projet. Et également que les acteurs sont assez formés pour maintenir la bonne qualité de la structure. C’est un défi bien sûr, mais les résultats et les améliorations durables parlent d’ellesmêmes, je crois ! Si vous avez le temps, rendez-vous sur la page « Issues » d’Apache Hadoop*, vous trouverez les chantiers actuels sur lesquels travaillent les contributeurs pour améliorer l’outil ; cela vous donnera une idée du dynamisme de la communauté Hadoop ! 3) Justement, qu’est-ce qui pourrait être amélioré sur Apache Hadoop ? Quels sont les terrains de recherche actuels ? Là encore, la meilleure réponse concernant les développements actuels et les terrains d’exploration se trouve sur cette page Issues. Comme le développement est complètement ouvert, les forces, les faiblesses et les bugs peuvent être découverts facilement, à la fois par les utilisateurs et les contributeurs. Les principaux défis relevés sur d’autres projets de l’écosystème Hadoop sont ceux qui visent à rendre les requêtes plus rapides et plus faciles à réaliser. Peu de personnes les formulent en pur Java Map/Reduce ; la plupart utilisent d’autres langages de requêtes plus sophistiqués comme Pig, Hive, Cascading, Cascalog, Scalding, etc. Concernant Hadoop en lui-même, une voie intéressante d’exploration vise à rendre les clusters Hadoop plus économes en énergie, en orientant les données les moins utilisées vers des disques qui peuvent être ralentis, permettant ainsi la réduction des coûts d’énergie… mais avec le risque de rallonger le temps d’analyse. Isabel Drost-Fromm Co-Fondatrice / Contributrice, Apache Mahout. Membre de l’Apache Software Foundation 16Customisation marketing : Monoprix et dunnhumby Monoprix et leur partenaire dunnhumby ont présenté un projet original d’utilisation marketing du Big Data : il s’agit d’une expérience de personnalisation de mailings pour chaque client, avec des offres de discount adaptées aux préfé- rences de consommation de ce client. Cette opération, qui est une déclinaison du programme de fidélité de Monoprix, vise à mettre en adéquation les offres de couponing proposées par les marques avec les profils de consommation clients : pour chaque client, un mailing unique est créé grâce à un algorithme d’allocations qui génère des combinaisons inédites d’offres promotionnelles. Les clients qui reçoivent ce courrier, mail ou papier, ont la possibilité de se rendre en magasin avec l’offre imprimée pour béné- ficier de ces promotions personnalisées. Au total, ce sont 33 millions de transactions de clients Monoprix qui ont été analysées, ce qui représente 350 millions d’articles achetés. Ces données sont donc essentiellement des données transactionnelles mais dunnhumby intègre également les données « préférence de média », à savoir le taux de retour des coupons papier pour établir une préfé- rence média. L’allocation coupons/clients dure moins d’une heure. Lancée en février 2012 pour Monoprix, cette initiative (déjà expérimentée auprès de Tesco en Grande Bretagne et Kroger aux Etats-Unis) a fait la preuve de son efficacité : le taux de retour des coupons a été doublé par rapport à des coupons non personnalisés. Interview « Il faut que les équipes data et les équipes créatives travaillent main dans la main » Hannah Whittall Directrice Coms & Media, dunnhumby France 1) Pouvez-vous nous parler de la genèse de ce projet? La communication personnalisée de Monoprix est fondée sur le même modèle que les expérimentations menées, entre autres, chez Kroger (aux Etats-Unis) et Tesco (en Angleterre), pour récompenser les clients de façon régulière avec des offres personnalisées calculées à partir de leurs achats. Nous avons dé- montré le gain généré par cette approche et avons été capables d’automatiser tout cela grâce à un outil propriétaire qui permet la personnalisation des communications à partir de millions de transactions traitées en quelques minutes. Monoprix est le premier distributeur français à bénéficier de cet outil et de cette approche, déjà mis en place chez d’autres distributeurs de par le monde, avec un succès certain à chaque fois. 2) Comment choisissez-vous les clients qui recevront ces offres personnalisées? Nous contactons uniquement les clients qui sont « opt-in » (ceux qui choisissent de recevoir nos communications) puis nous effectuons une sélection à partir d’autres critères en lien avec les objectifs du programme. Une fois que les clients sont choisis, ils reçoivent donc leur mailing en lien avec leurs pré- férences. Nous suivons et analysons alors leur réponse à ce courrier, afin de pouvoir améliorer et optimiser en permanence le ciblage (qui reçoit la communication ?) et le canal (par quel canal devons-nous atteindre le client ?). 18 19Plus que par ses technologies innovantes ou son marché, le Big Data suscite surtout la curiosité pour ses nombreuses applications en entreprise. Celles-ci restent encore limitées à des retours d’expérience ponctuels mais elles sont en pleine phase de généralisation. Vous trouverez ici quelques exemples inspirants, dans plusieurs domaines d’activité. Exemples d’applications en entreprises Monoprix 01 Hannah Whittall Directrice Coms & Media, dunnhumby France 18 3) Quels sont les plans futurs pour ce programme? Avez-vous des améliorations à apporter? Il y a des améliorations à apporter sur le canal de distribution et également sur le processus de retrait de l’offre (dématé- rialisation de l’offre sur mobile ou directement par mail, au lieu de l’impression papier). Nous travaillons là-dessus en lien étroit avec nos clients du retail en fonction des technologies dont ils disposent. Nous pourrions également songer à intégrer dans le traitement d’autres types de données clients : les historiques de navigation, les données sociales, la géolocalisation également afin de fournir du contenu et des offres plus précises, en temps réel, lorsque le client en manifeste le besoin ou les recherche activement. 4) Craignez-vous que ce nouveau type d’approche transforme le métier du marketer?... En termes de créativité par exemple? Bien sûr, cela a un impact sur le travail et les compétences du marketer mais cela n’atténue en rien l’importance de la créativité. Le plus de données et d’informations nous réunissons à propos du client, le mieux nous pouvons informer et briefer les équipes créatives et contenu. Sur ce projet, nous traitons principalement d’offres commerciales, mais nous pouvons également personnaliser les contenus et les messages délivrés afin qu’ils soient encore plus pertinents. Comme nous sommes de plus en plus capables de le faire en temps réel via les médias digitaux, de nombreuses opportunités s’offrent à nous. On s’accorde de plus en plus sur le fait qu’il faut que les équipes data et les équipes créatives travaillent main dans la main. Une expé- rience 100% créative, même si elle est très bien réalisée, sera toujours difficile à quantifier dans ses résultats, mais elle vise toujours à comprendre qui est le client ; c’est là où un savant mélange d’art et de science peut ajouter énormé- ment de valeur ! 19Optimisation du traitement industriel : La Poste Le projet Orest TAE, en production depuis décembre 2011, collecte et restitue toutes les informations disponibles sur un pli lors de la réception, du tri et de la distribution de celui-ci. Il s’agit d’une plateforme d’indexation des courriers qui traite 110 millions de documents par jour, selon un rythme pouvant aller jusqu’à 4000 documents par seconde en heure de pointe ! Au total, plus de 2 milliards de documents sont indexés sur cette plateforme. On notera que les systèmes de capteurs industriels (ex : lecture optique des plis, flasheurs manuels, machines de tri ou encore EDI client) sont interconnectés à la plateforme ce qui lui permet de croiser de multiples sources de données, dont des équipements industriels lourds, ce qui constitue une expérience originale. L’objectif de ce projet très ambitieux est double : • Il s’agit d’obtenir une vision générale des flux de courriers et de pouvoir remonter ainsi des indicateurs de performance utiles au pilotage de l’activité en temps réel, • mais il permet également aux agents opérationnels d’obtenir directement l’information sur un pli. En cas de demande liée à des anomalies, la détection est ainsi facilitée et la réaction beaucoup plus rapide : la plateforme propose en effet des outils de visualisation des anomalies au niveau le plus fin que constitue le traitement d’une enveloppe. Les travaux ont été menés conjointement avec Dassault Systems, Exalead et Sopra Group, et la plateforme est aujourd’hui accessible à 800 utilisateurs répartis sur les sites de production : on considère que leur nombre moyen de requêtes journalières est de 15000, avec un temps de réponse inférieur à 3 secondes ! Avec l’évolution régulière des fonctionnalités, sur la base des demandes concrètes des utilisateurs qui se familiarisent avec les analyses permises par ce type de technologie, le nombre d’utilisateurs continue à augmenter régulièrement. Suite à cette implémentation, La Poste espère ainsi remplacer ses approches statistiques historiques par une vision davantage unitaire des événements. Avec, à la clé, une amélioration de la performance des sites et du service client… Interview « Orest est devenu un outil clef dans la logique de fonctionnement du réseau industriel » Denis Weiss DSI Industriel, La Poste 1) Le projet OREST TAE permet à la Poste de visualiser au plus fin les anomalies ou des améliorations potentielles dans le traitement du courrier. Quels ont été les principaux défis à relever pour que le système montre toute sa performance ? Au-delà de l’infrastructure technique qu’il a fallu stabiliser, les deux principaux défis ont été de permettre à toutes les équipes de se familiariser à ces technologies. Techniquement, il fallait déterminer comment exploiter efficacement ce type de système ; et, d’un point de vue fonctionnel, s’habituer au fait que l’analyse ne se faisait plus sur un tableau imprimé mais plutôt sur écran, par itération. De plus, il était nécessaire de valider le fonctionnement exhaustif car, si les méthodes de recette classiques fonctionnent pour une, voire pour quelques dizaines de milliers de données, ce n’est plus forcément le cas avec 1 milliard de données ! 2) Votre plateforme permet de calculer des indicateurs de pilotage sur la production de courrier. Quels types d’indicateurs avez-vous mis en place ? Et pouvez-vous évaluer l’évolution de la performance des sites et du service ? Il est très difficile d’attribuer l’amélioration des indicateurs de qualité ou une moindre exposition aux aléas à un outil, en effet – et c’est particulièrement vrai dans le cas d’Orest - la performance vient de la bonne utilisation, de la bonne compréhension par les utilisateurs. La pertinence et donc la performance induite par ce type d’outil se mesure à mon avis à l’usage qui en est fait et à la satisfaction des utilisateurs : aujourd’hui Orest n’est pas un outil de plus, c’est devenu un outil clef dans la logique de fonctionnement du réseau industriel. 20Exemples d’applications en entreprises 02 Denis Weiss DSI Industriel, La Poste 20 3) Votre projet se poursuit et s’amplifie… Combien de personnes seront à terme impliquées dans ce nouveau process ? Comptez-vous apporter des évolutions qualitatives à la plateforme ? Nous pensons doubler le nombre d’utilisateurs, mais en particulier nous nous appuyons de plus en plus sur ces données pour générer des rapports et des interactions dans d’autres outils et d’autres process : à travers la mise en place de web-services directement sur la base Orest, celui-ci devient le support de reportings et de nouveaux services en dehors du monde industriel et aussi pour nos clients. 21 La PosteRecherche : Projet DEUS Mené par l’Observatoire de Paris, avec l’aide de GENCI (Grand Equipement National de Calcul Intensif), le projet Deus lancé en 2011 visait à modéliser pour la première fois la formation des structures cosmiques dans tout l’Univers observable, depuis le Big Bang jusqu’à nos jours. Pour cela, trois hypothèses avaient été retenues, correspondant à trois modèles d’énergie noire (composante énergétique de l’univers qui constitue un moteur de son expansion) : il fallait comprendre ainsi quel était l’impact de cette énergie sur l’univers et donc en déduire sa nature. Pour cela, un grand nombre de données représentant 550 milliards de particules de l’univers (issues du télescope spatial WMAP) ont été injectées dans le supercalculateur CURIE de GENCI, installé au TGCC du CEA, qui présente une capacité de traitement de 2 pétaflops par seconde (2 millions de milliards d’opérations par seconde). Il s’agissait d’opérer les traitements pour chacune des trois simulations en utilisant toutes les capacités de calculs de la machine (76000 cœurs de calcul sur 80000, 360 To de mémoire). Au total, ce sont 150 pétaoctets de données brutes qui ont été générées, ce qui posait une problématique de stockage : la solution a donc consisté à développer un outil de post-traitement qui, en parallèle du calcul, a permis de réduire à la volée ce volume de données générées, sans pénaliser les temps de simulation. Au final, ces traitements ont permis de réduire l’étude à 1,5 pétaoctets de données raffinées, grâce à un débit de stockage des données très important (50 Go/s) ! Le résultat, disponible pour la communauté scientifique internationale, est une modélisation de la distribution de matière dans tout l’Univers observable, semblable à celle qui pourrait être observée par les télescopes : c’est donc un support exceptionnel d’étude pour les agences spatiales ESA et NASA, et ces modélisations permettront d’apporter des interprétations substantielles aux observations du satellite européen Planck. Outre la performance en cosmologie, cette expérience, unique à l’échelle mondiale, est également une prouesse dans l’univers du calcul haute performance : elle ouvre le champ à d’autres applications du calcul intensif (HPC), comme par exemple pour le projet ITER ou les simulations climatiques, selon le même principe d’optimisation des entrées et sorties et de post-traitement à la volée des résultats. Interview « Big Data et HPC sont amenés à converger » Stéphane Requena Responsable technique, GENCI 1) Cette expérience est un modèle de performance technologique et d’optimisation des machines… au-delà de cet aspect « automatisé », quels sont les travaux d’analyse que vous avez réalisés ? Il reste aux chercheurs de l’Observatoire de Paris un gros travail d’analyse des résultats à effectuer : en effet, même si les données raffinées ont un volume réduit par rapport aux données de sortie brutes, elles restent volumineuses et complexes. Aujourd’hui, nous avons un film global sur l’évolution de l’Univers mais si nous voulons analyser plus précisément la formation de certaines structures, il faut identifier les données pertinentes. Il y a donc un effort d’analyse à faire pour corréler ces données de sortie, corroborer les résultats et effectuer de nouveaux calculs. Forcément, les équipes de recherche doivent être dimensionnées pour absorber ce volume massif de données, et c’est là un nouvel enjeu : du coup, on cherche à développer l’analyse automatique Big Data, c’est-à-dire utiliser des outils automatisés qui identifieront uniquement les données pertinentes pour les chercheurs. 2) Suite à cette expérience, quels sont les prochains projets de ce type que l’on peut attendre ? Il y a de nombreux domaines dans lesquels on peut envisager un couplage du HPC avec du Big Data, par exemple pour la combustion (dans les secteurs automobiles, aéronautiques et dans l’énergie) ; en effet, les calculs modélisant la combustion peuvent représenter des dizaines de téraoctets de données, qu’il est intéressant de traiter pour garantir une combustion homogène et stable. En effet, sans homogénéité et stabilité, les anomalies de combustion peuvent conduire à un mauvais rendement des moteurs avec à la clé des problèmes de surconsommation, de pollution et même d’explosion…d’où la nécessité de faire des simulations. Autre secteur d’application : la climatologie où l’on souhaite modéliser l’évolution du climat avec des maillages très fins de la Terre, ce qui implique plusieurs modèles complexes de simulation que l’on lie entre eux. A terme, la communauté de la climatologie envisage de traiter des exabytes de données ! 3) Pour vous, quel est le lien entre HPC et Big Data? Parle-t-on de la même chose ? En quoi diffèrent-ils ? Quand on parle de Big Data, on parle du traitement de grands volumes de données, c’est-à-dire une fouille dans des données et une interprétation des résultats qui peut, dans le cas de données complexes, recourir à du calcul. Le HPC quant à lui correspond à du calcul scientifique, que l’on applique à plusieurs 22 23 Le supercalculateur CURIE de GENCI installé au TGCC du CEA - © CADAMExemples d’applications en entreprises 03 Stéphane Requena Responsable technique, GENCI 22 domaines scientifiques ; c’est donc davantage l’utilisation de modèles mathé- matiques sur des superordinateurs. Forcément, ces deux domaines sont amenés à converger : si l’on prend l’exemple des données livrées par les nouveaux télescopes, nous avons besoin à la fois de calcul haute performance pour accélérer le traitement, et d’interprétation des données pour tirer de véritables informations. Le rythme de traitement est important lorsque l’on gère des gros volumes : si l’on optimise un calcul mais que le traitement des données est lent, l’analyse au global ne sert à rien. 4) La France a été à la manœuvre sur ce projet… pouvez-vous nous expliquer les origines ? La France dispose du supercalculateur CURIE qui était à l’époque une des trois machines capables dans le Monde de réaliser cette simulation DEUS (les autres se trouvant en Chine et aux USA). CURIE présente de grosses capacités à la fois pour le calcul et le stockage, en mémoire et sur les disques ; en 2012, elle est mise à disposition par GENCI à destination de la communauté scientifique européenne via l’infrastructure de recherche PRACE. Le projet DEUS émanait de l’Observatoire de Paris qui cherchait une machine pour pouvoir effectuer ses simulations donc nous avons pu la leur mettre à disposition. Depuis d’autres machines ont été rendues également accessibles dans PRACE : en Allemagne, des chercheurs anglais sont actuellement en train de finaliser des simulations massives en climatologie, notamment sur la modélisation des cyclones dans le golfe du Mexique. Si elles aboutissent, leurs recherches auront permis grâce à PRACE d’avoir 3 ans d’avance sur les travaux en cours dans le domaine ! 23 L’Observatoire de Paris Stéphane Requena (à droite) et Jean-Michel Alimi de l’Observatoire de Paris, reçoivent le prix spécial du jury lors des Trophées de l’Innovation Big Data Exemple de modélisation de l’universLocalisation : Géomarketing selon SFR Menés depuis deux ans par une équipe dé- diée au sein de l’entreprise, les travaux de géomarketing de SFR ont visé à collecter et analyser les données de géolocalisation des utilisateurs réseaux, afin d’en tirer des informations sur la fréquentation et les flux de populations sur certaines zones géographiques. Ainsi SFR a pu établir que le Festival de Cannes avait réuni 389 500 visiteurs dont 16 % d’étrangers ! Comment fonctionne cette infrastructure ? En réalité, SFR a mis en place un serveur de collecte développé par Intersec qui récupère, via les antennes relais, toutes les données relatives à des événements de consommation (ex : allumer son téléphone, appeler, etc.), ce qui correspond à un total d’un milliard d’événements de mobilité par jour ! Puis ces données anonymisées sont croisées avec des données externes (de type Open Data) au sein d’un outil logiciel développé en interne sur deux bases, une NoSQL et une autre Hadoop. Les données d’événements sont également corrigées statistiquement pour correspondre aux parts de marché locales de SFR. L’intérêt d’une telle démarche est de fournir une information inédite aux collectivités locales et au secteur du tourisme : les analyses menées évitent en effet l’aspect déclaratif des questionnaires et les données sont disponibles en quasi temps réel. Pour l’opérateur, c’est une opportunité unique de valoriser ses données en vendant des études aux entités intéressées. Mais au-delà, ces données ont également une utilisation interne puisqu’elles permettent à l’opérateur de suivre la consommation de ses abonnés et d’intervenir plus rapidement sur la fidélisation, la gestion des fraudes et le service client. Interview « Aujourd’hui, on voit beaucoup d’opérateurs internationaux qui se lancent dans l’aventure alors que nous étions les seuls en Europe à l’époque » Mathieu Gras Head of LBS & Big Data Business Development Manager, SFR 1) Pouvez-vous revenir sur les origines de ce projet ? Comment s’est déroulé le développement de cette nouvelle activité ? C’est un projet qui a connu une phase de business development assez longue. En fait, nous avons rapidement constitué une équipe transversale et autonome, et nous souhaitions répondre à la fois à un besoin externe (connaître les flux de population) et à un besoin interne (avoir des indicateurs marketing temps réel). Nous sommes d’abord partis sur la réponse au besoin externe parce qu’il nous semblait le plus valorisable mais nous nous sommes rendus compte assez vite que nous étions trop en avance sur le marché et que, même si nos projets étaient bien reçus, ils étaient trop en rupture. Du coup, nous nous sommes concentrés sur la partie interne et nous avons constaté que les équipes adhéraient rapidement à nos projets car la donnée était immédiatement valorisée ! C’est par la suite que les activités externes se sont vraiment développées, car le marché était prêt et l’engouement autour du Big Data jouait sûrement en notre faveur ! Aujourd’hui, on voit beaucoup d’opérateurs internationaux qui se lancent à leur tour dans l’aventure alors que nous étions les seuls en Europe à l’époque. 2) Pour vous, y’a-t-il eu un basculement technologique ou cette activité aurait-elle pu être créée il y a cinq ans ? Très honnêtement, je pense que l’on avait les ressources technologiques : l’opérateur fait du temps réel depuis des années. Mais le traitement aurait forcément nécessité plus de ressources, plus de temps et donc plus d’investissement : le prix d’un serveur était bien supérieur il y a cinq ans ! De plus, d’autres sources de données sont à présent disponibles, ce qui rend les analyses plus complexes et donc plus intéressantes. Donc, oui technologiquement, nous aurions pu le faire, mais cela n’aurait pas eu le même intérêt économique et le marché n’aurait certainement pas répondu de la même façon ! 3) Y’a-t-il certains projets récents que vous avez réalisés avec cette plateforme de géomarketing ? Oui, nous avons travaillé en juillet dernier sur le Tour de France : l’objectif était d’observer l’affluence des populations sur le Tour et de déterminer l’impact de celui-ci sur le tourisme local (restauration, nombre de nuits d’hotels, etc.). En effet, les municipalités investissent de fortes sommes pour obtenir le passage du Tour sur leur territoire et le retour sur investissement en terme touristique est forcément une information qui les intéresse ! 24 25Exemples d’applications en entreprises 04 Mathieu Gras Head of LBS & Big Data Business Development Manager, SFR 24 25 SFR Etude de fréquentation du festival de Cannes Etude de fréquentation du Métro parisienAgrégation de Données : Projet Ellicible de Coface Services Coface Services (Ellisphere au 1er janvier 2014) est l’entité de référence concernant l’information d’entreprises en France : elle propose en effet une base de données unique sur les entreprises fran- çaises, qui repose sur de nombreuses sources publiques et privées. Afin de développer son offre de marketing direct et afin de la mettre en adé- quation avec les besoins de « real-time marketing », Coface Services a choisi d’évoluer vers une plateforme plus réactive qui permet au client de bénéficier d’un service haut de gamme combinant de multiples critères pour un résultat immédiat : ce service est adapté aux besoins du client dans la mesure où l’organisation de l’information (ciblage, segmentation, surveillance de groupes etc.) lui revient de façon autonome, contrairement aux segmentations fonctionnelles observées dans les bases de données traditionnelles. En effet, un effort important en matière de finesse, de granularité et de résolution a été réalisé au niveau de la segmentation. La plateforme Ellicible a ainsi vu le jour le 20 mars 2013 : elle est appuyée sur des technologies New SQL (et non Hadoop/NoSQL) intégrant le traitement massivement parallèle et développées par la société Parstream. Ainsi des milliers de requêtes à très fortes volumé- tries (plusieurs milliards de données) peuvent être exécutées en même temps, avec un très faible temps de traitement (quelques millisecondes). La grande avancée de cette plateforme tient dans le raccourcissement des temps d’affichage des résultats : ils sont cette fois-ci disponibles en temps réel. Enfin cette plateforme est évolutive car elle intègre de nouvelles sources partenaires de grand volume, en France et à l’international. Pour les clients, Ellicible crée ainsi de nouveaux usages dans leur recherche de prospects et d’informations sur les entreprises : ciblage facilité, segmentation et organisation de l’information personnalisées, obtention immédiate des résultats. Interview « Nous observons que l’usage de l’application parcourt l’ensemble de ses fonctionnalités » Jean-Daniel Ruegger Directeur de domaine au sein de la DSI, Coface Services 1) Cette plateforme combine volume et performance de traitement, mais elle agglomère surtout de multiples sources de données : pouvez-vous nous parler du processus d’agrégation de ces données distribuées ? En effet, hormis le volume et la vitesse qui sont nos contraintes techniques, nous avons également la contrainte fonctionnelle de la variété des informations que nous assemblons. Aujourd’hui nous collectons nos données d’une vingtaine de sources différentes et nous produisons aussi nos propres données en interne. Les sources sont différentes mais leurs cycles de renouvellement aussi. Nous avons donc un processus ETL relativement classique pour chaque filière, l’originalité résidant dans l’assemblage final et sa mise à disposition. 2) Vous avez opté pour une technologie SQL et non pour des plateformes de type Hadoop. Pour quelle raison ? Pensez-vous évoluer vers ce type de technologie à l’avenir ? Coface Services a une longue histoire et toute une série de «premières» dans le traitement de l’information. Sans remonter jusqu’aux racines de l’entreprise avec la création de Bottin en 1796, l’activité «Solutions Data» a innové avec la télématique dès le début des années 80, et les traitements massivement parallèles au début des années 90. Nous savions que nous voulions une technologie non-intrusive tant matériellement que du point de vue des compétences né- cessaires, donc nous cherchions une solution New SQL à traitement parallèle. Par ailleurs Hadoop – orienté batch – n’était pas envisageable. 3) Quels sont les retours que vous avez eus sur cette plateforme ? Les clients se sont-ils approprié ces nouveaux usages ? Les retours que nous avons eus sont nombreux, en interne aussi car nous utilisons la technologie pour des opérations de segmentations clé-en-main, vraiment « as a service ». Nous mesurons le degré d’appropriation par deux signes forts : d’une part, nous observons que l’usage de l’application parcourt l’ensemble de ses fonctionnalités, avec des retours très positifs ; et d’autre part, nos clients (qui vont de la PME à l’enseigne nationale ou internationale) nous demandent et suggèrent des extensions très innovantes, ce qui montre leur intérêt ! 26 27Exemples d’applications en entreprises 05 Jean-Daniel Ruegger Directeur de domaine au sein de la DSI, Coface Services 26 27 Coface Services28 29 : informatique (capacités de programmation sur les nouveaux outils), statistiques (capacité d’innovation et de modélisation) et business (capacité à interpréter les indicateurs et à les transformer en langage opérationnel). Ces profils polyvalents correspondent à un nouveau type de métier appelé Data Scientist, pour lequel les postulants sont encore rares : McKinsey estimait ainsi que la demande de Data Scientists pourrait atteindre 1,5 millions de postes dans le monde en cinq ans ! Par conséquent, les offres d’emploi liées à ce métier se multiplient depuis 2010 (cf interview de Jacques Froissant) et les rémunérations se montrent attractives mais les efforts de formation restent encore le nerf de la guerre et les profils expérimentés manquent à l’appel. En attendant de trouver la perle rare, les entreprises patientent en faisant monter en compétences leurs propres équipes, liées au Big Data. On pourrait également rajouter celles liées à la communication car la prise de décision appuyée sur les données repose bien souvent sur la capacité de représentation et de hiérarchisation de l’information, telle qu’on peut l’observer dans la datavisualisation. Dès lors, ces compétences réunies sont-elles à disposition pour l’entreprise ? Les nouveaux métiers du Big Data La question des compétences est une problématique souvent évoquée lorsqu’on parle de la mise en place du Big Data en entreprise : en effet, selon Gartner, seules 31% des entreprises estiment pouvoir lancer des projets Big Data en faisant appel à leur personnel existant. Elles recherchent en effet des profils capables d’agglomérer les trois qualités Quelles sont les nouvelles compétences liées au Big Data ? En modifiant peu à peu les paradigmes de l’analyse de données, le Big Data a créé de nouveaux besoins : en effet, les compétences informatiques sont mises à l’épreuve par la complexité des supports de base que sont Hadoop, MapReduce, NoSQL, etc. Même en faisant appel à des fournisseurs et des sociétés de service, la nécessité de disposer en interne de compétences techniques assez poussées se fait de plus en plus prégnante : si le Big Data doit être déployé de façon généralisée dans plusieurs services de l’entreprise, il est indispensable d’avoir à disposition des équipes pouvant connecter rapidement ces nouvelles technologies avec les besoins business. Autre impératif réclamé par le Big Data : la possibilité d’analyser les données traitées avec une vision métier. En effet, c’est dans la partie analyse que le Big Data révèle bien souvent ses qualités stratégiques, ce qui nécessite forcément d’exploiter les données selon des objectifs business propres à chaque département. En marketing par exemple, cette approche est de plus en plus observée : les marketers s’orientent de plus en plus vers l’intégration de compétences « data » dans leurs équipes, ou bien ils se forment eux-mêmes à ce nouvel impératif. Enfin, le Big Data porte en lui de nombreuses promesses liées à l’évolution des algorithmes et des statistiques : pour que les données puissent être vraiment exploitées à des fins prospectives, les modèles statistiques sont amenés à évoluer, ce qui pousse nécessairement les entreprises à envisager l’embauche de statisticiens et diplômés en mathématiques. « Informatique, statistique, business » est donc le triptyque des compétences Les métiers du Big Data Que change le Big Data aux compétences en place ? Comment s’y adapter ? Et quels sont les modes d’organisation à privilégier pour capter toute la valeur des données ? Voici un petit tour d’horizon de l’entreprise en format Big Data. « La nécessité de disposer en interne de compétences techniques assez poussées se fait de plus en plus prégnante » Informatique Statistique Business28 29 La nécessaire communication entre les métiers Plusieurs départements sont ainsi concernés : les métiers IT, les métiers de la statistique et de la BI, et bien sûr les métiers opérationnels, ceux qui disposent des données et qui cherchent à les mettre à profit. Pour toutes ces entités, le Big Data bouleverse l’ordre établi dans la mesure où il invite à davantage de synergies entre les métiers afin de faciliter le traitement et la communication des données : les services supports doivent en effet travailler main dans la main avec les départements business pour éviter un aller-retour chronophage de l’information ainsi que des lourdeurs technologiques. Les équipes business sont donc de plus en plus impliquées dans le traitement et l’analyse de leurs propres données (d’où l’importance de leur montée en compétences) ce qui modifie également le rapport à la décision : en effet, par leur rapport direct et immédiat aux données, les agents opé- rationnels disposent d’un avantage comparatif indispensable qui leur confère une position particulière dans la « data-centric organization ». Contrairement à une approche top-to-bottom, l’entreprise en mode Big Data fait ainsi de la remontée des informations une clé de sa croissance. Quant aux départements IT, leur rôle sera particulièrement mis en avant lors de l’implémentation des outils et lors des premières expérimentations avec les équipes métiers ; au fur et à mesure de la courbe d’apprentissage, ils pourront peu à peu se recentrer sur une mission de support et de développement, laissant aux équipes d’analystes le soin de récupérer les données. Enfin les profils BI et statistiques pourront être soumis à plusieurs types d’organisadéclaraient avoir augmenté et enrichi leur offre de formation en business intelligence. Au-delà, ce sont les entreprises des fournisseurs qui prennent le relais en mettant en place des séminaires de formation et des initiatives de type « université en ligne ». L’impact du Big data sur l’organisation de l’entreprise Au-delà de la mise à disposition d’outils et de ressources humaines et financières, le Big Data soulève logiquement une problématique d’organisation au sein de la structure qui choisit de l’implémenter : en effet, puisque le Big Data est censé prendre en compte des données réparties dans plusieurs services de l’entreprise et mettre en place des processus décisionnels transverses, il implique forcé- ment une approche globale mettant la donnée au centre des attentions. notamment sur des métiers comme le data mining qui présentent déjà certaines caractéristiques proches de la data science. Les offres de formation en France Afin de pallier le déficit de profils « data scientist » disponibles, les organismes de formation et les établissements universitaires ont lancé des programmes intégralement dédiés au Big Data, ou envisagent de le faire : c’est le cas de Télécom ParisTech ou l’ENSAI mais également d’organismes privés qui font évoluer leurs offres de formation sur le segment décisionnel. Ces dernières sont bien souvent sectorielles ou orientées Hadoop mais elles ont l’avantage de permettre aux professionnels en poste de se mettre à niveau. Quant aux parcours universitaires, ils ré- pondent généralement à la dichotomie « informatique vs statistique » : il est très rare en effet de trouver des masters réunissant ces deux domaines de formation (seul le Master spécialisé Big Data de Télécom ParisTech, 1er du genre en Europe, le propose actuellement). Du coup, ce sont plutôt les écoles et DUT de statistiques qui sont à la manœuvre : on recense ainsi 70 spécialités de master en statistiques à l’université mais aucun n’est pour l’instant dédié au Big Data. Selon l’étude State of Business Intelligence Survey réalisée en 2013 pour Teradata, 41% des professeurs d’université interrogés « Selon Gartner, seules 31% des entreprises estiment pouvoir lancer des projets Big Data en faisant appel à leur personnel existant » Panorama des enseignements dispensés au sein du Master «Gestion et Analyse des Données Massives» de Telecom Paristech • L’écosystème Big Data • Bases de Données et Bases de Données Avancées • Données personnelles • SI Décisionnels et Gestion de la Relation Client • Ingénierie du web • Transport et routage dans l’internet • Machine-Learning • Visualisation • Apprentissage Statistique « en ligne » et distribué • Systèmes Répartis • Sécurité des systèmes d’information (source : site internet du Master)30 d’intention en France : on ne recense pas encore de CDO français, et, actuellement, ce sont plutôt les DSI qui assument le relais auprès de la direction. Mais, aux Etats-Unis, les exemples se multiplient, essentiellement dans l’administration (villes de Chicago, San Francisco, NYC, US Army, Federal Reserve, etc.), ce qui a conduit un cabinet de conseil, Russell Reynolds Associates, à prédire la création d’un tel poste pour la moitié des firmes du classement Fortune 500 d’ici à 2015… question de la rapidité du cycle de décision, les allers-retours avec les équipes opérationnelles étant moins intégrés. On le voit, la question de l’organisationtype n’a pas encore été tranchée, essentiellement parce que les entreprises n’ont pas toutes les mêmes besoins et n’utilisent pas les données de la même façon… C’est la raison pour laquelle une réflexion stratégique doit précéder tout achat d’outils Big Data ou toute mise en place hâtive car les entreprises doivent avant tout faire l’inventaire de leurs besoins et de leurs ressources. C’est d’ailleurs une des principales préconisations des cabinets de conseil qui agissent en ce sens auprès des entreprises pour dessiner des organisations censées réagir efficacement et de façon opérationnelle à la problématique du Big Data. Le Chief Data Officer La réorganisation de l’entreprise autour des données pose nécessairement la question de la structuration de la prise de décision et des remontées hiérarchiques auprès des instances dirigeantes : en effet, l’utilisation de la donnée, pour être efficace, doit s’inviter jusqu’au Comité de Direction des entreprises ! Mais pour cela, il manque encore actuellement des porte-parole identifiables dont la fonction serait d’orienter les dé- cisions globales de l’entreprise en fonction des données traitées. Ce déficit de personne ou plutôt de fonction a vite été pallié par la création d’un nouveau personnage au cœur de l’entreprise : celui de Chief Data Officer. Au même titre que le CTO ou le CIO, le CDO serait donc un responsable exécutif pour les données de l’entreprise, qui s’efforcerait d’appuyer les décisions du CODIR sur les données. Il chapeauterait donc toute l’organisation dédiée aux données, qu’elle soit centralisée ou non. Pour l’instant, ce rôle est resté à l’état tion en fonction de leur proximité avec les métiers : dans le cas d’une centralisation de leurs compétences, ils seront amenés à récupérer les données issues des services opérationnels afin de les traiter en lien avec ceux-ci. Mais on peut également imaginer une intégration de ces profils directement au sein des équipes métiers afin de raccourcir le cycle de décision. Plusieurs types de « data-driven organization » En écho à cette pluralité d’organisations pour les métiers décisionnels, on remarque que les entreprises pionnières ont adopté plusieurs schémas mettant en avant leurs données. • L’option « décentralisée », à savoir la mise en place du Big Data « métier par métier » ou « service par service » (souvent au fur et à mesure, en fonction de l’importance relative des données pour les différents départements) : dans ce schéma, le département métier (ex : le marketing) intègre les outils en son sein avec l’appui de la DSI. Les analystes mé- tiers sont mis à profit au cœur de la division pour l’exploitation des données, ce qui réclame une montée en compétences (cf + haut). Dans le cas où l’entreprise dispose d’un département BI dédié, celui-ci est amené à servir de support pour les projets menés, ou peut être éclaté dans les différentes directions opérationnelles. • L’option « centralisée », à savoir la constitution d’une direction dédiée au Big Data au cœur de l’entreprise, afin de centraliser toutes les données et d’effectuer le traitement et l’exploitation pour le compte des entités opérationnelles. Bien sûr, ce type de structure fonctionne également en synergie avec d’autres services (les métiers bien sûr, mais également l’IT) mais elle présente le grand avantage de réunir en autonomie des professionnels du Big Data qui pourront ainsi impulser le mouvement « datacentric » et proposer des projets transversaux (ex : mutualiser les données de plusieurs services). • Enfin, l’option la plus utilisée actuellement est certainement l’option de la sous-traitance : confier à une entreprise spécialisée dans le Big Data la gestion des données et les analyses conjointes. Cette option qui a le mérite de la souplesse et qui permet d’enrichir l’exploitation des données par une expertise extérieure (ainsi que par des données externes) pose toutefois la « La question de l’organisation-type n’a pas encore été tranchée » « L’utilisation de la donnée, pour être efficace, doit s’inviter jusqu’au Comité de Direction des entreprises » Mark Headd, CDO de la ville de Philadelphie30 1) On parle beaucoup de la fonction de « data scientist » en lien avec l’émergence du Big Data. Comment définiriez-vous ce nouveau poste ? Pour moi, il n’y a pas une mais deux fonctions autour de la data : 1) une fonction technique, scientifique, appelée « data scientist » qui correspond à une culture ingénieur statistique et informatique, et qui s’occupe de récupérer les données, de les structurer et de les produire, 2) puis une fonction davantage business appelée « data analyst » qui exploite ces données afin d’aboutir à des préconisations business. Généralement, ce deuxième profil provient d’école de management ou de formations en marketing. On le retrouve beaucoup dans le secteur du e-commerce où les budgets et préconisations en matière d’acquisition client ont une importance stratégique. 2) Les deux fonctions sont-elles complémentaires ? Faut-il embaucher les deux ? Cela dépend beaucoup de la taille de l’entreprise : souvent les petites entreprises vont d’abord se doter d’un data analyst, car la problématique web correspond à des enjeux business immédiats. Mais dès que l’on monte en taille, on rencontre de plus en plus de data scientist. Dans les grandes entreprises, dans le retail ou en banque, ils sont de plus en plus présents. La demande a beaucoup augmenté pour ces postes-là : si vous regardez les offres d’emploi liées au Big Data sur les moteurs de recherche, vous constaterez qu’elles ont doublé dans les 6 derniers mois. 3) Justement, pensez-vous qu’il y ait un décalage entre la demande et l’offre ? Y’a-t-il un manque de profils disponibles pour répondre aux besoins des entreprises ? Et comment y remédier ? Il est effectivement difficile de trouver les deux types de profils, car la demande pour ces deux fonctions a explosé très rapidement. C’est sûrement pour le data scientist que le décalage est le plus fort… ils sont très sollicités. Cependant, en France, on recense 17 formations professionnelles et universitaires qui proposent des programmes en lien avec ces fonctions. J’ai confiance dans le fait que ces efforts porteront leurs fruits rapidement : la France est plutôt bien armée pour combler le fossé entre offre et demande sur ces compétences-là. 4) Autre sujet actuel : on parle de plus en plus d’application Big Data dans les RH (recrutement, gestion de la paie…). En connaissez-vous quelques-unes ? Effectivement, il y a de plus en plus d’initiatives RH liées au Big Data. Par exemple, sur le recrutement, l’entreprise américaine Evolv a décidé d’exploiter les données d’une entreprise de plus de 20 000 employés pour tenter de mettre en avant des facteurs de performance. Ils se sont ainsi rendus compte que : 1) il n’y avait aucune corrélation entre le CV et la performance, 2) les personnes actives sur les réseaux sociaux étaient souvent les plus performantes et les plus fidèles à l’entreprise… assez surprenant non ? Linkedin est également assez en avance sur ces questions-là : ils travaillent en permanence sur les données de leurs membres et permettent aux entreprises de cibler beaucoup plus finement les candidats et prospects qui leur semblent correspondre à leur activité. 5) Pensez-vous que les entreprises seront effectivement amenées à généraliser ce type d’approche dans les années à venir ? Oui, je pense qu’on y viendra, notamment pour le management… On peut très bien imaginer qu’un DRH analyse les données issues des échanges de ses employés (sur les réseaux sociaux, sur internet ou en interne) pour mesurer l’ambiance, comprendre les attentes, les inquiétudes et être capable d’intervenir en amont. Ce sera beaucoup plus efficace que des enquêtes annuelles de satisfaction ! Mais les RH restent encore méfiants par rapport à ce type de technologies : c’est d’ailleurs souvent la dernière fonction à acquérir et intégrer les outils les plus récents. Après, on peut comprendre les inquié- tudes si l’on se réfère à certaines applications : le grand risque du Big Data appliqué à la RH, c’est qu’un profil type de performance soit défini à partir de ces données, et que l’entreprise n’embauche plus qu’en fonction de ce modèle. Ce serait catastrophique pour la diversité et la capacité d’innovation de l’entreprise ! Interview « Les offres d’emploi liées au Big Data ont doublé dans les six derniers mois » Jacques Froissant Président, Altaïde « La France est plutôt bien armée pour combler le fossé entre offre et demande sur ces compétences-là. » Capture d’écran du site d’Evolv32 33 ressé les pouvoirs publics qui ont proposé des mesures de financement et d’accompagnement pour soutenir le décollage du marché. Aux Etats-Unis, le programme « The Big Data Research and Development initiative » avait ainsi été lancé au printemps 2012 pour soutenir les programmes de recherche sur les technologies de traitement de grande échelle : 200 millions de dollars ont été mis à disposition des grandes agences fédérales dans la Santé, l’Energie ou la Défense pour trouver des applications sectorielles immédiates. En Europe, la Commission Européenne s’est également emparée du sujet en lançant des appels à projets : le premier début 2012 concernant le « Management de l’information intelligente » (50millions d’euros), le second en 2013 intitulé « Scalable data analytics » (31millions d’euros). Elle fait du Big Data un de ses principaux sujets d’étude : un programme de travail sur le Big Data et la Smart Data est ainsi prévu pour 2014 et 2015. La France, quant à elle, a commencé à s’intéresser au sujet en mars 2012 avec le lancement d’un premier appel à projets et l’inscription du Big Data dans le programme des Investissements d’Avenir au sein de la section consacrée à l’entreprise. En 2006, un rapport financé par la Commission Européenne établissait ainsi que le marché lié à l’utilisation de ces données Open Data représentait 27 milliards d’euros. Alliées aux technologies mobiles, ces données sont également un vecteur d’innovation important, permettant la création de nouveaux services (ex : conseils géolocalisés dans le secteur du tourisme, renseignements voyageurs dans le domaine des transports, etc.). L’Open data s’est donc imposé en quelques années comme un secteur en croissance, attirant de nombreuses startups dont la mission est de traiter, trier et analyser ces données à destination des entreprises et des collectivités. En France, c’est le portail data.gouv.fr, chapeauté par Etalab, qui met à disposition du public les données du gouvernement sous l’autorité du Premier Ministre. Soutenir le décollage du marché : les investissements publics dans le domaine du Big Data Le dynamisme porté par le Big Data et l’éclosion de nombreuses start ups en lien avec ce sujet ont rapidement inté- Par son ampleur et par ses nombreuses promesses, le Big Data a rapidement attiré l’attention des pouvoirs publics : ils y ont vu un potentiel de croissance important pour la filière numérique en France mais également des menaces éthiques fortes sur le citoyen, concernant la confidentialité des données notamment. Cependant, bien avant ces problématiques, l’univers public était présent dans l’écosystème Big Data à travers un phénomène antérieur qui connaît aujourd’hui un développement corollaire au Big Data : l’Open Data. L’Open Data L’Open Data est un mouvement amorcé au milieu des années 2000 visant à transmettre au grand public les données numériques détenues par les administrations publiques, dans un but de transparence et d’efficacité de l’action publique. En effet, de nombreuses informations démographiques, économiques, sociales pouvaient revêtir un caractère straté- gique pour les organisations privées et le grand public (ex : régularité des transports publics, temps d’attente dans les services publics, niveau de rémunération dans une zone géographique donnée, affluence des zones touristiques, etc.) et les rendre accessibles, libres de droits, constituait donc une avancée économique autant que citoyenne (l’institution publique se trouvant ainsi engagée vis-à-vis de ses administrés à corriger les imperfections soulevées par ces données). Développé dans les administrations européennes et nord-américaines, ce mouvement a désormais gagné les organisations privées qui peuvent choisir de mettre à disposition du public et de partenaires les données qu’elles tirent de leur activité et qui concernent la collectivité. A l’heure du Big Data où les données prennent une importance centrale dans le décisionnel de l’entreprise, ces informations véhiculées par l’Open Data et croisées avec les données internes, constituent donc un nouvel outil précieux pour nourrir la vision stratégique de Les pouvoirs publics face au Big Data 27 milliards d’€ > C’est le potentiel de marché de l’Open Data (chiffre de 2006) Les chiffres du financement public pour le Big Data > USA 200 millions de $ > Union Européenne 81 millions d’€ > France 11,5 millions d’€32 33 « Fleur Pellerin a annoncé en janvier 2013 la création d’une filière Big Data capable d’attirer les investissements étrangers » l’économie numérique. Cet appel à projets a permis de sélectionner 7 projets pour un total de 11,5 millions d’euros attribués au Big Data en avril 2013, et 4 projets restent encore à l’étude. Pour l’heure, la ministre chargée de l’Economie Numérique, Fleur Pellerin, a annoncé en janvier 2013 la création d’une filière Big Data, capable d’attirer les investissements étrangers, suivie de l’annonce d’un plan de soutien en juin 2013. Ce plan visera à construire un écosystème du Big Data, à fournir la formation nécessaire aux jeunes data scientists et à promouvoir les start ups prometteuses de la filière. Ce plan, salué par l’AFDEL (l’association française des éditeurs de logiciels), s’inscrit dans le projet plus global de création d’une Silicon Valley à la française, appelé Paris Capitale Numérique. Smile … b i g brother is watching you ! La ministre chargée de l’économie numérique, Fleur Pellerin La problématique de confidentialité des données L’une des questions centrales soulevées par le Big Data est probablement celle de la protection des données personnelles : en effet, l’utilisation massive de données à des fins d’optimisation ou de ciblage marketing renforce la crainte déjà prégnante d’une surveillance et d’une manipulation automatisées du citoyen : géolocalisation, suivi des historiques sur Internet, personnalisation non consentie des offres, etc. sont autant d’incarnations du phénomène Big Data qui peuvent être perçues comme des menaces pour la vie privée des consommateurs finaux. Cette inquiétude, dont la récente affaire sur le programme américain PRISM s’est fait l’écho, pourrait également s’avérer néfaste économiquement puisqu’une rupture de confiance du consommateur vis-à-vis du fournisseur entraînerait automatiquement un retour en arrière dans le partage des données et donc, à terme, un recul du Big Data et de ses promesses. Pour toutes ces raisons, les autorités de régulation se sont penchées sur la question, reprenant leurs législations en matière de protection des données personnelles afin de les adapter au Big Data : en France, c’est la loi Informatique et Libertés du 6 janvier 1978, actualisée plusieurs fois dans les années 2000, qui fait office de socle législatif. Dans le droit actuel français, la protection d’une donnée personnelle* est garantie par 5 critères : • la finalité de l’utilisation : on garde une donnée pour une utilisation déterminée à l’avance. • la pertinence : les données exploitées doivent être pertinentes au regard de l’objectif avancé. • la conservation limitée (eq « Droit à l’Oubli ») : les données ne peuvent être conservées indéfiniment dans un serveur. La durée de conservation est établie en cohérence avec l’objectif d’utilisation. • la sécurité et la confidentialité : le responsable des données doit assurer la sécurité de celles-ci. • le respect des droits des personnes (loyauté et transparence) : elles doivent avoir accès aux données, être informées de leur utilisation et pouvoir s’opposer. *Selon la loi « constitue une donnée à caractère personnel toute information relative à une personne physique identifiée ou qui peut être identifiée, directement ou indirectement, par référence à un numéro d’identification ou à un ou plusieurs éléments qui lui sont propres » 34 En France, la ministre Fleur Pellerin a renouvelé en 2013 son souhait de pré- senter un projet de loi relatif à la protection des données personnelles au premier semestre 2014 mais l’ampleur du projet reste floue. Le débat reste donc encore largement ouvert sur les mesures à adopter pour garantir à la fois le dynamisme économique et la protection des citoyens. Beaucoup d’analystes s’inquiètent du retard que pourrait prendre l’Europe par rapport aux Etats-Unis et à l’Asie craignant une fuite des données vers ces zones géographiques et donc, à terme, une perte de souveraineté (les données constituant désormais une matière première stratégique). A ce titre les récents événements sur le programme PRISM ont ravivé les débats sur ce dossier, rendant la question de la protection des données encore plus stratégique dans le contexte actuel d’explosion de l’univers numérique et d’industrialisation du Big Data. La progression du Big Data interroge la pertinence de ces critères car l’exploitation automatique de données met à mal le principe de finalité, tout comme la conservation dans le cloud conduit à des incertitudes en matière de sécurité. L’exercice du droit des personnes est, quant à lui, très largement bafoué, les internautes n’étant souvent pas informés de la récupération de leurs données de navigation. La Commission Européenne s’est donc emparée du sujet, par l’entremise de la Commissaire Viviane Reding en charge de la Justice et des Droits Fondamentaux, qui proposait en janvier 2012 un projet de règlement unifiant les régimes de protection des données européens et renforçant les droits des personnes ainsi que la responsabilité des entreprises. Des outils liés au consentement préalable des internautes (sur les cookies par exemple) ont été mis en place, mais les discussions sur le projet de rè- glement restent vives, certains craignant qu’un encadrement trop strict freine l’innovation et creuse un décalage avec les Etats-Unis, beaucoup moins contraignants sur l’exploitation des données. Après un an et demi de débats, le projet de règlement a finalement été retoqué en juin 2013 par les ministres de la Justice des Etats Membres, mais Viviane Reding a d’ores et déjà annoncé qu’elle comptait obtenir un accord sur le projet en 2014. Une réunion entre ministres de la Justice s’est tenue à Vilnius en juillet 2013, ouvrant la porte à un accord en 2014. La Commissaire Viviane Reding annonce son projet de règlement sur la protection des données en janvier 2012 35 « Une rupture de confiance du consommateur vis-à-vis du fournisseur entraînerait automatiquement un retour en arrière » Appel à projets «Management de l’Information Intelligente» Proposition de règlement européen sur les données personnelles Lancement du programme «The Big Data Research and Development Initiative» Inscription du Big Data dans les Investissements d’Avenir Lancement de l’appel à projets «Scalable data analytics» Annonce de la création d’une filière Big Data par la ministre Fleur Pellerin Sélection de 7 projets Big Data au titre des Investissements d’Avenir Annonce d’un plan de soutien à la filière du Big Data Le projet de règlement sur les données personnelles est retoqué Réunion de Vilnius ouvrant le champ à un accord sur le projet de règlement en 2014 2012 201334 1) Pour vous, en quoi le Big Data a-t-il changé la donne dans la protection des données personnelles ? Pourquoi remet-il en cause l’arsenal législatif actuel ? En matière de protection des données personnelles, au-delà des questions classiques qui sont exacerbées par le volume et la variété des données traitées par le Big Data, ce qui change vraiment, c’est l’application du principe de finalité. En effet, l’une des particularités du Big Data est la remise en cause de l’approche scientifique classique consistant à devoir poser une hypothèse de travail pour ensuite collecter et traiter des données destinées à valider ou invalider cette hypothèse. Avec le Big Data, il est désormais possible, compte tenu des capacités de traitement, d’opérer sans hypothèse de travail préalable. En d’autres termes, mener des recherches sans savoir à l’avance ce que l’on va pouvoir trouver. Dans un tel contexte, il est difficile de respecter le principe central posé par la loi du 6 janvier 1978 selon lequel « (les données) sont collectées pour des finalités déterminées, explicites et légitimes et ne sont pas traitées ultérieurement de manière incompatible avec ces finalités». De même, il est difficile de respecter les autres dispositions de cette loi qui font directement référence au principe de finalité: - l’obligation de ne collecter que des données adéquates, pertinentes et nonexcessives au regard des finalités, - ou encore, en ce qui concerne la durée de conservation des données, l’obligation de ne pas excéder la seule période nécessaire aux finalités pour lesquelles elles sont collectées. 2) La France a-t-elle une position particulière sur la question par rapport à ses collègues européens ? Comment définiriez-vous cette position ? Et, plus globalement, quels sont les principales différences législatives entre les Etats-Unis et l’Europe concernant la protection des données ? La France a toujours su faire entendre sa voix sur la scène européenne en matière de protection des données personnelles. Elle est particulièrement active dans le cadre des négociations qui devraient mener à l’adoption du règlement européen en matière de données personnelles : la CNIL, la Ministre de la Justice, le Sénat et l’Assemblée Nationale contribuent au débat public. Toutefois, la France ne fait pas bande à part parmi les Etats Membres et elle partage l’opinion majoritaire. Concernant les principales différences entre les Etats-Unis et l’Europe, il faut tout d’abord rappeler qu’à la différence de l’Union Européenne, il n’existe pas de loi générale en matière de protection des données personnelles aux Etats-Unis, même si des règlementations sectorielles très strictes peuvent exister dans le domaine des informations financières ou de la santé. Par ailleurs, l’affaire PRISM nous rappelle que des textes américains comme le «USA Patriot Act» (2001), le «Protect America Act» (2007) ou le «Foreign Surveillance Intelligence Act» (2008) permettent une très grande intrusion dans la sphère privée par rapport à ce qui est autorisé en Europe. Les autorités américaines peuvent notamment obtenir les données traitées par toute entreprise présente aux Etats Unis, y compris les données qui concerneraient des ressortissants étrangers, avec une facilité qui déconcerte et effraye en Europe. Il était question, en 2012, d’un texte permettant d’étendre l’accès des autorités américaines aux données situées en dehors du territoire américain, dans le but de lutter contre la cyber-criminalité et le terrorisme. Il s’agissait du Cyber Intelligence Sharing and Protection Act. Bien que ce texte n’ait finalement pas été adopté, un nouveau projet, très similaire serait en préparation. 3) Comment voyez-vous l’évolution des discussions sur le projet de règlement européen relatif aux données personnelles ? Quelles sont les orientations qui se dessinent pour ce texte ? Le rejet de ce texte en juin dernier a-t-il mis en péril les discussions ? L’instruction du projet de règlement européen, présenté par Viviane Reding début 2012, est toujours en cours et peut encore réserver des surprises, néanmoins les négociateurs se montrent persévérants dans la recherche d’un consensus. La rencontre informelle de Vilnius, qui a réuni les ministres européens de la Justice le 19 juillet dernier, affiche un bilan positif. L’adoption du règlement n’est pas envisagée avant début 2014, mais le dossier a bien avancé. Les ministres français et allemand, notamment, ont manifesté leur soutien à ce projet. Par ailleurs, il faut prendre en considé- ration les impacts de l’affaire PRISM sur l’avancée des discussions. Les débats sont aujourd’hui animés par les révélations de M. Edward Snowden, qui avait dévoilé l’existence de ce programme américain collectant des données personnelles d’individus hors des EtatsUnis. Selon Viviane Reding « PRISM a réveillé les Européens sur la nécessité d’avoir des règles fortes et strictes». Voilà de quoi motiver ceux qui prônent l’adoption du règlement dans les meilleurs délais. Interview « La France a toujours su faire entendre sa voix sur la scène européenne en matière de protection des données personnelles » Thierry Dor Associé au cabinet Gide Loyrette Nouel 35© 2013 Accenture. Tous droits réservés. ** Analyser. Réalisé. * La haute performance. Réalisée. Moins de suppositions. Plus de certitudes. Analytics. Delivered. ** Les données sont des éléments clés. À condition de savoir les interpréter. Nous aidons nos clients à utiliser l’analyse pour transformer les données en idée, l’idée en action et l’action en résultats concrets. High performance. Delivered.* 05.09.2013 10:47 Twist 235 37 Coordonnées Contact Tél : Fax : Mail : Les BIG DATA, une opportunité particulièrement lucrative, facteur de différenciation compétitive Dans un monde en perpétuelle évolution et accélération, des données de plus en plus volumineuses, riches et variées – les fameuses BIG DATA – représentent un atout majeur pour les entreprises, à condition de savoir les capter, les raffiner, les combiner et les analyser. Ce formidable vivier de nouvelles informations permet non seulement de mieux répondre aux attentes des clients mais surtout d’identifier de nouveaux axes stratégiques ainsi que de capter d’autres marchés. Grâce à la réduction des coûts de stockage et aux développements de nouvelles techniques de gestion de la donnée, ce monde de l’exploration et de l’interprétation, autrefois plus réservé à des spécialistes, s’ouvre à présent à toute entreprise brassant un grand volume de données. De la stratégie à la mise en œuvre, Accenture vous accompagne dans le développement de capacités analytiques et prédictives nécessaires à la prise de décision et au pilotage de votre activité. Accenture vous aide également à adresser les nouveaux défis technologiques des BIG DATA, notamment : • gérer des plates-formes de données non structurées de grande capacité ; • faire face aux nouvelles demandes pesant sur les infrastructures réseau ; • accueillir un grand nombre de serveurs standards au sein des centres de données ; • déployer des capacités de stockage de plusieurs pétaoctets ; • exploiter ces précieuses données ; • développer et mettre en place une gouvernance adaptée à la complexité et l’hétérogénéité des données ; • intégrer le traitement de données non structurées dans les organisations et les processus existants. Notre offre de services Accenture Analytics, vous permet de disposer : • Des meilleurs professionnels. Notre réseau mondial de professionnels offre un accès à une combinaison de compétences analytiques approfondies, de connaissances métier et d’expérience des processus. • D’une offre éprouvée. Grâce à notre longue expérience, notre offre de services couvre plus de 100 secteurs d’activité individuels ou croisés et de services fonctionnels, plus de 200 pratiques et normes sectorielles clés, des outils de développement automatisés et des composantes structurelles réutilisables. • Des services de recherche et développement inégalés. Les outils et les services analytiques d’Accenture constituent l’aboutissement d’un long historique d’innovation dans la gestion des data. • D’alliances stratégiques. Bien que nous ne privilégions aucun prestataire spécifique, nous avons formé un réseau de partenaires stratégiques avec lesquels nous nous associons éventuellement lors de la mise en œuvre de nos projets, notamment SAS, SAP, Oracle et Microsoft. • D’une envergure mondiale. Grâce à notre réseau mondial de centres dédiés à l’analytique, nous modélisons automatiquement nos processus analytiques dans un souci de constante amélioration. Nous générons ainsi une source conséquente de connaissances tirées de l’analyse des données. En vous appuyant sur Accenture, vous aurez l’assurance de maximiser l’utilisation de vos données et ainsi créer plus rapidement davantage de valeur. A propos d’Accenture Accenture est une entreprise internationale de conseil en management, technologies et externalisation. Combinant son expérience et ses capacités de recherche et d’innovation développées et mises en œuvre auprès des plus grandes organisations du monde sur l’ensemble des métiers et secteurs d’activité, Accenture aide ses clients - entreprises et administrations - à renforcer leur performance. Avec plus de 266 000 employés intervenant dans plus de 120 pays, Accenture a généré un chiffre d’affaires de 27,9 milliards de dollars au cours de l’année fiscale clôturée le 31 août 2012. (Responsable technologique des offres Business Intelligence, Big Data & Analytics : Laurent Gaultier) www.accenture.com Accenture ACCENTURE Xavier CIMINO Responsable Accenture Interactive Digital & Analytics 118 avenue de France 75636 Paris Cedex 13 +33 (0) 1 53 23 55 55 +33 (0) 1 53 23 53 23 xavier.cimino@accenture.comDébloquez le potentiel de vos Big Data ! Trouvez enfin un moyen efficace et facile d’analyser l’ensemble de vos données ● Détecter des opportunités croisées ● Découvrir des modèles de comportement Les informations disponibles sur votre activité et votre clientèle prennent des formes de plus en plus variées avec l’évolution des technologies de communication et de stockage des données. Elles o rent de nouvelles possibilités et l’idée de les exploiter est séduisante. Mais comment faire pour que cela reste facile et accessible ? Il existe désormais des solutions simples et rentables Avec son module de Data Mining intuitif, Actuate – the BIRT Company – donne aux experts marché et métier le pouvoir d’analyser directement leurs Big Data sans l’aide d’un Data Scientist. Plus réactive et avec une meilleure connaissance de son activité, votre entreprise en devient plus compétitive. Nos clients utilisent BIRT Analytics pour : ● Prédire des évolutions ● Grouper et croiser des populations Découvrez BIRT Analytics sur www.actuate.fr Le Data Mining n’est plus dévolu qu’aux Data Scientists Analysez des données brutes à la volée grâce à notre module de Data Mining rapide et intuitif39 Coordonnées Contact Tél : Fax : Mail : Actuate - The BIRT Company™ Actuate a fondé et codirige le projet Open Source BIRT, qui est utilisé par plus de 2,5 millions de développeurs à travers le monde et sert de socle à la suite commerciale proposée par Actuate. Pouvant être facilement déployées auprès de millions d’utilisateurs, les applications construites avec BIRT offrent une meilleure vision métier ainsi qu’une compréhension approfondie des comportements des clients. Actuate aide ainsi les entreprises à tirer pleinement parti des Big Data et de l’essor des appareils tactiles. Les solutions BIRT d’Actuate facilitent le développement d’applications personnalisées de business analytics et de communication client basées sur BIRT. Les applications construites avec le format unique de design BIRT peuvent accéder et intégrer tous types de données, y compris les données non structurées. Elles assurent une expérience utilisateur ergonomique et homogène, quel que soit le niveau de connaissances techniques, et sont supportées pour tous les déploiements, qu’ils soient sur site, Cloud, hybrides, web ou mobiles. Actuate, cotée au NASDAQ sous le symbole BIRT, compte plus de 5 000 clients à travers le monde dans divers secteurs d’activité, dont les services financiers, les technologies et le secteur public. Son siège social est basé dans la Silicon Valley. BIRT Analytics, le Data Mining et l’Analyse prédictive intuitifs BIRT Analytics™, la solution Actuate permettant l’exploration de données graphique et l’analyse prédictive, permet de mettre en place une analyse rapide à partir de n’importe quelle source de données sans besoin de connaissances techniques et statistiques spécifiques. BIRT Analytics procure aux analystes et aux opérationnels des fonctionnalités avancées pour prendre des décisions plus avisées et opportunes à l’ère des Big Data. La solution allie la facilité d’utilisation et la flexibilité des outils d’exploration de données à la puissance statistique et algorithmique des outils d’analyse avancée, généralement réservés aux experts IT. BIRT Analytics donne la possibilité aux analystes métiers de découvrir par eux-mêmes des corrélations et de prévoir des comportements et des résultats par le biais de techniques telles que la segmentation client, la ‘prochaine meilleure offre’, le risque fournisseur ou la fidélisation client. Au-delà de l’analyse des données, BIRT Analytics offre également la possibilité de concevoir des campagnes et d’en prédire les retombées pour une amélioration constante des résultats opérationnels. « Avec BIRT Analytics, nous proposons le meilleur de l’univers analytique », déclare Nobby Akiha, senior vice-président du Marketing chez Actuate. « Les analystes métier n’ont plus à se contenter d’analyses prédictives ‘sommaires’ et profitent de la puissance analytique des outils statistiques traditionnels dans un produit visuel, facile à utiliser, qui analyse tous les types et toutes les tailles de données. Et même le Big Data » ajoute-t-il. Grâce à BIRT Analytics, les analystes métiers qui doivent traiter des milliards de données disposent d’une solution puissante et simple d’utilisation pour effectuer des prédictions sans avoir à coder. « Combiné aux autres modules de la suite de produits basés sur BIRT, BIRT Analytics fait le lien entre la gestion métier orientée données interne et externe, et vous permet de remplir votre mission d’aujourd’hui, c’est-à-dire gérer et décider en vous fondant sur les données pour gagner un avantage concurrentiel » conclut Nobby Akiha. www.actuate.fr Actuate Actuate International Corporation Magali CARIO Marketing Campaigns Manager Southern Europe 57 rue de Châteaudun 75009 Paris +33 (0) 1 76 21 56 50 +33 (0) 1 76 21 56 56 fr_contact@actuate.comAffini-Tech SARL 11avenue Henri IV, 92190 Meudon Tél : +33 (0) 6 61 88 76 71 Fax : +33 (0) 9 58 12 97 98 Mail : contact@affini-tech.com Web : www.affini-tech.com Affini-Tech met en oeuvre pour vous des briques technologiques packagées permettant de réaliser très rapidement des retours sur investissements importants. Ces briques vous permettent d’élargir le paysage des données que vous utilisez dans vos analyses et de bénéficier de toute la performance des algorithmes de “Machine Learning”. L’idée maitresse de ces outils est de transposer à toute activité (online ou traditionnelle) les recettes qui ont fait le succès des leaders de l’économie numérique. DISPOSEZ DES MÊMES ATOUTS QUE LES LEADERS DU WEB Hybridation de données Les données de votre organisation sont à 80% liées à des dates ou des lieux géographiques. Accédez à de potentielles liaisons fortes de vos informations à des données complémentaires, pour par exemple cibler plus finement vos clients. Moteur de Recommandation Qui n’a jamais été frappé par les grands sites eCommerce vous proposant d’acheter les produits que d’autres consommateurs semblables à vous ont acheté ? Ce levier d'action peut être mis au profit de votre business simplement et rapidement. Avec les technologies de moteur de recommandations d'Affini-Tech, tirez parti des informations que vous possédez sur vos clients pour mettre en oeuvre des stratégies de recommandations et de personnalisation de vos relations, et ainsi améliorer la performance de vos business. 41 Coordonnées Contact Tél : Fax : Mail : «Les outils, les pratiques du Big Data s’adressent à toutes les organisations, quelles que soient leurs tailles». Affini-Tech, acteur français du Big Data, le démontre tous les jours chez des clients de tous secteurs d’activité. Si le Big Data est né et a grandi chez les géants du Net, c’est aujourd’hui dans les industries traditionnelles que les plus grands bénéfices sont générés. Le positionnement affirmé et le savoir-faire d’Affini-Tech est de mettre à la portée de toute entreprise, sur ses volumes de données, les apports du Big Data : Analyse de transactions, Prédiction, Recommandation, Classification, Audit… Par une démarche à la conjonction entre les métiers et l’lT, et par la démonstration, l’entreprise découvre de nouvelles opportunités pour des coûts radicalement plus faibles. Le retour sur investissement est obtenu en quelques semaines, et les coûts sont maitrisés. L’utilisation de méthodes agiles permet de conserver à tout moment des objectifs atteignables. Vous disposez tant du savoir faire d’Affini-tech que de ses briques technologiques prêtes à l’emploi, développées pour répondre à des besoins précis. Affini-Tech vous permet d’en comprendre les ressorts et d’être en possession d’une RoadMap Big Data pour vos acteurs clés internes. Affini-tech ne vous accompagne pas uniquement par la technologie. Une démarche auprès des métiers vous permet de bien plus grandes créations de valeur et de spectaculaires diminutions de vos coûts. C’est aussi grâce à la nouvelle capacité offerte par les plateformes Big Data à traiter massivement de gros volumes de données qu’il devient possible, à moindres coûts, de mettre en place des innovations. Le Big Data est abordable. www.affini-tech.com Affini-Tech Affini-Tech SARL Vincent Heuschling Fondateur 11 avenue Henri IV 92190 Meudon +33 (0) 6 61 88 76 71 +33 (0) 9 58 12 97 98 vhe@affini-tech.com43 Coordonnées Contact Tél : Fax : Mail : Responsable Commercial France Parra Benoit www.bimeanalytics.com benoit@bimeanalytics.com N/A +33 (0) 4 67 41 60 64 1 place Francis Ponge 34 000 Montpellier Leur Histoire Big Data avec BIME Puiser au cœur de l’internet des objets dans le désert Australien, c’est ce que fait la société MovingData. Afin d’améliorer la performance mobile de ses clients Telco nationaux, elle assure la qualité et la disponibilité des réseaux de téléphonie en dehors des grandes villes australiennes grâce à des milliers de capteurs répartis géographiquement. 500 Radius Records + Network Probes Pour comprendre plusieurs millions d’évènements générés sur ses réseaux : MovingData devait répondre à 2 besoins particuliers que seul BIME pouvait satisfaire : disposer d’outils permettant une analyse interactive et visuelle rapide des incidences réseaux et pouvoir communiquer ces analyses à leurs clients Telco grâce à des tableaux de bord collaboratifs, disponibles en ligne, en temps réel, sur des volumétries de données très importantes stockées dans Google BigQuery. Ce projet BigData a été réalisé en moins de trois mois. Trois partenaires Cloud, distants géographiquement, ont sans jamais se rencontrer pu l’orchestrer : l’Américain Google pour la base de données, le Français BIME pour l’analyse et les tableaux de bord, l’Australien MovingData pour les indicateurs métiers et les process d’alimentation de données. Pensez vos projets BigData avec l’agilité et la scalabilité du Cloud. BIME (We Are Cloud SAS) Bime Analytics Craig Morton Ceo of MovingDataUne décision repose-t-elle sur une intuition ou des données ? Data Science Performance Innovation Expérimentation Gouvernance de l’information Sécurité Conformité réglementaire Coordonnées CGI Business Consulting 17 place des Reflets 92 097 Paris La Défense cedex Contact Frederic Brajon, Associé T : +33 1 57 87 50 55 Email : frederic.brajon@cgi.com Site web www.cgi.com CGI Business Consulting, cabinet de conseil en innovation et transformation, fait partie du Groupe CGI inc. Ses consultants associent expertises sectorielles, fonctionnelles et technologiques pour accompagner les plus grandes entreprises et organisations. Parce que chaque client est unique, CGI Business Consulting a créé des méthodes de travail spécifiques permettant à chacun de prendre part au management de sa transformation et garantissant une amélioration durable de ses performances.45 Coordonnées Contact Tél : Fax : Mail : Big Data & Data Science Mieux connaître ses clients, anticiper les changements structurels de son marché, détecter les intentions d’achat, de résiliation, de fraude… Telles sont quelques-unes des promesses du big data. L’ouverture croissante de l’information pose un véritable défi de compétitivité aux grandes entreprises : rendre leur offre lisible dans un catalogue chaque jour plus complexe et plus confus. Les entreprises qui sauront non seulement triompher de cette complexité, mais en tirer profit en se positionnant comme détenteurs d’une information intelligible et consolidée, seront au centre de cette nouvelle économie. Quelle est la véritable valeur de l’information que mon entreprise détient ? Quelle information représente un avantage compétitif potentiel ? Laquelle pourrait devenir un produit ou un service potentiel ? Quelles synergies pourrions-nous trouver dans des gisements d’information externes ? A l’heure où une masse d’information sans précédent devient disponible, et où apparaissent des dizaines d’outils et de méthodes pour en tirer toute la valeur, une question essentielle demeure : « Quels gains pouvons-nous dès aujourd’hui tirer de cette révolution encore naissante ? » Réussir un projet de Big Data nécessite un ensemble de compétences permettant d’accompagner les entreprises sur différents axes : • Stratégique : Réconcilier les décideurs avec la donnée et faire de la maîtrise de l’information un enjeu stratégique (anticiper les bouleversements des écosystèmes, analyser les mouvements du marché, réduire les coûts, valoriser le patrimoine immatériel, …) • Métier : Analyser les leviers de performances, optimiser les processus (production, ventes, fraude, positionnement), • Organisationnel : repenser la gouvernance, faire accoster un modèle multi-informationnel (données, références, indicateurs, données règlementaire, données externes), repenser les accès et les stratégies d’archivages, redistribuer les rôles, adapter les politiques RH • Création de valeur : combiner les expertises (informatique, mathématique, business) au travers d’une approche de Data Science éprouvée pour révéler le potentiel de l’information Pour répondre à ces enjeux, CGI Business Consulting, cabinet de conseil du groupe CGI a créé une entité dédiée au traitement et à la valorisation de l’information : « Digital Information Strategy » Ses consultants expérimentés sont à votre disposition pour vous accompagner dans vos projets de transformation www.cgi.com CGI Business Consulting CGI Business Consulting Frederic BRAJON Associé 17 place des Reflets 92 097 Paris La Défense cedex +33 (0) 1 57 87 50 55 N/A frederic.brajon@cgi.comannonce presse A4_Mise en page 1 28/04/11 02:23 Page147 Coordonnées Contact Tél : Fax : Mail : Le Club Décision DSI, premier club français dédié aux directeurs informatiques Aujourd’hui le Club Décision DSI réunit 1 100 membres «directeurs Informatique & Télécoms» de sociétés du secteur privé et du secteur public dont le parc informatique est supérieur à 200 pc. Il rassemble des hommes et des femmes d’expérience, animés par la volonté de mener des actions qui soutiennent d’autres directeurs des systèmes d’information (DSI) dans la réalisation de leurs projets professionnels. Le club est administré par Véronique Daval, la présidente, le vice-président, ainsi que par un conseil central composé de neuf directeurs informatiques. Chaque année le club organise : • 20 manifestations thématiques par an. • 7 événements accessibles aux partenaires (éditeurs de logiciels, construc¬teurs, opérateurs télécoms, SSII) • Les Rencontres de l’innovation technologique • Le consortium du DSI • Les DSI Meeting (table rondes, débats) • Le diner de Gala avec son village solutions (réservé aux membres et aux partenaires du club) • Le dîner de gala annuel HELP DSI , le 1er Réseau francophone de 1100 DSI connectés HELP DSI ce sont des DSI, des groupes de DSI et des communautés de DSI qui échangent en associant leurs idées, leur expérience et leurs connaissances Afin d’optimiser leurs choix technologiques. Le club dispose de son propre réseau social (RSE) sur lequel de nombreuses thématiques sont abordées qui permettent aux membres de capitaliser sur l’expérience des uns et des autres. Les ambassadeurs de Club Décision DSI ont adopté cette solution afin d’améliorer la communication entre les membres, de créer des groupes de réflexion sur des thématiques variées, et de diffuser les compétences à travers le réseau des membres au niveau national et européen. Ce moteur d’expérience permet aux sociétés adhérentes de se servir des retours d’expé- rience des projets IT mis en place par les membres. Chaque année les ambassadeurs identifient des thématiques auprès des membres et définissent un programme annuel consultable sur le site internet du Club : www.club-decisiondsi.com www.clubdecisiondsi.com Club Décision DSI Club Décision DSI Véronique DAVAL Présidente du Club 16 Place Vendôme 75001 Paris +33 (0) 1 53 45 28 65 N/A club@decisiondsi.com annonce presse A4_Mise en page 1 28/04/11 02:23 Page149 Coordonnées Contact Tél : Fax : Mail : Zouheir Guedri, Directeur de Data&Data Consulting 1) Pouvez-vous nous présenter Data&Data Consulting, ses origines et sa spécificité sur le marché ? Data&Data Consulting est une start up spécialisée sur le Big Data, qui conseille les sociétés dans la valorisation de leurs données : nous apportons à la fois des recommandations en terme de pistes de création de valeur, de choix de technologies, de procédures et de stratégies à mettre en place. Data&Data Consulting est une structure constituée de consultants expérimentés, spécialisés dans la data avec un background d’ingénieurs et de statisticiens. 2) Quelles prestations proposez-vous à vos clients et quelles sont vos cibles principales ? Nous travaillons essentiellement avec des grands comptes mais également avec quelques start ups ayant des problématiques Big Data ou small data. Leur besoin principal est de savoir comment valoriser leurs données : nous leur proposons donc des études de marché, des conseils en matière d’orientations stratégiques et d’organisation, ainsi que des recommandations technologiques en fonction de leur activité. Pour cela, nous disposons de compétences de développement ainsi que d’un réseau de partenaires pour pouvoir lier l’implémentation opérationnelle aux recommandations stratégiques. Nous disposons également d’un centre de R&D dédié aux problématiques de Big Data et de visualisation des données, et nous travaillons avec des chercheurs d’universités de premier plan, Berkeley, Copenhagen Business School et Stanford University, sur la conception, le développement et l’expérimentation de solutions innovantes pour nos clients. 3) Plus globalement, comment voyez-vous l’évolution du marché du Big Data en France ? A-t-il atteint sa phase de maturité ? Y a-t-il quelques retards ? L’année 2013 a été une année d’expérimentation pour un grand nombre d’entreprises : on retrouve des projets avancés dans tous les secteurs, pas seulement les plus gros détenteurs de données, et ce sont pour la plupart de purs projets Big Data (et non pas un recyclage de projets anciens). De plus, la réflexion autour du Big Data est largement avancée, la phase de méfiance étant dépassée : au-delà d’un effet de mode, on reconnaît un véritable intérêt au Big Data et les réticences, bien que toujours présentes (notamment sur la question de la confidentialité des données) commencent à s’estomper. Cependant, nous nous trouvons pour l’heure dans la phase d’expérimentation et les premiers résultats en termes de ROI devraient plutôt être observés en 2014. Le véritable retard en France se situe davantage du côté de la mise en place d’une organisation décisionnelle : si les technologies et les objectifs changent, les processus de prise de décisions restent les mêmes, ce qui conduit à un manque de réactivité par rapport à l’information véhiculée par les données. Pour moi, il faudrait mettre en place des boucles de décisions automatisées, comme aux Etats-Unis. 4) Vous évoquez la question de la protection des données personnelles… que pensez-vous du débat actuel et des actions des pouvoirs publics sur le sujet ? Le Big Data, comme toute avancée technologique, peut comporter des risques, qu’il ne faut surtout pas ignorer : en effet, le Big Data repose sur la confiance du consommateur et toute rupture dans cette confiance entraînerait automatiquement un retour en arrière. Ce qui s’est produit avec le programme PRISM est un exemple d’excès qui peut effrayer les citoyens et consommateurs. De la même façon, on craint que le Cloud ne soit pas assez protecteur, alors qu’il est à la base de l’essor du Big Data. Il est donc urgent de maîtriser ces risques pour garder la confiance des consommateurs ; en cela, je crois que les projets amorcés en Europe sur la protection des données vont dans le bon sens. Par contre, je juge essentiel de ne pas opposer le modèle européen au modèle américain, ce serait contreproductif et ne permettrait pas de garantir l’essor du Big Data. De la même façon, le plan du gouvernement pour encourager la filière Big Data est un bon signe envoyé au marché ; il faudra simplement l’orienter davantage vers les start ups pour les années à venir. www.data-and-data.com Data & Data Consulting Data & Data Consulting Zouheir GUEDRI Associé 31 rue Saint-Lazare 75 009 Paris +33 (0) 6 22 35 14 20 N/A zouheir.guedri@data-and-data.comNe vous laissez pas distancer ! D’ici à 2015, Gartner prévoit que sur les 500 entreprises du classement Fortune, plus de 85 % échoueront à exploiter efficacement les Big Data pour rester compétitives. Avec EXALEAD, aucune raison que vous soyez l’une d’entre elles ! www.3ds.com/products/exalead/51 Coordonnées Contact Tél : Fax : Mail : EXALEAD est un fournisseur de logiciels de recherche et d’accès à l’information en entreprise et sur le Web. EXALEAD propose EXALEAD CloudViewTM, une technologie logicielle industrielle qui offre agilité, fonctionnalités sémantiques avancées et performances uniques. CloudView permet de concevoir des applications d’exploration et d’analyse de l’information pour transformer les données de l’entreprise en richesse exploitable et pertinente. Ces applications reposent sur un index et réconcilient données structurées et non structurées, internes ou externes. Search Based Applications et Big Data EXALEAD offre des applications d’exploration et de l’analyse de l’information pour libérer, capitaliser, valoriser votre Big Data. Les applications construites autour d’EXALEAD CloudView permettent aux entreprises de réellement exploiter leur Big Data sans remise en question du SI existant, avec un déploiement rapide et un ROI complet en quelques mois. Que vous cherchiez à valoriser les pétaoctets de vos entrepôts de données, ou à explorer la valeur cachée dans l’immensité du contenu non structuré comme les fichiers de logs, les emails ou des pages Web, EXALEAD CloudView propose une approche pragmatique. Collecte et fusion (agrégation de données) • Contenu Web • Contenu d’entreprise • Systèmes existants / spécifiques • Fusion de données Data mining et analyse de contenu • Analyse de données textuelles • Analyse de données Web • Analyse multimédia • Analyse de sentiments Recherche et navigation facilitées • Recherche plein texte et navigation à facettes • Accès multimédia • Recommandation de contenu Des applications métiers à forte valeur ajoutée • Déployer rapidement des applications orientées processus, enrichies des informations pertinentes extraites des Big Data EXALEAD est une marque du groupe Dassault Systèmes. www.3ds.com Exalead EXALEAD Axel BRANGER Directeur Commercial 10 place de la Madeleine 75008 PARIS +33 (0) 1 55 35 26 26 +33 (0) 1 55 35 26 27 contact@exalead.compubFastConnect_Mise en page 1 24/09/13 16:47 Page153 Coordonnées Contact Tél : Fax : Mail : Le Big Data est une réponse aux nouveaux défis d’aujourd’hui • Comment faire émerger la valeur d’un volume d’informations en constante croissance, dans des délais et coûts maitrisés ? • Comment exploiter l’information jusqu’alors inexploitée, due à sa nature non-structurée ? • Pour prendre des décisions et des stratégies gagnantes, comment se différencier de ses concurrents par des analyses toujours plus pointues et toujours plus proches du métier ? Les solutions techniques Big Data / NoSQL sont les outils pour atteindre ces objectifs, mais nécessitent des compétences spécifiques : Le rôle du Data Scientist est de vous accompagner dans la conception et la présentation d’analyses élaborées pour tirer toujours plus de valeur des données. Le rôle du développeur - ingénieur est de savoir exploiter la puissance des outils Big Data et maitriser les environnements distribués. Le rôle de l’Ops est de vous aider dans la mise en place d’une plateforme Big Data robuste et performante, dans votre DataCenter ou sur le Cloud. Grâce à une méthode de projet Agile, l’équipe Big Data réalise vos projets de manière transparente et maitrisée. FastConnect vous accompagne dans tout le cycle de votre projet : Il existe différentes solutions Big Data pour répondre à différents besoins et l’écosystème Hadoop est devenu une plateforme incontournable bientôt omniprésente dans les SI comme le sont devenus les bases de données, les serveurs d’applications et les plateformes décisionnelles. Nos experts sont là pour vous aider dans la mise en place de votre solution Big Data, ainsi que dans la formation de vos équipes. www.fastconnect.fr FastConnect FASTCONNECT Mathias KLUBA Responsable Big Data / NoSQL 11, rue des Peupliers 92130 Issy-les-Moulineaux +33 (0) 1 45 07 81 65 +33 (0) 1 45 07 90 87 mathias.kluba@fastconnect.fr pubFastConnect_Mise en page 1 24/09/13 16:47 Page1Plus de données. Meilleurs résultats. Real-time analytics 50x-1000x faster than traditional databases Open architecture support for Hadoop, R and wide variety of BI and ETL tools Optimized storage 10x-30x more data per server Massive scalability effectively unlimited number of nodes, petabyte (and beyond) scale Flexibility deployment via industry standard hardware, optimized appliances, or private/public cloud Découvrez pourquoi des milliers de clients utilisent Vertica. Enregistrez-vous pour un test gratuit de 30 jours sur vertica.com/evaluate Vertica, la plateforme analytique temps-réel, conçue pour le Big Data.55 Coordonnées Contact Tél : Fax : Mail : HP Vertica Analytics Platform La plate-forme d’analyse de nouvelle génération spécialement conçue pour tirer le maximum des Big Data Issue des travaux de recherche de Michael Stonebraker, le créateur d’Ingres et de PostgreSQL, HP Vertica Analytics Platform est une base de données analytique en temps réel capable des plus hautes performances à ce jour. Elle intègre des fonctions analytiques « in-database », une intégration étroite avec Hadoop et R, un déploiement rapide et une administration minimale de la plate-forme. Vertica est bâti sur une architecture orientée colonnes tout en supportant le langage SQL, tant pour le chargement que pour les requêtes. Ainsi, il n’est pas nécessaire d’apprendre un langage spécifique et tous les outils amont et aval (ETL, décisionnels et Front-end) sont utilisables. Avec Vertica, nos clients obtiennent désormais des réponses de 10 à 1000 fois plus rapides qu’avec des bases traditionnelles. Chez Kansys, un leader US du « Big Data as a Service », une requête qui prenait précédemment 18 heures s’exécute maintenant en 10-15 secondes. Chez Guess?, la marque de mode, les temps de requêtes complexes sont de 60 à 80 fois plus rapides qu’avant Vertica. Le chargement des données est aussi extrêmement rapide et les données chargées sont accessibles de suite pour les traitements analytiques, sans nécessité d’indexation, 24h sur 24, 7 jours sur 7. Zynga, un leader mondial des jeux en ligne, capture les événements issus des interactions des joueurs et injecte ainsi dans Vertica 60 milliards de lignes, représentant 10 Téraoctets de données semi-structurées, par jour. Le taux de compression peut atteindre 90%, réduisant considérablement les coûts de stockage, en utilisant des architectures de stockage standards. KDDI, opérateur mobile japonais, charge dans Vertica 8 millions d’enregistrements d’appels (CDR) par seconde. Même si HP propose des appliances configurées pour Vertica, la solution repose sur l’architecture x86 et les unités de stockage standards. Quelques clients Vertica : AOL, AT&T, Groupon, Mozilla, Twitter, Guess, Comcast, Level3, Sprint, Verizon, First American, The Washington Post… Pour en savoir plus : Testez et déployez Vertica Community Edition, une version gratuite et fonctionnellement complète de Vertica Enterprise Edition, seulement limitée à un téraoctet de données et trois noeuds. Rendez-vous sur http://vertica.com/community/eDM ou taggez ce code pour obtenir Vertica Community Edition ! » www.vertica.com Hewlett-Packard France Hewlett-Packard France Frédéric Lemeille Sales Manager Vertica 20 Quai du Point du Jour 92100 Boulogne-Billancourt 0820 211 211 N/A vertica-France@hp.comInterview Corinne Baragoin et Béatrice Cochard, IBM 1) Les outils Big Data deviennent un complément indispensable des entrepôts de données au sein des entreprises : qu’apportent-ils en plus ? Qu’est ce qui a changé par rapport à ces datawarehouses traditionnels ? Pour moi, les datawarehouses traditionnels ne permettent pas de répondre aux nouveaux besoins métier. Ils présentent des limitations majeures et se montrent contraignants pour l’utilisateur. Tout d’abord, le gros défaut du datawarehouse est le fait qu’il n’exploite pas l’ensemble des données disponibles dans et hors de l’entreprise : ni les données non structurées (ex : texte libre, et au-delà audio et vidéo) ni les données semi-structurées provenant de logs ou de capteurs… c’est donc une perte de valeur importante que les outils de Big Data ont permis de pallier en élargissant le périmètre par l’exploitation de ces nouvelles informations. Ensuite, concernant leur aspect contraignant et monolithique… Impossible de prendre en compte de nouvelles demandes métier sans bouleverser tout l’entrepôt et en revoir le modèle ! Cela implique une latence forte pour les utilisateurs, le temps nécessaire à l’IT pour prendre en compte la modification du modèle et son alimentation. Le Big Data a profondément bousculé cela puisqu‘on peut s’appuyer sur une vision purement exploratoire pour tirer parti des données… C’est donc un vrai changement de paradigme ! 2) Justement, vousparlezdelavariétédesdonnées…Est-ceunsujetnouveauchez IBM? Pour tout dire, cela fait longtemps que nous travaillons sur ce sujet, depuis le début des années 2000. Il est apparu évident qu’il faudrait analyser assez rapidement les vidéos, les textes, etc. qui se développaient sur les différents supports numériques, avec un haut niveau de granularité. Aujourd’hui, on parle beaucoup de « données non-structurées » : je préfère parler d’informations « multi-structurées ». L’avantage du Big Data est justement de pouvoir exploiter tout type de donnée et de les analyser pour les transformer en informations pertinentes pour l’entreprise, et ce quelle qu’en soit la structure. 3) Partant de ce constat sur l’intérêt du Big Data et les limites des datawarehouses, quelles technologies avez-vous mises en place pour répondre aux défis évoqués ? Face aux limites des entrepôts, nous sommes convaincus qu’il faut repenser les architectures de données selon 3 briques : l’une permettant l’analyse d’historiques de données multi-structurées à bas coût appelée Infosphere BigInsights, une autre permettant l’analyse en temps réel appelée Infosphere Streams et nous avons depuis longtemps vu l’importance d’enrichir les outils d’analyse par des outils plus fins liés à l’exploration de données, comme InfoSphere Data Explorer. Et bien évidemment à l’entrée de toutes ces briques, nous nous assurons de la qualité de l’intégration des données et de leur gouvernance, par des outils d’analyse dédiés. 4) Pourriez-vous nous décrire la brique InfoSphere Streams plus précisément ? InfoSphere Streams traite des flux de données multi-structurées (donnéees structurées, nonstructurées, audio, vidéo) en temps réel. Au-delà de sa performance sur de grandes volumé- tries, sa très faible latence (microseconde) et ses capacités d’optimisation dynamique des flux, InfoSphere Streams a l’énorme qualité d’exécuter tout type d’analyse, qu’elles soient prédictives tirées d’outils de data mining, de moteur de règles, de fonctions de time series, etc. 5) Et pour BigInsights, diriez-vous qu’il est une déclinaison d’Hadoop afin de faciliter l’usage de celui-ci ? InfoSphere BigInsights s’appuie effectivement sur le code open source de Hadoop et l’enrichit pour en faire une version prête pour l’entreprise sur les aspects performances, accélérateurs analytiques, déploiement de nouveaux services, facilités d’administration, etc… Pour cela, InfoSphere Biginsights complète la version open source par de nombreux composants : des connecteurs pour l’intégrer au SI de l’entreprise, des outils d’installation simplifiée et unifiée, des fonctions d’administration système ou d’accélération de l’analyse de tout type de données (réseaux sociaux, logs, capteurs, etc.). 6) Passons maintenant au challenge le plus important: l’intégration dans l’entreprise. Diriez-vous que vous avez un rôle de facilitateur duBigData auprès des entreprises ? Notre approche n’est pas seulement technologique. Nous partons des besoins métiers, nous demandons à nos clients quel type d’informations ils auraient besoin de mieux exploiter, et nous leur présentons des expériences clients déjà vécues. Ce qui est également important, c’est de faire un pilote avec l’IT et les métiers afin d’appréhender les défis technologiques avec une vision à 360° et d’adapter la plateforme aux besoins spécifiques du client. Pour IBM, les technologies sont prêtes : le frein est plus souvent du côté des équipes des clients qui manquent parfois de connaissances pour les appréhender. Il faut également faire évoluer l’organisation de l’entreprise pour mettre en place ces outils, ce n’est pas toujours évident… C’est pourquoi un temps de formation est nécessaire et nous le proposons au travers de nos workshops. 7) Vous adressez-vous de la même façon aux petites et aux grandes entreprises, qui n’ont pas forcément les mêmes volumes de données ? Pour IBM, la question du Big Data n’est pas uniquement celle du volume : on peut être une petite entreprise avec des volumes de données inférieurs à des téraoctets, et avoir des problématiques de Big Data. A partir du moment où l’on décide de se démarquer de sa concurrence par les données, où l’on a compris que les informations générées à l’exté- rieur de l’entreprise étaient fondamentales, où l’on réalise l’apport du temps réel dans son contexte pour réduire la latence d’exploitation, alors on se trouve face à une démarche de Big Data et notre rôle est d’accompagner cette démarche. 8) Si l’on revient aux technologies que vous proposez, sur quoi travaillez-vous actuellement ? Quels sont les outils que vous allez mettre prochainement à disposition en terme de stockage ou d’analyse ? En terme de stockage et de solution, notre travail se concentre essentiellement sur les appliances, en plus de solutions purement logicielles. Nous allons sortir au 2e semestre 2013 l’appliance « PureData Systems for Hadoop » : accélérateur pour le déploiement de solutions Hadoop qui intègrera InfoSphere BigInsights et permettra une installation rapide et un temps de mise en œuvre réduit. Mais c’est essentiellement sur le domaine de l’analyse avancée de l’information pour en tirer du sens pour l’entreprise que nous progressons. Au-delà de solution de BI et d’analyse prédictive, nous travaillons au développement de systèmes à même de tirer plus de sens de l’information (analyse sémantique) et de la contextualiser, voire des systèmes d’intelligence cognitive. Par exemple, trouver un diagnostic basé sur des évidences, à partir de réponses de patients: c’est ce sur quoi nous travaillons avec Watson en « deep QA » dans le domaine de la santé ! 9) Plus généralement, quels sont les défis auxquels vous pensez devoir faire face dans les années à venir ? Les principaux défis sont probablement ceux liés au fait de placer l’information au centre des SI de demain et de repenser les architectures de données avec ces nouvelles technologies. Il faudra répondre à la question de leur inté- gration dans l’entreprise, à leur gouvernance, mais aussi à la sécurité, la qualité et puis, bien entendu, penser à la formation des équipes ! Le Big Data c’est un mouvement de fond pour les entreprises. Elles ont à faire face au défi majeur de leur organisation : tirer avantage des informations pour être plus compétitives. Il est donc crucial d’avoir une approche globale, pas uniquement fondée sur des concepts informatiques avec des solutions qui intègrent toutes les dimensions de l’entreprise. Corinne Baragoin Certified IT Specialist Big Data Beatrice Cochard Big Data Technical Sales Manager57 Coordonnées Contact Tél : Fax : Mail : IBM est un acteur technologique au service de l’innovation et de la transformation des PME, des groupes internationaux et des administrations. IBM participe à créer une planète plus intelligente pour permettre aux organisations qu’elle sert d’optimiser leur positionnement dans un monde en perpétuelle évolution. OFFRE IBM BIG DATA Big Data permet de comprendre, avec plus de précision que jamais, comment fonctionne notre monde afin de produire une plus grande croissance économique et du progrès social. Il constitue une opportunité d’obtenir des connaissances sur des types de données et de contenus nouveaux, afin de rendre les entités plus agiles. Plateforme Big Data IBM – IBM seul propose une plateforme complète qui permet de résoudre les défis Big Data qui se posent aux organisations. Le principal bénéfice d’une telle plateforme est de tirer parti de composants pré-intégrés afin de réduire le coût et le temps d’implémentation. IBM DB2 10.5 with BLU Acceleration DB2 10.5 with BLU Acceleration est une base de données en mémoire orientée colonne. C’est une option de paramétrage du nouveau moteur de base de données DB2 10.5 qui permet à la fois de gérer dans une même instance de base de données des tables relationnelles, mais aussi des données stockées ‘à plat’ et exploitées sous forme de tableau en mémoire. IBM InfoSphere Streams IBM InfoSphere Streams est une plateforme de traitement qui permet d'analyser des données en mode flux à très haut débit. Optimisée pour le trafic intense, IBM InfoSphere Streams est capable d’absorber, de filtrer, d’analyser et de corréler des volumes massifs de flux de données structurées ou non structurées, tels que : • les fichiers texte, fichiers de tableur, images, enregistrements vidéo et audio. • les Emails, contenus de dialogues en ligne, SMS, trafic web, blogs et sites de réseaux sociaux. • les transactions financières, données de scanner de police, rapports de systèmes et d’applications. • les données satellite, données GPS, enregistrements de lecteurs de badges et d’accès. IBM InfoSphere BigInsights IBM InfoSphere BigInsights est un produit qui s’appuie sur la technologie Hadoop. Conçu comme une solution intégrée, il offre des fonctions de gestion, de sécurité et de fiabilité nécessaires à un déploiement à grande échelle. Ses fonctions de recherche, de visualisation et d’analyse permettent de mettre en place rapidement des fonctions analytiques puissantes. IBM InfoSphere Data Explorer IBM InfoSphere Data Explorer permet d’exploiter les nombreuses sources d’information et leur mise à jour en temps réel. Cette solution permet une vision unique des données du Data Warehouse, des applications d’entreprise, des applications de gestion de contenus et du web. Une interface Web, centrée sur l’information, permet de rechercher et de naviguer dans les Big Data à travers des sources fédérées. IBM InfoSphere Master Data Management & Information Server La bonne gouvernance des données mais aussi la cohérence de ces données sont des propositions de valeur qu’IBM souhaite apporter à ses clients. IBM propose des solutions complètes, qui permettent d'identifier, de nettoyer, de transformer et distribuer vos données sans obstacle et de manière sécurisée dans l'ensemble de l'entreprise. Dans le domaine du MDM, IBM propose un plateforrme disposant d’un puissant moteur de corrélation qui résout à la fois les rapprochements entre objets et les relations entre objets. PureData for Analytics Appliance décisionnelle haute performance conçue pour l’analytique sur des volumes de données sans cesse croissants avec plus de simplicité, de rapidité et une meilleure accessiblité. Réduit le temps d’exéctution d’heures à la minute sur des Petabytes de données. www.ibm.com IBM France IBM France Isabelle LEFEVRE Marketing Manager Big Data 17 avenue de l’Europe 92275 Bois Colombes +33 (0) 1 58 75 00 00 N/A isabelle_lefevre@fr.ibm.comInterSystems All Data: collectez, stockez, exploitez sans limite toutes vos données: internes, externes, web, réseaux sociaux, … Donnez du sens aux masses de données structurées et non structurées, et dégagez rapidement de la valeur métier pour vos utilisateurs. BIG DATA? ALL DATA! Tirez facilement le bénéfi ce de toutes les données disponibles59 Coordonnées Contact Tél : Fax : Mail : Relevez le défi du Big Data... Tout de suite! La problématique fondamentale des entreprises à l’heure actuelle est d’essayer d’exploiter toutes les données à leur disposition pour en tirer un réel avantage concurrentiel dans leurs métiers. Toutes les données, ou ce que nous appelons le ‘All Data’, cela veut dire principalement trois types de données : • Les données structurées à l’intérieur de l’entreprise, a priori elles sont bien maitrisées et ce depuis longtemps, • Les données non-structurées à l’intérieur de l’entreprise (emails, contrats, documents, intranet…) représentent un gisement important en fonction des métiers, et sont peu ou mal exploitées, • Les données non-structurées à l’extérieur de l’entreprise, le grand inconnu, tant en termes de volumes, que de qualité, et de pertinence pour le métier. Cette notion de ‘All Data’ est évidemment une variante du Big Data tant toutes ces données peuvent représenter des volumes considérables, une variabilité de sources et de formats extrème, et enfin un besoin de traitement rapide et performant si on veut rendre tout cela exploitable. Face à ces trois sources qu’il faut réconcilier, les sociétés se retrouvent donc confrontées aux «3 V» bien exprimés par les analystes du Big Data: Volume, Variabilité, Vitesse Ce challenge technologique, mais aussi métier, est résolu nativement par les solutions InterSystems, originellement issues du MIT, qui permettent de mettre en œuvre un projet Big data sans rien sacrifier : la performance extrème est au rendez-vous sur des technologies standard (performance de niveau base mémoire tout en restant sur des technologies disques ‘classiques’), ouverte maximale sur toutes les données structurées et non structrées qui restent ou deviennent accessible une SQL, volumes traités virtuellement illimité de part la technologie de stockage même. Au cœur de nos technologies: InterSystems Caché®, base de données NoSQL/objet/relationnelle ultra performante, supporte tous les formats de données: aussi bien les structures simples que complexes, les modèles relationnels, Objet ou NOSQL et est capable d’exploiter les données structurées et non structurées de manière intelligente. Grâce à InterSystems DeepSee® elle offre en outre le décisionnel intégré et en temps réel sur tous les formats de données. Le moteur d’analyse sémantique iKnow permet enfin de générer de l’information pertinente à partir de données non structurées. Au niveau projets BIG DATA, InterSystems Caché est notamment au cœur du projet GAIA de cartographie de la Voie Lactée (plusieurs centaine de To avec forte contrainte de temps de traitement), du système de trading du Crédit Suisse (forte contrainte de performance temps réel hauts volumes), de solutions de «Smart Metering» en Europe, ainsi que de très nombreuses entreprises qui exploite les immenses volumes de données textuelles du web pour leur enjeux métiers (marketing, presse…). Au delà du Big Data, InterSystems propose à ses clients une démarche vers le ‘All Data’, ce que nous appelons «libérer les données». InterSystems est, depuis plus de 30 ans, l’un des principaux éditeurs mondiaux de logiciels novateurs dans le domaine des bases de données, du développement rapide, et de l’inté- gration d’applications. Les technologies InterSystems sont reconnues et mises en œuvre dans tous les ecteurs d’activité, adoptées par plus de 2500 éditeurs, mises en œuvre par les plus grands intégrateurs et SSII, et plus de quatre millions de personnes à travers le monde utilisent chaque jour des applications stratégiques s’appuyant sur l’environnement logiciel d’InterSystems. www.intersystems.fr InterSystems France InterSystems France Robert BIRA Market Development France Tour Europlaza - La Défense 4 20 avenue André Prothin 92400 Courbevoie +33 (0) 1 77 49 16 00 +33 (0) 1 47 76 02 63 Robert.Bira@InterSystems.com Data Capture Data Sharing Data Analytics Data-driven ActionsJaspersoft: L’écosystème partenaire Big Data le plus important de l’industrie informatique Hadoop NoSQL/NewSQL Analytic DBMS BigQuery61 Coordonnées Contact Tél : Fax : Mail : Jaspersoft permet à des millions de personnes de prendre chaque jour, de meilleures décisions plus rapidement, en leur donnant accès à des données utiles et exploitables au cœur de leurs applications et processus métier. Sa plateforme d’outils de reporting et d’analyse intégrés offre à chaque utilisateur une autonomie réelle et les réponses dont il a besoin. Elle s’adapte à toutes les architectures et à tous les budgets afin de servir l’ensemble de l’entreprise. Grâce à une communauté forte de plusieurs centaines de milliers de membres, les logiciels open source de Jaspersoft comptent des millions de téléchargements. Ses solutions décisionnelles sont intégrées au cœur de centaines de milliers d’applications et de processus métier d’où Jaspersoft – The Intelligence Inside. Jaspersoft est une société privée qui possède des bureaux dans le monde entier. Pourquoi Jaspersoft ? Le décisionnel libre-service pour tous Jaspersoft propose une suite décisionnelle complète de bout en bout, en libre-service pour : TOUS LES UTILISATEURS : En fournissant des rapports interactifs non pixellisés, des tableaux de bord et des analyses ad-hoc. Jaspersoft offre un décisionnel libre-service intuitif aux utilisateurs occasionnels et expérimentés. TOUTES LES QUESTIONS : Grâce à un moteur en mémoire et une couche évoluée de métadonnées, les utilisateurs reçoivent des réponses ultrarapides à toutes leurs requêtes. TOUS LES APPAREILS : Les utilisateurs peuvent accéder à toutes les fonctionnalités décisionnelles depuis leur bureau ou en déplacement sur smartphone ou sur tablette. Une plateforme évolutive pour les créateurs de décisionnel La plateforme décisionnelle Jaspersoft permet aux administrateurs du décisionnel de s’adapter facilement pour mieux prendre en charge : TOUS LES UTILISATEURS Le faible coût de l’abonnement et la rapidité d’implémentation permettent aux entreprises de toute taille de se lancer rapidement et de passer à des milliers d’utilisateurs de manière économique. TOUTES LES INFRASTRUCTURES Flexible et entièrement basée sur les standards Web, l’architecture de Jaspersoft peut fonctionner en version autonome ou s’intégrer facilement à n’importe quelle application sur site ou sur environnement Cloud grâce aux API étendues et aux thèmes CSS. Conçue pour le nouveau monde des TI La plateforme décisionnelle moderne de Jaspersoft est conçue pour suivre l’évolution du monde des TI, en particulier : LE BIG DATA Jaspersoft est la seule plateforme décisionnelle capable de créer des rapports et des analyses, directement depuis des sources Big Data tels que Hadoop, MongoDB et Cassandra ainsi que les principales bases de données analytiques comme HP Vertica, IBM Netezza, EMC Greenplum et bien d’autres. Jaspersoft a déjà travaillé sur des projets Big Data au sein de groupes comme Groupon, Ericsson, Vimeo, Jagex et SoftServe entre autres. Pour plus d’informations, consultez www.jaspersoft.com/bigdata. LE CLOUD La plateforme décisionnelle entièrement mutualisée de Jaspersoft offre des fonctionnalités SaaS pour les entreprises ainsi que des fonctionnalités PaaS pour les développeurs. Elle est la première à s’intégrer aux plateformes Cloud leaders tel qu’Amazon, Red Hat et VMware. LE MOBILE Jaspersoft propose le seul framework open source du marché pour le décisionnel mobile sur les appareils iOS et Android en tant qu’applications natives et sur navigateur, grâce à la technologie HTML 5. Contacts: Anthony Pangnanouvong, Business Development, France apangnanouvong@jaspersoft.com www.jaspersoft.com Jaspersoft Jaspersoft SARL Georges CARBONNEL Responsable Enterprise Accounts, France 3 rue Colonel Moll 75017 Paris +33 (0) 9 70 44 40 19 +353 1 686 5249 gcarbonnel@jaspersoft.comCréation visuel : Elan Graphic (78) - Photos © Depositphotos.com63 Coordonnées Contact Tél : Fax : Mail : Fort d’une quinzaine d’années d’expérience au service de la maîtrise et de la valorisation de la donnée, Keyrus aide les entreprises à fournir à chacun de leurs collaborateurs les informations et la motivation nécessaires au développement de leurs activités et de leurs équipes. S’inscrivant dans la continuité de cette mission claire et partagée, Keyrus propose une capacité unique de réalisation de solutions analytiques essentielles aux enjeux de performance des entreprises. Pour ce faire, Keyrus a réuni des compétences métiers – fonctionnelles et sectorielles –, et des expertises analytiques et technologiques travaillant de façon totalement intégrée. Notre approche unique de proof-of-value vous permet ainsi de comprendre en quelques semaines le plein potentiel des nouveaux modes de valorisation de la donnée et d’entreprendre le chemin permettant de les intégrer au sein d’un portefeuille analytique au service de la découverte des leviers de la performance économique. ‘’Dans un monde de plus en plus dématérialisé où les clés de la compétitivité et de la croissance font appel à une connaissance plus fine des marchés, des clients et de leurs dynamiques, Keyrus se positionne comme le partenaire naturel de ses clients dans la transformation de leur actif informationnel en valeur économique durable. S’il est en effet à présent largement admis que les données, sous ses formes et ses origines les plus diverses, constituent un actif majeur des organisations dans toutes les industries et que leur rôle de catalyseur de la capacité d’anticipation et de l’agilité opérationnelle ne fait plus aucun doute, les enjeux dessinés par leur exploitation n’en restent pas moins à la hauteur des opportunités qu’elle augure. Conscient de l’importance du changement que les nouveaux paradigmes sous-tendent au sein d’un écosystème économique en pleine mutation et des questions bien concrètes que l’exploitation de la richesse et de l’accessibilité toujours croissante des données soulèvent, Keyrus vous accompagne dans la mise en œuvre des organisations et des solutions permettant de répondre aux enjeux économiques modernes d’un monde devenu numérique. Fort d’une capacité unique à mobiliser conjointement l’expertise métier, analytique et technologique indispensable au succès des ambitions analytiques et Big Data de ses clients, Keyrus répond aux défis d’aujourd’hui par des modalités bien tangibles et pragmatiques, ancrées dans la réalité de l’entreprise et ciblées sur des projets concrets et accessibles, construisant ainsi les fondations d’un avantage concurrentiel dans la durée. www.keyrus.com Keyrus KEYRUS Reda GOMERY Directeur des Opérations 155 rue Anatole France 92300 Levallois-Perret France +33 (0) 1 41 34 10 00 +33 (0) 1 41 34 10 10 bigdata-keyrus@keyrus.comLET MAPR WORK FOR YOU WWW.MAPR.COM MapR delivers on the promise of Hadoop with a proven, enterprise-grade Big Data platform that supports a broad set of mission-critical and real-time production uses. MapR Europe du Sud & Benelux 171 bis av. Charles-de-Gaulle - 92 200 Neuilly/Seine - France sales-southEU@mapr.com65 Coordonnées Contact Tél : Fax : Mail : MapR est la distribution la plus à la pointe du secteur pour les solutions Apache Hadoop, faisant de la gestion et de l’analyse du Big Data une réalité pour un nombre croissant d’entreprises utilisatrices. MapR contraste avec les autres distribution Hadoop, grâce à une architecture dédiée entreprise qui fournit aux clients une plate-forme fiable et très performante leur permettant non seulement d’analyser les données d’une manière nouvelle et puissante, mais aussi de créer de nouveaux produits et services pour leur clientèle. MapR a considérablement perfectionné Hadoop en ajoutant à la plate-forme des extensions puissantes dédiées entreprise, la rendant plus simple à utiliser, plus fiable et beaucoup plus rapide que ce qui est proposé par les autres distributions Hadoop. Il existe plus d’une douzaine de fonctionnalités, disponibles uniquement chez MapR. Non seulement MapR supporte toute la gamme des API Hadoop, mais elle fournit également un accès NFS pour le partage de fichiers à travers le réseau ; ainsi, chaque application à base de fichiers peut accéder à des données du groupe sans réécritures à coder. De surcroît, la plateforme MapR fournit des améliorations des performances, celles-ci étant multipliées au moins par deux, voire même par cinq, et elle permet une fiabilité de MapReduce sans précédent. MapR englobe, entre autres, les suites communautaires open-source populaires comme HBase, Hive, Cascading et Zookeeper. En plus de ses fonctions particulièrement simples à utiliser, MapR permet aux clients de réduire le coût des matériels hardware nécessaires de moitié, autorisant ainsi un plus grand nombre d’entreprises et d’organisations de profiter de la puissance de l’analyse du Big Data et de devancer ainsi leurs concurrents. MapR Technologies a connu une croissance rapide au niveau de la clientèle et de son expansion puisqu’elle opère désormais en Europe, au Moyen-Orient et en Asie. MapR est la seule plateforme Hadoop disponible sur Google Compute Engine. Elle est également présente dans Amazon Elastic MapReduce sur Amazon.com. Grâce à sa technologie de pointe et sa réputation de pionnière dans l’environnement Hadoop, l’entreprise permet à des milliers de clients de mieux gérer et analyser leurs données issues du Big Data. Actuellement, la plateforme Big Data MapR est utilisée par des sociétés issues de la finance et de l’assurance, des médias, de la recherche et de la santé, de l’industrie, des administrations, des chaînes de commerce de détail, ainsi que par les principales entreprises Fortune 100 et Web 2.0, permettant à toutes ces sociétés ou organisations d’analyser des centaines de milliards d’éléments sur une base journalière, des données concernant 90 % de la population connectée à Internet sur une base mensuelle, et plus de mille milliards de dollars de transactions de commerce de détails sur une base annuelle. Le siège social de l’entreprise est situé à San Jose, Californie, USA, et elle a ses bureaux européens à Londres, Paris, Stockholm et Munich. Consultez www.mapr.com pour de plus amples renseignements concernant l’entreprise et ses produits. Pour télécharger la version la plus récente de Apache Hadoop de MapR Distribution, veuillez vous rendre sur www.mapr.com/products/download www.mapr.com MapR Technologies MAPR TECHNOLOGIES Xavier GUERIN VP Southern Europe and Benelux MapR Europe du Sud & Benelux 171 bis avenue Charles de Gaulle 92200 Neuilly sur Seine +33 (0) 1 70 91 86 49 N/A sales-southEU@mapr.comLa base de données de graphes Neo4j • Neo4j vous permet de représenter les données connectées naturellement, en tant qu’objets reliés par un ensemble de relations, chacun possédant ses propres propriétés. La base de données de graphes, permet au développeur de commencer immédiatement à coder, car les données stockées dans la base font le parallèle direct avec les données elles mêmes. • Comparé aux bases relationnelles, la base de données de graphe Neo4j peut être jusqu’à plusieurs milliers de fois plus rapide pour traiter les données associatives, tout en simplifiant considérablement les requêtes qui peuvent s’étendre plus facilement à de larges ensembles de données, car elles ne nécessitent pas de recourir aux couteuses jointures du monde SQL. Les traversées utilisent un langage spécialement adapté pour parcourir les connections très simplement, et très rapidement. Vu qu’elles ne dépendent pas d’une modélisation rigide, Neo4j est plus propice pour la gestion de données changeantes et de schémas évoluant fréquemment. • Les bases de données de graphes sont un outil puissant pour exécuter des requêtes de type parcours de graphe. La recherche du plus court chemin entre deux points du graphe permettant, par exemple, de résoudre facilement les requêtes sociales ainsi que de géographie et d’analyse d’impact. Si vous vous arrachez les cheveux avec de nombreuses jointures et les procédures stockées complexes, il est fort possible que vous soyez en train de construire un graphe sans le savoir : car les graphes sont partout. Depuis les applications sociale web jusqu’à l’analyse d’impact sur un réseau Telecom en passant par la recherche en Biologie, les recommandations, la sécurité, et la détection de fraude, de nombreuses organisations ont adopté la bases de données de graphes Neo4j pour augmenter leurs capacités et leurs performances. C’est un système conçu pour gérer les données connectées que nous rencontrez de plus en plus au quotidien, qui est néanmoins fortement maturé avec plus de 10 ans en production. Découvrez avec nous ce qu’apporte la puissance de Neo4j à une large variété de clients tels que HP, SFR, Cisco, Deutsche Telekom, Viadeo et Glowbl.67 Coordonnées Contact Tél : Fax : Mail : www.neotechnology.com Business development France FAUVET Cédric cedric.fauvet@neotechnology.com N/A +33 (0) 8 05 08 03 44 Neo Technology France Neo4j Neo Technology Les chercheurs de Neo Technology sont les pionniers de la base de données de graphes depuis 2000. Ils ont contribué à mettre la puissance des graphes à la disposition de nombreuses PME innovantes telles que Glowbl, Sodifrance ou Perigee, mais aussi d’organisations réputées mondialement telles que Cisco, HP, Deutsche Telekom, SFR, et Viadeo. Ses 10 ans de service en production dans des environnements critiques pour le métier, ses partenaires Français et globaux et ses milliers de déploiements réussit on fait de Neo4j le leader mondial de la base de données de graphe. Cas d’usages de Neo4j Analyse d’impact Avoir la main sur son système et identifier en temps réel le client impacté par une maintenance ou une panne. Logistique Calculer le meilleur chemin pour livrer un client. Social, collaboration : Rechercher très facilement qui sont les amis de mes amis/ Recommandation : Définir en temps réel la liste les produits achetés par mes amis que je n’ai pas moi même achetés. Master Data Management / Gestion de configuration Construction d’un référentiel standardisé performant et sans redondance pour vos données critiques hiérarchisées : Hiérarchie d’entreprise et de produit. Droits d’accès Gestion des groupes, utilisateurs et droits rapide et sans redondance. Géo-Spatial Modélisation d’une carte routière et calculs d’itinéraires. Biologie, interactions moléculaires Réduire les risques d’effets secondaires des médicaments en calculant en temps réel les interactions entre une protéine et une future molécule., Bénéfices clés de Neo4j Des requêtes haute performance Le modèle de données du graphe permet l’exécution des requêtes complexes avec une haute performance, inhérentes aux données connectées des applications d’aujourd’hui. En un mot le bon outil pour le bon besoin. Des projets livrés plus rapidement Modéliser une base de données de graphes est aussi simple que d’écrire sur un tableau blanc. Les entreprises peuvent capturer rapidement toutes sortes de données, structurées, semi-structurées et déstructurées et ainsi les stocker dans Neo4j. Ceci résultant dans une réduction des temps de développement, une réduction de coûts de maintenance et de plus hautes performances. La découverte de nouveaux cas d’usage Très souvent les utilisateurs et clients de Neo4j démarrent un projet car ils n’ont pas pu trouver de solution à un problème bien précis avec les bases de données relationnelles. Puis ils découvrent, par la simplicité du modèle de données de graphes, de nouveaux cas d’usage très utiles dans le monde des startup ou des industries fortement concurrentielles. 69 Coordonnées Contact Tél : Fax : Mail : www.parstream.com ParStream est une plateforme innovante et primée de Big Data Analytics. Créée en tant que technologie totalement nouvelle à partir de 2008, son index compressé haute-performance (HPCI) et son architecture état de l’art (share nothing, columnar) permet d’obtenir des temps de réponse en millisecondes sur des milliards d’enregistrements. Conçue dès l’origine pour tirer partie des environnement multi-coeur, ParStream passe à l’échelle linéairement et apporte l’infrastructure analytique la plus efficace en coût et en rendement énergétique. ParStream a commencé comme défi technologique pour un groupe d’ingénieurs allemands : effectuer des opérations analytiques sur un jeu de données de 18 milliards d’enregistrements pour des centaines d’utilisateurs tout en fournissant des temps de réponse interactives. Afin d’obtenir de telles performances dans les contraintes serrées de coûts du e-commerce, des recherches importantes ont été effectuées conduisant à une percée technologique et un brevet pour l’indexation de grands ensembles de données. ParStream se présente comme une base NewSQL permettant une prise en main aisée aussi bien par des équipes BI, des DBA et des développeurs. Elle est disponible sous forme logicielle et – ne requérant pas de matériel spécifique – s’intègre avec une empreinte économique et énergique optimisée. La version initiale de ParStream, montrée en 2010, a reçu le prix « One to Watch » du Emerging Companies Summit de Nvidia, ce qui lui a valu un attention immédiate et depuis soutenue d’acteurs telles que Red Herring (Top 100 Europe), Gartner (Cool Vendor) ou encore Computer Week Allemagne (Big Data Innovation). En 2013, ParStream a été classée le premier des Startup du Big Data parmi une sélection de leaders de l’industrie par CIO.com ParStream travaille en étroite relation avec le groupe « Database Systems et Information Management » de l’université de Berlin et en particulier avec le professeur Markl qui pré- side le conseil scientifique de la société aux cotés de Don Haderle (« le père de DB2 »), Marie-Anne Neimat (co-fondatrice de TimesTen et ex-VP du Développement d’Oracle) et Andy Palmer (co-fondateur et ex-CEO de Vertica). ParStream a ainsi accès à une ampleur et profondeur de connaissances sur le marché et la technologie analytique pour soutenir et développer son avance technologique. ParStream est membre de plusieurs initiatives et projets du gouvernement fédéral allemand. Par exemple, ParStream est l’un des six membres du project de recherche MIA qui est une place de marché Cloud pour l’information et l’analytique du Web Germanophone à l’initiative du BMWI (Ministre fédéral de l’Economie et de la Technologie). Egalement, Jörg Bienert le CTO de ParStream, est membre du Conseil sur la Nouvelle Economie Numérique du Ministre de l’Economie et de la Technologie et il est fréquemment membre des délégations internationales du ministre. ParStream est soutenue par des fonds reconnus de la Silicon Valley tels que Khosla Ventures, Data Collective, Baker Capital, … et a des clients initiaux tels que Coface Services en France. ParStream est basée à Cologne avec des bureaux à Hamburg, Paris ainsi qu’a Cupertino. ParStream est utilisée dans des applications variées qui vont de l’e-commerce à la recherche scientifique en passant par la supervision et l’optimisation d’infrastructures et de systèmes complexes. N/A sales@parstream.com +33 (0) 1 40 90 34 20 Sr. Director Solutions Livaudais Peter La Grande Arche - Paroi Nord Paris La Défense - 92044 ParStream ParStreamOptimisation d’Hadoop et plus encore. Découvrir comment sur pentaho.fr C M Y CM MY CY CMY K 13-108 Pentaho FR Ad v3 print_bleed.pdf 1 20.08.2013 13:04:0171 Coordonnées Contact Tél : Fax : Mail : Pentaho construit le futur de l’analytique. Son héritage Open Source mène son innovation continue pour une plate-forme analytique intégrée et moderne conçue pour les diverses exigences de l’analyse d’entreprise de demain, notamment celles du Big Data. L’analytique performante à moindre coût est facilement accessible grâce à la suite d’outils de Pentaho qui permet l’accès aux données, la visualisation, l’intégration et l’analyse de données ainsi que le datamining. Pentaho permet d’exploiter plus rapidement les Big Data grâce à sa solution d’analytique pour Big Data la plus complète du marché. Pentaho offre : • Pentaho Big Data Analytics Center • Une continuité totale depuis l’accès aux données jusqu’à la prise de décisions : une plate-forme complète analytique et d’intégration de données conçue pour n’importe quel entrepôt de données Big Data • Un développement et une exécution plus rapides : développement visuel et exécution distribuée • Une analyse interactive et instantanée : aucun codage ni compétences ETL requis Instaview Pour répondre aux besoins spécifiques des analystes Big Data, Pentaho a créé Instaview, première application interactive et instantanée pour Big Data. Instaview convertit les données en analyses en trois étapes simples visant à réduire considérablement le temps de recherche, de visualisation et d’exploration de larges volumes de données complexes et diverses. Pentaho facilite l’analyse des données Hadoop L’utilisation de Pentaho Business Analytics avec Hadoop offre une conception graphique hautement productive associée à une analyse et à une visualisation des données instantanées: • Une plate-forme d’analyse Hadoop complète – développement visuel pour l’ingestion, la préparation, l’intégration et l’organisation des données Hadoop et visualisation, exploration et prédiction interactives • Une meilleure productivité de l’équipe informatique grâce à la réutilisation des compé- tences existantes – facilement utilisables sans formation particulière par les informaticiens, les analystes d’entreprise et les scientifiques spécialistes des données • Une protection contre les risques – fonctionne avec toutes les principales distributions Hadoop, ainsi que les bases de données NoSQL et les entrepôts de données traditionnels, en connectant Hadoop au reste de l’entreprise • Productivité et performance : gain en productivité de développement et en performance d’exécution multiplié par 10 ou par 15 par rapport au codage manuel MapReduce, grâce à l’utilisation de l’unique moteur ETL qui s’exé- cute nativement comme une tâche MapReduce à travers le cluster Hadoop Analyse et visualisation NoSQL Grâce à un support natif des bases de données NoSQL les plus utilisées, notamment Apache Cassandra/DataStax, HBase, MongoDB/10gen et HPCC Systems, Pentaho fournit : • Une plate-forme d’analyse Hadoop complète : développement visuel pour l’ingestion, la préparation, l’intégration et l’organisation des données NoSQL ; visualisation, exploration et prédiction interactives • Une création de rapports et une analyse par ordinateur et par utilisateur sur le nombre croissant de données générées, telles que contenu web, documents, réseaux sociaux ... • Une meilleure productivité de l’équipe informatique grâce à la réutilisation des compétences existantes : outils facilement utilisables sans formation particulière par les informaticiens, analystes d’entreprise et scientifiques spécialistes des données • Une protection contre les risques – fonctionne avec toutes les bases de données NoSQL de premier ordre, ainsi que les entrepôts de données traditionnels et Hadoop, en connectant les bases de données NoSQL au reste de l’entreprise • Productivité et performance : gain en productivité de développement et en performance d’exécution multiplié par 10 ou par 15 par rapport au développement codé manuellement pour les bases de données NoSQL Visitez le Pentaho Big Data Analytics Center : www.pentahobigdata.com pour en savoir plus sur Pentaho et Big Data, accéder à des articles techniques et vous tenir informé des dernières nouvelles et tendances du secteur. Pour évaluer gratuitement ‘’Pentaho Business Analytics’’: www.pentaho.fr/download/ www.pentaho.fr Pentaho PENTAHO Olivier CHARLERY French Inside Sales Paris - France 0800-915343 1 407 517-4575 ocharlery@pentaho.comTéléchargez le livre blanc sur : www.qlikview.fr/big-data QlikView donne tout son sens au Big Data Le Big Data nous concerne tous. Il transforme le monde qui nous entoure. Grâce à la plate-forme QlikView de Business Discovery, vous pouvez exploiter toute sa puissance : • Analyser des données issues de différentes sources depuis une seule et même application; • Explorer naturellement les associations entre les données; • Visualiser les données à l’aide de graphiques soignés et performants; • Accéder à vos données à partir de périphériques mobiles pour les analyser; • Développer la prise de décisions collaboratives en temps réel et de façon sécurisée Découvrez comment QlikView permet à King.com, un acteur majeur des jeux en ligne (Candy Crush Saga) d’analyser le comportement de jeu de 40 millions de clients, grâce à l’exploitation des données stockées dans son cluster Hadoop, où deux milliards de nouvelles lignes sont créées chaque jour. PUB_BigData_FINAL.indd 1 9/2/2013 11:29:39 AM73 Coordonnées Contact Tél : Fax : Mail : QlikTech (code NASDAQ : QLIK) est un leader en matière de Business Discovery, la Business Intelligence (BI) conduite par l’utilisateur. La plate-forme QlikView de Business Discovery comble l’écart entre les solutions de BI traditionnelles et les applications inadaptées de feuilles de calcul. QlikTech a mis au point une technologie pionnière de recherche associative en mémoire et grâce à cet environnement de BI en libre-service, les utilisateurs peuvent explorer les informations librement, au lieu d’être cantonnés à une série prédéfinie de questions. QlikView permet aux utilisateurs métier d’appréhender leur activité de façon unique : • Consolider l’ensemble des données issues de différentes sources dans une seule et même application; • Explorer naturellement les associations entre les données; • Visualiser les données à l’aide de graphiques soignés et performants; • Accéder à vos données à partir de périphériques mobiles pour les capturer et les analyser; • Développer la prise de décisions collaboratives en temps réel et de façon sécurisée. Le déploiement de l’environnement d’analyse en libre-service de QlikView ne nécessite que quelques jours ou quelques semaines, et répond aux besoins des PME comme des plus grandes entreprises internationales. Le modèle orienté applications de la plate-forme QlikView de Business Discovery est également compatible avec les solutions de BI existantes et offre une expérience collaborative basée sur l’immersion et intégrant une dimension sociale et mobile. Plus de 29 000 sociétés à travers le monde ont déjà fait le choix de QlikView. www.qlikview.com QlikTech France QlikTech France Stéphane BRIFFOD Director Presales 93 avenue Charles de Gaulle 92220 Neuilly-sur-Seine +33 (0) 1 55 62 06 90 N/A infoFR@qlikview.comwww.quartetfs.com PARIS • LONDRES • NEW-YORK • SINGAPOUR • HONG-KONG ActivePivot - Enfin l’analyse multidimensionnelle tient ses promesses ! ActivePivot - Enfin l’analyse multidimensionnelle tient ses promesses ! ActivePivotTM Agrégation de grands volumes de données Calculs sophistiqués à partir de vos règles métier Profondeur d’analyse Calculs en mémoire, en mode incrémental Rafraîchissement des données à la volée Performance Pas de limite au nombre de dimensions Temps de réponse instantanés Liberté d’analyse Une base de données “mixed workload” au service de la prise de décision opérationnelle +33 (0) 1 475 Coordonnées Contact Tél : Fax : Mail : Quartet FS répond aux besoins des entreprises qui souhaitent améliorer leur performance en mettant l’analyse des données en temps réel au service de la prise de décision opérationnelle. ACTIVEPIVOT EN BREF Puissant moteur d’agrégation et de calcul en mémoire, ActivePivot permet aux décideurs du quotidien d’analyser leur activité et d’en optimiser la performance en s’appuyant sur des indicateurs complexes générés à la volée à partir de données rafraîchies en temps réel. ActivePivot est donc une solution innovante particulièrement adaptée aux enjeux analytiques du « Big Data ». Combinant les traitements transactionnels et analytiques au sein d’un seul et même environnement tirant parti du traitement en mémoire, ActivePivot se distingue par la combinaison des caractéristiques suivantes: • Agrégation de grands volumes de données hétérogènes de manière incrémentale • Calcul à la volée d’indicateurs à partir de n’importe quel type de règle métier • Navigation dans les données à différents niveaux d’agrégation • Simulation de scénarii sur des données temps réel • Choix de l’interface de visualisation: ActivePivot Live ou interfaces MDX/XMLA CAS D’USAGE ActivePivot apporte de la valeur dans les processus nécessitant l’agrégation de grands volumes de données très volatiles, comme la supply chain, le risk management, le pricing dynamique ou encore la gestion de trafic. Dans ces contextes, ActivePivot permet d’adresser des cas d’usage inédits comme la gestion par exception, l’optimisation de ressources, l’analyse d’impact, la détection d’anomalies ou encore le stress testing. • Transport: Visibilité de bout en bout sur la supply chain Un enjeu Big Data dans le monde du transport est le pilotage de la chaîne logistique. Pour garantir les délais de livraison, les opérateurs logistiques ont besoin de faire la synthèse des informations qui remontent de leur supply chain, que ce soit des systèmes de planification, de TMS ou encore de gestion des entrepôts. ActivePivot fait la synthèse en continu de toutes ces données pour permettre aux opérateurs logistiques d’avoir une visibilité de A à Z sur leur supply chain. ActivePivot permet aux opérateurs de disposer dune véritable tour de contrôle de leurs flux opérationnels. • Finance: Analyse des risques en temps réel ActivePivot est déployé dans de nombreux établissements financiers pour répondre à un besoin croissant d’analyse et de surveillance des risques en temps réel. Chez Lloyds Banking Group, les traders utilisent ActivePivot pour obtenir une visibilité en temps réel sur leurs positions en préalable à toute activité de trading. Chez Nordea, les risk managers utilisent ActivePivot pour calculer la Value at Risk en temps réel, une mesure qui nécessite l’agrégation incrémentale de grands volumes de données non linéaires. • E-commerce: Pricing dynamique Un cas d’usage typique pour ActivePivot dans le monde du e-commerce est la prise de décision en mode “stressé” ou en flux tendu, comme par exemple en période de solde. Lorsqu’il faut ajuster les prix en quasi temps réel, ActivePivot permet aux acheteurs de déterminer les références pour lesquelles une variation de prix aura l’effet de levier le plus fort sur les ventes sans pour autant détériorer la marge de l’ensemble du rayon. A PROPOS DE QUARTET FS Créée en 2005 par un groupe de cinq entrepreneurs issus du monde applicatif, Quartet FS est une société à capitaux privés avec des bureaux à Paris (siège de la R&D), Londres, New-York, Hong Kong et Singapour. Avec plus de 50 projets en production dans des groupes d’envergure internationale, Quartet FS a pour clients des entreprises dans de nombreux secteurs d’activité parmi lesquels la finance, la logistique, le transport ou encore la grande distribution. www.quartetfs.com Quartet FS QUARTET FS Nina KRAUSE Sales Executive 2 rue Jean Lantier 75001 Paris +33 (0) 1 40 13 91 00 +33 (0) 1 40 13 84 51 nina.krause@quartetfs.com +33 (0) 1 4Les Big Data ont trouvé leur maître. HIGH-PERFORMANCE SAS et les noms de produits ou services SAS® sont les marques déposées de SAS Institute Inc., Cary NC, USA. Les autres noms de produits ou concepts sont des marques déposées des sociétés respectives. Copyright © 2013. Tous droits réservés. Découvrez tous les atouts de l’analytique haute performance sur www.sas.com/france/hpa Il existe une solution rapide et efficace pour valoriser la masse de big data que vous affrontez. SAS® High-Performance Analytics simplifie l’analyse des grandes volumétries de données pour résoudre des problèmes complexes et permet de prendre des décisions rapides et fiables grâce à la puissance d’analyse, à la capacité et la rapidité de traitement de quantités massives de données.77 Coordonnées Contact Tél : Fax : Mail : SAS, votre atout performance Prenez de meilleures décisions plus rapidement SAS vous aide à résoudre vos problèmes complexes, atteindre vos objectifs clés et exploiter plus efficacement vos données. Pourquoi ? Leader mondial du décisionnel et des solutions de business analytics, nous proposons des outils analytiques puissants, reconnus sur le marché, des solutions de pilotage de l’information et de business intelligence, pour vous aider à faire face aux challenges d’aujourd’hui et anticiper les opportunités de demain. Regardez vos objectifs prendre forme Une des priorités de votre entreprise : savoir tirer parti des big data. L’analytique va vous aider à atteindre cet objectif, à vous permettre de percevoir qu’un détail peut faire la différence ou à prendre du recul pour détecter de plus grandes opportunités, de plus fructueuses perspectives. C’est toute la puissance apportée par l’analytique. A cet instant même, les clients de SAS – parmi lesquels 90 des 100 premières entreprises du classement FORTUNE Global 500® de 2012, s’appuient sur nos solutions analytiques pour : • Découvrir et saisir des opportunités de développement et de performance dans de multiples domaines. • Prendre des décisions stratégiques, opérationnelles et tactiques en un rien de temps. • Utiliser des données pour des décisions aux résultats tangibles. Avec SAS, c’est possible Nous nous engageons sur le succès de vos projets sur le long terme. Nos équipes de consultants, formateurs, support 24/7, vous accompagnent tout au long du cycle de vie de votre projet. La communauté de nos clients et partenaires contribuent à cet accompagnement. Comment nous vous aidons Vous avez besoin d’une solution spécifique adaptée à votre secteur ? Ou d’une solution fonctionnelle transverse qui va vous permettre de répondre à vos challenges ? Quelle que soit votre problématique, SAS a une réponse pour vous. Par exemple, nous aidons à combattre la fraude dans le secteur financier, à accélérer la mise sur le marché de médicaments ou identifier des opportunités de ventes croisées et additionnelles dans la distribution. Nous aidons aussi nos clients à valoriser leur relation client, à piloter leurs risques et à optimiser leurs réseaux informatiques. Nos solutions répondent à ces problématiques complexes en s’appuyant sur un socle technologique avec trois composantes clé : la gestion des données, les outils d’analyse et la restitution de l’information. Vous n’avez jamais pris de décisions aussi rapidement grâce à vos données. Avec SAS® High-Performance Analytics, vous n’avez plus besoin de longs processus pour analyser vos Big Data. Obtenez des résultats en quelques minutes ou secondes, et consacrez le temps ainsi gagné à votre business. Nous avons aussi rendu la business analytics accessible et simple. Changez votre manière d’analyser vos données : avec SAS® Visual Analytics vous explorez visuellement et rapidement vos données. Vous pouvez créer vos rapports et partager les résultats sur le web ou des tablettes Android® et iPad®. Tous vos collaborateurs amenés à prendre des décisions, quel que soit leur métier ou leur niveau hiérarchique, peuvent désormais avoir accès à des analyses prédictives rapides et précises. Votre succès est notre succès. Et c’est pourquoi nous vous aidons à déployer et utiliser les solutions SAS de la façon qui vous convient le mieux. Nous avons des offres flexibles pour répondre à vos besoins : cloud privé, hébergement, grid ou services web d’Amazon... SAS Institute, société privée créée en 1976. Plus de 65000 sites clients répartis dans 135 pays, dont 2600 en France. www.sas.com/france SAS Institute SAS INSTITUTE Serge BOULET Directeur Marketing Domaine de Grégy Grégysur-Yerres 77257 BRIE COMTE ROBERT CEDEX +33 (0) 1 60 62 11 11 +33 (0) 1 60 62 11 12 comsas@fra.sas.com79 Coordonnées Contact Tél : Fax : Mail : Si votre performance dépend de l’agilité de l’accès aux données… • Avec Aggrego Suite© de Semsoft, relevez le défi de l’intégration de données dans un contexte Big Data de manière simple et rapide tout en maitrisant votre investissement (intégration limitée, pas de stockage, mode Cloud). La solution Aggrego Suite© est une base de données virtuelle qui réconcilie des sources de données hétérogènes (internes / externes, structurées / non structurées) en les présentant de manière structurée et homogène. Avec Aggrego Suite© vous valorisez avec agilité votre capital informationnel étendu sans intrusivité, ni centralisation, pour : - Faire des requêtes métiers complexes, - Enrichir dynamiquement vos informations clients / produits / fournisseurs, - Collecter de manière simple des données pour analyse et Data mining. • Aggrego Suite© est le fruit de plus de 10 ans de R & D conjointe avec l’INRIA, Orange Labs, l’Université d’Orsay et le CNRS autour des technologies du web sémantique et du VLDB (Very Large Database). Elle a déjà séduit un certain nombre de clients en France dont Orange, Total, Médiamétrie/EuroDataTV,... • La solution Aggrego Suite de Semsoft a été primée lors des Data Intelligence Awards 2013. ROI Valorisation du capital informationnel étendu de l’entreprise vs. coûts d’intégration et d’exploitation faibles. Facilité Mise en œuvre en quelques jours/semaines. Agilité Ajout de sources et évolution du modèle instantanés, requêtes métiers complexes et contextuelles. www.semsoft-corp.com COO Regnault Damien Damien.regnault@semsoft-corp.com N/A +33 (0) 2 99 12 19 86 80, avenue des buttes de Coesmes 35700 Rennes SEMSOFT Semsoft STRATEGIE | GOUVERNANCE  | ARCHITECTURE www.sentelis.com smart solutions for smart leaders81 Coordonnées Contact Tél : Fax : Mail : smart SOLUTIONS for smart LEADERS Nos métiers Stratégie / Gouvernance / Architecture Nos prestations Industrialisation du SI Gouvernance orientée service de la DSI Conception d’architecture nouvelle génération Etude et mise en œuvre de socles SI industriels Etude et activation de pratiques DSI industrielles Marketing de la DSI Une vocation à accompagner les directions des systèmes d’information grâce à : • une parfaite compréhension des tendances de fond sectorielles et des impératifs auxquels doivent répondre les décideurs • une capacité à comprendre, conseiller et défendre des approches et solutions innovantes • une exigence de haute qualité doublée de pragmatisme Un savoir-faire à forte valeur ajoutée fondé sur : • une pratique conjuguée de la stratégie, de la gouvernance et de l’architecture des systèmes d’information • des compétences interdépendantes en étude amont et mise en œuvre opérationnelle • une forte expérience sur les composants et pratiques transverses (SOA, BPM, MDM, BI, BigData, Shared Services Centre, Amélioration continue…) • une méthodologie dédiée à la mise en œuvre de ces fondations : smartfoundations™ Une approche très personnalisée de nos clients qui repose sur : • une compréhension approfondie de leur contexte métier et système d’information • la recherche de solution « sur mesure » • une équipe de talents complémentaires au sein d’un cabinet indépendant www.sentelis.com Sentelis SENTELIS Isabelle REGNIER Directeur Commercial 31 Rue du pont 92200 Neuilly-sur-Seine France +33 (0) 1 75 61 34 00 N/A i.regnier@sentelis.com83 Coordonnées Contact Tél : Fax : Mail : Sinequa fournit une plateforme de Search & d’Analyse du Big Data en temps réel. Sa solution s’adresse aux grandes entreprises et administrations publiques pour offrir à leurs utilisateurs un point d’accès unifié à l’information couvrant toutes les données textuelles et base de données. Son interface visuelle permet de découvrir de façon intuitive et conversationnelle l’information pertinente. Big Data ne serait que « Big Noise » (grand bruit sourd) sans des capacités d’analyse puissantes pour extraire et visualiser les informations pertinentes. Sinequa se distingue par cette capacité d’analyse approfondie pour extraire l’information pertinente à partir de toutes sortes de données : les données non structurées dans des documents , emails, sites Web et des réseaux sociaux, et les données structurées, dans les applications d’entreprise, telles que ERP , CRM , Finance, RH, etc. L’analyse sémantique, développée pour 19 langues, permet de lever le plus grand défi du Big Data : traiter la masse des données textuelles ou «données générées par l’humain». L’analyse sémantique permet à la fois de mieux comprendre les questions des utilisateurs, formulées en langage naturel, et le sens des textes, allant bien au-delà de la recherche de mots clés. Il contribue également à catégoriser des informations en utilisant des filtres spécifiques à un métier afin d’améliorer considérablement la découverte d’information. Sinequa offre une forte sécurité d’accès aux informations de l’entreprise avec un contrôle strict des droits d’accès de chaque utilisateur. Plus de 120 connecteurs aux sources de données aident à faire face à la diversité inhérente au Big Data. Nos clients utilisent notre plateforme de Search & d’Analyse du Big Data pour créer des applications spécifiques (Search Based Applications ou SBA) liées à leur cœur de métier, comme la création de vues à 360° (par exemple sur les clients) ou de révéler les réseaux sociaux implicites (réseaux d’experts sur un sujet donné), généralement avec un très fort ROI. Les données sur les clients viennent souvent d’applications d’entreprises classiques comme le CRM, ERP ou systèmes financiers, des systèmes de gestion de documents contenant des contrats, des descriptions de produits et de services, de courriers électroniques et des échanges de centre d’appels. Les données sur les experts et l’expertise peuvent provenir de publications internes et externes, rapports de projets, systèmes RH, RSE, etc. Sinequa ne fournit pas seulement une liste de noms comme résultat d’une recherche, mais le degré d’expertise de chacun ainsi que les documents relatifs à cette expertise et les relations entre experts. Ceci révèle les « réseaux sociaux implicites » ou la «matrice organisationnelle informelle » d’une entreprise, pas en fonction de la position hiérarchique, mais du travail accompli et de l’expertise détectée grâce à ce travail. Dans chaque cas, de fortes capacités sémantiques sont nécessaires pour aller au-delà de la recherche simpliste par mots clés, pour découvrir les contenus traitant d’un sujet particulier, même si elles ne contiennent pas les mots clés utilisés dans une requête de recherche. blog.sinequa.com Sinequa SINEQUA Hans-Josef JEANROND Directeur Marketing 12 rue d’Athènes 75009 Paris +33 (0) 1 70 08 71 71 +33 (0) 1 45 26 38 92 jeanrond@sinequa.comQuand on a la passion... ... l’innovation va plus loin. métiers High Tech • Conseil • Ingénierie Système • Ingénierie Physique • Ingénierie Logiciel • Testing 5 marchés clés • aéronautique, • spatial, • défense, • énergie, • ferroviaire, • télécoms 6 ans d’expérience au service de l’industrie +20 collaborateurs Sogeti dans 15 pays +20 000 orientations R&D - innovation • Incubateur de solutions • Partenariats laboratoires • Propriété intellectuelle • R&D interne 4 Avec 3 000 collaborateurs en France, et plus de 20 ans d’expérience,Sogeti High Tech figure parmi les leaders du marché de l’Ingénierie et du Conseil en Technologies. Nous intervenons dans de nombreux projets d’innovation et d’ingénierie technologiques des plus grands groupes industriels mondiaux. Nos expertises techniques et métiers renforcent la valeur ajoutée de nos solutions au service des challenges du monde industriel du XXIè siècle. www.sogeti-hightech.fr85 Coordonnées Contact Tél : Fax : Mail : Analyse du risque, affinement du ciblage marketing, aiguillon pour la R&D et autres axes d’application de l’analyse prédictive sont bienvenus dans tous secteurs d’activité, en ces temps de rigueur économique, perçus comme de potentiels axes de croissance. Donner accès, par exemple, aussi bien aux bureaux d’études qu’au service marketing, à la confrontation des données de conception et fabrication d’un produit avec celles issues de son exploitation, analyse des coûts induits incluse, afin d’optimiser le cycle de vie de ce produit et/ou alimenter la démarche d’innovation de l’entreprise. Tels sont en effet, d’un point de vue générique, les deux enjeux forts du Big Data : optimiser, dans une optique d’efficacité opérationnelle ; générer de nouvelles idées, propositions et débouchés, dans un objectif de croissance de revenus. L’offre Big Data de Sogeti High Tech, forte des compétences de plus de 200 scientifiques et analystes spécialisés et d’un savoir-faire dans le domaine de la simulation, répond à ces besoins d’analyse, expressions des besoins d’optimisation et d’innovation des industriels. L’offre Big Data de Sogeti High Tech s’adresse aux industriels de tous secteurs selon une déclinaison de services incluant : – le conseil avec notamment l’animation d’ateliers sur fond d’études de cas, visant à cerner l’impact potentiel d’un projet, sa nature, son périmètre, son organisation, les ressources impliquées, – le développement de modèles d’analyse, – la conduite de projet menant à la mise en place de systèmes Big Data, de l’infrastructure aux modèles d’analyse de données sur-mesure, et, en bout de chaîne, les modèles prédictifs ou prospectifs. Sogeti High Tech, filiale du groupe Capgemini, est un leader du marché de l’Ingénierie et du Conseil en Technologies. www.sogeti-hightech.fr Sogeti High Tech Sogeti High Tech Philippe RAVIX Directeur Innovation 15 bis rue Ernest Renan 92136 Issy-les-Moulineaux +33 (0) 1 40 93 73 00 +33 (0) 1 40 93 73 73 philippe.ravix@sogeti.comToutes vos applications, vos systèmes et votre infrastructure génèrent des données chaque milliseconde de chaque jour. Ces données machine constituent le domaine le plus complexe, avec la plus forte croissance du « Big Data ». C’est aussi le domaine qui possède le plus de valeur car on peut y trouver tous les détails des transactions effectuées par les utilisateurs, le comportement des clients, l’activité des capteurs de toutes sortes, le comportement des machines, les menaces de sécurité, les activités frauduleuses pour ne citer que ces exemples. Start with big data and Splunk® software. End with an unfair advantage. Splunk software collects, analyses and transforms machine-generated big data into real-time Operational Intelligence—valuable insight that can make your business more responsive, productive and profitable. Over half of the Fortune 100™ use Splunk software and have the business results to prove it. Learn more at Splunk.com/listen. © 2013 Splunk Inc. All rights reserved.87 Coordonnées Contact Tél : Fax : Mail : Les données machine contiennent des informations critiques, utiles pour l’ensemble de l’Entreprise. Par exemple : • Monitoring des transactions de bout en bout pour les business en ligne 24h/24 et 7j/7 • Comprendre l’expérience client, son comportement et l’utilisation des services en temps réel • Respect des SLAs internes et monitoring des SLAs des Fournisseurs de Services • Identifier les tendances et analyser les sentiments sur les réseaux sociaux • Cartographier et visualiser les scenarii et schémas comportementaux pour améliorer sa politique sécurité L’utilisation des données machine est un challenge. En effet, il est difficile de les traiter et de les analyser avec les outils de management de données classiques, sans parler des performances. • Les données machine sont générées par une multitude de sources différentes : effectuer des corrélations entre des évènements significatifs provenant de ces sources est extrêmement complexe • Ces données sont non structurées et difficiles à faire rentrer dans un schéma prédéfini • Les données machines atteignent rapidement des volumes importants et sont estampillées avec une unité de temps ; elles nécessitent une nouvelle approche pour les traiter et les analyser • Les informations les plus précieuses à en retirer sont le plus souvent utiles en temps réel Les solutions classiques de Business Intelligence, Data Warehouse ou IT Analytics ne sont tout simplement pas conçues pour ces types de données de très gros volume, dynamiques et non structurées. Des solutions émergentes en Open Source peuvent fournir une partie de la réponse mais nécessitent des équipes de développeurs de très bon niveau, très spécialisées et qui au final coutent très cher. De plus, quand les demandes évoluent, ces solutions fragiles n’ont très souvent pas l’agilité nécessaire pour s’adapter. Les entreprises d’aujourd’hui ne peuvent pas attendre. Les décideurs, ou qu’ils se trouvent dans l’organisation des entreprises, doivent constamment s’adapter aux changements incessants et de plus en plus rapides de leur environnement. Ils ont besoin d’une technologie qui permet les analyses temps réel, le data mining et la production de rapports a la volée : en bref, une solution qui leur apporte des réponses aussitôt qu’elles sont posées. Plateforme pour le Big Data La plupart des organisations maintient en parallèle plusieurs types de données (données machine, relationnelles et d’autres formes de données non structurées). Splunk permet naturellement cette intégration, afin de vous permettre d’obtenir le maximum de vos informations. Que vous soyez développeur, professionnel des TIC, expert sécurité ou Business Analyst, la plateforme Splunk et ses « apps » rendent vos données accessibles, utilisables et pleines de valeur. Qu’est ce qui rend Splunk Unique ? Splunk Enterprise est une solution temps réel, intégrée, de bout en bout, pour les données machine. Elle offre les capacités fondamentales suivantes : • Assemblage et Indexation universelle des données machine provenant de toute source • Langage de recherche puissant pour analyser des données temps réel ou historiques • Monitoring de comportements et de niveaux ; alertes en temps réel quand un ensemble de conditions sont remplies • Production de rapports et d’analyses • Tableaux de Bord personnalisés et spécifiques pour chaque fonction de l’entreprise • Haute disponibilité et évolutivité sur les plateformes standard du marche • Contrôle d’accès et sécurité basée sur les fonctions • Support flexible des déploiements multi-site et distribués • Connectivite avec les autres outils de données comme les SGBDR et une connectivité bidirectionnelle avec Hadoop • Une plateforme robuste et flexible idéale pour les applications Big Data Vous deployez Hadoop? Hunk (Splunk Analytics on Hadoop) est une nouvelle application qui permet d’explorer, analyser et visualiser des données dans Hadoop. S’appuyant sur les années d’expérience de Splunk dans le Big Data et le déploiement auprès de milliers de clients dans le monde, Hunk permet une amélioration spectaculaire en termes de vitesse et de simplicité pour analyser et interagir avec les données situées dans Hadoop. Tout cela sans programmation, ni intégration couteuse ni migrations forcées de données. Regional Sales Director, EMEA South Goyeneix Pierre fr.splunk.com emea_sales@splunk.com N/A +33 (0) 1 55 68 10 43 5, place de la Pyramide Tour Ariane La Défense 9 92088 Paris La Défense Cedex Splunk Inc. Splunk Inc.Notre société accompagne les entreprises dans le traitement de l’information autour du CRM, de la Business Intelligence et du Big Data. Nous apportons aux responsables fonctionnelles des moyens rapides et efficaces afin qu’ils puissent prendre les meilleures décisions. Aujourd’hui, exploiter les données diverses (interne ou externe à l’entreprise) est possible via des technologies robustes et innovantes. Nous conseillons et mettons en œuvre des systèmes d’informations efficaces de prise de décision pour pouvoir disposer d’une meilleure connaissance des données. Nous sommes une entreprise d’experts dans les solutions CRM, Business Intelligence et Big Data. Notre « Lab Data Scientist » est dédié à la pratique de la science sur les données. Aujourd’hui, de plus en plus d’entreprises souhaitent exploiter au mieux leurs données afin de pouvoir améliorer leur compétitivité et leur productivité. Dans cet objectif, notre entité accompagne les entreprises dans la prise en compte du besoin métier, dans la mise en place d’architecture de données, de transformation, d’acquisition de nouvelle connaissance pour ainsi transformer les données en connaissance. Cette entité travaille ainsi sur les volets dédiés à la Data Science à savoir : • Ingénierie de la donnée : architecture, stockage, modélisation, optimisation, automatisation autour des plateformes Big Data (Hadoop, Aster Data …) • Transformation des données : modèles statistiques (calculs de distances, calcul de corrélation, clustering, classification, arbre de décision, réseau de neurones) appliqués aussi aux documents textes, mise en place de techniques de machine learning • Visualisation des données : graphiques adaptés aux données, mise en récit des données pour une meilleure adhésion utilisateurs • Connaissance métiers : autour de l’intelligence sociale sur les clients et produits pour fidéliser, développer et gérer les clients89 Coordonnées Contact Tél : Fax : Mail : SRD Conseil, entreprise créé en 2006, a pour objectif d’aider les entreprises dans le cœur de leurs préoccupations à s’avoir l’acquisition, la rétention et la fidélisation de leurs clients. SRD Conseil aide à organiser, optimiser et à mesurer l’efficience des actions marketing et commerciales par la mise en place d’outils, de méthodes et de formations adaptés à métier aux besoins des entreprises. SRD Conseil intervient sous plusieurs formes de prestations à savoir : • Forfait : Sur des projets cadrés, ou afin de permettre aux clients de bénéficier d’offres basées sur nos domaines d’expertise (migration, projets QuickStart, solutions standards verticalisées en mode SaaS…), SRD Conseil propose à ses clients d’intervenir au forfait. • Régie : Pour un besoin de renfort technique et/ou fonctionnel, sur un périmètre et une durée indéfinie, un consultant SRD conseil peut intervenir en régie, de 0,5 à 220 jours par an. • TMA (tierce maintenance applicative) : SRD Conseil propose d’intervenir sur des TMA de 20 à 1000 jours, sur engagement de 6, 12 ou 24 mois, sans nécessairement être l’intégrateur à l’origine du projet. • Formation : En tant qu’organisme agréé, SRD Conseil intervient auprès de vos équipes techniques, métiers et/ou vos utilisateurs finaux avec des plans de formations adaptés. • Recrutement : En cas de besoin de renfort interne (CDI), n’hésitez pas à consulter SRD Conseil: la sélection de profil fait l’objet d’une rigueur particulière (plusieurs entretiens, contrôle de références poussé, éventuels tests …) Nous intervenons dans les domaines suivants : Banque - Finance / Assurances / Mutuelles / Santé - Pharma / Energie / Transports & Sécurité / Immobilier – BTP / Hôtellerie & Restauration / Services BtoB & BtoC / Négoce - Distribution / eCommerce / FAI & Telecom / Administration / Association Notre équipe de Data Scientist est là pour apporter leur connaissance des architectures Big data, de traitements statistiques et text-mining aux données structurées ou poly structurées, et mettre en place des data visualisations pertinentes pour mieux découvrir et comprendre ces données. L’objectif est d’accompagner nos clients dans une meilleure compréhension de leur métier et ainsi de leur permettre la mise en place d’une vraie stratégie autour de la donnée. www.srd-conseil.com SRD Conseil SRD CONSEIL Abed AJRAOU Directeur Business Unit BI et Big Data 10 rue château 75009 PARIS +33 (0) 1 74 64 06 07 N/A contact@srd-conseil.comThe collision between traditional approaches to Data Integration and Hadoop is one of the more interesting aspects of Big Data generally and of Hadoop specifically. Data integration and more specifically, Extraction, Transformation and Loading (ETL), represents a natural application of Hadoop and a precedent to achieving the ultimate promise of Big Data – new insights. But perhaps most importantly at this point in the adoption curve, it represents an excellent starting point for leveraging Hadoop to tackle Big Data challenges. ETL Must Die On Halloween 2012, Doug Henschen published a fascinating article around the work Sears is doing with Hadoop. Within the article, there is a section labeled, “ETL Must Die.” While I can appreciate the sentiment, let’s be clear: ETL as a capability in the information management stack is not going anywhere. Data will need to be sourced (“E”), it will need to be related and refined (“T”) and put somewhere (“L”). What Sears has done is a fundamental shift in architecture for delivering this capability. Sears needed a new architecture, and found one in Hadoop. As detailed in the article, Hadoop is providing a whole range of benefits to Sears. But to say Sears is no longer doing ETL is not accurate. In fact, the opposite would appear to be the case. Sears is sourcing more data, the scope of the transformations has increased, and the distribution of information has expanded. What Sears has done is to move existing workloads from various tools and platforms into a Hadoop environment. That has shifted the reliance on specific products but not the capabilities required to maximize the value of the data. Hadoop is not a Data Integration Solution In a recent research piece entitled “Hadoop is not a Data Integration Solution,” Ted Friedman and Merv Adrian from Gartner describe the gaps between Hadoop and a proper Data Integration Solution. But, what is it about the Hadoop infrastructure that is attracting such interest despite these significant gaps? In the era of Big Data, Hadoop’s architecture is fundamentally superior for supporting many of the most commonly deployed data integration functions. For this reason, organizations are flocking to Hadoop even if key functional capabilities must be written by hand today. Hadoop makes it easy to scale computing power horizontally with low cost components. More importantly, this architecture will also support a broader range of data integration functions. We are seeing willingness by organizations to abandon well-understood and mature features of Data Integration products and embrace a raw, open source technology. The main problem Big Data creates is an architectural one, not a functional one. Perhaps it is fair to say that today; Hadoop is not a Data Integration solution. But, as Mr. Adrian and Mr. Friedman seem to agree, it could very well be the Big Data operating system on which next-generation data integration solutions are built. Moreover, I believe it’s a safe bet that the applications needed to perform sophisticated Data Integration in Hadoop are coming quickly. Rebuilding ETL and ELT in Hadoop In his February 21st post entitled, “Big Data’s New Uses Cases: Transformation, Active Archive and Exploration,” Cloudera’s CTO, Amr Awadallah, provides a concise and accurate history of the “T” in ETL. In the late 90s and early 2000s, the conventional wisdom was to extract data from key source systems, cleanse and relate that data through transformations, then load it into the warehouse. As businesses got customized views of information combined from multiple systems, the traditional ETL approach, particularly the “T”, began to suffer under the weight of growing volumes. At the same time, databases and the hardware that supported them were evolving rapidly to support intense query load with massively parallel processing architectures. Over time, a new approach to data integration was developed which would avoid the lack of relative scalability in traditional data integration engines. The concept was simple: Extract the tables from source systems and then load those tables directly into the data warehouse into a separate staging area. Use SQL, a common and widespread skill to combine and relate those raw tables into the tables required for reporting and analytics. This approach became known as ELT and is, in fact, the most common approach used for data integration today. While this approach provides the scalability required to perform the “T” for integrating the growing sources and volumes of data, there are tradeoffs. Most of the logic used for data integration is expressed in SQL and it is hard to maintain. It requires constant tuning as data changes. It is difficult to test and debug. Oh, and, very often, it fails to perform well. ELT has become the conventional wisdom in integrating data but little focus has been put on the impact these tradeoffs have from an expense and agility perspective. Current practitioners would argue that it is the cost of operating a large-scale analytics and reporting environment and that there is no other alternative that can provide the required scale to meet the insights the business demands. By targeting the replacement of ELT or ETL in Hadoop, you can provide clear answers to many of these questions. There are massive cost savings in just offloading the data warehouse and there is a backlog of new sources that the business wants in the warehouse but has not been met because of cost and scalability.. Such an approach yields a series of side benefits to the organization that will equip the team to deliver the next Big Data project. Fundamentally, by focusing your first project on operational efficiencies, you will deliver a win for your business partners and your organization. ETL – the Leading Use Case for Hadoop The adoption of Hadoop and its promise is creating hype but make no mistake – it is also creating real value today. Identifying the right starting point can create momentum and initial wins on the journey to leveraging Big Data. Why not start with an approach that has a clear payback and builds the skills you need in order to consistently deliver results? Start by rebuilding and even augmenting existing ETL or ELT workloads. In the process, you won’t be killing ETL but rather moving this core capability to an architecture that can support the scale the business needs, at a cost it can afford. Hadoop will dramatically change the data integration landscape but it won’t kill ETL. Far from it. ETL is the killer app that will drive mainstream adoption of Hadoop, the new operating system for Big Data. Josh Rogers President of Data Integration Syncsort. Is ETL Dead in the Age of Hadoop? By Josh Rogers91 Coordonnées Contact Tél : Fax : Mail : www.syncsort.com Syncsort France SYNCSORT France Florence RABUEL Regional Sales Manager Tour Egée - La Défense 17 avenue de l’Arche 92671 Courbevoie Cedex +33 (0) 1 46 67 46 10 +33 (0) 1 47 88 04 38 syncsortSA@syncsort.com Syncsort propose aux organisations gérant d’énormes quantités de données des solutions logicielles permettant de collecter et traiter de manière plus intelligente cette avalanche exponentielle de données. Puisant dans son expérience de milliers de déploiements sur toutes les plateformes majeures, y compris le mainframe, Syncsort aide ses clients, partout dans le monde, à surmonter les limites architecturales des environnements Hadoop et ETL d’aujourd’hui. Les entreprises obtiennent ainsi de meilleurs résultats en moins de temps, avec moins de ressources pour un coût de possession réduit. Pour en savoir plus, veuillez consulter notre site.93 Coordonnées Contact Tél : Fax : Mail : Tableau Software aide les utilisateurs à visualiser et à comprendre leurs données. Tableau permet d’analyser, de visualiser et de partager simplement des informations. La société Tableau Software propose des solutions de Business Intelligence qui aident les personnes et les organisations à travailler plus efficacement en leur permettant d’identifier plus clairement les tendances. Grâce à l’utilisation des outils de Tableau, les utilisateurs optimisent leur temps en ayant accès aux informations qui leur sont importantes de manière très rapide. Plus de 12 000 entreprises font confiance à Tableau pour obtenir rapidement des résultats, au bureau comme lors des déplacements. Grâce à sa facilité d’utilisation, Tableau Public est un outil qui permet de traiter un gros volume de données facilement et rapidement et ensuite de les publier sur le web en un seul clic. Cet outil aide diverses typologies d’utilisateurs dont les journalistes à analyser des données complexes et extraire des informations pertinentes qui permettent de très belles visualisations de données et cela de manière dynamique. Tableau Software a trois produits principaux pour les entreprises : Tableau Desktop, Tableau Server et Tableau Online. Répondez aux questions immédiatement grâce à Tableau Desktop. Tableau Desktop utilise une technologie innovante de l’université de Stanford qui vous permet de glisser-déposer des données pour les analyser. Vous pouvez accéder aux données en quelques clics, puis visualiser et créer facilement des tableaux de bord interactifs. Nous avons mené des recherches pendant plusieurs années pour mettre en place un système prenant en charge la capacité naturelle des personnes à penser de manière visuelle. Basculez facilement entre les vues, suivez votre raisonnement naturel. Vous n’êtes pas coincé par des assistants d’exécution ni obligé de rédiger des scripts. Vous créez simplement des visualisations de données riches et harmonieuses. C’est tellement simple à utiliser que c’est à la portée de n’importe quel utilisateur d’Excel. Obtenez plus de résultats en fournissant moins d’efforts. Et c’est 10 à 100 x plus rapide que les solutions existantes. Tableau Server - Une incroyable alternative aux solutions décisionnelles traditionnelles. Tableau Server est une solution décisionnelle qui fournit un outil d’analyse basé sur navigateur Web accessible à tous. C’est une alternative très rapide aux logiciels d’informatique décisionnelle traditionnels connus pour leur lenteur et leur manque de flexibilité. Vous avez un travail à effectuer, mais les outils dont vous disposez actuellement sont lents et volumineux. Tableau Server est un nouveau type d’outil d’informatique décisionnelle 100 fois plus rapide et agréable à utiliser. Vous effectuez votre déploiement selon vos besoins. Testez-le gratuitement en ligne. Obtenez des résultats en quelques semaines seulement, et non plus après quelques années. La puissance de Tableau dans le cloud. Tableau Online est une version hébergée de Tableau Server. Elle rend l’analyse d’entreprise rapide et plus facile que jamais. Partagez des tableaux de bord avec l’ensemble de votre entreprise, et avec vos clients et partenaires en quelques minutes. Fournissez des vues de données interactives en direct qui permettront aux personnes de répondre à leurs propres questions directement dans un navigateur Web ou sur une tablette. Faites-le dans un environnement sécurisé et hébergé. Soyez opérationnel en quelques minutes. Ajoutez de nouveaux utilisateurs en quelques clics. Vous pouvez augmenter la puissance de Tableau Online en fonction de vos besoins et le rendre accessible où que vous soyez. Aucun achat, aucune configuration et aucune gestion d’infrastructure n’est nécessaire. www.tableausoftware.com Tableau Software TABLEAU SOFTWARE Julien SIGONNEY Sales Area Manager Blue Fin Building 110 Southwark Street London SE1 0TA - United Kingdom +44 (0) 203 310 4500 +44 (0) 203 310 4501 europeansales@tableausoftware.comRedesigning the data landscape around user experience95 Coordonnées Contact Tél : Fax : Mail : Worldline, filiale d’Atos, est le leader européen et un acteur mondial référent dans le secteur des paiements et des services transactionnels. En ajoutant à ses expertises et plates-formes transactionnelles historiques des composants Big Data industriels, Worldline construit avec ses clients et partenaires des projets exploitant pleinement la valeur intrinsèque des données. Worldline délivre ainsi à ses clients des services de bout en bout sur l’ensemble de la chaine de valeur : captation des données, analyse, visualisation et valorisation. • Pour la phase de captation, Worldline tire parti de ses compétences historiques en termes de collecte, intégration, stockage et nettoyage de gros volumes de données transactionnelles. Pour ces types de données, les composantes vélocité (temps réel) et variété (formats divers voire changeants) sont souvent critiques. Les données sont gérées au sein des datacenters Worldline, ce qui permet d’apporter flexibilité et fiabilité à cette phase du cycle. • Dans chaque contexte client, Worldline apporte son expertise en termes d’analyse de données, notamment dans les domaines de la lutte contre la fraude, du scoring de transactions et de la gestion de la relation client, et met en place des modèles statistiques et des algorithmes d’intelligence artificielle sur mesure pour passer de la donnée brute à l’information à valeur ajoutée. • La phase de visualisation est le maillon indispensable pour assurer un lien entre les données et les utilisateurs finaux. Elle est prise en compte dès la conception des services et ce quel que soit le terminal de l’utilisateur. Pour ce faire, Worldline met à profit ses réussites dans la création d’interfaces et d’applications adaptées aux multiples combinaisons contexte, support et usage. • Enfin, pour la valorisation, Worldline dispose des expertises business nécessaires pour accompagner ses clients dans le nouveau paysage informationnel du Big Data et leur permet de tirer le meilleur parti des données, qu’elles soient internes ou externes. C’est ainsi que se concrétisent pour eux les multiples opportunités qu’elles représentent. En associant cohérence et niveaux de qualité de service industriels de bout en bout de la chaine, Worldline va au-delà des enjeux purement techniques pour délivrer la valeur des technologies et des nouveaux usages de la Big Data à tous ses clients. du BigData. www.worldline.com Worldline Worldline Gregoire WIBAUX Business development & Marketing stratégique River Ouest 80 quai Voltaire 95877 Bezons Cedex +33 (0) 4 78 17 69 35 N/A infoWL@worldline.comPlay with yourBig Data Ysance créateur de plateformes digitales www.ysance.com97 Coordonnées Contact Tél : Fax : Mail : Créée en 2005 par une équipe d’experts IT, Ysance est une agence conseil en technologie digitale forte de 100 collaborateurs. Ysance aide les directions métier à tirer un profit des nouveaux usages du numérique en accompagnant ses clients dans la conception, la mise en œuvre et l’animation de leurs projets digitaux. Ses activités s’articulent autour de 5 métiers : le Marketing digital, la Business Intelligence, l’e-business, le Cloud Computing et le Big Data. Depuis 3 ans, Ysance construit des plateformes Big Data pour les mettre au service des différents métiers de l’entreprise : CRM, eCommerce, Marketing, Ventes, RH, Finances, BI, Datamining, etc. Fort de cette expérience, Ysance a conçu une méthodologie progressive et pragmatique déclinée en 4 étapes pour rapidement accéder aux potentiels des Big Data : 1. Découvrir et estimer la valeur d’une démarche Big Data pour son activité Evaluer les avantages et identifier les métiers pouvant en bénéficier Imaginer les services, les analyses et les opportunités rendus possibles Définir les scénarios Big Data et les business cases associés 2. Démarrer et réaliser VOS premières analyses Big Data Définir un premier scope d’analyse métier Collecter les données et les charger dans la plateforme Big Data d’Ysance Réaliser un ensemble d’analyses et valider le modèle 3. Développer et mettre en place le socle de VOTRE plateforme Big Data Formaliser et valider les besoins techniques et fonctionnels Identifier les sources et les volumes de cible Définir l’architecture et choisir les solutions techniques Implémenter la plate-forme Big Data 4. Déployer et faire du Big Data un avantage concurrentiel Industrialiser la collecte, le stockage et l’analyse en temps réel Élargir, organiser et sécuriser l’accès à la plate-forme Capitaliser les bonnes pratiques et les normes de développement Organiser la conduite du changement Ysance dispose d’une grande expertise des technologies Hadoop, des enjeux de Data management et des environnements Cloud. www.ysance.com Ysance YSANCE Romain CHAUMAIS Directeur du Développement Tour de l’Horloge 4 place Louis Armand 75012 Paris +33 (0) 1 43 36 23 17 +33 (0) 1 73 72 97 26 contact(à)ysance.comguide du big data 2013 / 2014 Synthèse du marché Big Data 2012 - 2013 www.bigdataparis.com Un évènement organisé par : Synthèse du marché Big Data www.bigdataparis.com Un évènement organisé par : 2 A – ETUDE DU MARCHE BIG DATA I. Le Big Data, du concept à la mise en œuvre . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . P 03 1) Le Big Data : quelques rappels sur un phénomène 2) Le Bilan année 1, bilan et perspectives II. Le Big Data, du data deluge à l’exploitation de la donnée . . . . . . . . . . . . . . . . . . . . . . . . . . . . P 05 1) La nature de la donnée 2) Le traitement de la donnée : des innovations en plein essor 3) L’analyse de la donnée : quels changements ? III. Le Big Data, quels usages ? . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . P 06 1) Les usages marketing 2) Le management des opérations et de la supply chain 3) L’usage exploratoire 4) L’apparition de services innovants IV. Les principales questions entourant le Big Data . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . P 08 1) Enjeux stratégiques a) Comment mettre en place le Big Data au sein de son entreprise ? b) Quel business model ? Quels apports économiques du Big Data ? 2) Enjeu RH : le recrutement des data scientists 3) Enjeux technologiques a) La qualité de la donnée b) La sécurité des données 4) Enjeu réglementaire : la protection des données personnelles V. Vers de nouveaux marchés – L’impact du Big Data . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . P 11 1) La Dataviz 2) L’Open Data 3) L’Internet des Objets B – INTERVIEWS D’EXPERTS I. Jean-Marie Messager, SOPRA CONSULTING : Etat des Lieux du Big Data . . . . . . P 13 II. Pierre Delort, ASSOCIATION NATIONALE DES DSI : Le Chief Data Officer . . . . . P 14 III. Fiche Projet de Mathieu Gras, SFR : La mise en place d’un service de publicité géolocalisée . . . . . . . . . . . . . . . . . . . . . . . . . . . P 15 C – ARTICLES D’EXPERTISE I. Mouloud Dey, SAS FRANCE . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . P 16 II. Steven Totman, SYNCSORT . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . P 17 III. Sanjay Poonen, SAP . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . P 18 SOMMAIRESynthèse du marché Big Data www.bigdataparis.com Un évènement organisé par : 3 A. ETUDE DU MARCHE BIG DATA I. Le Big Data, du concept à la mise en œuvre 1) Le Big Data : quelques rappels sur un phénomène Le Big Data s’est imposé dans la sphère du management à la faveur d’un rapport de Mc Kinsey paru sur ce sujet en mai 2011. Déjà auparavant, quelques expérimentations issues du milieu de la recherche avaient permis d’évoquer cette thématique (cf la revue Nature en 2008). En quoi consiste le Big Data ? Comme le décrit Mc Kinsey, le Big Data est une réponse à l’explosion des données observée dans l’univers numérique (Internet, RFID, mobile) : il permet de capter celles-ci, de les traiter à très grande vitesse et de les rendre ainsi exploitables pour les entreprises et les organisations, quelle que soit la nature de cette donnée. Economiquement comme technologiquement, le Big Data apporte une avancée réelle dans l’appareil décisionnel de l’entreprise car il inscrit la donnée au cœur même de la décision et se décline en multiples usages indispensables pour permettre à l’entreprise d’accroître ses marges : meilleure connaissance du client, ajustements des flux physiques, détection d’erreurs… Mc Kinsey a énoncé une règle très simple pour reconnaître un produit Big Data : la règle des 3V. Ces 3V correspondent aux termes suivants : - Volume : des volumes de données conséquents, de l’ordre du téra-, du péta-, voire de l’exaoctet (1018 octets) - Variété : des données de natures très diverses, qu’il s’agisse de vidéos, de logs, de mails, etc… - Vélocité : une vitesse de traitement accélérée pouvant même aller jusqu’au temps réel Par la suite, les experts du sujet ont eu tendance à rajouter un 4e V à cette définition, celui de Valeur; en effet, le Big Data se définit par une valorisation de la donnée, c’est-à-dire une transformation de celle-ci en information qui générera par la suite d’importants bénéfices. Le Big Data s’appuie sur un socle technologique solide en plein essor (cf partie II) mais dispose d’applications très économiques (cf partie III) qui lui ont permis de réaliser un véritable buzz en 2012 : les décideurs de tous bords (et pas seulement les informaticiens ou statisticiens) se sont penchés sur la question, intrigués par la promesse du Big Data et par l’exemple de nombreux projets développés outre-Atlantique. En France, l’année 2012 a été marquée par l’apparition des premières expériences matures de Big Data. Pour autant, le Big Data n’en est qu’à ses débuts, ce qui explique que de nombreuses questions restent encore à l’étude (cf partie IV) et que d’autres marchés se développent dans son sillage (cf partie V). Bienvenue dans l’ère du déluge de données !Synthèse du marché Big Data www.bigdataparis.com Un évènement organisé par : 4 2) Le Bilan année 1, bilan et perspectives Avant de revenir plus concrètement sur ces différents aspects, il est utile de faire le point sur les développements de ce phénomène en France et dans les autres pays. Des rapports sont en effet parus sur la question en 2012, permettant d’y voir plus clair dans la mise en application du Big Data : les études IDC de juin, août et septembre 2012, respectivement pour SAP, Hitachi et EMC, ont donné des indications sur les besoins des entreprises, la maturité de leurs projets et les perspectives annoncées. Il ressort de ces études que le Big Data est encore à l’état de projet pour la majorité des entreprises françaises et européennes : en effet, 33% des entreprises britanniques avaient mis en place des solutions Big Data ou prévoyaient de le faire dans les 12 mois, alors qu’en Allemagne (18%), en Russie (10%) et en France (8%), les chiffres étaient bien plus bas. Le coût des infrastructures reste un frein régulièrement évoqué pour expliquer la lenteur du déploiement du Big Data. Cependant une bonne majorité des entreprises ont conscience de l’intérêt du Big Data et de la problé- matique soulevée par l’explosion des données : pour elles, il s’agit surtout de réduire les coûts en maîtrisant les données d’activité (cité par 40% des sondés) mais d’autres apports du Big Data sont bien identifiés parmi lesquels la gestion et la planification des budgets, l’analyse des risques ou la création de nouveaux marchés. Au total, IDC estime que la vente de solutions Big Data devrait passer de 3,2 milliards de $ en 2010 à 16,9 milliards de $ en 2015, soit un taux de croissance annuelle de près de 40%. Le marché du Big Data se structure donc peu à peu en France et en Europe et le terme « Big Data » est désormais largement reconnu ; qu’il s’agisse de petites entreprises spécialisées ou de grandes compagnies d’envergure mondiale, l’analyse de données multiples est devenue un critère de développement important en 2012, essentiellement dans les secteurs banque, telecom et secteur public. les chiffres Europe 2.000 USA 3.500 Amérique Latine 50 Inde 50 Chine 200 300 400 Japon Reste de l’Asie Pacifique Moyen-Oriant et Afrique 200 Quantité de nouvelles données par zones géographiques enregistrées en 2010, en petaoctets Evolution du marché en milliards de dollars - Source : IDC 3.2 en 2010 16.9 en 2015 (est.) 250 Mds $ de potentiel annuel pour l’administration publique Européenne, l’équivalent du PIB Grec 60 % du potentiel de hausse de la marge opérationnelle pour les commerces de détailSynthèse du marché Big Data www.bigdataparis.com Un évènement organisé par : 5 II. Le Big Data, du data deluge à l’exploitation de la donnée Avant d’être un phénomène économique, le Big Data est avant tout un processus technologique qui vise à transformer une donnée brute en information directement exploitable par l’entreprise. Les outils à l’œuvre lors de ce processus constituent la réelle innovation de ces dernières années. 1) La nature de la donnée A l’origine du Big Data, il y a la matière de base : la data. Cette donnée, issue des différents supports que sont Internet, les smartphones ou les capteurs RFID, est de plus en plus variée. En cause : l’apparition de formats plus complexes comme les vidéos mais également l’expansion d’une donnée davantage qualitative, « de contenu », issue par exemple des réseaux sociaux et des forums de discussion. Ce déferlement de données, qualifié de « déluge » dans le langage consacré, contraint les technologies à évoluer et à traiter des données qui ne sont pas structurées ; on parle de données non structurées, voire parfois de données multi-structurées. Au-delà du volume de ce data deluge, c’est la nature de ces données qui est souvent mise en avant : la donnée brute, directement extraite de l’activité ou de l’opinion de l’internaute apporte une information qui, si elle est bien traitée, promet à son détenteur de suivre pas à pas les comportements des clients et les opérations de l’entreprise. 2) Le traitement de la donnée : des innovations en plein essor Afin de s’adapter à cette contrainte représentée par la diversité des données et afin d’absorber les grands volumes observés, les éditeurs ont développé des solutions de bases de données adaptées à cet environnement. Historiquement, c’est au début des années 2000 que, confrontés les premiers à ces problèmes, les chercheurs de Google ont développé un mode de calcul fondé sur la parallélisation massive et permettant de traiter de grands volumes de données : MapReduce.Synthèse du marché Big Data www.bigdataparis.com Un évènement organisé par : 6 Par la suite, c’est la fondation Apache qui a décliné ce mode de calcul sur une plateforme Open Source nommée Hadoop, véritable librairie de calculs parallèles permettant de traiter des données non structurées. Hadoop est rapidement devenue la référence en matière de parallélisation des big data, et les éditeurs se sont employés à adapter l’offre initiale Open Source Hadoop en solution commerciale, customisée en fonction des applications clientes et des indicateurs de performance. C’est aujourd’hui la principale offre qu’on retrouve sur le marché, soit au travers de solutions Cloud soit par le biais d’appliances (boîtier hardware intégrant la technologie Hadoop). D’autres briques s’ajoutent ensuite à Hadoop pour spécialiser le traitement : Hive, Pig, Cassandra… Ce sont des systèmes de gestion de bases de données non relationnelles distribuées, utilisant des modalités de requête NoSQL, qui dépassent donc les codifications du langage SQL. Ce mouvement NoSQL (Not Only SQL) est d’ailleurs une des autres caractéristiques majeures de l’avènement du Big Data. Ces différents outils permettent donc de traiter tous types de données, dans des quantités très volumineuses, et en un temps limité. La problématique du temps réel est d’ailleurs de plus en plus prégnante dans les offres des éditeurs, qu’il s’agisse de traitement sur des serveurs dédiés ou de traitement in-memory (dans la mémoire de l’ordinateur). 3) L’analyse de la donnée : quels changements ? Le traitement de la donnée effectué ne constitue pas pour autant un but en soi : à l’issue du traitement, la donnée est simplement lissée, triée, elle n’a pas encore révélé tout son potentiel. C’est ici que l’intervention d’analystes spécialisés, les data scientists, prend toute son importance : ceux-ci peuvent interpréter les données, les croiser, les remettre en perspective et proposer des représentations directement compréhensibles pour les niveaux décisionnels. La Business Intelligence, discipline de l’entreprise consacrée de longue date à l’analyse des données à des fins de pilotage et de reporting s’enrichit désormais de l’apport des Big Data : la saisie de données multiples provenant de sources internes comme externes, apporte un éclairage nouveau sur les chiffres et autorise davantage d’exploration des comportements statistiques. Le datamining en format Big Data a donc de beaux jours devant lui à condition que les compétences requises soient présentes au sein de l’entreprise pour analyser correctement les données.Synthèse du marché Big Data www.bigdataparis.com Un évènement organisé par : 7 III. Le Big Data, quels usages ? Cette donnée transformée en information devient dès lors un outil incomparable pour les différents métiers qui l’utilisent: c’est au stade opérationnel qu’elle apporte réellement de la valeur à l’entreprise, conduisant celle-ci à mieux gérer l’activité et à accroître ses parts de marché, tout en assurant un sursaut d’innovation pour les grandes comme les petites structures. 1) Les usages marketing L’usage le plus répandu du Big Data se situe probablement du côté du marketing, et plus encore sur le terrain du digital. Les données multiples partagées sur le Web sont en effet un gisement inépuisable pour les entreprises qui cherchent à mieux connaître leurs clients et à communiquer avec eux de façon plus ciblée. Le Big Data apporte ainsi une précision plus forte dans la segmentation des clients et dans le message qui leur est adressé : personnalisation en ligne, reciblage, publicité temps-réel via le RTB, analyse de sentiment…les méthodes abondent pour identifier au plus fin les besoins de l’internaute et lui communiquer en temps réel une réponse à ses attentes. Un phénomène qu’on observe également dans le domaine offline : en magasin, dans la grande distribution, des études sont menées pour déterminer les prix les plus appropriés en fonction des populations, mais également les préférences géolocalisées des clients et visiteurs. Un outil qui s’avère déterminant lorsqu’il s’agit de comprendre les chiffres de ventes, région par région, et d’évaluer ainsi la performance des forces commerciales. Là où le Big Data s’avère véritablement innovant par rapport à un outil marketing classique (de type CRM), c’est dans l’analyse des données qualitatives : grâce au traitement des données géolocalisées ou des données sociales, les responsables marketing ont désormais la possibilité de pousser leur message au plus près de l’utilisateur, dans sa sphère de préférences ou sur son itinéraire géographique. Une révolution dans le domaine du marketing qui aiguise de nombreuses curiosités !Synthèse du marché Big Data www.bigdataparis.com Un évènement organisé par : 8 2) Le management des opérations et de la supply chain Mais le Big Data a également des usages internes à l’entreprise, notamment dans le suivi de l’activité et la détection des erreurs ; en effet, agréger les données de production et les analyser en temps réel permet aux décideurs de piloter plus précisément leur entreprise et de réagir dans les plus brefs délais si des erreurs ou des pannes sont détectées. Ces dispositifs sont particulièrement actifs dans le domaine des télécoms, des transports, de la logistique ou de la production industrielle, où le suivi au plus près des flux et des équipements est un facteur clé d’efficacité. A ce titre, le développement des outils de localisation autorise là encore les projets les plus ambitieux, puisque le monitoring géographique de la supply chain permet de contrôler en permanence le bon déroulé des opérations et conduit à une réponse immédiate si des anomalies sont détectées. Enfin, comme pour tout outil de pilotage, le caractère prédictif du Big data joue un rôle non négligeable : en analysant les données météo, techniques ou de trafic, les responsables logistiques sont capables de déterminer leur niveau de stocks, la maintenance de leurs équipements et d’adapter la production à venir en fonction de ces données externes. 3) L’usage exploratoire Le Big Data est avant tout un outil manipulé par les chercheurs pour détecter parmi les immenses jeux de données liés au vivant des informations significatives qu’ils pourront analyser et modéliser. C’est ainsi que des programmes Big Data ont vu le jour dans la génomique, l’imagerie médicale ou, au-delà, dans l’exploration des sous-sols et même de l’espace. L’idée est que le croisement de pétaoctets de données permet de plonger au cœur de l’infiniment petit et de déterminer ainsi en des temps réduits le comportement de particules infimes observées au cœur du vivant. Un potentiel de recherche impressionnant qui fait basculer les laboratoires et les directions R&D des entreprises dans une autre dimension. Même les sciences sociales sont concernées puisque l’observation de comportements macroéconomiques au sein de populations entières permet de déceler des signaux faibles pouvant être généralisés, et autoriser ainsi la prédiction. 4) L’apparition de services innovants Enfin le dernier usage du Big Data, déjà évoqué au cœur des autres domaines d’activité, concerne les services innovants : concrètement, il s’agit des métiers et des pratiques liés au temps réel et à la localisation qui permettent de créer des prestations totalement nouvelles auprès du consommateur final. On retrouve ces innovations dans le tourisme, le transport ou encore la distribution, avec une prégnance des PME dans la production de ces nouveaux services. L’utilisateur a à disposition, sur son smartphone, une information qui lui permet d’adapter ses usages : par exemple dans le domaine des loisirs, la possibilité de savoir en temps réel le nombre de places restantes dans les théâtres environnants est un service totalement nouveau qui facilite pourtant beaucoup la prise de décision du consommateur… et le remplissage des salles pour les guichetiers !Synthèse du marché Big Data www.bigdataparis.com Un évènement organisé par : 9 IV. Les principales questions entourant le Big Data Si le Big Data s’est imposé au cours de cette année 2012, il n’en reste pas moins l’objet de nombreux questionnements, et notamment sur les aspects technologiques, éthiques ou encore économiques qu’il comporte. L’année dernière, le débat portait essentiellement sur le caractère réellement novateur du Big Data, par rapport à l’analyse de données traditionnelle effectuée depuis de nombreuses années déjà ; cette interrogation ayant été partiellement balayée par l’observation de projets innovants issus du Big Data, les questions se tournent maintenant vers d’autres enjeux, plus techniques. 1) Enjeux stratégiques : …. A commencer par des enjeux stratégiques. Le Big Data répond en effet à un désir de performance des organisations et à une volonté de créer des opportunités de croissance dans un contexte relativement morose pour l’économie. Or cette volonté impose de réfléchir en terme de coûts des équipements et en terme d’organisation des tâches. Et par-dessus tout, il importe de se poser la question des bénéfices exacts retirés de cette implémentation. a) Comment mettre en place le Big Data au sein de son entreprise ? Les entreprises qui choisiront de s’équiper de technologies Big Data seront fatalement amenées à réfléchir sur leurs besoins : où le Big Data est-il nécessaire ? Où n’est-il pas indispensable ? Si tous les départements de l’entreprise ne retirent pas le même profit de l’analyse de leurs données, l’investissement en technologies Big Data devra être ciblé et adapté aux différentes activités de l’entreprise. Cette question s’impose également lorsqu’il s’agit d’évaluer les ressources humaines nécessaires pour travailler la donnée ; les métiers ont-ils besoin d’accéder au Big Data de la même façon que les directions informatiques ? Comment s’organise la remontée d’informations et selon quel objectif temporel ? Une organisation optimale devra alors être définie, pour s’assurer que l’objectif initial du Big Data (à savoir la réduction du temps de prise de décision) soit effectivement atteint. Pour certaines entreprises, cette organisation optimale des équipes recouvrera une approche décentralisée dans laquelle les métiers opérationnels seront chargés du traitement de leurs propres données et seront directement en lien avec le terrain pour cela. Mais pour d’autres sociétés, l’optimisation passera par la création d’un service central dédié à la donnée, qui se chargerait de traiter l’ensemble des Big Data de l’entreprise avant de rebasculer l’information vers les services. A cet effet, on parle de plus en plus d’un nouveau poste en création dans les majors américaines : celui de Chief Data Officer, autrement dit un responsable des données de l’entreprise dont le rôle serait de transmettre au comité de direction les observations et analyses appuyées sur les données, et ce afin d’éclairer davantage la prise de décision.Synthèse du marché Big Data www.bigdataparis.com Un évènement organisé par : 10 b) Quel business model ? Quels apports économiques du Big Data ? Au-delà de cette analyse organisationnelle et financière, le Big Data pose également une question de fond sur le bénéfice qu’il apporte à son utilisateur. Nous avons vu les différents usages du Big Data… mais il est souvent difficile d’avoir une analyse économique de ces usages : concrètement, quelle valeur l’entreprise « Big Data » va-t-elle générer ? Les indicateurs sont multiples : on peut considérer ainsi que les opérations de ciblage marketing seront susceptibles d’augmenter le chiffre d’affaires de l’entreprise, là où l’agrégation de données internes permettra en revanche de suivre l’activité et de détecter les erreurs, avec pour conséquence la limitation des coûts. Mais d’autres analyses montrent que le véritable gain du Big Data réside dans les parts de marché : mettre en place une organisation Big Data permet de prendre le dessus par rapport à ses concurrents en termes de diffusion des messages et de captation d’audience… l’essentiel étant bien sûr de se situer aux avant-postes. Enfin, beaucoup s’accordent sur le fait que la véritable création de valeur du Big Data réside dans l’apport d’innovation et de nouveaux services que celui-ci encourage. Bien que difficilement mesurable économiquement, il induit une valeur ajoutée démultipliée par l’effet de réseau (notamment dans les télécoms ou les médias). 2) Enjeu RH : le recrutement des data scientists Autre enjeu qui se présente aux entreprises utilisatrices du Big Data, qu’elles soient petites ou grandes : la montée en compétences pour absorber le savoir-faire nécessaire à la pratique du Big Data. Concrètement, les profils les plus recherchés sont ceux des data scientists et des data analysts. Les uns comme les autres sont détenteurs d’un bagage à la fois statistique, technique et opérationnel, le data analyst étant certainement encore plus au contact du terrain que son homologue data scientist, plus orienté ingénieur. Leur rôle au sein de l’entreprise est de traiter les données d’activités et de prospection en les liant à une prise de décision « business » opérationnelle. Un enjeu réside dans la formation de ces experts de la donnée : en effet, les écoles commencent tout juste à proposer des formations en lien avec ce métier et les entreprises communiquent fréquemment sur le manque de profils disponibles. 3) Enjeux technologiques : Les enjeux technologiques du Big Data ont beaucoup évolué entre 2011 et maintenant : en 2011, en effet, les experts se penchaient davantage sur la question de la volumétrie, du stockage ou encore de la nature non-structurée des données traitées. Ces enjeux de base pour le Big Data semblent aujourd’hui surmontés, laissant place à d’autres préoccupations.Synthèse du marché Big Data www.bigdataparis.com Un évènement organisé par : 11 a) La qualité de la donnée La question qui a occupé le devant de la scène en 2012 est celle de la qualité des données : en effet, les utilisateurs du Big Data ont constaté que le traitement de grands volumes de données pouvait accroître le nombre d’erreurs si les données n’étaient pas intègres à la base. De nombreuses anomalies pouvaient en effet entacher la véracité des données et du traitement : le fait que des données soient en doublons, le fait qu’elles proviennent de mauvaises sources, ou encore qu’elles soient déjà obsolètes… un aléa encore amplifié par le fait que les données proviennent de plus en plus de sources externes. Pour contrer cela, les intégrateurs ont développé de nouvelles solutions qui permettent de mieux percevoir la source de la donnée et de réduire le taux d’erreur. Des fournisseurs spécialisés dans l’analyse et le nettoyage de la donnée externe ont également vu le jour. Mais l’analyse humaine reste quoi qu’il en soit indispensable et la montée en compétence, évoquée précédemment, présente à ce titre un intérêt stratégique pour l’entreprise. b) La sécurité des données D’autre part, le second enjeu directement connecté à l’explosion des données est celui de la confidentialité et de la sécurité : en stockant des données stratégiques sur lesquelles elle compte appuyer ses décisions, l’entreprise s’expose à des phénomènes de cybercriminalité et de piratage. Les administrations publiques sont également fortement concernées par cette préoccupation. Les solutions de stockage sur serveurs et dans le Cloud doivent de ce fait répondre à ce risque d’insé- curité sur les réseaux ; mais même au sein de l’organisation, des systèmes de protection sont nécessaires afin de limiter l’accès aux données aux seules personnes qui en démontrent le besoin. On rejoint ici la problématique organisationnelle décrite plus haut : comment planifier la remontée d’informations ?Synthèse du marché Big Data www.bigdataparis.com Un évènement organisé par : 12 4) Enjeu réglementaire : la protection des données personnelles Enfin, la dernière problématique récurrente lorsque l’on évoque le Big Data est celle de la protection des données personnelles. En effet, l’utilisation massive de données issues des actes d’achat des consommateurs, ou de leurs historiques sur internet, ou encore de leur géolocalisation, contraint les organismes de protection comme la CNIL à être vigilants, et les entreprises à se conformer précisé- ment à ces recommandations. La législation est d’ailleurs en pleine évolution sur ces sujets : la Commission Européenne a ainsi fait paraître en janvier 2012 un projet de règlement visant à réformer l’accès aux données personnelles sur Internet. Ce projet est à l’étude et des avancées prochaines sont prévues (on a d’ores et déjà mis en place, sur certains sites internet, une autorisation préalable de l’internaute pour l’exploitation des cookies). C’est principalement par ces dispositifs d’autorisations que les entreprises se prémunissent contre une utilisation abusive des données (ex : « l’opt-in » pour les services géolocalisés) mais le critère principal est également l’anonymisation des données, essentiellement dans des activités de profiling et de segmentation. Quels que soient les leviers retenus par les organismes réglementaires, il est primordial pour les consommateurs et pour les entreprises que la protection des données soient assurée : en effet, toute faille dans ces dispositifs risquerait d’altérer la confiance des usagers, ce qui limiterait dès lors l’impact et le pouvoir d’innovation du Big Data.Synthèse du marché Big Data www.bigdataparis.com Un évènement organisé par : 13 V. Vers de nouveaux marchés – L’impact du Big Data Comme tout nouveau marché en structuration, le Big Data entraîne dans son sillage d’autres segments d’activité connexes, dont certains l’ont d’ailleurs parfois précédé. Leurs degrés de maturité sont divers mais ils possèdent tous un lien assez fort avec le Big Data dont ils s’enrichissent mutuellement. 1) La Dataviz La dataviz, autrement appelée datavisualisation, s’est développée au croisement de la statistique et du design. Sa valeur ajoutée réside dans la représentation de la donnée et la communication de son contenu aux décideurs opérationnels et au grand public. L’idée est de rendre l’accès à la décision beaucoup plus immédiat grâce à une représentation hiérarchisant clairement les enjeux : la datavisualisation procède donc à la fois d’une analyse et d’une mise en forme graphique. Une exigence renforcée dans un contexte Big Data où l’avalanche de données produit une importante contrainte de restitution et de mise en perspective. Il importe donc aux fournisseurs de dataviz de présenter des qualités à la fois techniques, statistiques et créatives ; pour l’instant, on retrouve surtout les acteurs de la dataviz dans des petites structures à dimension fortement innovante. Les grands éditeurs commencent à s’approprier ces outils mais ceuxci restent encore le fait de quelques entreprises historiquement spécialisées dans la représentation graphique. Le véritable enjeu pour ce marché est de produire des outils directement en lien avec la perception du destinataire de l’information ; en effet, c’est en créant des ergonomies adaptées à leur utilisateur que les dataviz pourront s’implanter durablement dans le champ décisionnel des entreprises et des organisations. A la fois en tant qu’outil de communication, et en tant qu’aide à la décision. Pour l’instant, le champ d’utilisation est surtout orienté BtoC, les créations les plus ambitieuses s’imposant par le biais du datajournalisme ; cependant la multiplication des supports (tablettes, smartphones, etc...) ainsi que la quête de temps réel sont autant d’éléments qui militent en faveur d’un développement rapide de ce secteur.Synthèse du marché Big Data www.bigdataparis.com Un évènement organisé par : 14 2) L’Open Data L’Open Data s’est développé bien en amont du Big Data ; en ce sens, il le précède… Mais il est aussi et surtout une part intrinsèque du Big Data par le flot d’informations qu’il véhicule. Concrètement l’Open Data recouvre l’ouverture gratuite des données publiques et privées au grand public et aux entreprises. Soit la mise en ligne d’informations statistiques et fonctionnelles jugées utiles aux destinataires de l’information (ex : les temps d’attente de métro et RER pour les usagers des transports publics, les indicateurs démographiques et sociologiques de certaines zones géographiques, etc…). L’objectif principal de l’Open Data est double : il vise à créer des nouveaux services auprès du citoyen et à limiter ainsi les pertes d’efficacité liées aux asymétries d’information. Cette dernière dimension de « bonne gestion » transparaît notamment dans les démarches Open Data lancées par les administrations publiques: leur volonté d’ouvrir les données souligne un effort de transparence qui les oblige vis-à-vis de leurs administrés (ex : révéler les temps d’attente sur les hotlines administratives conduira les organisations publiques à entreprendre des efforts pour réduire et limiter ces temps d’attente). Quant à la dimension « nouveaux services », elle se retrouve dans le domaine du grand public mais également dans celui du BtoB : en ouvrant leurs données anonymisées à d’autres acteurs, notamment des partenaires ou des organisations intégrées dans la même chaîne de valeur qu’eux, les entreprises fournissent un surcroît d’informations qui, transformée par les savoir-faire des partenaires, pourra générer de l’innovation dans leur propre écosystème…Un procédé largement gagnant-gagnant ! Si l’Open Data est autant lié au Big Data, c’est parce que l’ensemble des données mises en circulation par l’Open Data participent aujourd’hui au data deluge auquel répond le Big Data. La notion de création de valeur à partir de l’analyse de la donnée, chère au Big Data, est également bien présente ; aujourd’hui, des entreprises spécialisées se sont créées exclusivement autour de la question de l’Open Data, traitant et analysant des volumes très importants de données publiques afin de les valoriser et de les revendre par la suite. Les entreprises font d’ailleurs de plus en plus appel à ces données externes qui enrichissent bien souvent leur vision stratégique. L’Open Data s’affirme donc comme un terrain de développement important du Big Data, car la donnée qu’il véhicule est considérée comme fiable, intègre, nettoyée de ses imperfections, ce qui répond à l’enjeu récurrent de qualité des données.Synthèse du marché Big Data www.bigdataparis.com Un évènement organisé par : 15 3) L’Internet des Objets Enfin, dans une vision davantage prospective, on associe souvent le Big Data à un phénomène innovant en plein développement technologique : l’Internet des Objets. L’Internet des Objets recouvre l’échange d’informations entre objets connectés qu’il s’agisse d’outils traditionnels de mobilité (ex : tablettes tactiles), de capteurs embarqués ou d’objets du quotidien. L’Internet des Objets reprend et prolonge les technologies RFID et M2M déjà à l’œuvre dans des environnements professionnels et grand public. Les potentialités ouvertes par l’Internet des Objets sont importantes en terme de temps réel et de synchronisation : en connectant de multiples objets sur des applications conjointes, les développeurs espèrent ainsi augmenter la systématisation des process et diminuer les pertes liées au manque de coordination des outils. Par-dessus tout, l’Internet des Objets offre une promesse d’intégration optimale de l’information au cœur même de l’environnement direct des utilisateurs : en effet, en utilisant des supports variés directement implantés au cœur de l’activité, et reliés par un même système de transmission, l’Internet des Objets garantit une importante simplification des usages. Ce développement de l’Internet de l’Objet implique forcément des transferts de données massifs et extrêmement rapides dans le temps, ce qui revient à la problématique du Big Data et conditionne l’essor de ce nouveau secteur à une maîtrise totale du traitement Big Data. En ce sens, le déploiement de ce type d’outils est encore en phase de recherche et d’expérimentation mais constitue un des secteurs de développement les plus attractifs des années à venir.Synthèse du marché Big Data www.bigdataparis.com Un évènement organisé par : 16 B. INTERVIEWS D’EXPERTS Interview de Jean-Marie Messager, directeur de la practice BI chez Sopra Consulting 1. Le Big Data a gagné une véritable notoriété au cours de l’année écoulée… quelles sont les entreprises et les secteurs qui se sont montrés les plus sensibles à ce sujet ? Ce sont aujourd’hui les secteurs qui génèrent naturellement beaucoup de données. On retrouve notamment le secteur des télécoms, la finance, la distribution, mais aussi l’industrie. Cela pourrait être aussi le cas de la santé ou des administrations. En terme de métiers, le Marketing et la Logistique sont attirés par les apports du Big Data, d’autres semblent en prendre conscience (les ressources humaines par exemple). 2. Pour quels usages les entreprises s’intéressent-elles au Big Data ? On connaît certains exemples d’applications business du Big Data : par exemple, une tarification qui s’adapte en temps réel en fonction de la demande, ou encore l’anticipation du comportement des consommateurs en fonction des prévisions météorologiques, ou bien le pilotage de processus industriel ou de chaîne logistique complexe… les exemples sont nombreux et variés. Cependant, toutes les entreprises ne s’intéressent pas aux mêmes usages du Big Data, elles n’ont pas toutes les mêmes besoins. Nous pouvons répartir ces usages suivant 4 axes : 1)accéder à toutes les données sans limites, rapidement, ce qui permet d’optimiser les processus opérationnels, 2)accélérer les prises de décisions, 3)utiliser les nouvelles et futures sources de données (capteurs, objets connectés, données issues des réseaux sociaux, de l’open data, etc…), 4)être capable d’offrir de nouveaux services et usages auprès des clients, des partenaires et/ou du grand public. Dans tous les cas de figure, une analyse de la valeur dans le contexte de l’Entreprise (en examinant ses processus opérationnels) est nécessaire pour orienter les projets. D’autre part, on s’est rendu compte que les entreprises s’intéressent aussi au Big Data pour réduire les coûts (démocratisation des technologies de grande base de données). 3. Passée la question du Pourquoi vient celle du Comment... Avez-vous des conseils à donner sur l’intégration du Big Data en entreprise ? Là encore, il faut se demander où se trouvent réellement les besoins et identifier les opportunités. Une analyse de la valeur est indispensable en entrée pour orienter les projets. Il me semble important que la réflexion soit menée par les métiers avec une implication de l’IT. Sur le plan technique, il est nécessaire qu’il y ait une anticipation de l’appropriation de ces nouvelles technologies (Hadoop, MPP, NoSQL, in Memory,…), pour garantir leur insertion dans le SI de l’Entreprise. Cette anticipation peut se traduire par des études ou développement de prototypes dans le contexte de l’Entreprise. Pourquoi ? Pour mesurer l’effort de transformation, éviter le choc « culturel » et sensibiliser les équipes techniques internes aux nouvelles solutions et méthodes possibles avec le Big Data. Utiliser les possibilités du Cloud Computing permet de faciliter ces approches (investissement, délais) et l’appropriation de ces nouvelles technologies.Synthèse du marché Big Data www.bigdataparis.com Un évènement organisé par : 17 4. Quelles évolutions avez-vous pu noter en l’espace d’un an sur le front du Big Data ? On remarque d’abord que ce sont les entreprises qui nous sollicitent et non l’inverse, comme auparavant : cela prouve une véritable prise de conscience. Elles sont aidées en cela par l’apparition de concepts et marchés connexes, comme l’Open Data ou l’Internet des Objets, qui imposent progressivement la donnée au centre de l’activité … De façon générale, il y a une véritable curiosité sur le sujet, même si les entreprises ont l’impression de découvrir un nouveau monde avec le Big Data. C’est peut-être pour cette raison qu’elles semblent pour l’instant plus séduites par le discours sur la réduction des coûts et l’optimisation opérationnelle que sur la création de nouveaux usages et d’innovation.Synthèse du marché Big Data www.bigdataparis.com Un évènement organisé par : 18 Interview de Pierre Delort, président de l’Association Nationale des DSI 1) Cette année, les conversations autour du Big Data ont beaucoup mentionné l’apport d’une nouvelle fonction dans l’entreprise, celle de Chief Data Officer. Comment définiriezvous ce personnage ? Quel est son rôle ? La principale fonction d’un Chief Data Officer est d’augmenter ce qu’on appelle les « data-informed decisions » ; en d’autres termes, le rôle d’un CDO est de faciliter l’accès aux données lors de la prise de décision. Là où certaines orientations stratégiques sont souvent prises par vision ou intuition, la création d’un poste de CDO permettra d’appuyer davantage les décisions sur des éléments objectifs, les données, traitées par des méthodes statistiques solides. Pour cela, le Chief Data Officer doit assumer une fonction transversale afin d’acquérir une excellente connaissance de l’entreprise, qu’il s’agisse de process, de métiers, d’enjeux business mais également du vocabulaire propre à chaque activité. Il est donc au cœur des différents sujets de l’entreprise et s’appuie sur une équipe d’analystes et d’informaticiens pour agréger cette information et la rendre accessible au niveau décisionnel. 2) En quoi est-il lié aux DSI ? Est-ce une émanation de la fonction de DSI ou bien est-il différent ? Et quelles sont les compétences supplémentaires qu’il doit développer ? Pour moi, il est assez naturel et légitime qu’en phase d’initialisation de la fonction de CDO, ce soit le DSI qui assure le leadership de cette mission. En effet, la fonction de DSI est transversale et caracté- risée par une proximité avec les équipes en charge des datawarehouses qui disposent des meilleures connaissances sur les données. A travers le DSI, on peut considérer que les éventuelles créations ou modifications apportées au business par les décisions prises seront rapidement intégrées au datawarehouse pour suivi et amélioration. Cela permettra de procéder en temps de cycle court, ce qui me semble important. Cependant, avec la maturité de cette fonction, il est probable que le Chief Data Officer migre vers les métiers opérationnels, directement en lien avec l’activité… Il faudra alors arbitrer en fonction d’une réelle globalité et d’un besoin de transversalité. Concernant les compétences supplémentaires à développer, en plus des compétences techniques, il est fondamental pour moi que le CDO présente une très forte connaissance des statistiques inductives. Mais il importe tout autant qu’il possède des qualités de pédagogie et de communication, afin de faciliter la compréhension des statisticiens par les décideurs et de transmettre les informations le plus clairement possible au cœur de l’appareil décisionnaire. Dernière chose : l’humilité et l’ouverture ! En effet, il lui faudra accepter que la décision se prenne également sur des éléments subjectifs, issus d’une « vision » davantage que d’une analyse statistique. Le chef d’entreprise a besoin d’être tourné vers l’avenir et les données ne sont qu’une restitution du passé… charge au CDO d’accepter cette limite ! 3) Les entreprises françaises ont-elles conscience de la nécessité de créer ce nouveau poste ? Où en est-on dans la mise en place de cette fonction ? Et qu’en pensent les DSI : sont-ils prêts ? Les entreprises françaises sont encore dans un stade de relative curiosité mais gardent une certaine méfiance : en effet, ce n’est pas dans la culture française de faire confiance à des approches trop statistiques, trop déterministes. Les anglo-saxons sont davantage pragmatiques et intègrent plus facilement les concepts de corrélations et d’inductions. Cependant, la prise de conscience se fait jour peu à peu en France et nous constatons au sein de l’Association Nationale des DSI que les discussions sont de plus en plus nombreuses autour de cette approche: les DSI ont compris qu’il leur fallait passer d’un support « process » hérité des ERP à un support « décision » orienté par la data. En pratique, ce sont les laboratoires de Recherche qui sont les plus en avance sur la question et qui seront certainement pionniers pour expérimenter une inflexion du rôle de DSI vers celui de CDO !Synthèse du marché Big Data www.bigdataparis.com Un évènement organisé par : 19 Interview de Mathieu Gras, Responsable Services Géolocalisés chez SFR La mise en place d’un service de publicité géolocalisée Présentation du projet Notre projet de publicité géolocalisée a été lancé il y a environ deux ans alors que nous cherchions à nous développer sur de nouvelles activités ; de nombreux annonceurs sont venus nous voir pour nous faire part de leur intérêt vis-à-vis du support mobile pour transmettre de l’information promotionnelle aux usagers. Certaines technologies d’analyse de données en temps réel (notamment géographiques) avaient atteint un stade de maturité qui nous permettait d’envisager des actions dans ce domaine. Concrètement, il s’agit de récupérer des informations de géolocalisation du porteur du téléphone et de lui transmettre des contenus publicitaires en fonction de sa situation géographique : par exemple, s’il entre dans un centre commercial, il sera particulièrement attentif à toute offre qui pourrait lui être faite venant d’un des distributeurs présents sur les lieux, l’avantage de notre solution étant qu’elle est compatible avec 100% des téléphones et ne nécessite pas le téléchargement d’une quelconque application. La régie publicitaire de SFR oriente les messages en temps réel en fonction des données de géolocalisation et selon des segmentations effectuées au préalable par un Ad Server. Bien entendu, toutes ces opérations sont menées avec l’accord de l’usager, qui signale par un «Opt-In» initial son consentement vis-à-vis de ce type de messages. Sur le plan technologique, les solutions que nous avons décidé d’utiliser proviennent de la société Intersec, éditeur français de solution innovantes et spécialiste de la gestion de données Big Data pour les Télecoms. Les premiers résultats sont réellement encourageants ; nous observons un fort intérêt commercial des annonceurs pour ce type de plateforme ! Vous avez parlé d’une équipe dédiée… vous travaillez donc exclusivement sur le Big data ? Vous n’êtes pas directement intégrés dans les équipes opérationnelles ? Non, et c’est une particularité qui nous a semblé fortement innovante et mobilisatrice : nous avons créé une équipe consacrée exclusivement à l’exploitation de la donnée. Notre but est double : améliorer notre capacité opérationnelle en traitant et en analysant les données internes, mais également développer de nouvelles activités externes : en effet, les données que nous récupérons en tant qu’opé- rateur représentent une forte valeur ajoutée, que nous pouvons exploiter. La technologie Big Data nous permet de voir cette donnée avec une dimension supplémentaire, la même donnée peut être exploitée totalement différemment par une Direction Marketing ou une Direction Commerciale … Notre force est d’avoir la vision globale sur cette donnée ; ainsi en ciblant précisément leur besoin nous pouvons la mettre en forme au format souhaité. Justement, à part la publicité géolocalisée, quels sont les autres projets que vous menez ? Actuellement, nous apportons notre soutien aux équipes opérationnelles sur la détection des fraudes ; notre analyse permet de faire ressortir des anomalies statistiques, ces données sont ensuite mises à disposition pour les équipes expertes qui peuvent confirmer ou infirmer des fraudes. Cette capacité d’analyse unique au sein de SFR nous permet de signaler ces anomalies aux différentes Directions et ainsi d’intervenir très rapidement pour réduire les pertes. Mais nous travaillons également sur des services statistiques comme par l’exemple l’information auprès des collectivités locales pour déterminer des taux d’affluence lors de festivals, événements culturels ou dans les transports en commun. C’est une information très précieuse pour eux ! Quant à nous, ce type d’initiatives nous permet de transformer peu à peu notre réseau d’un centre de coût en un centre de profit. C’est une tendance lourde qu’on observe d’ailleurs de plus en plus en Europe et à l’international. Les télécoms sont à l’avant-garde du Big Data dans ce domaine !Synthèse du marché Big Data www.bigdataparis.com Un évènement organisé par : 20 C. ARTICLES D’EXPERTISE Mouloud DEY, Directeur des Solutions et Marchés Emergents SAS France C’est dans un contexte économique, social et environnemental difficile que les Big Data s’octroient progressivement une légitimité auprès des décideurs des plus grandes instances internationales. Pendant qu’aux Etats-Unis l’administration Obama y alloue $200 millions pour catalyser les initiatives de recherche et développement, le gouvernement français inscrit les Big Data dans le cadre de ses investissements d’avenir consacrés au développement de la société numérique. Les entreprises ne sont pas en reste et, même si la plupart d’entre elles s’interrogent sur les meilleures approches, les Big Data sont désormais reconnues comme un levier important pour l’innovation, susceptible d’engendrer à la fois de nouveaux modèles économiques et d’importants gains de productivité. Ce n’est pas la taille qui compte, mais les relations Des études récentes montrent que les entreprises les plus performantes sont celles qui complètent l’intuition de leurs décideurs dans des processus métiers instrumentés par des solutions analytiques. En effet « Big Data » ne signifie nullement « Better Data » et, bien que ce soit la partie la plus visible du phénomène, ce n’est pas tant la taille des données qui compte mais leurs relations. La valeur additionnelle qu’on peut retirer des nouvelles formes de données (en particulier des données non structurées) vient essentiellement des perspectives nouvelles et des possibilités d’expérimentation résultant de leurs combinaisons à l’infini avec les données plus traditionnelles de l’entreprise. Nous sommes au commencement d’une ère où toutes les activités professionnelles et personnelles des individus deviennent numériques mais seules les entreprises qui sauront adapter leurs systèmes d’informations à ces nouvelles perspectives pourront réellement en capter la valeur. Big data, big challenges De ce fait, les directions des systèmes d’information (DSI) ont un rôle de levier à jouer dans la création de cette valeur et de nombreux défis à relever. Le premier défi relève de la gouvernance des données. Il s’agit notamment d’éviter de se laisser déborder par des initiatives isolées de directions métiers tentées par les sirènes associées aux nouvelles sources de données (médias et réseaux sociaux, géolocalisation, open data,…) sans se soucier du volume, de la sécurité, de la qualité, du degré de fraîcheur et de pertinence de ces nouvelles formes de données. Le second défi relève de la nécessaire adaptation des services et des infrastructures techniques aux nouveaux besoins des directions métiers. La relative perméabilité entre usages professionnels et usages personnels a consacré le concept « Bring Your Own Device » (BYOD) déjà perçu comme une difficulté dans un certain nombre d’entreprises. L’usage devenu presque banal du Cloud Computing pourrait consacrer la généralisation du « Bring Your Own Cloud», voire du « Bring Your Own Data » pour des utilisateurs métiers progressivement habitués, par leurs usages personnels, à consommer des services élastiques dans le nuage plus que des applications. Data as a Service En effet, s’il est aisé de maîtriser les besoins en infrastructure des applications décisionnelles traditionnelles très automatisées, il est aujourd’hui plus difficile d’anticiper les charges et capacités associées aux Big Data du fait des aspects fortement expérimentaux de ce genre de projet. Les DSI devront proposer l’accès et l’analyse de ces données sous forme de services agiles, suffisamment séparées des applications décisionnelles actuelles pour ne pas fragiliser les infrastructures existantes mais néanmoins assez proches pour bénéficier également de la richesse des informations parfois dormantes accumulées depuis de nombreuses années dans les entrepôts de données. Synthèse du marché Big Data www.bigdataparis.com Un évènement organisé par : 21 Steven Totman, Responsable du pôle intégration de données chez Syncsort Big Data : le point de rupture. Qu’entend-on par Big Data ? Pourquoi ces données importent tant aux entreprises ? Steven Totman, Responsable du pôle intégration de données chez Syncsort, nous éclaire sur le pourquoi du comment. Des cartes perforées aux pétaoctets – retour sur l’incroyable croissance des volumes de données À quel moment les données sont-elles devenues des « Big Data » ? Cette question a fait l’objet d’un débat passionnant lors d’un récent dîner entre collègues. Le consensus s’est alors établi sur les années 70, au temps où le stockage des données s’effectuait encore sur des cartes perforées de 880 octets chacune. À cette époque, un problème de « Big Data » se traduisait essentiellement par l’achat d’une plus grande armoire de stockage et par les montagnes de confettis engendrées par la perforation des cartes. Dans les années 80, avec l’apparition des disquettes 3,5 pouces d’une capacité phénoménale de 1,44 Mo, les problèmes de « Big Data » prirent une toute autre tournure. Sachant qu’il en fallait pas moins de 20 pour stocker un jeu comme Monkey Island ou Wing Commander, l’équilibre précaire des piles de disquettes constituait en soi un problème de « Big Data ». Notons qu’à la même époque, IBM révolutionna le stockage en entreprise avec son système 3380 d’une capacité exceptionnelle de 2,5 Go. Or, nous étions encore bien loin des 23 pétaoctets de données nouvelles traitées quotidiennement par Google, comme l’un de nous le faisait si judicieusement remarquer ! Mais alors à quel moment nos infrastructures informatiques ont-elles commencé à ployer sous le poids des « Big Data » ? Un secret de Polichinelle Pour tout dire, cela fait un bon moment que les infrastructures ont atteint leur point de rupture. De fait, il n’est pas rare de voir certains clients effrayés par un simple téraoctet de données. Cette discussion avec mes collègues me rappela également une conversation que j’ai eue dernièrement avec le DSI d’un opérateur télécoms. Ce dernier m’expliquait que l’ETL (processus qui consiste à effectuer les opérations de transformation dans la base de données), l’obligeait à solliciter un financement de 40 % de nœuds supplémentaires (à 500 000 $ le nœud) sur la base de données de son datawarehouse, et ce uniquement pour faire face à une croissance annuelle de 10 % des volumes de données. Cependant, à la question de son DAF sur les retombées de cet investissement de 2 millions de dollars, le DSI n’avait d’autre argument à avancer que le maintien du statu quo : mêmes rapports, mêmes délais, aucune amélioration. On comprend alors son manque d’enthousiasme à l’idée de présenter son « dossier » à son DAF. Pendant des années, la saturation des infrastructures informatiques (en particulier les outils ETL) sous l’effet des Big Data est restée un secret de Polichinelle. Ainsi, ce n’est que maintenant que l’on observe une véritable prise de conscience collective et l’engouement pour de nouvelles technologies comme Hadoop et des solutions ETL performantes. Enfin, notons qu’à mon sens, la notion de « Big Data » se justifie aussi bien pour une équipe de cinq personnes devant gérer 10 téraoctets de données que pour une équipe de 500 personnes confrontée à un pétaoctet. Des solutions transparentes Votre entreprise rassemble des données provenant de sources multiples ? L’ajout d’une nouvelle source de données ou la création d’un nouveau rapport demande plus de trois mois de travail à votre département informatique ? Si oui, il est fort probable que vous soyez confronté à un problème de « Big Data ». Mais rassurez-vous, depuis la disparition des cartes perforées dans les années 70, il est possible d’intégrer en toute transparence des logiciels qui accélèrent le traitement des données aux environnements existants ; ceux-ci permettent donc de mettre un terme aux problèmes de Big Data. En conclusion, si « Big Data » est le terme en vogue pour traduire un problème de longue date, cela fait des années que nous apportons la solution aux problèmes de « Big Data ».Synthèse du marché Big Data www.bigdataparis.com Un évènement organisé par : 22 Sanjay Poonen, Président et Corporate Officer, Technology & Innovation, directeur de la division mobile de SAP Internet des objets : quand la mobilité rencontre le Big Data dans le Cloud (mot compte triple !) Pour Sanjay Poonen, à la tête de la division mobilité de SAP, l’Internet des objets apparaît comme le prolongement des terminaux mobiles, multipliant le nombre d’informations que l’entreprise doit géreren temps réel. Mais ouvrant la porte à de nouveaux scénarios métier très prometteurs.Travailler pour un groupe international suppose de se plier à quelques obligations, comme les conférences téléphoniques avec l’Europe démarrant pour moi à 5 heures du matin. Mais il est encore plus frustrant de se réveiller à 4 heures 30 pour découvrir que ladite conférence a été annulée pendant la nuit. Que se passerait-il si mon calendrier était en mesure de dialoguer avec mon réveil via Internet ? L’annulation de la conférence aurait reprogrammé mon réveil pour décaler l’heure de la sonnerie, me permettant de dormir un peu plus. Maintenant imaginez à quoi ressemblerait ma matinée si tous mes appareils étaient en mesure de se synchroniser. L’annulation du rendez-vous reprogrammerait alors non seulement mon réveil mais aussi ma machine à café. En complément, mon terminal mobile pourrait recevoir des alertes de ma voiture quand le niveau d’essence du réservoir est trop bas. Ou des informations sur les retards des trains que j’emprunte pour me rendre au travail. Ou encore des alertes quand un embouteillage se forme sur la route m’amenant à la gare. Autant de données qui pourraient venir, via Internet, nourrir mon réveil (et ma machine à café par voie de conséquence) afin de lui permettre d’adapter l’heure de la sonnerie en fonction des événements en temps réel. Poussons plus loin la réflexion : sur mon trajet vers la gare, mon téléphone reçoit une alerte de mon réfrigérateur signalant que je vais être à court de lait et qu’un magasin effectuant en ce moment des promotions sur le lait (et vendant également mon yaourt favori) se trouve sur ma route. Via la géolocalisation, je suis dirigé directement vers le rayon où sont stockés ces produits, tandis qu’un coupon personnalisé de réduction m’offrant un rabais de 50 % sur les yaourts arrive directement sur mon terminal mobile. M2M : la fonction « sociale » des objets Voici un autre scénario. Quand ma famille se rend à Tahoe (dans la Sierra Nevada, aux Etats-Unis, NDLR) pour faire du ski, ma femme et moi sommes en désaccord concernant le maintien ou non du chauffage dans notre domicile. Elle voudrait le conserver en marche pour le confort des enfants quand nous rentrerons ; je préfère de mon côté économiser l’énergie. La bonne réponse consisterait à baisser le thermostat lors de notre départ mais, sur la route du retour, à le reprogrammer via un terminal mobile. A condition bien sûr que ce thermostat soit connecté à Internet. Tous ces usages peuvent sembler sortir tout droit de « Retour vers le futur », mais la plupart des scénarios que je viens de décrire sont aujourd’hui envisageables via ce qu’on appelle l’Internet des objets (ou IoT pour Internet of Things) et le partage intelligent d’informations avec le Machine-toMachine (M2M). Avec les avancées de la RFID, la miniaturisation et les progrès des capacités d’analyse, l’Internet des objets devient de plus en plus tangible. Il faut penser aux communications M2M comme à une fonction de collaboration sociale entre objets ou entre des objets et des humains.Synthèse du marché Big Data www.bigdataparis.com Un évènement organisé par : 23 Gérer les machines comme des terminaux mobiles Ces technologies sont aujourd’hui entrées dans leur phase de maturation. Qu’il s’agisse de thermostats intelligents fournis par une start-up comme Nest Labs ou par Honeywell. Ou qu’il s’agisse de ce qu’on appelle le « precision retailing » (consistant pour un distributeur à entrer dans une relation personnalisée avec chaque consommateur), où des innovations dans l’analyse des Big Data couplées à la mobilité et au GPS permettent d’offrir aux consommateurs des promotions ciblées directement sur leur terminal mobile. Un des clients de SAP dans l’automobile m’a un jour expliqué qu’il y avait plus d’électronique dans une voiture moderne que dans la première navette spatiale. J’ai aussi appris que vous vous trompez du tout au tout si vous pensez que les tracteurs d’aujourd’hui sont des machines sans intelligence ; ils récupèrent de nombreux flux d’informations, à l’image d’un Airbus 380, afin que les agriculteurs puissent optimiser leur utilisation de la machine, programmer les périodes de maintenance de leur tracteur et consacrer plus de temps à leur production de denrées alimentaires. Les industriels de la grande consommation travaillent eux à des distributeurs automatiques intelligents permettant d’exploiter des données sur l’usage de leurs produits ou la météo du jour afin d’optimiser les fréquences de réapprovisionnement. Si vous savez que la journée va être chaude par exemple, être capable d’amener vos camions suffisamment rapidement sur le terrain, afin de réapprovisionner les distributeurs en boissons rafraîchissantes, peut être le facteur clef permettant à une entreprise de réaliser un trimestre historique. Chez SAP, nous sommes en train d’étudier toutes ces machines, qu’elles soient connectées via un câble ou sans fil, et les considérons comme des extensions des terminaux mobiles : elles doivent toutes être sécurisées, gérées et en mesure de faire fonctionner des applications un peu à la manière d’un téléphone mobile. Gérer cette évolution vers des communications M2M intelligentes requiert une architecture étendue et des solutions technologiques sur lesquelles nous travaillons avec nos partenaires. Mais au cœur même du M2M se trouvent trois éléments clefs : la mobilité, le Big Data et le Cloud. Et quand ces trois composantes sont réunies comme c’est le cas dans l’Internet des objets ou dans le M2M, c’est un peu comme obtenir un mot compte-triple au Scrabble !DÉCOUVREZ LA PROCHAINE RÉVOLUTION INFORMATIQUE ET MANAGÉRIALE MONDIALE Inscription sur www.bigdataparis.com BIG DATA PARIS CONGRÈS EXPO, les 3 et 4 avril 2013 CNIT Paris La Défense 2e édition Un évènement organisé par Flashez moi ! Introduction Big Data SOMMAIRE Rédacteurs : Réf.: QU'EST-CE QUE LE BIG DATA? ENJEUX TECHNOLOGIQUES ENJEUX STRATÉGIQUES BIG DATA ET RH ANNEXE SH. Lazare / F. Barthélemy AXIO_BD_V1Data & Information System Présentation AXIODIS Avertissement Ce document constitue le support d’une présentation orale. Privé des commentaires l’accompagnant, il peut donner lieu à des interprétations erronées. 4 Qu'est-ce que le Big Data? Enjeux technologiques Enjeux stratégiques Big Data et RH Annexe Historique & contexte L’évolution du SI amène les entreprises à traiter de plus en plus de données issues de sources toujours plus variées . Les prévisions de taux de croissance des volumes de données traitées dépassent les limites des technologies traditionnelles. On parle de pétaoctet (billiard d’octets) voir de zettaoctet (trilliard d’octets)  Quelle solution pour exploiter ces données ? 5 Qu'est-ce que le Big Data? Enjeux technologiques Enjeux stratégiques Big Data et RH Annexe Marché du Big Data6 Qu'est-ce que le Big Data? Enjeux technologiques Enjeux stratégiques Big Data et RH Annexe Big Data : exploration de très vastes ensembles de données pour obtenir des renseignements utilisables Le terme Big Data se réfère aux technologies qui permettent aux entreprises d'analyser rapidement un volume de données très important et d'obtenir une vue synoptique. En mixant intégration de stockage, analyse prédictive et applications, le Big Data permet de gagner en temps, en efficacité et en qualité dans l’interprétation de données. Les objectifs de ces solutions d’intégration et de traitements des données sont de traiter un volume très important de données aussi bien structurées que non structurées, se trouvant sur des terminaux variés (PC, smartphones, tablettes, objets communicants...), produites ou non en temps réel depuis n'importe quelle zone géographique dans le monde.  le Big Data sera un outil majeur à la fois pour la prise de décisions et l'optimisation de la compétitivité au sein des entreprises. Définition7 Qu'est-ce que le Big Data? Enjeux technologiques Enjeux stratégiques Big Data et RH Annexe Le Big Data se caractérise par la problématique des 3V :  Vélocité : la vitesse à laquelle les données sont traitées simultanément  Variété : l'origine variée des sources de données qui arrivent non structurées (formats, codes, langages différents...)  Volume : le poids total des données collectées Vous êtes confronté à une problématique de gestion de données correspondant à ces trois critères ou plus simplement vous ne savez plus gérer ces données avec les architectures traditionnelles, alors vous avez une problématique de type Big Data. Il faut en effet penser à collecter, stocker puis analyser les données d’une façon qui ne peut plus être traitée par une approche traditionnelle pour permettre de satisfaire au 4ème V  la Valorisation des données. Problématique8 Qu'est-ce que le Big Data? Enjeux technologiques Enjeux stratégiques Big Data et RH Annexe Est-ce une innovation? .  Bases de données d'analyse massivement parallèle (MPP). Ces bases de données conformes SQL sont conçues pour répartir le traitement des données sur plusieurs machines  Modèle Map-Reduce, Hadoop, et autres approches NoSQL. Ces approches, appelées collectivement "NoSQL" ou "Not Only SQL" permettent d'accéder aux données via des langages de programmation sans utiliser les interfaces basées sur SQL et permettent de répartir les données sur plusieurs machines distinctes. L’explosion des volumes des données nécessite une innovation en terme de :  Accélération matérielle Abandon des disques durs au profit des mémoires dynamiques DRAM ou flash  meilleur bénéfice des processeurs multicoeurs.9 Qu'est-ce que le Big Data? Enjeux technologiques Enjeux stratégiques Big Data et RH Annexe  Datavizualisation : capacité à représenter des données de façon visuelle (graphiques, diagrammes, cartographies, infographies). Plus largement c’est la capacité à naviguer rapidement et simplement dans les données.  Not Only SQL / Bases sans schéma : catégorie de systèmes de gestion de base de données (SGBD) qui n'est plus fondée sur l'architecture classique des bases relationnelles. L'unité logique n'y est plus la table, et les données ne sont en général pas manipulées avec SQL.  Map Reduce : modèle de programmation permettant de manipuler de grandes quantités de données non obligatoirement structurées.  Hadoop / Cassandra / MongoDB : framework de développement d’application utilisant le modèle Map Reduce.  Data Flow / Pig / Hive ..: logiciel et langage d’analyse de données permettant d’utiliser Hadoop. VocabulaireEnjeux stratégiques 10 Qu'est-ce que le Big Data? Big Data et RH Annexe Enjeux technologiques La compréhension de votre environnement passe la par la valorisation des toutes les données accessibles pour les raisons suivantes :  Stratégiques (Créer un avantage concurrentiel, Contrôler son image)  Organisationnelles (Piloter en temps réel, Impliquer les collaborateurs) l’environnement actuel toujours plus d’informations exploitables nécessite une nouvelle approche de l’analyse des données . Pourquoi faire du Big Data?Enjeux stratégiques 11 Qu'est-ce que le Big Data? Big Data et RH Annexe Enjeux technologiques  De nombreux secteurs sont concernés :  (e-) (m-) Commerce & CRM  Santé  Défense, renseignement (e.g. cybersécurité, biométrie)  Banque/Finance  Transports ”intelligents”  Et concerne différentes activités :  Moteurs de recherche, moteurs de recommandation  Maintenance prédictive  Marketing viral à travers les réseaux sociaux  Détection des fraudes  Médecine individualisée  Publicité en ligne (retargeting) Big Data : Secteurs & activitésEnjeux stratégiques 12 Qu'est-ce que le Big Data? Big Data et RH Annexe Enjeux technologiques L’émergence de nouveaux métiers capables de gérer vos données d’intérêt et d’en extraire les bonnes informations :  Architecte Big Data:  Connaissance infrastructures et logiciels Big Data  Connaissances en modélisations  Data Analyst:  Connaissance des logiciels & langages Big Data  Connaissance en modélisations  Data Scientist:  Connaissance des logiciels & langages Big Data  Connaissance en modélisations  Connaissances métiers  Chief-Data-Officer (Directeur des données)  Responsable des données et de leur gouvernance (collecte, traitement, sauvegarde, accès)  Responsable de l’analyse des données et aide à la décision  Mettre en œuvre des équipes agiles & transverses Impacts du Big Data dans l‘entreprise13 Qu'est-ce que le Big Data? Enjeux technologiques Big Data et RH Enjeux stratégiques Annexe Source de données hétérogènes Architecture Big Data Intégration des données Stockage et traitement de données Consommation / valorisation des données Analyse des données Faire évoluer votre SI traditionnel vers un SI BigData Sources hétérogènes14 Qu'est-ce que le Big Data? Enjeux technologiques Big Data et RH Enjeux stratégiques Annexe Stockage des données Les approches NoSQL (data in memory) sont particulièrement importantes pour les tâches d'analyse qui ne peuvent pas être codées efficacement dans SQL (itérations multiples sur les données, analyse de textes…) Map-Reduce et Hadoop sont les « outils » NoSQL les plus répandus pour mettre à disposition les données non structurée au niveau des applications HDFS15 Qu'est-ce que le Big Data? Enjeux technologiques Big Data et RH Enjeux stratégiques Annexe Les utilisateurs / décideurs doivent pouvoir visualiser et comprendre les résultats. Le « Reporting version Big Data » doit être conçu pour pouvoir trouver "une aiguille dans une botte de foin "  on parle de datavizualisation. Data visualisation Les présentations peuvent être simples, dynamiques… il faut choisir ce qu’on veut montrer. Un graphique n’est qu’une présentation de la réalité…16 Qu'est-ce que le Big Data? Enjeux technologiques Big Data et RH Enjeux stratégiques Annexe Sécurité et supervision Accès & sécurité Provenance et fiabilité des données Programmes de traitements, contrôles d’accès Archivage, entrepôts de données Il est nécessaire d’inclure dans votre architecture des solutions de supervision à même d’auditer en permanence votre environnement.  Garantir l’anonymisation des données la sécurité des traitements  Se prémunir des risques d’atteintes à la vie privée  Respecter les contraintes légales et réglementaires évolutifs. Qu'est-ce que le Big Data? Enjeux technologiques Enjeux stratégiques Big Data et RH 17 Annexe Repenser les fonctions RH Exploiter et croiser plus de sources de données H@rp GPEC Fidélisation des employés Ciblage des candidats / impact formation Corrélation de la performance et la structure d’une unité Explication de l’absentéisme / santé Résolutions de conflits Satisfaction au travail Le Big Data apporte une nouvelle dimension aux RH Qu'est-ce que le Big Data? Enjeux technologiques Enjeux stratégiques Big Data et RH 18 Annexe CEB indique dans son étude de 2012 que 77 % des professionnels RH ne savent pas évaluer l’impact du potentiel des salariés de leur entreprise sur ses résultats financiers. Le gain de productivité dû au Big Data pour les services RH s’élèverait à environ 70% et permettrait ainsi de traiter plus de sujets pour une meilleure connaissance des collaborateurs. De nouvelles ambitions Sécuriser Valoriser AnticiperQu'est-ce que le Big Data? Enjeux technologiques Enjeux stratégiques Big Data et RH 19 Annexe  Les premiers acteurs RH à avoir utilisé le Big Data sont les sous-traitants RH souhaitant améliorer le recrutement:  Démultiplication les sources d’informations :  Paye par action/motif sur une historique complet par collaborateur  Analyse des demandes de recrutement trop récurrente sur certains postes  Analyse des CV et banques externes (yc monster…)  Modélisation du parcours de recrutement permettant d’éviter les “erreurs” de recrutement.  En complement le Big Data leur a permis de développer :  une expertise sur les données collectées pour répondre à leurs clients  Une offre de services et de conseil à forte valeur ajoutée complémentaire à la sous-traitance L’exemple du recrutementQu'est-ce que le Big Data? Enjeux technologiques Enjeux stratégiques Big Data et RH 20 Annexe  Prévoir l’évolution des métiers de l’entreprise et des effectifs en croisant des données concernant tout type d’information :  La stratégie de l’entreprise => secteurs, marchés, technologies  Les compétences présentes aujourd’hui  Les formations internes et externes => durées, coûts, …  Les coûts RH => recrutements, salaires, …  Le Big Data leur a permis de concevoir un plan de maintient des effectifs et de prévision des compétences nécessaire dans le futurs  Prévoir les campagnes de recrutement, de formation  Accompagner les salariés vers de nouveaux challenges  Chiffrer ces évolutions L’exemple de la gestion des compétencesAnnexe 21 Qu'est-ce que le Big Data? Enjeux technologiques Enjeux stratégiques Big Data et RH Autour du Big Data, on trouve également les termes :  Open Data : solution visant à rendre accessibles à tous des bases de données, s'appuyant sur le participatif et la transparence.  Little Data: parfois utilisé pour permettre aux entreprises qui n’auraient pas les 3V pour utiliser les technologies Big Data  Smart Data: Extraire parmi l’ensemble des données du Big Data les données “intelligentes” permettant de piloter vos activités… nouvelle expression synonyme de Business Intelligence. Attention à ne pas être confronté au final au Bad Data! Définition autres notionsAnnexe 22 Qu'est-ce que le Big Data? Enjeux technologiques Enjeux stratégiques Big Data et RH  Quelles variables expliquent la performance d’une unité d’affaire ou d’une équipe ?  Quelles variables expliquent les statistiques obtenues en santé, en sécurité, en absentéisme, les plaintes clients, la fidélisation des clients, les ventes ?  Quels profils et quelles compétences prédisent le mieux la fidélisation d’employés et la performance des employés et des candidats?  Quels managers génèrent les meilleurs résultats en terme de civilité organisationnelle, de résolutions de conflits, de règlement de plaintes, de satisfaction au travail, de promotion ou de départ?  Quelle initiative de formation a eu le meilleur impact ?  Quelles statistiques influencent le plus la profitabilité et la croissance de l’entreprise ? Thématiques RHAnnexe 23 Qu'est-ce que le Big Data? Enjeux technologiques Enjeux stratégiques Big Data et RH  http://www.forbes.com/sites/gilpress/2013/05/09/a-veryshort-history-of-big-data/  http://www.martinhilbert.net/WorldInfoCapacityPPT.ht ml  Cabinets conseils ‘Big Data’:  IDATE  DATA&DATA Consulting  Enquête IBM ‘Big Data ’ 2012 Références bibliographiquesMERCI www.axiodis.com EARN A CERTIFICATE OF COMPLETION AND CEUS Participants who successfully complete all course requirements are eligible to receive a Certificate of Completion and 2.0 CEUs. COURSE VISION MIT wants to help solve the world’s biggest and most important problems such as Big Data. Tackling the Challenges of Big Data is an online course developed by the faculty of the MIT Computer Science and Artificial Intelligence Laboratory in collaboration with MIT Professional Education, and edX. COURSE OVERVIEW The course is held over six weeks and will provide the following: > Five modules covering 18 topic areas with 20 hours of video > Five assessments to reinforce key learning concepts of each module > Case studies > Discussion Forums for participants to discuss thought provoking questions in medicine, social media, finance, and transportation posed by the MIT faculty teaching the course; share, engage, and ideate with other participants > Community Wiki for sharing additional resources, suggested readings, and related links Participants will also take away: > Course materials from all presentations > 90 day access to the archived course (includes videos, discussion boards, content, and Wiki) CUSTOM PROGRAMS We can also offer this online course for large groups of employees from the same organization. Please contact MIT Professional Education (customprograms@ mit.edu) to discuss your training and education needs. COURSE DESCRIPTION This Online X course will survey state-of-the-art topics in Big Data, looking at data collection (smartphones, sensors, the Web), data storage and processing (scalable relational databases, Hadoop, Spark, etc.), extracting structured data from unstructured data, systems issues (exploiting multicore, security), analytics (machine learning, data compression, efficient algorithms), visualization, and a range of applications. Each module will introduce broad concepts as well as provide the most recent developments in research. The course will be taught by a team of world experts in each of these areas from the MIT Computer Science and Artificial Intelligence Laboratory (CSAIL). With backgrounds in data, programming finance, multicore technology, database systems, robotics, transportation, hardware, and operating systems, each MIT Tackling the Challenges of Big Data professor brings their own unique experience and expertise to the course. MIT PROFESSIONAL EDUCATION For 65 years MIT Professional Education has been providing a gateway to renowned MIT research, knowledge, and expertise for those engaged in science and technology worldwide, through advanced education courses designed for working professionals. COMPUTER SCIENCE AND ARTIFICIAL INTELLIGENCE LABORATORY (CSAIL) The Computer Science and Artificial Intelligence Laboratory is the largest research laboratory at MIT and one of the world’s most important centers of information technology research. edX Open edX is the opensource educational platform developed by edX and its open source partners, including leading institutions. It powers the edX.org destination site and research initiatives. TACKLING THE CHALLENGES OF BIG DATA COURSE TITLE: Tackling the Challenges of Big Data COURSE DATES: November 4th - December 16th 2014 and February 3rd - March 17th 2015 FEE: $545 LOCATION: Online CEUS: 2.0 CONTACT: m onlinex-registration@mit.edu COURSE INFORMATION ONLINE: https://mitprofessionalx.edx.org REGISTER NOW > HTTPS://MITPROFESSIONALX.EDX.ORGKEY BENEFITS > Position yourself in your organization as a vital subject matter expert regarding major technologies and applications in your industry that are driving the Big Data revolution, and position your company to propel forward and stay competitive > Engage confidently with management on opportunities and Big Data challenges faced by your industry; analyze emerging technologies and how those technologies can be applied effectively to address real business problems while unlocking the value of data and its potential use for company growth > Learn and assess the issues of scalability – make your work more productive - to save time and money > Gain valuable insights from world-renowned MIT Faculty and access to CSAIL research that will differentiate how you and your company break down Big Data to save time and money, while making work more efficient > Convenient, flexible schedule with access 24 hours a day > MIT Professional Education Alumni Benefits: After completing the course, participants will become alumni of MIT Professional Education and will receive: > Exclusive discounts on all future Short Courses and Online X Courses > Access to our restricted alumni group on LinkedIn, and more WHO SHOULD PARTICIPATE? Prerequisite(s): This course is designed to be suitable for anyone with a bachelor’s level education in computer science. Tackling the Challenges of Big Data is designed to be valuable to both individuals and companies because it provides a platform for discussion from numerous technical perspectives. The concepts delivered through this course can spark idea generation among team members, and the knowledge gained can be applied to their company’s approach to Big Data problems and shape the way business operates today. The application of the course is broad and can apply to both early career professionals as well as senior technical managers. Participants will benefit the most from the concepts taught in this course if they have at least three years of work experience. Participants may include: > Engineers who need to understand the new Big Data technologies and concepts to apply in their work > Technical managers who want to familiarize themselves with these emerging technologies > Entrepreneurs who would like to gain perspective on trends and future capabilities of Big Data technology At CSAIL, we think of Big Data as a big opportunity to develop the next generation of technologies to store, manage, analyze, share, and understand the huge quantities of data we are now collecting. Based on interactions with our industry partners, we’ve gained a unique perspective on the issues posed by large amounts of complex, digital data. SAM MADDEN | Director, Big Data Initiative, MIT Computer Science and Artificial Intelligence Laboratory Professor, Electrical Engineering and Computer Science “ “ LEARNING OBJECTIVES Participants will learn the state-of-the-art in Big Data. The course aims to reduce the time from research to industry dissemination and expose participants to some of the most recent ideas and techniques in Big Data. After taking this course, participants will: > Distinguish what is Big Data (volume, velocity, variety), and learn where it comes from, and what are the key challenges > Determine how and where Big Data challenges arise in a number of domains, including social media, transportation, finance, and medicine > Investigate multicore challenges and how to engineer around them > Explore the relational model, SQL, and capabilities of new relational systems in terms of scalability and performance > Understand the capabilities of NoSQL systems, their capabilities and pitfalls, and how the NewSQL movement addresses these issues > Learn how to maximize the MapReduce programming model: What are its benefits, how it compares to relational systems, and new developments that improve its performance and robustness > Learn why building secure Big Data systems is so hard and survey recent techniques that help; including learning direct processing on encrypted data, information flow control, auditing, and replay > Discover user interfaces for Big Data and what makes building them difficult TACKLING THE CHALLENGES OF BIG DATA REGISTER NOW > HTTPS://MITPROFESSIONALX.EDX.ORGEARN A CERTIFICATE OF COMPLETION Upon successful completion of the course and all assessments a Certificate of Completion will be awarded by MIT Professional Education. To earn a Certificate of Completion in this course, participants should watch all the videos, and complete all assessments by the course end date with an average of 80 percent success rate. Note: On the right, this is a Sample Certificate of Completion MODULES, TOPICS, AND FACULTY Module One: Introduction and Use Cases The introductory module aims to give a broad survey of Big Data challenges and opportunities and highlights applications as case studies. > Introduction: Big Data Challenges (Sam Madden) > Case Study: Transportation (Daniela Rus) > Case Study: Visualizing Twitter (Sam Madden) Module Two: Big Data Collection The data capture module surveys approaches to data collection, cleaning, and integration. > Data Cleaning and Integration (Mike Stonebraker) > Hosted Data Platforms and the Cloud (Matei Zaharia) Module Three: Big Data Storage The module on Big Data storage describes modern approaches to databases and computing platforms. > Modern Databases (Mike Stonebraker) > Distributed Computing Platforms (Matei Zaharia) > NoSQL, NewSQL (Sam Madden) Module Four: Big Data Systems The systems module discusses solutions to creating and deploying working Big Data systems and applications. > Multicore Scalability (Nickolai Zeldovich) > Security (Nickolai Zeldovich) > User Interfaces for Data (David Karger) Module Five: Big Data Analytics The analytics module covers state-of-the-art algorithms for very large data sets and streaming computation. > Machine Learning Tools (Tommi Jaakkola) > Fast Algorithms I (Ronitt Rubinfeld) > Fast Algorithms II (Piotr Indyk) > Data Compression (Daniela Rus) > Case Study: Information Summarization (Regina Barzilay) > Applications: Medicine (John Guttag) > Applications: Finance (Andrew Lo) Note: Schedule and faculty are subject to change without notice. Thanks to our dedication to developing the technologies of the future, conducting fundamental, long-term research in computer science and information technology, solving significant societal problems, and inspiring the future workforce of innovators and big thinkers, we can provide a one-of-a-kind learning experience for participants looking to learn about the tools and skills they need to solve their Big Data problems. DANIELA RUS | Director, MIT Computer Science and Artificial Intelligence Laboratory Professor, Electrical Engineering and Computer Science “ TACKLING THE CHALLENGES OF BIG DATA REGISTER NOW > HTTPS://MITPROFESSIONALX.EDX.ORGTACKLING THE CHALLENGES OF BIG DATA FACULTY CO-DIRECTORS DANIELA RUS | Professor, Electrical Engineering and Computer Science Rus is Professor of Electrical Engineering and Computer Science and Director of the Computer Science and Artificial Intelligence Laboratory (CSAIL) at MIT. Rus’ research interests include distributed robotics, mobile computing, and programmable matter. At CSAIL, she has led numerous groundbreaking research projects in the areas of transportation, security, environmental modeling and monitoring, underwater exploration, and agriculture. Her research group, the Distributed Robotics Lab, has developed modular and self-reconfiguring robots, systems of self-organizing robots, networks of robots and sensors for first responders, mobile sensor networks, techniques for cooperative underwater robotics, and new technology for desktop robotics. They have built robots that can tend a garden, bake cookies from scratch, cut birthday cake, fly in swarms without human aid to perform surveillance functions, and dance with humans. SAM MADDEN | Professor, Electrical Engineering and Computer Science Madden is a computer scientist specializing in database management systems. He is the faculty director of MIT’s Big Data Initiative at CSAIL and co-director of the Intel Science and Technology Center (ISTC) in Big Data at CSAIL. Recent projects include CarTel, a distributed wireless platform that monitors traffic and onboard diagnostic conditions in order to generate road surface reports, and Relational Cloud, a project investigating research issues in building a database as a service. In 2005, Madden was named one of Technology Review magazine’s “Top 35 Under 35.” He is also cofounder of Vertica (acquired by HP). ADDITIONAL FACULTY INSTRUCTORS Regina Barzilay Associate Professor Electrical Engineering and Computer Science Andrew Lo Professor MIT Sloan School of Management John Guttag Professor Electrical Engineering and Computer Science Ronitt Rubinfeld Professor Electrical Engineering and Computer Science Piotr Indyk Professor Electrical Engineering and Computer Science Michael Stonebraker Adjunct Professor Electrical Engineering and Computer Science Tommi Jaakkola Professor Electrical Engineering and Computer Science Matei Zaharia Assistant Professor Electrical Engineering and Computer Science David Karger Professor Electrical Engineering and Computer Science Nickolai Zeldovich Associate Professor Electrical Engineering and Computer Science REGISTER NOW > HTTPS://MITPROFESSIONALX.EDX.ORG“This course was an eye-opener for me. It helped me understand what Big Data actually is and what it is not. It also helped me realize that at the core of Big Data there are two important technologies: distributed storage & processing, and machine learning algorithms. Because of this course, I am now focusing on machine learning algorithms.” Sunny Shah, Consultant, Robert Bosch, INDIA “This course provided a comprehensive overview of what Big Data really represents, and how the analysis of large data sources may improve operating efficiencies, result in new business opportunities, and improve profit margins. This knowledge will allow me to lead efforts to utilize resources more efficiently.” Norman Yale, Professional Technical Architect, AT&T Corporation, UNITED STATES “I learned the latest technologies and financial models from both the course content and the discussion forum where I communicated with participants from across the continents. I could apply the knowledge I gained from this course to my projects right away.” Satoshi Hashimoto, Account Manager, Coca-Cola Business Services Company, Ltd., JAPAN “The course was a great survey of topics directly relevant to challenges we face daily, and served as a fantastic launching point for further learning.” Jairo Lozano, Chief Implementation and Production Director, Senseta, COLOMBIA “MIT offers up a very relevant course that exposes the myths, challenges, and right approaches to solving Big Data problems.” Sanjeev Katariya, Director of Engineering, Microsoft Corporation, UNITED STATES “The course improved my understanding of how Big Data can boost a company’s performance. As a management consultant in an IT firm, I’m now far better positioned to help my clients understand how to leverage Big Data to their benefit.” Felipe A. Bustos, Business Manager, Everis Business Consulting, CHILE “The course material/lectures were very useful, and covered a wide array of related topics to explore. I enjoyed doing the course and found the course material/lectures way beyond my expectation in a positive way.” Srinivas Veereshwara, Technical Leader Leader, Cisco Systems Inc., UNITED STATES “Participants provided so many valuable resources throughout the class. Their comments, knowledge, and contributions were extraordinary. I connected with some of them offline to exchange practical experiences about various methods and software. We continue to do so, via our FB group page and LinkedIn Group.” Alina Tousain, Senior Management Consultant, Plante Moran, UNITED STATES “This course helped me to obtain a better and wider vision of the issues related to the world of Big Data. Now, thanks to this acquired knowledge, I have a whole new perspective on the steps that should be applied to Big Data projects, and I can make better decisions in all my business tasks.” Adrià López, Project Manager, e-laCaixa, SPAIN PARTICIPANTS’ COMMENTS TACKLING THE CHALLENGES OF BIG DATA REGISTER NOW > HTTPS://MITPROFESSIONALX.EDX.ORGPARTICIPANTS’ COMMENTS “The course provides an end-to-end view of what disciplines and specialties are involved in Big Data solutions, and stimulates participants to explore the most recent research on the subject.” Alexandre Lima, Technical Delivery Manager, Hewlett Packard, BRAZIL “As a CTO, I really appreciated being brought up to speed on the many aspects of a fast-moving tech area. The in-depth discussions of the typical use cases, differentiators, and pros & cons of each technology were very valuable and more objective and insightful than all the buzzy, best-foot-forward marketing hype that seems to surround every product.” Mark Paquette, CTO, thedatabank, inc., UNITED STATES “The MIT course on Big Data has proven to be a very complete course. It offers not only the opportunity to delve into the different components of the Big Data ecosystem, but also to gain significant insights through exchanges with fellow students. A must do!” Jurgen Jannssens, Senior Consultant, TETRADE Consulting, BELGIUM “I left the course with a big toolbox to handle data strategies which have made a huge impact on our small startup company. The knowledge I gained from this course has saved us hundreds of hours of work.” Tommy Otzen, CEO, Networker.net, DENMARK “I have taken many technical courses, and this course has given me a much broader view of the possibilities for projects with Big Data.” Cesar Siqueira, Advisory IT Specialist, IBM of Brazil, BRAZIL “The course takes you through the vastness of Big Data technologies, processes, algorithms, and architectural approaches and provides you with the building blocks of a Big Data strategy for your project/company. The greatest professors of MIT join their forces in order to demystify what Big Data really is, from advanced GPU clusters to data cleaning processes. The course is bold, straight to the point, detailed, and lives up to the reputation of what is probably the greatest engineering university in the world.” Vlad Marin, Big Data Architect, Airbus S.A.S., FRANCE “I thought the course positively impacted me. Having the information condensed and delivered in a comprehensive and intelligent way was a huge asset. It helped me understand the power and complexities in the world of Big Data.” Mimi Slaughter, COO, Tower 3 Ventures, UNITED STATES “I was working with Big Data previously, testing Big Data use cases with my team of graduate interns, but I was missing some new developments and structured information since I left university 9 years back. Having attended this course, I am now able to remove the gaps, become aware of what is going on in research and academics, and I have better insight into the problems with Big Data. With this certificate, people across departments now recognize me as an SME.” Hemant Kumar, Associate Architect in Advance Analytics and Big Data, IBM Global Services, SINGAPORE “The course gave us very useful, state-of-the-art knowledge about the subject. It helped us steer our research project about online social network analysis in the right direction, which saved us a lot of time!” Thijs Waardenburg, MSc, Researcher/lecturer, University of Applied Sciences Utrecht, THE NETHERLANDS TACKLING THE CHALLENGES OF BIG DATA REGISTER NOW > HTTPS://MITPROFESSIONALX.EDX.ORG La Chaire Accenture Strategic Business Analytics de l’ESSECLa création de nouvelles opportunités par l’analyse des données Dans le monde numérique actuel, l’analyse des données est au cœur des réseaux sociaux et des technologies mobiles et cloud. Elle permet aux entreprises de mieux exploiter les informations dont elles disposent pour en tirer des enseignements à même d’améliorer leurs résultats sur le long terme. Ce marché est immense, et ne cesse de se développer. Actuellement estimé à 40 milliards de dollars, il croît de 15 % par an. Les entreprises n’ont jamais eu autant de données à leur disposition. En 2011, des études ont montré que 1,8 zétaoctets (soit 1800 milliards de gigaoctets) avaient été générés en un an. Les chercheurs pensent que ce volume devrait atteindre 35,2 zétaoctets en 2020. Devant cette masse d’information sans cesse croissante, le besoin en expertise analytique est de plus en plus pressant. Certaines études estiment que le nombre de postes d’experts des données à pourvoir en 2018 pourrait atteindre 140 000, voire 180 000 personnes. (Source : données préliminaires IDC BA Services Forecast pour ACN, 5 fév. 2013). La Chaire Accenture Strategic Business Analytics de l’ESSEC a été créée pour répondre à deux types de besoins de ce marché : la nécessité d’être capable de tirer un enseignement pertinent de ces données tout en disposant d’un niveau d’expertise et de compétences d’analyses nécessaires à ces processus. Pour réussir dans l’univers numérique, les entreprises doivent non seulement collecter des données, mais aussi en tirer des enseignements exploitables qui leur permettent de générer des résultats sur le long terme afin de rester compétitives. Les entreprises doivent apprendre à extraire la véritable intelligence que leurs systèmes de Business Intelligence (BI) peuvent leur fournir. La Chaire Accenture Strategic Business Analytics de l’ESSEC qualifie cette approche de Business Intelligence adaptée aux problématiques des organisations. ™ Le premier objectif de la Business Intelligence est d’identifier les bonnes informations au bon moment et au bon endroit, afin d’améliorer et d’optimiser la performance de l’organisation et de ses prises de décision. ™ Mais la réalité de la Business Intelligence est souvent bien éloignée de ce concept. Trop souvent, les dirigeants l’envisagent comme un fichier statique de lignes de données et rarement comme un moyen de contextualiser l’information, encore moins comme un véritable outil à la décision. Les données sont de plus en plus intégrées aux opérations quotidiennes des entreprises et elles deviennent par là même des éléments essentiels à la compréhension d’un métier. Elles doivent donc être analysées à la lumière de l’expérience concrète. Les académiques et les chercheurs doivent donc se rapprocher des spécialistes de terrain qui ont une expérience pratique du marché, et comprendre clairement comment les données influencent les organisations du secteur public et les entreprises. La Chaire Accenture Strategic Business Analytics de l’ESSEC a été créée afin d’encourager une meilleure compréhension des impacts du numérique sur l’économie, sur les entreprises et les administrations, et sur la vie quotidienne. Elle vise également à identifier les compétences nécessaires à une parfaite maîtrise des enjeux actuels et émergents. Armée de cette connaissance, la Chaire formera les « Digital Architects » de demain, des individus capables de mettre en œuvre cette approche multisectorielle, en lien avec les problématiques réelles des organisations, et tournée vers le résultat. Jean-Michel Blanquer Dean and President, groupe ESSEC Pierre Nanterme Chairman & CEO, AccentureUne approche originale Le développement d’une stratégie transverse à l’entreprise L’ESSEC et Accenture voient le Business Analytics comme un moteur de croissance qui va révolutionner la façon dont les entreprises interagissent avec leurs clients, mais aussi la façon dont les différents éléments de ces entreprises interagissent entre eux. Dans ce sens, outre les besoins en compétences statistiques et informatiques, l’analyse de données nécessite une connaissance métier et une capacité à transmettre l’information obtenue d’une manière intelligible pour obtenir des résultats positifs. Cela implique de collecter des données (relatives par exemple aux clients, aux concurrents et aux tendances) et d’appliquer des méthodes et modèles statistiques, mais aussi de pouvoir les mettre en relation avec les problématiques liées aux métiers et de tirer les enseignements de ces analyses afin de les transmettre à ceux qui prendront et appliqueront les décisions. Les projets de Business Analytics ont un caractère transversal : les données collectées par un service informatique peuvent être utiles aux services Finance ou Marketing. Elles peuvent ainsi contribuer à définir la stratégie des Opérations ou des Ventes. La gestion d’un projet d’analyse des données est donc difficile à aborder, mais cruciale. Or, la plupart des entreprises ne disposent pas des processus, des compétences, de l’organisation ni des technologies nécessaires à la mise en œuvre de ces projets transversaux. La Chaire Accenture Strategic Business Analytics de l’ESSEC associe deux principes : L’interaction entre praticiens et académiques Pour développer des méthodologies et des modèles d’analyse des données rigoureux et pertinents mais aussi afin de tester l’utilité des technologies et des outils, il est essentiel d’utiliser des données réelles. Les chercheurs sont capables d’élaborer des méthodologies de pointe, mais leurs recherches sont souvent entravées par un accès limité aux données réelles. L’interaction entre les académiques et les praticiens dans ce domaine ouvre la porte à une véritable collaboration associant innovation, rigueur et pertinence. La définition des questions de recherche en collaboration entre praticiens et académiques garantit donc, d’une part, la cohérence avec l’état de l’art de la recherche et, d’autre part, la pertinence au regard des problématiques concrètes que les praticiens affrontent chaque jour et que le Business Analytics est appelé à résoudre. L’expert Business Analytics Statistique Informatique Métiers Communication Gestion de Projets Leadership Une approche stratégique du Business Analytics pour traiter les problématiques de Business Intelligence des entreprises et des administrations L’approche de la Chaire est de traiter les problématiques de Business Intelligence afin de répondre aux enjeux des entreprises et des administrations. Au cœur de cette approche, on trouve la volonté de s’assurer que les données d’une organisation sont traitées comme un atout. Que l’entreprise dispose des bonnes données, au bon moment et au bon endroit. Et que celles-ci permettent de tirer des conclusions claires qui amènent à des enseignements orientant les décisions métier d’une manière efficace et bénéfique. L’augmentation du nombre de prises de décisions basées sur l’analyse des données est une question de mentalité, de culture et d’organisation, mais aussi de processus, de structure et d’architecture informatique adaptés.Une expertise au service de la société Une recherche de pointe Notre équipe de chercheurs réalise des études innovantes, grâce à une approche transverse aux disciplines, aux secteurs d’activité et aux fonctions de l’entreprise. Transverse aux disciplines : En raison de la transversalité des projets de Business Analytics, nos chercheurs des départements marketing, systèmes d’information, management des opérations, stratégie, etc. participent conjointement aux projets de la Chaire. Transverse aux secteurs d’activité : Les travaux rassembleront des experts du monde de l’entreprise et de la recherche académique, en provenance de différents secteurs et pays. Transverse aux fonctions : Les données seront collectées par des spécialistes des technologies de l’information, analysées par des experts en statistique, et les résultats seront communiqués aux parties prenantes sous une forme pertinente et exploitable. Les partenariats de l’ESSEC avec d’autres écoles d’ingénieurs ou de statistiques, comme Centrale-Supélec ou l’ENSAE, contribueront à ces activités. Un périmètre international La dimension internationale est au cœur de la dynamique de la Chaire Accenture Strategic Business Analytics de l’ESSEC. L’école a des campus en Europe et en Asie, et a noué des partenariats avec des institutions prestigieuses, comme l’University of Mannheim Business School (Allemagne), Tuck School of Business at Dartmouth (États-Unis), School of Management Fudan University (Chine), FGV (Bresil), et Keio Business School (Japon). De son coté, Accenture compte près de 275 000 collaborateurs qui travaillent et opèrent dans plus de 200 villes et 56 pays. Les programmes pédagogiques associés Qu’est-ce qu’un « Digital Architect » ? Les Digital Architects sont des spécialistes à même d’exploiter les statistiques, l’analyse quantitative et les techniques de modélisation pour orienter ou prendre des décisions métier. L’intérêt croissant des entreprises pour la mise en pratique du Business Analytics a provoqué un écart entre les talents disponibles et la demande des entreprises. Grâce à la Chaire Accenture Strategic Business Analytics de l’ESSEC, les employeurs disposeront d’un vivier de talents nouvellement formés, dotés de compétences originales. Les étudiants auront accès aux programmes de formation de l’ESSEC liés au Business Analytics, et soutenus par les activités de la Chaire. Le premier programme associé à la Chaire, la filière « Strategic Business Analytics », fait partie du programme de la Grande Ecole. Elle a pour objectif de préparer les étudiants généralistes de la Grande Ecole aux fonctions Business Analytics. Une fois diplômés, les étudiants disposeront d’une expérience pratique des applications Business Analytics, qu’ils pourront mettre en œuvre dans le domaine des big data, du marketing stratégique, des opérations, et bien d’autres encore. En plus de ce programme Grande Ecole, il existe un Master en Business Analytics qui offre l’opportunité aux étudiants qui n’ont pas eu une formation en management d’acquérir des compétences sur ce sujet, tout en se spécialisant déjà aux métiers liés aux données.Activités La Chaire Strategic Business Analytics a pour ambition d’apporter un éclairage sur la manière dont le Business Analytics change notre société et les organisations, tout en proposant aux décideurs des solutions concrètes pour répondre à ces changements et atteindre leurs objectifs. Le périmètre d’action de la Chaire Accenture Strategic Business Analytics de l’ESSEC comprend : Le Club Le Club Strategic Business Analytics regroupe des directeurs (généraux, marketing, financier, etc.) de grandes entreprises françaises et internationales, ainsi que des représentants de l’ESSEC et Accenture. C’est un « Think Tank » sur la thématique Business Analytics. Ces décideurs collaborent avec les chercheurs afin d’alimenter le débat et contribuer à leurs réflexions. La Conférence annuelle Chaque année, la Chaire présente les résultats de ses recherches lors d’une conférence annuelle ouverte au grand public. En plus d’une communication autour d’activités récentes, cette conférence propose une plateforme de développement du réseau et d’interaction. Cette conférence offre l’opportunité à tous ceux qui sont intéressés par le Business Analytics de bénéficier du résultat de nos recherches, mais surtout d’échanger avec nos équipes. Les séminaires La Chaire Strategic Business Analytics organise aussi de nombreux séminaires tout au long de l’année (séminaires classiques, « petitsdéjeuners », débats, etc.). L’objectif est de rendre compte de l’état d’avancement des activités d’une manière régulière, et ce aux différents types d’audience qui pourraient être intéressés par nos travaux. Ces séminaires ont lieu sur les différents campus de l’ESSEC (Cergy, La Défense et Singapour), mais aussi au sein des bureaux d’Accenture à Paris ou ailleurs. Ils offrent aux participants l’opportunité d’entretenir une relation régulière avec les étudiants, les entreprises, l’Etat et la société civile dans son ensemble. Les publications Ces événements et activités sont nourris par des publications rédigées par des équipes de chercheurs de la Chaire Strategic Business Analytics -professeurs, doctorants et étudiants - en collaboration avec des partenaires externes dans certains cas. Certaines publications ont un caractère strictement académique. Toutefois, dans la mesure où l’objectif est d’éclairer le débat public, la Chaire propose des publications plus accessibles et développe des collaborations avec des Think Tanks externes à l’ESSEC et les médias.Organisation La Chaire Accenture Strategic Business Analytics de l’ESSEC associe la rigueur académique à la pertinence pratique en rassemblant des praticiens et des consultants issus de divers secteurs d’activité, en encourageant la collaboration entre les professeurs de différents départements et en jetant des passerelles entre la recherche, l’enseignement et le monde de l’entreprise, notamment par des études de cas. L’équipe Le professeur titulaire de la Chaire est Nicolas Glady, accompagné par Martine George, directrice exécutive de la Chaire, Jean-Pierre Bokobza, directeur exécutif au sein d’Accenture Analytics, et Fabrice Marque, directeur exécutif au sein de l’activité CRM d’Accenture. D’autres professeurs de l’ESSEC basés à Paris ou à Singapour, ainsi que des étudiants doctorants apporteront leur contribution aux recherches. Des professeurs étrangers visitants viendront occasionnellement compléter cette équipe. Enfin, des experts du secteur privé ou du secteur public contribueront aux projets d’une manière ponctuelle.Nicolas Glady est docteur en économétrie et professeur à l’ESSEC où il dispense des cours de Marketing Stratégique, Marketing Analytics et Marketing Management au sein de la Grande École et du programme doctoral. Ses travaux de recherche portent sur les techniques quantitatives au service de la stratégie et du marketing (Business Analytics), le big data et d’autres thèmes liés aux transformations numériques en général. Il est l’auteur de nombreuses publications académiques et conseille régulièrement des entreprises du secteur financier, de la grande distribution, de l’alimentaire, ou des nouvelles technologies. Gouvernance La Chaire est co-gérée par l’ESSEC et Accenture via son comité de pilotage. Le comité de pilotage oriente la stratégie du programme et comprend des directeurs exécutifs de grandes entreprises, des représentants de l’administration de l’ESSEC, de son corps enseignant, ainsi que les partenaires financiers du programme. Le Club joue le rôle de Think Tank de la Chaire Accenture Strategic Business Analytics de l’ESSEC. Constitué de directeurs de grandes entreprises, d’universitaires et de praticiens français et internationaux, experts des questions « Business Analytics », ce Club contribue à la réflexion sur les tendances du secteur et sur le rôle que doit jouer la Chaire Strategic Business Analytics. Martine George est docteur en sciences. Elle possède plus de 20 ans d’expérience professionnelle dont 15 passées à développer des équipes de Business Analytics au sein de grandes organisations de différents secteurs. Elle est régulièrement invitée comme speaker et expert dans des évènements relatifs à l’analytique à l’étranger. Passionnée par le développement des talents et des organisations en business analytics, elle est également coach certifiée ICF et facilitateur. Jean-Pierre Bokobza, Directeur exécutif d’Accenture, pilote les activités Analytics d’Accenture en Europe, Amérique latine et Afrique. Il était au préalable responsable des activités BPO (externalisation des processus métier) d’Accenture pour la même zone géographique. Jean-Pierre Bokobza est diplômé de l’Ecole nationale de l’aviation civile (ENAC) et pilote de ligne. Fabrice Marque, Directeur exécutif d’Accenture, dirige la ligne de service CRM en France. Il est également responsable des offres Transformation des services au niveau EALA (Europe et Amérique latine). Diplômé d’une école d’ingénieurs et d’une école de commerce (ESSEC), il titulaire d’un MBA de Cranfield University.ESSEC Depuis plus d’un siècle, l’ESSEC poursuit un projet pédagogique innovant plaçant l’individu au cœur de son modèle d’enseignement, promouvant les valeurs de liberté et d’ouverture, d’innovation et de responsabilité. Préparer les managers de demain à réconcilier intérêt personnel et responsabilité collective, intégrer à la réflexion une vision de l’intérêt général et mettre les défis économiques en perspective avec les enjeux sociaux sont quelques unes des missions que s’est fixé l’ESSEC. Pour plus d’informations, suivre @essec et consulter www.essec.edu Copyright © 2013 Accenture All rights reserved. Accenture, its logo, and High Performance Delivered are trademarks of Accenture. Accenture Analytics Accenture Analytics met à la disposition des entreprises des solutions analytiques ciblées pour leur permettre d’améliorer leurs performances. Ses capacités complètes vont de l’accès et du reporting sur les données jusqu’à la modélisation mathématique, la prévision et l’analyse statistique sophistiquée. Avec plus de 16 000 spécialistes de l’analytique, Accenture Analytics s’appuie sur une robuste expérience sectorielle, fonctionnelle, métier et technique pour concevoir des services de conseil et d’externalisation innovants destinés aux clients des secteurs publics et privés. Pour plus d’informations, suivre @ISpeakAnalytics et consulter http://www.accenture.com/analytics © Group ESSEC 2013 Big Data Alchemy: How can Banks Maximize the Value of their Customer Data?2 Banks are Struggling to Profit from Increasing Volumes of Data More than 70% of banking executives worldwide say customer centricity is important to them1 . However, achieving greater customer centricity requires a deeper understanding of customer needs. Our research indicates that only 37% of customers believe that banks understand their needs and preferences adequately (see Figure 1). This may be surprising given the increasing volume and variety of data that banks have about their customers. The Banks Have Not Fully Exploited the Potential of Customer Data frequent use of web and mobile channels has led to a steady increase in the number of customer interactions and, as a result, increasing volume of customer data. However, banks are only using a small portion of this data to generate insights that enhance the customer experience. For instance, research indicates that less than half of banks analyze customers’ external data, such as social media activities and online behavior. Further, only 29% analyze customers’ share of walleta , one of the key measures of a bank’s relationship with its customers2 . Figure 1: Customer Satisfaction across Five Core Areas of the Customer–Bank Relationship Source: Capgemini and EFMA, Retail Banking Voice of the Customer Survey, 2013. a) Customers’ share of wallet is the percentage of financial services products customers have with a particular bank relative to all of the financial services products they hold. 60% of financial institutions in North America believe that big data analytics offers a significant competitive advantage and 90% think that successful big data initiatives will define the winners in the future. Knowledge of Customer Product-Channel Fit Intimacy and Relationship Building Consistent Multi-Channel Experience Trust and Confidence % of respondents Satisfied Not Satisfied Unsure 43% 13% 43% 37% 47% 16% 36% 51% 13% 44% 12% 44% 45% 12% 43%3 It is certainly strange given that the value of big data is clear to business leaders across the financial services industry. Over 60% of financial institutions in North America, for instance, believe that big data analytics offers a significant competitive advantage. Additionally, over 90% believe that successful big data initiatives will determine the winners of the future3 . However, knowledge of the impact of big data has not translated to on-the-ground investments. For instance, only 37% of Figure 2: Big Data Adoption Levels in Banks Source: Microsoft and Celent, How Big is Big Data: Big Data Usage and Attitudes among North American Financial Services Firm, March 2013. Big data maturity levels (% of respondents) Exploring Experimenting Deploying Expanding 38% 25% 12% 37% 63% 25% Exploring Experimenting Deploying Expanding Only 37% of banks have hands-on experience with live big data implementations, while the majority of banks are still focusing on pilots and experiments. banks have hands-on experience with live big data implementations, while the majority of banks are still focusing on pilots and experiments (see Figure 2). In the next section, we examine some of the reasons for this gap between the clear case for action and the will to achieve it. 4 Our research shows that ‘organizational silos’ are the biggest barrier to success in big data. Dearth of analytics talent, high cost of data management, and a lack of strategic focus on big data are also major stumbling blocks (see Figure 3). Finally, privacy concerns – which are high on many bank executives’ agendas – are also a significant issue. Silos of Data Block a Single Customer View Customer data typically resides in silos across lines of business or is distributed across systems focused on specific functions such as CRM, portfolio management and loan servicing. As such, banks lack a seamless 360-degree view of the customer. Further, many banks have inflexible legacy systems that impede data integration and prevent them from generating a single view of the customer. For instance, Deutsche Bank embarked on a big data project to analyze a large amount of unstructured data, but faced difficulties in the extraction of data from legacy systems, and their integration with big data systems (see insert on Page 5). Why are Banks Unable to Exploit Big Data? Figure 3: Key Impediments to Big Data Success Source: Capgemini and the Economist Intelligence Unit, The Deciding Factor: Big Data and Decision-making, 2012. Organizational silos constitute the top barrier to success in big data. 57% 44% 40% 34% 33% 24% 17% Time taken to analyze large data sets Shortage of skilled people for data analysis Big data is not viewed sufficiently strategically bysenior management Unstructured content in big data is too difficult to interpret The high cost of storing and analyzing large data sets Big data sets are too complex to collect and store Too many "silos" - data is not pooled for the benefit of the entire organization What are your organization’sthree biggest impedimentsto using big data for effective decision-making (select up to three)? % of respondents5 Big Data Plans at Deutsche Bank Held Back due to Legacy Infrastructure Deutsche Bank has been working on a big data implementation since the beginning of 2012 in an attempt to analyze all of its unstructured data. However, problems have arisen while attempting to unravel the traditional systems – mainframes and databases, and trying to make big data tools work with these systems. The bank has been collecting data from the front end (trading data), the middle (operations data) and the back-end (finance data). Petabytes of this data are stored across 46 data warehouses, where there is 90% overlap of data. It is difficult to unravel these data warehouses that have been built over the last two to three decades. The data integration challenge and the significant investments made by the bank in traditional IT infrastructure pose a key question for the bank’s senior executives – what do they do now with their traditional system? They believe that big, unstructured and raw data analysis will provide important insights, mainly unknown to the bank. But they need to extract this data, streamline it and build traceability and linkages from the traditional systems, which is an expensive proposition. Source: Computerworld UK, Deutsche Bank: Big data plans held back by legacy systems, February 2013. The Skills and Development Gap Needs Closing Banks need new skill sets to benefit from big data analytics. New data management skills, including programming, mathematical, and statistical skills go beyond what is required for traditional analytics applications. For instance, ‘data scientists’ need to be not only well versed in understanding analytics and IT, they should also have the ability to communicate effectively with decision makers. However, this combination of skills is in short supply4 . Three-quarters of banks do not have the right resources to gain value from big data5 . Banks also face the challenge of training end-users of big data, who may not be data experts themselves but need to use data to enhance decision-making. Lack of Strategic Focus: Big Data Viewed as Just Another ‘IT Project’ Big data requires new technologies and processes to store, organize, and retrieve large volumes of structured and unstructured data. Traditional data management approaches followed by banks do not meet big data requirements. For instance, traditional approaches hinge on a relational data model where relationships are created inside the system and then analyzed. However, with big data, it is difficult to establish formal relationships with the variety of unstructured data that comes through. Similarly, most traditional data management projects view data from a static and/or historic perspective. However, big data analytics is largely aimed to be used in a near real-time basis. While most IT projects are driven by the twin facets of stability and scale, big data demands discovery, ability to mine existing and new data, and agility6 . Consequently, by taking a traditional ITbased approach, organizations limit the potential of big data. In fact, an average company sees a return of just 55 cents on every dollar that it spends on big data7 . Privacy Concerns Limit the Adoption of Customer Data Analytics The use of customer data invariably raises privacy issues8 . By uncovering hidden connections between seemingly unrelated pieces of data, big data analytics could potentially reveal sensitive personal information. Research indicates that 62% of bankers are cautious in their use of big data due to privacy issues9 . Further, outsourcing of data analysis activities or distribution of customer data across departments for the generation of richer insights also amplifies security risks. For instance, a recent security breach at a leading UK-based bank exposed databases of thousands of customer files. Although this bank launched an urgent investigation, files containing highly sensitive information — such as customers’ earnings, savings, mortgages, and insurance policies — ended up in the wrong hands10. Such incidents reinforce concerns about data privacy and discourage customers from sharing personal information in exchange for customized offers. So how can banks effectively overcome these challenges? What are some of the key areas that they should focus on? In the next section, we discuss some starting points for banks in their big data journey. An average company sees a return of just 55 cents on every dollar that it spends on big data.6 Banks that apply analytics to customer data have a fourpercentage point lead in market share over banks that do not. Customer Data Analytics is a Low Priority Area for Banks Most banks have not focused significant energy on using analytics to enhance customer experience. Our survey with the EFMA indicates that risk management has been a high-priority focus area for most banks, mainly to comply with regulatory requirements, while customer analytics has largely been neglected (see Figure 4)11. Customer Analytics has Proven Benefits from Acquisition to Retention Processes Research showed that banks that apply analytics to customer data have a four-percentage point lead in market share over banks that do not. The difference in banks that use analytics to understand customer attrition is even more stark at 12-percentage points12. We believe banks can maximize the value of their customer data by leveraging big data analytics across the three key areas of customer retention, market share growth and increasing share of wallet (see Figure 5). Big Data Analytics Helps Maximize Lead Generation Potential Big data solutions can help banks generate leads for customer acquisition more effectively. Take the case of US Bank, How Can Banks Realize Greater Value From Customer Data? Figure 4: Banks have Limited Focus and Capabilities around Customer Analytics Source: Capgemini and EFMA, World Retail Banking Report, 2013. the fifth largest commercial bank in the US. The bank wanted to focus on multichannel data to drive strategic decisionmaking and maximize lead conversions. The bank deployed an analytics solution that integrates data from online and offline channels and provides a unified view of the customer. This integrated data feeds into the bank’s CRM solution, supplying the call center with more relevant leads. It also provides recommendations to the bank’s web team on improving customer engagement on the bank’s website. As a result, the bank’s lead conversion rate has improved by over 100% and customers receive an enhanced and personalized experience. The bank also executed three major website redesigns in 18 months, using data-driven insights to refine website content and increase customer engagement13. Advanced Analytics Improves Credit Risk Estimation by Exploring Diverse Datasets Assessing risks and setting the right prices are key success factors in the competitive retail banking market. Existing scoring methodologies, mainly FICO scoresb , assess credit worthiness based solely on a customer’s financial history. However, in order to ensure a more comprehensive assessment, credit scores should also include additional variables such as demographic, financial, employment, and behavioral data. By using advanced predictive analytics based on these additional data points, banks can significantly enhance their credit scoring mechanisms. Bank’s Current Priorities High Bank’s Self-Assessed Capabilities Low High Risk Management Fraud Analytics Financial Reporting Portfolio Analytics Low Pricing Channel Analytics Sales Analytics Customer Analytics Marketing Analytics b) FICO score is the most widely used credit score model in the US. It takes into account factors in a person’s financial history such as payment history, credit utilization, length of credit, types of credit used, and recent searches for credit. 7 Figure 5: How can Big Data Analytics Help Banks Maximize Value from Customer Data? Source: Capgemini Consulting analysis. At US Bank, analytics enabled a single customer view across online and offline channels, which improved the bank’s lead conversion rate by over 100%. Grow Share of Wallet Big Data Analytics Improve Credit Risk Estimation Maximize Lead Generation Potential Acquire Customers Retain Customers Limit Customer Attrition Improve Customer Satisfaction Drive Efficiency of Marketing Programs Increase Sales Through Predictive Analysis For instance, although ‘current account’ balance levels and volatility are good indicators of financial robustness and stability, transaction drill-down analysis provides in-depth insights about customers. It enables the segmentation of customers based on spending behavior. Several start-ups are also leveraging social network data to score customers based on credit quality. These include Zest Finance and Kreditech14. Other startups such as LendUp and Lendo even provide loan services based on social network data15. ‘Next Best Action’ Analytics Models Unlock Opportunities to Drive Top Line Growth From ‘next best offer’ to cross-selling and up-selling, the insights gleaned from big data analytics allows marketing professionals to make more accurate decisions. Big data analytics allows banks to target specific micro customer segments by combining various data points such as past buying behavior, demographics, sentiment analysis from social media along with CRM data. This helps improve customer engagement, experience and loyalty, ultimately leading to increased sales and profitability. Predictive Analytics can Improve Conversion Rates by Seven Times and Top-line Growth Ten-fold We studied the impact of using advanced, predictive analytics on marketing effectiveness for a leading European bank. The bank shifted from a model where it relied solely on internal customer data in building marketing campaigns, to one where it merged internal and external data sets and applied advanced analytics techniques to this combined data set. As a result of this shift, the bank was able to identify and qualify its target customers better. In fact, conversion rates of prospects increased by as much as seven times16. In another instance, a European bank built a ‘propensity to save’ model that predicts the probability of its customer base to invest in savings products, which in turn leads to increased cross-selling. The input to this model included data sets of 1.5 million customers with over 40 variables. The analytics team tested over 50 hypotheses through logistic regression propensity models to calculate the probability of savings for each customer. The pilot branches where this model was implemented witnessed a 10x increase in sales and a 200% growth in conversion rate over a two-month period compared to a reference group17. Big Data Analytics Helps Banks Limit Customer Attrition A mid-sized European bank used data sets of over 2 million customers with over 200 variables to create a model that predicts the probability of churn for each customer. An automated scorecard with multiple logistic regression models and decision trees calculated the probability of churn for each customer. Through early identification of churn risks, an outflow of nearly 30 million per year was avoided18.8 How Can Banks Realize Greater Value From Customer Data? Advanced analytics increased the conversion of prospects by Drive Share of Wallet Limit Customer Attrition 2 million customers across 200+ variables Developed automated scorecards and multiple logistic regression models and decision trees avoid an outflow of about Analyzed over Early identification of cancellation risks helped €30 Million Acquire New Customers (Internal data) (Internal data and External data) Conventional Analytics Advanced Analytics The data input included increase in sales and 200% 10x growth in 1.5 Mn customer data A B C D for the product in scope across 40 variables 7 times conversion rate Leading European bank European bank Mid-sized bank 9 Bank of America Leverages Big Data Analytics to Deliver Consistent Customer Experience and Detect Risks Early Needs or Events-Based Marketing Bank of America is focusing on big data with an emphasis on an integrated approach to customers and internal operations. The key objective of its big data efforts is understanding the customer across all channels and interactions, and presenting consistent, appealing offers to well-defined customer segments. For example, the bank utilizes transaction and propensity models to determine which of its primary relationship customers may have a credit card, or a mortgage loan that could benefit from refinancing. When the customer accesses the bank’s online channel, calls a call center, or visits a branch, that information is available to the online app, or the sales associate to present the offer. The bank has launched a program called ‘BankAmeriDeals’, which provides cash-back offers to holders of the bank’s credit and debit cards based on analyses of where they have made payments in the past. Risk Management The bank moved from a shared-services data modeling environment to a dedicated ‘Grid Computing’ platform to drive operational efficiency by early detection of high-risk accounts. The initiative is benefiting the bank in several ways, such as reducing its loan default calculation time for a mortgage book of more than 10 million loans from 96 hours to just four. The bank is also able to process ad hoc jobs at three times the speed of the previous environment. Governance Structure The bank modified its organizational structure in line with big data initiatives. The bank historically employed several quantitative analysts, but in order to support its big data initiatives, the bank consolidated dispersed analytics talent. The bank also set up matrix reporting lines from its analytics teams to a central analytics group as well as business units. This has improved visibility and reusability of initiatives along with providing customized services specific to a function or a business unit. Source: International Institute for Analytics and SAS, “Big Data in Big Companies”, May 2013. Given that there are numerous avenues for the application of customer data analytics, where and how should banks begin? In the next and concluding section, we present a structured approach for banks to industrialize their big data efforts across the organization. 10 How Can Banks Scale-up to the Next Level of Customer Data Analytics? Transformation across Culture, Capabilities and Technology is Critical for the Success of Big Data Initiatives In order to graduate to higher levels of maturity in customer data analytics, banks will need to build the right organizational culture and back it up with the right skill sets and technological components (see Figure 6). Drive a Shift from a ‘Data as an ITasset’ to a ‘Data as a Key Asset for Decision-Making’ Culture Effective big data initiatives require cultural changes within the organization and a concerted shift towards a datadriven behavior. To drive successful big data programs, banks should strive towards full executive sponsorship for analytics initiatives, develop and promote a company-wide analytics strategy, and embed analytics into core business processes. In essence, banks need to graduate towards a model where analytics is a company-wide priority and an integral element of decision-making across the organization. Develop Analytics Talent with a Targeted Recruitment Process and Continual Training Programs As a first step towards building expertise in customer data analytics, banks will need to establish a well-defined Figure 6: Roadmap to Building Analytics Maturity Source: Capgemini Consulting. recruitment process to attract analytics talent. Further, disparate analytics teams should be consolidated into an Analytics Centre of Excellence (CoE) that promotes the sharing of best practices and supports skills development. Banks must also invest in continually training their analytics staff on new tools and techniques. Finally, specialized training programs should be developed for line of business personnel, to train them in the use of analytics to enhance decision-making. Beginner Culture Proficient Level of Maturity Expert Preliminary analytics strategy, but little buy-in from leadership Analytics used to understand issues, develop data-based options across the business Full executive sponsorship of analytics Capabilities & Operating Model Technology Pockets of reporting and analysis capability Mass/random targeting of customers to increase product profitability using basic product eligibility criteria Sample Applications of Customer Data Analytics Well-defined recruitment process to attract analytics talent Analytics Centre of Excellence to promote best practices Dispersed talent Budget for analytics training Use of some statistical and forecasting tools Strategic partnerships for supplementary analytics skills Data No defined data infrastructure Data available for existing and potential customers Internal, external and social media data is merged to build an integrated and structured dataset Conflicting, informal and dispersed data Most data is still unstructured and internal Poor data governance Basic data reporting using mainly spreadsheet based tools Coherent procedures for data management Basic profiling of customer base with customized analysis on drivers of purchase of each product individually Established, robust master data management framework for structured and unstructured data sets Analyzing customer behavior across channels to predict interest areas; developing personalized products and services11 Figure 7: Key Steps to Effective Big Data Initiatives Source: Capgemini Consulting. Establish a Strong Data Management Framework for Structured as well as Unstructured Data The quality, accuracy, and depth of customer data determine the value of customer insights. Consequently, banks will need to establish robust data management frameworks to formalize the collection, storage and use of structured as well as unstructured data. Additionally, banks must graduate to more advanced analytics techniques such as predictive and prescriptive analytics that enable more precise modeling of customer behavior. These in turn will drive increased cross-selling opportunities, pricing optimization and targeted offerings. Move Up the Analytics Maturity Curve with Three Sequential Controlled Steps Big data initiatives are typically time and resource-intensive. To pave the way for a smooth implementation, we recommend a three-step approach that begins with an assessment of existing analytics capabilities (see insert on Page 12) and is followed by the launch of pilot projects, which are subsequently expanded into full-scale organization-wide programs (see Figure 7). A capability assessment at the beginning of a big data program will provide banks with a view of analytics capability gaps that are holding them back, such as untapped data assets and key external data sets that are required to create a holistic view of the customer. With a clearer view of capability gaps, banks will be better placed to prioritize their actions and investments. Following a capability assessment, we recommend that banks undertake their transformation journey in controlled steps, rather than in a giant leap. As such, banks should first identify and focus on a few small pilot projects, and use these as opportunities to test the efficacy of new analytics tools and techniques. For instance, Rabobank, the Netherlandsbased banking and financial services company, started its big data initiative with a clear goal – to improve efficiency in business processes by analyzing customer data (see insert on Page 13). Based on the learning from a pilot project, banks can modify how they manage big data, add more complexity to use cases and subsequently rollout big data initiatives across the organization. Assess Big Data Analytics Capabilities Begin with a Pilot Big Data Use Case Extend Big Data Initiatives across Organization Stage 1 Stage 2 Stage 3Assess Your Big Data Maturity For each answer, select the option that you most closely relate with your organization 1 3 5 Do you have the right culture for driving big data analytics? Would you describe your organisation as datadriven? No, we largely rely on intuition We use limited analytics to develop data-based decision options for the business Collection and analysis of data underpins our business strategy and day-to-day decision making How important will big data be to decision-making in your organisation in the next five years? We are not yet impacted To a limited extent We expect big data to be a key component of decision-making going forward How do your business and IT teams operate? Both teams operate separately, with the business team giving guidelines and IT implementing Business and IT teams come together, but only for key projects driven from the top We have joint steering committees where business and IT teams work together as one team Does your organization have the capabilities for benefiting from big data? What is your investment level in analytics capabilities? We largely use adhoc tools based on individual experience with data analysis We have analytics teams in different business units who largely work independently We have a centralized analytics team that constantly invests in skill upgradation and works with smaller capability groups across the company How do you develop big data analytics capabilities? We rely solely on in-house trainings We rely on a mix of in-house and external trainings from third-party institutions such as universities We have multiple partnerships with specialist analytics firms that help in building long-terms capabilities in-house Do you have the right data that big data analytics demands? How structured are your datasets? We don’t have a defined data policy We have data availability, but in silos, and most data is limited to existing and some potential customers We rely on structured internal data sets, and combine them with external data sets. We then integrate them with social media to create a merged and integrated dataset that gives us a single view of the customer How do you deal with growing data volume? We haven’t developed a defined policy on handling growing datasets For those datasets that we have been tracking, we rely on historical growth volumes, while factoring in additional volume from external datasets We have well-defined systems and policies to cope with the explosion in datasets that we are already seeing Do you have the technology to ensure the success of big data Analytics? What tools do you use for big data analytics? We don’t use tools specific to big data. We use traditional tools that we have used for analytics in the past We use some big data tools based on the dataset, but haven’t standardized on their usage across the organization We have a full suite of integrated technology driven tools that enables us to do both predictive and prescriptive analytics on customer data How do you manage your data sets? Most teams within the company manage data in their own formats We have some data management guidelines, but they are not fully implemented yet We have established, robust master data management framework for structured and unstructured data sets Overall Score (0 - 45) Big Data Maturity Overall Score <9: Beginner, 10-30: Proficient, >30: Expert13 Rabobank Embarked on a Big Data Journey by Adopting a ‘Start Small and Add More Complexity Step-by-Step’ Strategy Rabobank named big data as one of the 10 most important trends in their 2013 yearly report and started developing a strategy around it. They created a list of 67 possible big data use cases, divided them into four categories – fix organizational bottlenecks, improve efficiency in business processes, create new business opportunities and develop new business models. For each of these categories they measured IT impact, time required for implementation, and business value proposition. The bank moved ahead with big data applications for the improvement of business processes due to their low IT impact and the possibility of a positive ROI. Rabobank started with a few proof-of-concepts using only internal data. Later, the bank extended the scope of its big data program to include web data (click behavior), social network data, public data from government sources and macrotrend data. The bank built small clusters using open-source technology to test and analyze unstructured data sets, which kept costs low and offered the scalability to expand. A dedicated multidisciplinary team was setup to implement big data use cases. The team experimented with small and short implementation cycles. One of the use cases at Rabobank involved analyzing criminal activities at ATMs. Rabobank found that the proximity of highways, and the season and weather conditions increased the risk of criminal activities. The bank also used big data tools to analyze customer data to find the best locations for ATMs. Based on its initial success with big data analytics, Rabobank is now focusing on addressing more pressing big data issues around privacy concerns and data ownership. Source: BigData-Startups.com, With Proof of Concepts, Rabobank Learned Valuable Big Data Lessons, 2013. Implementation challenges remain the biggest hurdles towards the effective use of customer data analytics by banks. While pilots deliver quick and measurable results, banks need to concurrently lay the foundations to effectively scale-up big data initiatives. The key lies in adopting a comprehensive approach, where pilots are backed by a well-defined data strategy and data governance model. The first step towards such an approach lies in altering traditional mindsets. Big data initiatives must be perceived differently from traditional IT programs. They must extend beyond the boundaries of the IT department and be embraced across functions as the core foundation for decision-making. Only then will banks be able to make the best use of their vast and growing repositories of customer data.1 SAP and Bloomberg Businessweek Research Services, “Banks Betting Big on Big Data and Real-Time Customer Insight”, September 2013 2 BBRS 2013 Banking Customer Centricity Study, 2013 3 Microsoft and Celent, “How Big is Big Data: Big Data Usage and Attitudes among North American Financial Services Firms”, March 2013 4 MIT Sloan Management Review and SAS, “How ‘Big Data’ is Different”, July 2012 5 Finextra Research, Clear2Pay, NGDATA, “Monetizing Payments: Exploiting Mobile Wallets and Big Data”, 2013 6 MIT Sloan Management Review and SAS, “How ‘Big Data’ is Different”, July 2012 7 Wikibon, “Enterprises Struggling to Derive Maximum Value from Big Data”, September 2013 8 O’Reilly Media, “EBook: Big Data Now”, October 2012 9 Finextra Research, Clear2Pay, NGDATA, “Monetizing Payments: Exploiting Mobile Wallets and Big Data”, 2013 10 Mail Online, “Exposed: Barclays account details for sale as ‘gold mine’ of up to 27,000 files is leaked in worst breach of bank data EVER”, February 2014 11 Capgemini, “World Retail Banking Report”, 2013 12 Aberdeen, “Analytics in Banking”, July 2013 13 US Bank Case Study by Adobe, 2012 14 The Economist “Lenders are Turning to Social Media to Assess Borrowers”, February 2013 15 Slate, “Your Social Networking Credit Score”, January 2013 16 Capgemini Consulting analysis 17 Capgemini Consulting analysis 18 Capgemini Consulting analysis ReferencesJean Coumaros Head of Financial Services Global Market Unit jean.coumaros@capgemini.com Jerome Buvat Head of Digital Transformation Research Institute jerome.buvat@capgemini.com Olivier Auliard Chief Data Scientist, Capgemini Consulting France oliver.auliard@capgemini.com Subrahmanyam KVJ Manager, Digital Transformation Research Institute subrahmanyam.kvj@capgemini.com Stanislas de Roys Head of Banking Market Unit stanislas.deroys@capgemini.com Laurence Chretien Vice President, Big Data and Analytics laurence.chretien@capgemini.com Vishal Clerk Senior Consultant, Digital Transformation Research Institute vishal.clerk@capgemini.com Authors For more information contact Digital Transformation Research Institute dtri.in@capgemini.com The authors would also like to acknowledge the contributions of Ingo Finck from Capgemini Consulting Germany, Sebastien Podetti from Capgemini Consulting France, Tripti Sethi from Capgemini Consulting Global, Steven Mornelli and Rajas Gokhale from Capgemini Financial Services Global Business Unit and Roopa Nambiar and Swati Nigam from the Digital Transformation Research Institute. Germany/Austria/Switzerland Titus Kehrmann titus.kehrmann@capgemini.com France Stanislas de Roys stanislas.deroys@capgemini.com Spain Christophe Mario christophe.mario@capgemini.com Global Jean Coumaros jean.coumaros@capgemini.com Norway Jon Waalen jon.waalen@capgemini.com United Kingdom Keith Middlemass keith.middlemass@capgemini.com United States Jeff Hunter jeff.hunter@capgemini.com BeNeLux Robert van der Eijk robert.van.der.eijk@capgemini.com India Natarajan Radhakrishnan natarajan.radhakrishnan@capgemini.com Sweden/Finland Johan Bergstrom johan.bergstrom@capgemini.comRightshore® is a trademark belonging to Capgemini Capgemini Consulting is the global strategy and transformation consulting organization of the Capgemini Group, specializing in advising and supporting enterprises in significant transformation, from innovative strategy to execution and with an unstinting focus on results. With the new digital economy creating significant disruptions and opportunities, our global team of over 3,600 talented individuals work with leading companies and governments to master Digital Transformation, drawing on our understanding of the digital economy and our leadership in business transformation and organizational change. Find out more at: http://www.capgemini-consulting.com/ With more than 130,000 people in over 40 countries, Capgemini is one of the world’s foremost providers of consulting, technology and outsourcing services. The Group reported 2013 global revenues of EUR 10.1 billion. Together with its clients, Capgemini creates and delivers business and technology solutions that fit their needs and drive the results they want. A deeply multicultural organization, Capgemini has developed its own way of working, the Collaborative Business ExperienceTM, and draws on Rightshore®, its worldwide delivery model. Learn more about us at www.capgemini.com About Capgemini and the Collaborative Business Experience Capgemini Consulting is the strategy and transformation consulting brand of Capgemini Group. The information contained in this document is proprietary. © 2014 Capgemini. All rights reserved. Customer Value Analytics Capgemini Consulting’s Customer value analytics solution identifies levers of profit improvement and growth across online and offline channels for clients, leveraging customer behavioural and preference patterns. The solution is sector-specific, and has specific modules developed for the Banking, Automotive & Insurance industries. The solution spans the entire customer journey, providing clients multiple opportunities to drive their top line through increased acquisition, an expanding share of wallet, demand forecasting and reduction of customer attrition. Several pre-built components like ready to use analytical platforms, proof of concept and data diagnostic methodologies, pre-fabricated models and use cases allow for quick deployment in project delivery. WHITE PAPER Big Data Meets Big Data Analytics Three Key Technologies for Extracting Real-Time Business Value from the Big Data That Threatens to Overwhelm Traditional Computing ArchitecturesSAS White Paper Table of Contents Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1 What Is Big Data? . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2 Rethinking Data Management . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3 From Standalone Disciplines to Integrated Processes . . . . . . . . . . . . 3 From Sample Subsets to Full Relevance . . . . . . . . . . . . . . . . . . . . . . . 4 Three Key Technologies for Extracting Business Value from Big Data . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5 Information Management for Big Data . . . . . . . . . . . . . . . . . . . . . . . . . 5 High-Performance Analytics for Big Data . . . . . . . . . . . . . . . . . . . . . . 6 Flexible Deployment Options for Big Data . . . . . . . . . . . . . . . . . . . . . . 8 SAS Differentiators at a Glance . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8 Conclusion . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9 Big Data and Big Data Analytics – Not Just for Large Organizations . 9 It Is Not Just About Building Bigger Databases . . . . . . . . . . . . . . . . . . 9 Choose the Most Appropriate Big Data Scenario . . . . . . . . . . . . . . . . 9 Moving Processing to the Data Source Yields Big Dividends . . . . . . 10 Big Data and Big Data Analytics Don’t Have to Be Difficult . . . . . . . 10 Closing Thoughts . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10 Content for this paper, Big Data Meets Big Data Analytics, was provided by Mark Troester, IT/CIO Thought Leader and Strategist at SAS. Troester oversees the company’s marketing efforts for information management and for the overall CIO and IT vision. He began his career in IT and has worked in product management and product marketing for a number of startups and established software companies.1 Big Data Meets Big Data Analytics Introduction Wal-Mart handles more than a million customer transactions each hour and imports those into databases estimated to contain more than 2.5 petabytes of data. Radio frequency identification (RFID) systems used by retailers and others can generate 100 to 1,000 times the data of conventional bar code systems. Facebook handles more than 250 million photo uploads and the interactions of 800 million active users with more than 900 million objects (pages, groups, etc.) – each day. More than 5 billion people are calling, texting, tweeting and browsing on mobile phones worldwide. Organizations are inundated with data – terabytes and petabytes of it. To put it in context, 1 terabyte contains 2,000 hours of CD-quality music and 10 terabytes could store the entire US Library of Congress print collection. Exabytes, zettabytes and yottabytes definitely are on the horizon. Data is pouring in from every conceivable direction: from operational and transactional systems, from scanning and facilities management systems, from inbound and outbound customer contact points, from mobile media and the Web. According to IDC, “In 2011, the amount of information created and replicated will surpass 1.8 zettabytes (1.8 trillion gigabytes), growing by a factor of nine in just five years. That’s nearly as many bits of information in the digital universe as stars in the physical universe.” (Source: IDC Digital Universe Study, sponsored by EMC, June 2011.) The explosion of data isn’t new. It continues a trend that started in the 1970s. What has changed is the velocity of growth, the diversity of the data and the imperative to make better use of information to transform the business. The hopeful vision of big data is that organizations will be able to harvest and harness every byte of relevant data and use it to make the best decisions. Big data technologies not only support the ability to collect large amounts, but more importantly, the ability to understand and take advantage of its full value.2 SAS White Paper What Is Big Data? Big data is a relative term describing a situation where the volume, velocity and variety of data exceed an organization’s storage or compute capacity for accurate and timely decision making. Some of this data is held in transactional data stores – the byproduct of fast-growing online activity. Machine-to-machine interactions, such as metering, call detail records, environmental sensing and RFID systems, generate their own tidal waves of data. All these forms of data are expanding, and that is coupled with fast-growing streams of unstructured and semistructured data from social media. That’s a lot of data, but it is the reality for many organizations. By some estimates, organizations in all sectors have at least 100 terabytes of data, many with more than a petabyte. “Even scarier, many predict this number to double every six months going forward,” said futurist Thornton May, speaking at a SAS webinar in 2011. Determining relevant data is key to delivering value from massive amounts of data. However, big data is defined less by volume – which is a constantly moving target – than by its ever-increasing variety, velocity, variability and complexity. • Variety. Up to 85 percent of an organization’s data is unstructured – not numeric – but it still must be folded into quantitative analysis and decision making. Text, video, audio and other unstructured data require different architecture and technologies for analysis. Big Data When the volume, velocity, variability and variety of data exceed an organization’s storage or compute capacity for accurate and timely decision making.3 Big Data Meets Big Data Analytics • Velocity. Thornton May says, “Initiatives such as the use of RFID tags and smart metering are driving an ever greater need to deal with the torrent of data in nearreal time. This, coupled with the need and drive to be more agile and deliver insight quicker, is putting tremendous pressure on organizations to build the necessary infrastructure and skill base to react quickly enough.” • Variability. In addition to the speed at which data comes your way, the data flows can be highly variable – with daily, seasonal and event-triggered peak loads that can be challenging to manage. • Complexity. Difficulties dealing with data increase with the expanding universe of data sources and are compounded by the need to link, match and transform data across business entities and systems. Organizations need to understand relationships, such as complex hierarchies and data linkages, among all data. A data environment can become extreme along any of the above dimensions or with a combination of two or all of them at once. However, it is important to understand that not all of your data will be relevant or useful. Organizations must be able to separate the wheat from the chaff and focus on the information that counts – not on the information overload. Rethinking Data Management The necessary infrastructure that May refers to will be much more than tweaks, upgrades and expansions to legacy systems and methods. “Because the shifts in both the amount and potential of today’s data are so epic, businesses require more than simple, incremental advances in the way they manage information,” wrote Dan Briody in Big Data: Harnessing a Game-Changing Asset (Economist Intelligence Unit, 2011). “Strategically, operationally and culturally, companies need to reconsider their entire approach to data management, and make important decisions about which data they choose to use, and how they choose to use them. … Most businesses have made slow progress in extracting value from big data. And some companies attempt to use traditional data management practices on big data, only to learn that the old rules no longer apply.” Some organizations will need to rethink their data management strategies when they face hundreds of gigabytes of data for the first time. Others may be fine until they reach tens or hundreds of terabytes. But whenever an organization reaches the critical mass defined as big data for itself, change is inevitable. From Standalone Disciplines to Integrated Processes Organizations are moving away from viewing data integration as a standalone discipline to a mindset where data integration, data quality, metadata management and data governance are designed and used together. The traditional extract-transform-load (ETL) data approach has been augmented with one that minimizes data movement and improves processing power. Big data refers to enormity in five dimensions: • Volume – from terabytes to petabytes and up. • Variety – an expanding universe of data types and sources. • Velocity – accelerated data flow in all directions. • Variability – inconsistent data flows with periodic peaks. • Complexity – the need to correlate and share data across entities. “Most businesses have made slow progress in extracting value from big data. And some companies attempt to use traditional data management practices on big data, only to learn that the old rules no longer apply.” Dan Briody “Big Data: Harnessing a Game-Changing Asset,” Economist Intelligence Unit, 20114 SAS White Paper Organizations are also embracing a holistic, enterprise view that treats data as a core enterprise asset. Finally, many organizations are retreating from reactive data management in favor of a managed and ultimately more proactive and predictive approach to managing information. From Sample Subsets to Full Relevance The true value of big data lies not just in having it, but in harvesting it for fast, factbased decisions that lead to real business value. For example, disasters such as the recent financial meltdown and mortgage crisis might have been prevented with risk computation on historical data at a massive scale. Financial institutions were essentially taking bundles of thousands of loans and looking at them as one. We now have the computing power to assess the probability of risk at the individual level. Every sector can benefit from this type of analysis. “Big data provides gigantic statistical samples, which enhance analytic tool results,” wrote Philip Russom, Director of Data Management Research for TDWI in the fourth quarter 2011 TDWI Best Practices Report, Big Data Analytics. “The general rule is that the larger the data sample, the more accurate are the statistics and other products of the analysis.” However, organizations have been limited to using subsets of their data, or they were constrained to simplistic analysis because the sheer volume of data overwhelmed their IT platforms. What good is it to collect and store terabytes of data if you can’t analyze it in full context, or if you have to wait hours or days to get results to urgent questions? On the other hand, not all business questions are better served by bigger data. Now, you have choices to suit both scenarios: • Incorporate massive data volumes in analysis. If the business question is one that will get better answers by analyzing all the data, go for it. The game-changing technologies that extract real business value from big data – all of it – are here today. One approach is to apply high-performance analytics to analyze massive amounts of data using technologies such as grid computing, in-database processing and in-memory analytics. SAS has introduced the concept of an analytical data warehouse that surfaces for analysis only the relevant data from the enterprise data warehouse, for simpler and faster processing. • Determine upfront which data is relevant. The traditional modus operandi has been to store everything; only when you query it do you discover what is relevant. SAS provides the ability to apply analytics on the front end to determine data relevance based on enterprise context. This analysis can be used to determine which data should be included in analytical processes and which can be placed in low-cost storage for later availability if needed. Cheap storage has driven a propensity to hoard data, but this habit is unsustainable. What organizations need is a better information engineering pipeline and a better governance process. Organizations do not have to grapple with overwhelming data volumes if that won’t better serve the purpose. Nor do they have to rely solely on analysis based on subsets of available data.5 Big Data Meets Big Data Analytics Three Key Technologies for Extracting Business Value from Big Data According to Philip Carter, Associate Vice President of IDC Asia Pacific, “Big data technologies describe a new generation of technologies and architectures, designed to economically extract value from very large volumes of a wide variety of data by enabling high-velocity capture, discovery and/or analysis.” (Source: IDC. Big Data Analytics: Future Architectures, Skills and Roadmaps for the CIO, September 2011.) Furthermore, this analysis is needed in real time or near-real time, and it must be affordable, secure and achievable. Fortunately, a number of technology advancements have occurred or are under way that make it possible to benefit from big data and big data analytics. For starters, storage, server processing and memory capacity have become abundant and cheap. The cost of a gigabyte of storage has dropped from approximately $16 in February 2000 to less than $0.07 today. Storage and processing technologies have been designed specifically for large data volumes. Computing models such as parallel processing, clustering, virtualization, grid environments and cloud computing, coupled with high-speed connectivity, have redefined what is possible. Here are three key technologies that can help you get a handle on big data – and even more importantly, extract meaningful business value from it. • Information management for big data. Manage data as a strategic, core asset, with ongoing process control for big data analytics. • High-performance analytics for big data. Gain rapid insights from big data and the ability to solve increasingly complex problems using more data. • Flexible deployment options for big data. Choose between options for onpremises or hosted, software-as-a-service (SaaS) approaches for big data and big data analytics. Information Management for Big Data Many organizations already struggle to manage their existing data. Big data will only add complexity to the issue. What data should be stored, and how long should we keep it? What data should be included in analytical processing, and how do we properly prepare it for analysis? What is the proper mix of traditional and emerging technologies? Big data will also intensify the need for data quality and governance, for embedding analytics into operational systems, and for issues of security, privacy and regulatory compliance. Everything that was problematic before will just grow larger. SAS provides the management and governance capabilities that enable organizations to effectively manage the entire life cycle of big data analytics, from data to decision. SAS provides a variety of these solutions, including data governance, metadata management, analytical model management, run-time management and deployment management. A “stream it, store it, score it” approach determines the 1 percent that is truly important in all the data an organization has. The idea is to use analytics to determine relevance instead of always putting all data in storage before analyzing it.6 SAS White Paper With SAS, this governance is an ongoing process, not just a one-time project. Proven methodology-driven approaches help organizations build processes based on their specific data maturity model. SAS® Information Management technology and implementation services enable organizations to fully exploit and govern their information assets to achieve competitive differentiation and sustained business success. Three key components work together in this realm: • Unified data management capabilities, including data governance, data integration, data quality and metadata management. • Complete analytics management, including model management, model deployment, monitoring and governance of the analytics information asset. • Effective decision management capabilities to easily embed information and analytical results directly into business processes while managing the necessary business rules, workflow and event logic. High-performance, scalable solutions slash the time and effort required to filter, aggregate and structure big data. By combining data integration, data quality and master data management in a unified development and delivery environment, organizations can maximize each stage of the data management process. Stream it, score it, store it. SAS is unique for incorporating high-performance analytics and analytical intelligence into the data management process for highly efficient modeling and faster results. For instance, you can analyze all the information within an organization – such as email, product catalogs, wiki articles and blogs – extract important concepts from that information, and look at the links among them to identify and assign weights to millions of terms and concepts. This organizational context is then used to assess data as it streams into the organization, churns out of internal systems, or sits in offline data stores. This up-front analysis identifies the relevant data that should be pushed to the enterprise data warehouse or to high-performance analytics. High-Performance Analytics for Big Data High-performance analytics from SAS enables you to tackle complex problems using big data and provides the timely insights needed to make decisions in an ever-shrinking processing window. Successful organizations can’t wait days or weeks to look at what’s next. Decisions need to be made in minutes or hours, not days or weeks. High-performance analytics also makes it possible to analyze all available data (not just a subset of it) to get precise answers for hard-to-solve problems and uncover new growth opportunities and manage unknown risks – all while using IT resources more effectively. Whether you need to analyze millions of SKUs to determine optimal price points, recalculate entire risk portfolios in minutes, identify well-defined segments to pursue customers that matter most or make targeted offers to customers in near-real time, high-performance analytics from SAS forms the backbone of your analytic endeavors. Quickly solve complex problems using big data and sophisticated analytics in a distributed, in-memory and parallel environment.7 Big Data Meets Big Data Analytics To ensure that you have the right combination of high-performance technologies to meet the demands of your business, we offer several processing options. These options enable you to make the best use of your IT resources while achieving performance gains you never would have thought possible. Accelerated processing of huge data sets is made possible by four primary technologies: • Grid computing. A centrally managed grid infrastructure provides dynamic workload balancing, high availability and parallel processing for data management, analytics and reporting. Multiple applications and users can share a grid environment for efficient use of hardware capacity and faster performance, while IT can incrementally add resources as needed. • In-database processing. Moving relevant data management, analytics and reporting tasks to where the data resides improves speed to insight, reduces data movement and promotes better data governance. Using the scalable architecture offered by third-party databases, in-database processing reduces the time needed to prepare data and build, deploy and update analytical models. • In-memory analytics. Quickly solve complex problems using big data and sophisticated analytics in an unfettered manner. Use concurrent, in-memory, multiuse access to data and rapidly run new scenarios or complex analytical computations. Instantly explore and visualize data. Quickly create and deploy analytical models. Solve dedicated, industry-specific business challenges by processing detailed data in-memory within a distributed environment, rather than on a disk. • Support for Hadoop. You can bring the power of SAS Analytics to the Hadoop framework (which stores and processes large volumes of data on commodity hardware). SAS provides seamless and transparent data access to Hadoop as just another data source, where Hive-based tables appear native to SAS. You can develop data management processes or analytics using SAS tools – while optimizing run-time execution using Hadoop Distributed Process Capability or SAS environments. With SAS Information Management, you can effectively manage data and processing in the Hadoop environment. In addition, a new product from SAS provides a Web-based solution that leverages SAS high-performance analytics technologies to explore huge volumes of data in mere seconds. Using SAS Visual Analytics, you can very quickly see correlations and patterns in big data, identify opportunities for further analysis and easily publish reports and information to an iPad®. Because it’s not just the fact that you have big data, it’s what you can do with the data to improve decision making that will result in organizational gains. SAS can cut through the complexities of big data and identify the most valuable insights so decision makers can solve complex problems faster than ever before. High-performance analytics from SAS is optimized to address new business requirements and overcome technical constraints. In addition, SAS is leading the way in empowering organizations to transform their structured and unstructured data assets into business value using multiple deployment options. “Today’s rapid pace of business requires operational analytics that deliver answers before a question becomes obsolete; the sooner you act on a decision, the greater its potential value. SAS High-Performance Analytics can turn any data, including big data assets, into quicker, better business decisions and ultimately competitive advantage.” Dan Vesset, Program Vice President, Business Analytics, IDC8 SAS White Paper Flexible Deployment Options for Big Data Flexible deployment models bring choice. High-performance analytics from SAS can be deployed in the cloud (with SAS or another provider), on a dedicated high-performance analytics appliance or in the existing on-premises IT infrastructure – whichever best serves your organization’s big data requirements. Whatever the deployment environment – from a desktop symmetric multiprocessing (SMP) to massively parallel processing (MPP) running on tens, hundreds or even thousands of servers – high-performance analytics from SAS scales for the best performance. A flexible architecture enables organizations to take advantage of hardware advances and different processing options, while extending the value of original investments. For some organizations, it won’t make sense to build the IT infrastructure to support big data, especially if data demands are highly variable or unpredictable. Those organizations can benefit from cloud computing, where big data analytics is delivered as a service and IT resources can be quickly adjusted to meet changing business demands. SAS Solutions OnDemand provides customers with the option to push big data analytics to the SAS infrastructure, greatly eliminating the time, capital expense and maintenance associated with on-premises deployments. SAS Differentiators at a Glance • Flexible architecture approach. SAS provides flexible architecture approaches that are optimized based on business requirements and technical constraints. • Ability to manage and leverage many models. Multiple deployment models include on-premises, cloud-hosted or hybrid options that provide the flexible capabilities required in many big data scenarios. • Solutions that are enabled for big data. SAS provides comprehensive big data analytics capabilities, from robust information management support (data, analytics and decision management) to high-performance analytics infrastructure support, big data visualization and exploration capabilities, solutions that integrate structured and unstructured data, and prepackaged business solutions. • Proven, trusted adviser status. SAS is uniquely positioned to help organizations turn big data and big data analytics into business value and differentiation based on our unparalleled leadership, product and solution offerings, and domain expertise. • Comprehensive information management approach supports the entire analytics life cycle. Our graduated big data analytics maturity curve approach allows organizations to address their current and future needs in an optimal fashion. High-performance analytics lets you do things you never thought about before because the data volumes were just way too big. For instance, you can get timely insights to make decisions about fleeting opportunities, get precise answers for hardto-solve problems and uncover new growth opportunities – all while using IT resources more effectively. Flexible deployment models bring choice. High-performance analytics from SAS can be deployed in the cloud (with SAS or another provider), on a dedicated high-performance analytics appliance or in the existing on-premises IT infrastructure – whatever best serves your organization’s big data requirements.9 Big Data Meets Big Data Analytics Conclusion “One-third of organizations (34 percent) do big data analytics today, although it’s new,” wrote Russom of TDWI. “In other words, they practice some form of advanced analytics, and they apply it to big data. This is a respectable presence for big data analytics, given the newness of the combination of advanced analytics and big data.” Given that more than one-third of organizations in Russom’s research reported having already broken the 10-terabyte barrier, big data analytics will see more widespread adoption. Organizations that succeed with big data analytics will be those that understand the possibilities, see through the vendor hype and choose the right deployment model. Big Data and Big Data Analytics – Not Just for Large Organizations If we define big data as the data volume, variety and velocity that exceed an organization’s ability to manage and analyze it in a timely fashion, then there are candidates in any industry. It doesn’t matter if the breaking point is reached at hundreds of gigabytes or tens or hundreds of terabytes. The principles that apply to big data and big data analytics are similar and can help the smaller organization extract more value from its data assets and IT resources. It Is Not Just About Building Bigger Databases Big data is not about the technologies to store massive amounts of data. It is about creating a flexible infrastructure with high-performance computing, high-performance analytics and governance – in a deployment model that makes sense for the organization. SAS can run in a symmetric multiprocessing (SMP) or grid environment – on-premises, in a cloud environment or on an appliance. Organizations can choose the approach that meets their needs today and scales for the future. Choose the Most Appropriate Big Data Scenario Depending on your business goal, data landscape and technical requirements, your organization may have very different ideas about working with big data. Two scenarios are common: • A complete data scenario whereby entire data sets can be properly managed and factored into analytical processing, complete with in-database or in-memory processing and grid technologies. • Targeted data scenarios that use analytics and data management tools to determine the right data to feed into analytic models, for situations where using the entire data set isn’t technically feasible or adds little value. SAS can help assess, provide guidance and deliver solutions that support the best approach for any organization. “Big data technologies describe a new generation of technologies and architectures, designed to economically extract value from very large volumes of a wide variety of data by enabling high-velocity capture, discovery and/or analysis.” Philip Carter, Associate Vice President of IDC Asia Pacific “Big Data Analytics: Future Architectures, Skills and Roadmaps for the CIO,” September 2011 “The new technologies and new best practices are fascinating, even mesmerizing, and there’s a certain macho coolness to working with dozens of terabytes. But don’t do it for the technology. Put big data and discovery analytics together for the new insights they give the business.” Philip Russom, Director of Data Management Research, TDWI “Big Data Analytics, TDWI Best Practices Report,” Fourth Quarter 201110 SAS White Paper Moving Processing to the Data Source Yields Big Dividends SAS was one of the first vendors to move data preparation and analytical processing to the actual data source, taking advantage of the massive parallel processing (MPP) capabilities in some databases. This approach eliminates the need to move the data, which in turn reduces demand on processing and network resources and accelerates performance. In-database processing will pay additional dividends as data volumes continue to grow. Big Data and Big Data Analytics Don’t Have to Be Difficult Big data technologies don’t have to be complex and require specialized skills. SAS provides an extensive array of preconfigured business solutions and business analytics solutions that greatly simplify the most complex analytical problems, including those based on big data. With cloud computing, big data analytics becomes an on-demand service. And of course, SAS offers technical support, professional services, training and partnerships to ease the way into big data analytics. Closing Thoughts Big data is not just about helping an organization be more successful – to market more effectively or improve business operations. It reaches to far more socially significant issues as well. Could we have foreseen the mortgage meltdown, the financial institution crisis and the recession, if only we had gotten our arms around more data and done more to correlate it? Could we trim millions of dollars in fraud from government programs and financial markets? Could we improve the quality and cost of health care and save lives? The possibilities are wide open. At SAS, we are optimistic about the potential for deriving new levels of value from big data with big data analytics. That’s why we reinvented our architecture and software to satisfy the demands of big data, larger problems and more complex scenarios, and to take advantage of new technology advancements. High-performance analytics from SAS is specifically designed to support big data initiatives, with in-memory, in-database and grid computing options. SAS Solutions OnDemand delivers SAS solutions on an infrastructure hosted by SAS or on a private cloud. The SAS High-Performance Analytics solution for Teradata and EMC Greenplum appliances provides yet another option for applying high-end analytics to big data. So, bring on the petabytes. Big data analytics has arrived. Learn more Explore SAS high-performance solutions to learn how to turn your big data into bigger opportunities. sas.com/hpa White paper: SAS® High-Performance Analytics: What Could You Do with Faster, Better Answers? Transform Your Organization and Gain Competitive Advantage sas.com/reg/wp/corp/41948 White paper: In-Memory Analytics for Big Data: Game-Changing Technology for Faster, Better Insights sas.com/reg/wp/corp/42876About SAS SAS is the leader in business analytics software and services, and the largest independent vendor in the business intelligence market. Through innovative solutions, SAS helps customers at more than 55,000 sites improve performance and deliver value by making better decisions faster. Since 1976, SAS has been giving customers around the world THE POWER TO KNOW®. For more information on SAS® Business Analytics software and services, visit sas.com. SAS Institute Inc. World Headquarters +1 919 677 8000 To contact your local SAS office, please visit: sas.com/offices SAS and all other SAS Institute Inc. product or service names are registered trademarks or trademarks of SAS Institute Inc. in the USA and other countries. ® indicates USA registration. Other brand and product names are trademarks of their respective companies. Copyright © 2012, SAS Institute Inc. All rights reserved. 105777_S81514_0512 BIG DATA With Jean-Michel Lasry Fany Declerck Jean-Cyprien Héam Erwan Koch Valentin Patilea Omar Mehdi Roustoumi Thierry Duchamp Didier Davydoff #13 March 2014 LES CAHIERS2 THE LOUIS BACHELIER RESEARCH REVIEW THE LOUIS BACHELIER RESEARCH REVIEW 3 Big data:what are the implications for research and industry? A Jean-Michel Lasry’s interview Should there be mandatory transparency in the bond market? By Fany Declerck Does the search for diversification account for bank interconnectedness? “Big Data” in the service of the banking industry Specific data requirements for empirical research? By Jean-Cyprien Héam and Erwan Koch By Omar Mehdi Roustoumi and Thierry Duchamp By Didier Davydoff Statistics and data processing: an indispensable combination By Valentin Patilea PUBLICATION OF INSTITUT LOUIS BACHELIER Palais Brongniart 28 place de la Bourse - 75002 PARIS Tel. 01 73 01 93 25 www.institutlouisbachelier.org www.louisbachelier.org PROJECT MANAGERS Cyril Armange Loïc Herpin CONTACT cyril.armange@institutlouisbachelier.org loic.herpin@institutlouisbachelier.org EDITORIAL DIRECTOR Jean-Michel Beacco CHIEF EDITOR Isaure du Fretay WITH PARTICIPATION OF Coralie Bach PARTNERS • MPG Partners • IODS GRAPHICS DESIGNER, COVER AND IMPLEMENTATION Gaël Nicolet La Cote Bleue 10-12 place Vendôme - 75001 Paris Tel. 01 44 76 85 85 www.lacotebleue.fr PRINTER Kava 42, rue Danton - 94270 Le Kremlin-Bicêtre Tel. 06 14 32 96 87 big data With Jean-Michel lasry Fany Declerck Jean-cyprien héaM erWan koch Valentin patilea oMar MehDi roustouMi thierry DuchaMp DiDier DaVyDoFF #13 March 2014 LES CAHIERS 6 8 10 16 18 14 INDEX FONDATION DU RISQUE RESEARCH FUNDATION INSTITUT www.institutlouisbachelier.org THE CREATION OF SCIENTIFIC TEAMS OF EXCELLENCE The Institut Louis Bachelier is a unique organization that brings together, around industrial partnerships, the best research teams in economics and mathematics, as attested by the LABEX (Laboratoire d’Excellence) certification awarded to the ILB within the framework of its Finance and Sustainable Development project.. • Creation of research programmes directly linked to the financial industry : 30 Chairs and research initiatives have been created under the aegis of the Institut Europlace de Finance (EIF) and the Fondation du Risque (FDR) since 2007, involving more than 200 researchers. • Management and organization of innovative R&D projects in collaboration with the Pôle Finance Innovation. • Contribution to and support for the emergence of new training at undergraduate, masters and doctoral level in phase with the requirements of the Paris Stock Exchange. • Cooperation with French, European, American and Asian universities and research centres. ENHANCING THE IMPACT OF RESEARCH The Institut Louis Bachelier disseminates the widest and most effective results from its research programs, particularly to French and European regulatory authorities. • The quarterly review “Les Cahiers Louis Bachelier” presents research work from its Chairs and research initiatives in language accessible to a wide public. • Publication of discussion papers aiming to clearly inform the public authorities and finance professionals on current topics. • The “Recherche en Finance” portal in partnership with AGEFI. • The financial research community network : www.louisbachelier.org REFLECTION AND DISCUSSION AT A EUROPEAN LEVEL The Institut Louis Bachelier is a veritable crossroads for encounters and contacts with a view to encouraging interaction between the world of research and economic actors. • Financial Risks International Forum : this annual event aims to present the best international research work and, by means of exchanges, discussions and round-tables, to address the concerns of economic actors. • Thematic Semesters : organized in the form of lectures, seminars and courses, these thematic semesters aim to encourage exchanges between academics and professionals on shared problem areas. • Chairs Day : held annually, this event aims to present and compare the work carried out in the context of the Chairs and research initiatives of the Institut Louis Bachelier. • Scientific Mornings : occasions for reviewing the latest developments in financial research through the research projects supported by the Institut Europlace de Finance. PROMOTING, SHARING AND DISSEMINATING FINANCIAL RESEARCH Created in September 2008, the Institut Louis Bachelier (ILB) is an internationally networked research centre with the mission of promoting, sharing and disseminating French financial research and teaching. 29% 19% 41% 11% Axe 1 : Finance and Sustainable Development Axe 2 : Finance of Demographic and Economic Transitions Axe 3 : Risk and Regulation Axe 4 : Behavioural Finance BREAKDOWN OF 30 CHAIRS AND RESEARCH INITIATIVES IN TERMS OF THE FOUR STRATEGIC AXES OF LABEX FINANCE AND SUSTAINABLE GROWTH4 THE LOUIS BACHELIER RESEARCH REVIEW THE LOUIS BACHELIER RESEARCH REVIEW 5 EDITO Megadata, analytics 2.0, zettaoctets, infomagic, infom@gic… does this terminology point to a new scientific revolution? For several decades, there has been a rapid and continuous development of IT tools, storage capacity and data response and computation time. These increased technological capabilities have, however, been incorporated in fits and starts by companies due to substantial adaptation costs in terms of equipment, staff training and governance. The previous revolution of this kind for finance and insurance took place in the early 1990s with, on the one hand, the creation of electronic trading markets and, on the other, the real-time monitoring of current accounts and permanent credits. It also allowed the management of stocks in real time. From analysis based on a few thousand observations, we moved to analysis based on tens of millions of observations, or an increase by a factor of 10,000 in the size of the databases used. This leap was not only quantitative; it also made available new information, which in turn led to new types of market with, for example, highfrequency trading, the introduction of appropriate regulations, etc. This new potential revolution with regard to data is of the same type and with a scale effect of similar size. The questions now being asked are not dissimilar to those of the early 1990s. How does one avoid being overwhelmed by the data? Should one use automatic data analysis methods or adopt newly conceived approaches for such massive data? Does the interest lie in the amount of data or in the existence of new types of data and questions to be considered? Do all businesses need to adapt to this new environment or is such adaptation too costly compared to the expected gain? How is privacy to be protected in the use of new data? How should governance pertaining to these new developments be partitioned among managers, IT services, marketing specialists, risk specialists, etc.? The automatic methods of the 1990s, slightly improved, covered by the general term “data mining”, are once again proposed for the analysis of big data. However, “drilling” at random in databases turns out to be costly in return for low productivity. Before doing so, it is better to specify what is wanted and to identify the area to be prospected. What is one looking for and what can one expect to find? Two major potential uses of these databases should be distinguished. • The data can be used to improve answers to standard questions. A typical example is the use of geolocation data to improve prediction of the risk of car accidents and provide new types of car insurance policies. Similarly web data can be used to better understand people’s consumption choices and to target marketing campaigns more effectively; and smart meters allow electricity consumption to be monitored in real time and production processes to be adapted more efficiently. • There is other data that will help to resolve questions that could not be considered earlier. Thus data on the detailed balance sheets of banks and their counterparts and on the composition of fund managers’ portfolios will improve understanding of interaction effects and their importance in the analysis of systemic risk. Similarly, by combining data from web sites, it may be possible to discover how ads in different media interact and influence a given consumer. To answer such questions, we must develop new models and introduce appropriate statistical methods. There are a number of such methods, introduced over the last 15 years, and they should be used appropriately, depending on the problem being considered. They have names such as: Lasso, sparse regression, statistical learning, segmentation, granularity, non-linear panel models with individual and time effects, compression, etc. (References on these methods are provided below). Finally, we should emphasize three points: 1. Big data is often of poor quality. Preliminary processing to make it more reliable can be very expensive, thus limiting the value of using it. 2. The methods used must have a well controlled level of computational complexity. In particular, the number of operations required to process n data should not increase too quickly with n. Thus momentum-type portfolio management based on a large number of assets will be less expensive from a computational standpoint than mean-variance management, for example. 3. The availability of real-time data does not necessarily imply real-time responses, which should take into account the people they are intended for. Thus knowledge of continuous auto risk will not prevent insurance premiums being adjusted on a monthly basis, for example. This issue of the Institut Louis Bachelier Cahier provides examples of questions and methods related to big data: analysis of liquidity from high frequency data, understanding the interconnections between banks from balance sheet data, potential uses of sparse regression, and so on. Christian Gouriéroux • Beath, C., Becerra-Fernandez, I., Ross, S., and T., Short (2012): “Finding Value in the Information Explosion”, MIT Sloan Management Review. • Mayer-Schonberger, V., and K., Cukier (2013): “Big Data: A Revolution that Will Transform How We Live, Work and Think”, John Murray. • Nichols, W. (2012): “Advertising Analytics 2.0”, Harvard Business Review. • Gagliardini, P., and C., Gouriéroux (2014): “Granularity Theory”, forthcoming Cambridge University Press. • Gagliardini, P., Gouriéroux, C., and M., Rubin (2013): ”Positional Portfolio Management”, CREST DP. • Hastie, T., Tibshirani, R., and J., Friedman (2009): “The Elements of Statistical Learning, Data Mining, Inference and Prediction”, 2nd ed., Springer. • Novicki, K., and T., Snijders (2001): “Estimation and Prediction for Stochastic Blockstructures”, J. Amer. Statist. Assoc., 96, 1077-1087. • Tibshirani, R. (1996): “Regression Shrinkage and Selection via Lasso”, JRSS B, 58, 267-288. If you would like to subscribe to the Louis Bachelier review, please contact the Institut Louis Bachelier team by email at the following address : contact@institutlouisbachelier.org Make sure to state the subject of your message and to provide your full details. You will then receive every issue by email at the address you have indicated. www.institutlouisbachelier.org SUBSCRIPTIONS NB : Note that there are a limited number of copies of each issue of The Louis Bachelier research review ! Further reading on big data Further reading on new statistical approaches6 THE LOUIS BACHELIER RESEARCH REVIEW THE LOUIS BACHELIER RESEARCH REVIEW 7 Jean-Michel Lasry Jean-Michel Lasry is Emeritus Professor at Université Paris Dauphine and Chairman of the Steering Committee of the Finance and Sustainable Development Chair. Prior to his retirement in 2013, he was Senior Scientific Advisor at Crédit Agricole CIB (previously CALYON). He was also a member of the Executive Committee of CALYON Markets Activities for four years as well as the Global Head of Research & Capital Management. Before that, he was Deputy CEO of CPR Bank in Paris for four years. From 1994 to 1996, Jean-Michel Lasry was the CEO of the Caisse Autonome de Refinancement. From 1990 to 1993, he was a member of the Executive Committee of CDC Banking Divisions and a Board Member of CDC Gestion. He worked as a Professor at Université Paris-Dauphine and École Polytechnique for 17 years, and has had more than 100 papers published in mathematics and economics journals. Jean-Michel Lasry, the topic of big data has had much media coverage in recent years. In what respects is the big data phenomenon new? Big data represents a break in several respects. First, in quantitative terms. The volumes of data available and the creation of new data are higher by several orders of magnitude than what we saw in the late 1990s. Next, this information is mostly available in real time, in contrast with the past, even the recent past, for much of the data. And the data is very varied in its nature. It includes things as diverse as the massive geolocation associated to the democratization of connected objects, widespread detailed timestamped recording of individual consumption – through supermarket receipts for example – and the continuous monitoring of biological constants, particularly through heart rate sensors. These various measurements are often linked to the development of new tools. In parallel, storage and computing capacity have greatly increased, while becoming more accessible in terms of cost. In short, big data amounts to a revolution in terms of the magnitude of data available and the democratization of measurement, storage and analytic tools. This mass of disparate data comes from many sources. Professionals are no longer the only producers of information… Indeed. It is no longer a matter only of the results of well-established process studies. Data now originates from a host of internet users, though their participation in blogs, social networks, etc. Their every click is recorded by the site visited as well as by cookies incorporated into browsers. The data also arises from all kinds of connected objects: smartphones, tennis rackets that record the player’s movements during a game, personalized connected weather stations, and so on. Finally, the acts of economic life are systematically recorded, whether they be financial flows, commercial exchanges or simple prospecting activities. Big data: what are the implications for research and industry? In November 2013, Paris Dauphine University and Havas teamed up to create the “Economics of new data” Chair within the Institut Louis Bachelier. This research programme brings together industrial sponsors and scientific experts to respond to the economic and scientific challenges of big data. Why does the advent of big data mark a break? Do researchers have appropriate techniques for analysing this information? What are the opportunities offered by big data? Jean-Michel Lasry, at the initiative of the Chair, discusses these various issues. Does this massive influx of data have anything in common with past experience? Let’s say we have met with precursor phenomena. The data collected by genetic biologists, by specialists in linguistic processing and by image processing specialists provided a foretaste of the issues encountered today. Typical examples include genome analysis, medical imaging and detecting spam on the web. To respond to these various questions, learning specialists, statisticians and computer scientists had to define new techniques that are very different from those traditionally used. A whole discipline has thus emerged over the past two decades in order to provide quantitative methods that can be grouped together under the heading “statistical learning” or “machine learning”1 . What principles are these methods based on? It is a matter of defining complex algorithms to systematically explore structures that enable information to be extracted. This work is conducted in a context whose massive scale is at first sight daunting. Underlying these quantitative methods is the concept of parsimony, which postulates that the objects of interest can be represented parsimoniously, that is to say, using a limited number of variables. Identifying these variables in an effective way, through efficient algorithms, becomes the central issue in the fast-growing discipline of high-dimensional statistics. Apart from mathematical and computing questions, what are the main big data issues for research? The arrival of this wealth of data paves the way for new research in many areas, for example sociological studies of social networks, microeconomic studies of consumption through the analysis of purchase receipts, and so on. The field of possibilities is very broad and extends to all disciplines. Big data is of value only if we make sense of it. This involves technical and algorithmic work, but also modelling according to the context and existing or potential uses. Companies are also increasingly likely be interested in this topic. How does this new data affect their business? Big data overturns the relationship between producers and consumers. Brands can now find out about their customers without going through an intermediary, thanks in particular to social networks. They are thus able to establish an individual relationship with each customer, and strengthen their image in much more complex ways than traditional advertising. Through a Facebook application, for example, Warner now has a much more detailed picture of spectators’ tastes in film, and can build a closer relationship with them. In other words, current technologies offer the possibility of constructing a completely new type of CRM. It was in this context that the Havas-Dauphine “Economie des nouvelles données” Chair was created in November 2013. What are its objectives? The Chair is intended to be multidisciplinary and transversal and has the aim of facilitating access by economics and management researchers to work on big data. Researchers in economics and management at Paris Dauphine, and more generally from PSL (Paris Sciences et Lettres), will be able more easily to set up scientific collaborations with researchers specializing in statistical learning and machine learning. Backed by a number of corporate sponsors, the Chair will conduct studies both on theoretical topics, such as the development of new algorithmic and statistical methods, and in more practical areas of applied related to its partners’ businesses. In the latter case, part of this research will probably revolve around the theme of the customer relationship. We hope, through this initiative, to promote exchanges between professionals and researchers so as to combine know-how and expertise. It is essential to quickly develop responses to on-going changes. Thanks to the quality and diversity of its expertise, France is in a position to become one of the world’s leading centres of excellence in the area of big data. Big data constitutes a revolution through the magnitude of the data available and through the democratization of measurement, storage and analytic tools. Big data represents a break both in the quantity and kind of data available. Professionals, such as pollsters for example, no longer have a monopoly on the production of data. The activity of internet users and the use of connected objects create a very heterogeneous mass of information. The advent of this information opens the way to new research in the majority of scientific disciplines. For companies, big data offers a chance to rethink the customer relationship. Key points 1. Scientific discipline concerned with the development, analysis and implementation of automated methods that allow machines (broadly defined) to evolve through a learning process. Wikipedia BIOGRAPHY8 THE LOUIS BACHELIER RESEARCH REVIEW THE LOUIS BACHELIER RESEARCH REVIEW 9 Finding the price of a share is easy. Information on stock prices and the latest transactions are at one’s fingertips. The process is more complicated for bonds. Yet in Europe, the bond market handles twice as much money as the stock market. Although substantial, this trading of corporate debt generally occurs in the greatest opacity. Online databases, such as Bloomberg’s, for example, have grown in recent years and can increase the amount of information available. However, they are relatively little used. The majority of transactions still take place in the traditional way, by telephone between buyers, sellers and dealers, confining the data to a small circle of insiders. Does such a way of operating allow sufficient liquidity? Does it ensure proper transmission of information and fair price formation? These are questions that the study by Bruno Biais and Fany Declerck seeks to answer. Calibrating bond issuance to meet market expectations Based on a sample of transactions implemented between 2003 and 2005, the authors studied the corporate bond trading system. They were particularly interested in the secondary market (resale of securities). It appears that the extent to which securities are traded depends on several factors. First, the size of the issue: the larger it is, the more active the trading. Second, maturity: bonds with a five year or ten year maturity are the most traded. Similarly, the rating directly affects demand from buyers. Thus bonds with the highest rating (AAA) appeal to investors because of their low level of risk. But lower-rated (BBB), and therefore risky, securities are also traded in large volumes. This phenomenon is explained by the amount of information provided by the company, another key element in bond trading. Risky bonds are subShould there be mandatory transparency in the bond market? Allowing investors quicker access to financial information is one of the challenges of Big Data. It is still essential that actors are cooperative in sharing their data. Yet the bond market today operates in a fairly opaque manner, preferring to trade OTC rather than using a public platform. Is this way of working efficient? Does it ensure good liquidity and fair price formation? Bruno Biais and Fany Declerck have addressed these questions. ject to more frequent communication, and investors react to the information provided. A liquid European market ... Market transparency also affects the difference between the seller’s price and the buyer’s price. In the United States, regulation has been introduced requiring dealers to divulge, in real time, the time, price and quantity of securities sold. This requirement has reduced the gap between the seller’s price and the buyer’s price by 5 to 10 per cent. No equivalent regulation has yet been introduced in Europe. Surprisingly, however, the study shows that the European market is more liquid than the U.S. market. Overall it records more transactions for lower fees, and within Europe, the euro market itself is more liquid than the sterling market. The researchers interpret these results as a positive result of European economic integration. Indeed, the European Union, and even more so the Eurozone, favour the proliferation of actors, thus generating greater competition. The market is fragmented, consisting both of large international banks and national institutions. The United States, by contrast, with its limited number of large players, operates less competitively. …despite a lack of information The European situation is not ideal either. Fany Declerck and Bruno Biais draw attention to a shortcoming in the price discovery process. They find that on the day of the transaction, the information contained in transactions is not included in the prices quoted by dealers. In total, it takes at least five days for all the information to be passed on. price adjustment is therefore delayed, and as a result investors buy at the wrong price. Despite good liquidity, the European bond market thus suffers from a lack of information. Dealers take advantage of this opacity to maintain high costs and delay price adjustment. A first attempt to improve the situation was made in July 2011 with the creation of NYSE BondMatch. This electronic exchange, dedicated to European corporate bonds, makes available data related to securities trades. While theoretically a step forward, in practice it has not had the success anticipated. Despite its full pre-and post-transaction transparency, the platform so far remains underutilized. Regulations favouring greater transparency, similar to those introduced in the United States, may therefore be necessary. More reliable and faster information t r a n s m i s s i o n should enable corporate issuers to better promote their bonds. It would probably also facilitate the resale of securities in the secondary market, thereby increasing liquidity and the attractiveness of corporate bonds. However, it would probably first be advisable to look at the impact of such regulation by comparing a sample of transactions subject to a reporting requirement to the rest of the market. This verification can only be carried out, however, with the support of the European authorities. They alone have the ability to compel dealers to report their data in real time. It takes five days for all post-transaction information to be passed on to the market The European bond market is more liquid than the U.S. market. Yet it is less transparent. This liquidity can be accounted for by European economic integration, which has opened the market to a large number of players and generated strong competition. However, the market suffers from poor transmission of information. Data related to a transaction (price, quantity, time) takes more than five days to reach the market. Price adjustment is therefore delayed. Key points Bruno Biais and Richard C. Green, “The Microstructure of the Bond Market in the 20th Century”, working paper. Carnegie Mellon University Research Showcase 2007. Michael A. Goldstein, E. Hotchkiss and E. Sirri, “Transparency and Liquidity: A Controlled Experiment on Corporate Bonds”, 2007, Review of Financial Studies, 235- 273. Norman Schuerhoff and Li Dan, “Dealer Networks”, working paper. Further reading... article on Find the Fany Declerck’s @www.louisbachelier.org Fany Declerck Fany Declerck is professor of finance at Toulouse School of Economics. After her master in econometrics and a Phd in finance, she spent 3 months as Marie Curie fellow at the Centre for Studies in Economics and Finance (University of Salerno). In May 2013 she was visiting researcher at Berkeley and in May 2014 visiting researcher at Banque de France. Her expertise as an academic is complemented by her professional experience, as she was associate researcher at Euronext before joining Toulouse. Her main interest research is in the microstructure of financial markets. Her work is based on large stocks and bonds high-frequency databases. She has published empirical studies in the Journal of Banking and Finance and the Journal of Financial Markets. Bruno Biais and Fany Declerck drew on the IIC and ICMA databases to analyse a sample of transactions implemented between 2003 and 2005. The sample is composed of 300 bonds denominated in euro and 300 bonds denominated in sterling. The securities have ratings ranging from AAA to BBB, and were issued by companies from various sectors (commodities, consumer goods and services, industry, health, etc.). The sample is thus comparable to that used by the U.S. TRACE study. In detail, the study considered 1,844,826 transactions, for which the researchers analysed the time of the transaction, price, quantity, characteristics and “dealer code”. METHODOLOGY The European bond market currently operates in an opaque fashion. Greater transparency could improve its effectiveness and enable bond prices to adjust faster. To confirm this hypothesis, one would need to compare two samples of transactions: one where the information is made public, and the other second without any reporting requirement. This experiment should be endorsed by the European Commission, to make dealers provide the information requested. Recommendations Based on the paper “Liquidity, Competition & Price Discovery in the European Corporate Bond Market” by Bruno Biais and Fany Declerck and on an interview B with Fany Declerck. IOGRAPHY10 THE LOUIS BACHELIER RESEARCH REVIEW THE LOUIS BACHELIER RESEARCH REVIEW 11 Are competition and cooperation compatible? It would seem so, on the strength of how financial institutions operate. Although banks compete to increase their market share, they also forge partnerships, particularly through interbank exchange. In this paradoxical situation, the failure of a bank is both good and bad news for other banks. The primary justification given for this interconnectedness is liquidity. Interbank transactions allow each institution to manage its short-term risks and meet its debt obligations. The literature is clear on this point. However, limiting the relationship among banks to this single concern would be simplistic. Other factors need to be considered. Banks, like insurance companies, may decide to form links in order to create a common product, transfer risk (in the case of reinsurance, for example) or diversify their positioning. It is this last point that Jean-Cyprien Héam and Erwan Koch wished to investigate in greater depth. Is the search for diversification a valid explanation of networking among financial institutions? Should we be concerned about this interconnectedness and exercise greater control over it? Or does it contribute to the proper functioning of the market? For their study, the researchers drew on new data made available by the regulator. Indeed, banks are required to submit their detailed accounts each quarter – an obligation that will soon become weekly for larger institutions. The advent of this information opens the way to new research, such as the study presented in this article. Benefitting from the positioning of its competitors The interconnectedness of banks stems firstly from the way the market is organised. Not all institutions follow the same business model: mutual benefit organisations and commercial groups, Jean-Cyprien Héam Jean-Cyprien Héam is economist at the Research Directorate of the French Prudential Supervisory Authority (Autorité de Controle Prudentiel et de Résolution) and PhD candidate at CREST, Paris. His research topics are focused on systemic risk based on network analysis and on liquidity risk. He is a graduate of the ENSAE and the Ecole Centrale Lyon. Erwan Koch Erwan Koch approachs the end of his PhD program at the ISFA and at the Laboratory of finance/insurance at CREST. His research concerns spatial risks and risks in networks, with applications to climate extremes and financial contagion. Engineer of “Ecole Centrale de Paris”, he also obtained a Master’s Degree in mathematical modeling and climatology at the same Engineer School and a Master’s Degree in actuarial sciences at Paris-Dauphine University. Does the search for diversification account for bank interconnectedness? Banks are financially linked to each other through interbank transactions. In this way they are able to manage their liquidity needs. But not only that. The obligation for banks to provide detailed accounts would provide access to new data and enable other hypotheses to be tested. Would interconnectedness also be a way for banks to diversify their positioning? Is it only a risk factor or does it contribute to the proper functioning of the banking market? Based on an interview1 with Jean-Cyprien Héam and Erwan Koch and on their paper “Diversification and Endogenous Financial Networks” (2014). for example, operate on the basis of very different logics. Similarly, for historical reasons, some banks are highly developed in a specific segment (geographical area, type of customer, etc.). Given this situation, each bank seeks to define the best strategy to optimize its investments. Since acquiring a new customer is expensive, it often prefers to enter a partnership with an already established competitor rather than attempting to win customers itself. Its choices are then guided by a tradeoff between risk and return. Several parameters will influence the level of diversification and therefore of interconnection. In particular the authors examined the profitability of loans from different banks, and the correlation between yields and the extent of regulatory capital constraint. It emerges that the greater the risk sensitivity of the institution, the more it seeks to diversify, since this is a way to limit differences in profitability and thus to reduce risk. Conversely, a riskneutral institution will be guided solely by the search for profit. Ensuring a good regulatory level Regulation also has a strong impact on the degree of interconnectedness. Prudential rules require banks to maintain a certain level of capital for each investment made. Interbank assets are no exception to this rule. The stronger this constraint, the more institutions will reduce their purchases of shares or bonds from other banks. In their study, Jean-Cyprien Héam and Erwan Koch emphasize this point. It is important to have a good regulatory level that limits systemic risk while providing an optimal level of lending to the real economy. The researchers show that excessive interconnectedness could generate contagion. Conversely, too little interconnectedness would penalize bank diversification strategies and consequently the operation of the banking market. Between diversification and contagion Trade-offs by banks are therefore implemented according to these different factors and the banks’ knowledge of their competitors’ business. Each institution then invests with its partners in the expectation that these links will have a positive impact on its business. It optimizes its balance sheet in accordance with the situation of other banks in the network. But traditionally, regulation views interconnectedness only through the prism of risk. From this perspective, the more banks are interconnected, the greater the risk of contagion. The need for diversification is not taken into account. Yet this need for diversification seems a plausible explanation for financial interconnectedness – one valid reason among others. Several factors should be considered in order to identify interbank activity, and further studies are thus necessary. It would in any case be interesting to find out about the impact of the different motives for interconnectedness so as to evaluate the sensitivity of the banking system to various shocks. Understanding these mechanisms should also guide the formulation of the most appropriate regulation. Interconnectedness is partly a response to banks’ optimization procedures Jean-Cyprien Héam and Erwan Koch have constructed a model where the interbank network results from banks’ desire for diversification. This choice depends on a set of parameters, the relative importance of which the authors seek to identify. Among these parameters are the profitability of loans, the correlation between returns, and the weight of the regulatory capital constraint. Initially, it is a matter of examining how an institution manages its interbank transactions based on its knowledge of the balance sheets of other banks; then of understanding how the entire system is constructed from this principle of individual optimization. METHODOLOGY Bank interconnectedness is often seen as a response to the liquidity needs of financial institutions. There are long-term interconnections that are not based on considerations of liquidity. For example, a bank may seek to diversify. By entering into partnership with a competitor specialising in a particular segment, it gains access to this segment. At the level of individual banks, interconnectedness is seen as a positive element. However, at a global level, interconnections can give rise to the risk of contagion. Key points Financial Stability Board Data Gaps Initiative, 2014 “Senior Supervisors Group Report on Counterparty Data”, www.financialstabilityboard.org Acemoglu, D., Ozdaglar, A., and A. Tahbaz-Salehi, 2013: “Systemic Risk and Stability in Financial Networks”, NBER Working Paper 18727. Elliott, M., Golub, B., and M. Jackson, 2014: “Financial Networks and Contagion”, mimeo. Further reading... @ Find the Jean-Cyprien Héam and Erwan Koch’s article on www.louisbachelier.org Evaluating the different reasons for banking interconnectedness is essential for measuring the sensitivity of the system to various shocks. Understanding this phenomenon can guide regulation with regard to the trade-off between diversification and contagion. This work also serves to provide an analysis of new data collected by the regulatory authorities. Further models analysing other reasons for interconnectedness should be developed to establish the broadest possible mapping of the formation mechanisms of financial networks. Recommendations 1. The opinions expressed here are those of the authors and do not necessarily reflect the views of the institutions to which they belong. BIOGRAPHIES12 THE LOUIS BACHELIER RESEARCH REVIEW THE LOUIS BACHELIER RESEARCH REVIEW 13 Valentin Patilea Valentin PATILEA is professor of statistics at Ecole Nationale de la Statistique et de l’Analyse de l’Information (Ensai). After a master in mathematics in Bucarest and a master in mathematical economics and econometrics in Toulouse, he obtained the PhD in statistics in Louvain-la-Neuve. He’s now leading the Ensai part of the Center of Research in Economics and Statistics (CREST). Valentin Patilea published numerous papers in top journal in the fields of statistics and econometrics. He’s regularly invited for seminars and short visits in prestigious universities and research centers and for invited talks in top field conferences. Valentin PATILEA is co-principal investigator of the new research program New Challenges for New Data. explanatory variables are selected. In addition, this method can be implemented simply and efficiently. The parsimony approach is also promising for modelling high-dimensional time series. The LASSO technique and its variants enable significant autocorrelations to be identified and thus to bring to light temporal interactions between the components of the vector observed over time. This can be used, for example, to anticipate the risk of contagion among banking institutions. These statistical techniques using penalization also apply in the case of structural breaks where the autocorrelations change on certain dates and remain stable between these dates. In other words, the concept of parsimony is not restricted to null parameters, but also applies to constant parameters through time periods. Summarizing the content of complex data Many applications in finance and insurance produce data that can be considered as belonging to continuous units of observation, also known as functional or curve data. This is the case, for example, with volatility curves or GPS records sometimes used in insurance. Technological advances allow increasingly fine-grained observation grids, enabling virtually any information about the entity to be captured. Once observed, the curve can be approached with high accuracy by a linear combination of a number, often quite small, of well chosen basic curves. Using only the basic curves and the coefficients of the combination for each observation entity, the method allows, on the one hand, the data to be compressed and, on the other, standard models to be used. Most of the statistical techniques usable with mass data were developed several years ago, and have simply been adapted to respond to the challenges of increased amounts of data. For researchers, the current “big data” phenomenon does not represent a scientific break in terms of statistical modelling. However, the massive influx of this data strengthens the legitimacy of the science. If IT provides the computational power, statistics provides the analytic tools – hence the importance of IT and statistics, sometimes viewed as in conflict, working together. However, as the amount of information always increases much faster than the power and capacity of computers, it is essential, before starting any research, to define a study protocol in order to ascertain the nature of the economic or financial question of interest, and which variables are likely to respond to it. High-dimensional statistics adapts traditional techniques to the proliferation of data Statistics has long been responding to problems of data analysis. The techniques have simply been adapted to deal with the growing amount of information. Computing power cannot replace statistical analysis. The two are complementary. Key points Bühlmann, P., and S.A. van de Geer (2011), Statistics for HighDimensional Data. Springer, New York. Ramsay, J.O., and B.W. Silverman (2005), Functional Data Analysis, 2nd ed. Springer, New York. Rigollet, P., and A.B. Tsybakov (2011), “Sparse estimation by exponential weighting”, Statistical Science, vol. 27, 558-575. Tibshirani, R. (1996), “Regression Shrinkage and Selection via the Lasso”, Journal of the Royal Statistical Society, Series B, vol. 58, 267-288. Further reading... article on Find the Valentin Patilea’s @www.louisbachelier.org Statistics and data processing: an indispensable combination Faced with the invasion of Big Data, professionals are in search of the “magic” methodology able to isolate the information needed to respond to the economic and financial questions that interest them. For, in itself, this wealth of data is of little interest. Within this flood of information, only a small proportion is relevant. A database, therefore, is only of value and utility if it is regularly updated and cleansed. However, the more information there is, the more complex this work of selection and analysis becomes. So how does one succeed in this process? How can structures, connections and causal relations be extracted from this mass of data? In Valentin Patilea’s view, the solution lies in the combination of statistics and IT, two keys that can together can reveal the full value of the data. Adapting traditional statistical techniques With the proliferation of data, analysts find themselves faced with new challenges. Valentin Patilea takes the example of a variable – economic or financial, discrete or continuous – that he wants to explore with the help of a large amount of information, sometimes collected automatically. This is typically the case with information retrieved mechanically from the web and social networks. The standard approach is based on statistical regression models, which allows one to model the relationship between the variable of interest and the explanatory variables that summarize the available information. However, conventional approaches, such as linear or logistic regressions may be unusable, both from a methodological and a numerical computational standpoint – the reason being that there are too many variables, sometimes greater even than the number of individuals observed. It is then necessary to adapt the classical model to the reality of big data. Reducing complexity by means of the parsimony principle The problem of modelling sometimes allows a parsimonious representation, i.e. just a small number of explanatory variables among those available can fully explain the variable of interest. In this case a strategy emerges: automatically selecting, from the data, those variables that are truly relevant. The parsimony principle is thus consistent with the idea that only a small proportion of the information contained in big data is really useful. A simple adaptation of standard techniques based on the idea of penalization provides an effective response to parsimonious problems. For example, to adapt the least squares criterion, one could add a penalty proportional to the number of non-zero coefficients among the regression coefficients in order to force the algorithm to prefer parsimonious representations. However, the form of such a penalty is not suitable for effective calculation of a solution. But there are several variants of this method. The most common, LASSO (Least Absolute Shrinkage Selection Operator), provides a theoretically effective method: with high probability, only the relevant The proliferation of data complicates modelling and analysis. How does one find relevant information in this flood of heterogeneous data? Is computer power adequate for extracting the data needed? What contribution can statistics make regarding these questions? Searching for information blindly is ineffective. It is first necessary to specify the use protocol and to define which data should be retained. Databases should be regularly updated and cleansed. Before engaging in data mining, one needs to compare the cost of this operation with its benefits. Recommendations Based on an interview with Valentin Patilea, head of the Rennes site of the Centre de Recherche en Economie et Statistique (CREST). BIOGRAPHY7th Financial Risks INTERNATIONAL FORUM Big Data in Finance anD insurance INSTITUT Program and online registration http://risk2014.institutlouisbachelier.org/ Design by Paul Morgan : www.paulmorgan.fr Paris, March 20 & 21, 2014 CCI Paris Ile-de-France 27, avenue de Friedland - 75008 PARIS Associate partner: Venue: With the support of:16 THE LOUIS BACHELIER RESEARCH REVIEW THE LOUIS BACHELIER RESEARCH REVIEW 17 suitable financial instruments and thus to better structure the commercial approach. Data retention as the second use of big data But big data is not confined to a purely analytic function. It can very much be the leading and sole owner of data: this is, for example, the use made by Facebook, which since 2011 has been storing and processing more than 1.5 million messages per second at peak times and 6 billion messages a day. A bank may also retain all its data, including all versions, while adding information such as timestamps. The audit of each entry is complemented by recording all accesses and actions in the system. Used this way, big data responds to the objective of storing more data and keeping it online, i.e. usable by operatives, while providing full traceability. Perspectives opened up by dynamic analysis Real time is needed to resolve investment banking issues, particularly those concerning the front office, where a massive amount of data is modified every instant2 . But much of this data is not used due to lack of storage capacity and/ or processing or analytic capacity. One specific application of big data enables data to be retained, including any changes over time (different versions), while allowing the format to evolve. Data are continuously added with great flexibility. The addition of a search engine enables this data to be efficiently explored in real time, just as Google allows one to search the entire World Wide Web and can instantly present the 10 top-ranked results at that time. This programmed automated use opens up new prospects, such as fraud detection or the optimisation of trading strategies. For the latter, the analysis is at once dynamic – for decision-making – and static – for back testing. Made available to a middle office operator, big data pro- vides unmatched power for detecting anomalies, because it is possible to access all the bank’s data without any real historical limits. The capacities can be used for ‘free’ research as well as various audit functions. Conclusion and perspectives The big data concept pertains not only to size but also to the cost and time of data processing. Its use allows the various needs of the banking industry to be met, with reduced processing times (a few minutes rather than several hours), at least cost (standard servers) on an adaptable platform (servers may be added). It is these three elements – time, cost and elasticity – that differentiates big data from conventional technologies. Thus thanks to big data, calculations of sensitivities, VaR measures, CVA (and DVA, FVA etc.) and other regulatory ratios are processed more effectively; in addition, the realtime analysis offers new opportunities in terms of fraud prevention, arbitrage and decision-making support. In this respect the EMIR regulation will offer further new opportunities for big data. In particular it will certainly yield valuable lessons on the OTC market, which is scheduled to be transparent as from 12 February 2014. Many other examples reveal the tangible prospects for applications of this technology in banking and other industries. A new era has just begun in which the challenges of big data will be constantly renewed, as a result of the exponential growth of data and its storage and processing capacity. In 2014, big data unquestionably represents the future, the prehistory of which today’s data scientists are modestly attempting to write. “Big Data” in the service of the banking industry Big data as defined by Gartner1 can be summed up as a combination of three properties: • storage capacity, • calculation capacity, • low cost. It is based on the simultaneous use of several standard or “general public” servers. These computers, produced in large quantities, are much cheaper than their high-end version, and are more powerful. Because they are also less reliable, software must be designed to withstand failures. In practice, a big data solution can store a large amount of data (up to several peta-bytes), carry out a large number of calculations on this data, and dynamically add computers to increase capacity, while resisting hardware failures. The technology is supported by three pillars: • regular scientific publications, particularly through Google since 2003, • practical validation of this technology by using Google for its own needs, • use of its Open Source version by many actors, initially from the web (eBay, Facebook), and now for the enterprise information system (Saleforces.com). Big data requirements in banking Issues of data storage and processing for a retail bank are very different from those of an investment bank. The former aims to better meet the needs of its customers and to attract new ones. In terms of data processing, it needs to be able to analyse the banking behaviour of its customers so as better understand and anticipate their needs. In short, it is a matter of comprehending socio-economic behaviour with the aim of improving the bank’s marketing strategies and its customer relationships. An investment bank, on the other hand, aspires to increase its earnings by making the right buying and selling decisions among the various products quoted in the markets or traded over-the-counter, while controlling its exposure to financial risks (market, counterparty, interest rate, liquidity, currency, etc.). In other words, it needs to be able to analyse in real time the market data available to it in order to maximize profitability and minimize its exposure to risk. For several decades, digital technologies have been constantly revolutionizing the banking industry. Prospects of gain, in market finance in particular, now call for the ability to analyse a very broad spectrum of financial infor- mation in record time. Occasional analysis as the first use of big data Big data was initially used to periodically analyse the periodic analysis of data that was already available but not exploited. It was a matter here of adding a system to the existing one is in order to duplicate the data for analysis. This replication was done internally, i.e. without outsourcing the data to a third party, thereby respecting the need for confidentiality. The advantage of big data was in this case to allow the use of hitherto unexploited data at a lower cost. In retail banking, it was typically used for multi-channel analysis of customers, so as to identify the most In recent years, many companies have been using big data to store and process their Google, Facebook, Twitter or Salesforce.com data, which are among the best known precursors of its use. While this technology seems to be proven, does that mean it is suitable for the banking sector? Can big data respond to its many specificities, from retail banking to investment banking, and help it to better comply with its prudential requirements? The deployment of Big Data in the banking sector comes in many forms, while meeting certain basic criteria that combine performance, speed, flexibility and robustness, with no limit on volume. The possibilities offered by big data allow all types of data – structured and unstructured, static and dynamic – to be stored and analysed. Data to be processed is subjected to algorithms from financial engineering, orienting big data storage and processing capacity in accordance with the requirements of banking activities in terms of information, analysis, efficiency and speed of decision-making. Because trading, investing and financing decisions are made only when their risks have been fully assessed, financial institutions’ big data issues concern a wide professional spectrum: real-time VaR and CVA measurement, explanation of intraday PnL, stress tests, calculation of LCR, collateral optimization, arbitrage and speculation, etc. Methodology Devise competitive advantages and business models made possible by Big Data thanks to new large volume storage and data processing opportunities. It is also necessary to take into account the regulatory requirements which big data makes it possible to comply with, covering audit, fraud detection (“Rogue trading”), and overall risk consolidation. Recommendations 1. Originally, then revised in 2012: unlimited storage (volume) and processing (speed) capacity for all types of document (variety). 2. Indices, asset prices, rate curves, etc. IN THE EYES OF OUR PARTNERS FURTHER READING... KEY POINTS o Big data should not only be seen as an alternative to conventional technologies. It also enables data to be processed more rapidly and at lower cost. o The three major features of a big data business solution are lower costs, better service continuity, and the elasticity of the solution. • Highly Available Transactions: Virtues and Limitations: Peter Bailis, Aaron Davidson, Alan Feket, Ali Ghodsi, Joseph M. Hellerstein, Ion Stoica, UC Berkeley and University of Sydney (2013). • Consumer Credit Risk Models via MachineLearning Algorithms: Amir Khandani and Adlar Kim, Journal of Banking & Finance34 (2010). By Omar Mehdi Roustoumi and Thierry Duchamp18 THE LOUIS BACHELIER RESEARCH REVIEW THE LOUIS BACHELIER RESEARCH REVIEW 19 • Are the classifications accurate? It is, for example, essential to be able to unambiguously identify the principal trading line of a given company, and not confuse it with secondary lines. • What checks are carried out on the accuracy of the data? Is the information simply requested from the actors, with all the risk of error, unintended or otherwise, thereby entailed, or is it systematically verified? To ensure high quality, it is vital to select the right data providers. IODS thus chose EUROFIDAI, a research institute founded by the CNRS in 2003, as its partner for stock exchange prices. For data on governance and mergers and acquisitions, the databases concerned were constructed by researchers, from the Paris-Dauphine University in the first case and from SKEMA in the second. For basic data on French companies, ALTARES was selected. This provider does not limit itself to obtaining information available at the registry of commercial courts. Individual contact is made at least once a month with all companies having a turnover in excess of €10 million, thus allowing the information to be verified and refined and more generally allowing data to be collected over and beyond the legal minimum, including, for example, the composition of executive committees and the identity of the heads of the main divisions in the company. The insistence on quality should not prevent the diversification of the types of data used. Advances in research often arise from the use of new data, which previously either did not exist or was not visible. For example, in the late 1980s, the exploitation of data from electronic markets – the Paris Stock Exchange having been a pioneer in this field – gave rise to the first publications in what would in later years become a prolific stream of research on market microstructure. Today, the growing mass of data from electronic bond trading platforms is perhaps a new frontier. This linkage of databases may also give rise to innovations in research. It is then necessary either to have common identifiers for the databases – though this is not always possible with regard to independent or even competing data providers – or to construct bridging tables allowing, for example, one to move from a database of company fundamentals to stock market databases. Specific data requirements for empirical research? Europe differs in two respects from the United States. First, European financial markets are still fragmented. The World Federation of Exchanges lists 16 member exchanges in Europe, despite market groupings such as the London Stock Exchange, Euronext, OMX and Deutsche Börse. In the United States, there are still only two (NYSE Euronext and NASDAQ OMX). The second problem specific to Europe is that even though some research clusters with impressive resources have emerged in various countries, the fact remains that the average budget available to European laboratories and teaching units is on average significantly lower than in the United States. The creation of IODS (INSEAD OEE Data Services) in 2011 should be seen in this context. Most useful data in finance is produced by and for market actors, not for academic research. The data is often accessible through ergonomic workstations with interactive visual displays. But in addition to visual display, research generally requires selecting relevant data by using all the variables as a selection criterion, not only those commonly used by practitioners. It is also important to be able to load bulk data and then carry out the processing specific to the research. That is why, whenever possible, data providers are asked to deliver flat files, which are stored on servers accessible through search engines that can be used in accordance with any selection criteria. It is also essential that databases be of high quality. In this regard the following questions are relevant. • How is missing data treated? If a market price on a stock is not available on a given day, it may be because its listing has been suspended and under no circumstances should the previous day’s price be used to make good the missing price. Conversely, information from a different source than the main flow should be searched for before being declared missing. S. Ince and R. Burt Porter (2006) showed that 7% of the ob- servations of U.S. share dividends in the Thomson Datastream Database (TDS) differed from CRSP, the standard academic database. • Is the database exempt from survivor bias? On average, investment funds that disappear from databases or securities whose listings are withdrawn have performed less well than the whole population before disappearing. The above-mentioned study showed that for this reason the TDS database overestimated the average performance of U.S. stocks by 2.40%. Most financial research published in scientific journals consists of empirical studies. The ease of access to data and the quality of the data are thus crucial production factors for the academic community. In this area, American researchers have a head start, thanks especially to the CRSP database of stock prices produced by the University of Chicago and the Compustat database of fundamental information on listed companies. European researchers are endeavouring to catch up. Macro-financial time series on savings can be classified on the basis of various factors: • The economic nature of the savingsproduct. The operational terminology of French national accounting is used because it provides a breakdown of all possible financialtransactions. But this breakdown is sometimes not fine-grained enough for analysis. More specialized information such as monetary statistics or statistics from professional associations is generally consistent with the terminology of national accounting. • The geographical dimension (country or group of countries) • The type of data: outstanding and transaction flow data, dissemination within the population, financial performance • Seasonality: raw series or seasonally adjusted series • Currency: the national currency or converted into euros or dollars Metadata should be documented, so as to clarify, for example, seasonal adjustment methods, statistical conversion methods and statistical discontinuities. Methodology When a study has entailed constructing a specific database, it is desirable to allow the entire academic community access to it, so that search results are verifiable, and to ensure updating that will allow development of future research. Market actors and data providers should ensure that the data is available to researchers. Recommendations IN THE EYES OF OUR PARTNERS FURTHER READING... KEY POINTS o The fragmentation of the European financial market should be taken into account for building recognized financial databases. o Financial databases are mostly produced by and for the market. They should be selected, edited, supplemented and interlinked to respond to the needs of empirical research. o Failure to correct data errors can lead to completely invalid empirical research results. • Ozgur S. Ince and R. Burt Porter (2006), “Individual Equity Return Data from Thomson Datastream: Handle with Care!”, Journal of Financial Research, Volume 29, Issue 4, pages 463–479 • Laurent Frésard, Christophe Pérignon and Anders Wilhelmsson, (2011), “The Pernicious Effects of Contaminated Data in Risk Management”, Journal of Banking & Finance, Volume 35, Pages: 2569-2583 • Roman Brückner, Patrick Lehmann, Martin H. Schmidt and Richard Stehle (2013), “Fama/French Factors for Germany: Which Set Is Best?” Working paper, School of Business and Economics at Humboldt University in Berlin By Didier DavydoffSAVE THE DATE Journée des Chaires Louis Bachelier Palais Brongniart à Paris 29 Avril 2014 Renseignements et inscription sur www.louisbachelier.org 4couv_LJDC2014.indd 1 11/03/2014 19:16:40 Institut Louis Bachelier is at the forefront of the research in Big DataILB Research Cluster Startups Public Institutions Academic Research International Network Businesses Innovation International Consortiums Startups Incubator Applied Research Programs 60% R&D Tax Credit Go to Market Public and Private FundingCreated in September 2008 by the French Ministry of Finance, the Institut Louis Bachelier (ILB) is a global research network. Institut Louis Bachelier Ecosystem Startups Public Institutions Academic Research International Network Businesses Innovation The ILB is thus a unique organization, bringing together teams of the most talented researchers in mathematics, economics & business administration in the financial field. Operating on an international scale, Institut Louis Bachelier aims to support, to promote and to disseminate French research and teaching in economics and finance.2014- Big Data in Finance and InsuranceFinancial The Financial Risks International Forum is an International Research Forum for academics and professionals organized by Institut Louis Bachelier in Paris, France. •The 2014 Risk Forum pursues three objectives: to identify the main streams of research in Big Data that will structure the Finance and Insurance’s evolutions in the future; to organize presentations and debates on these new data trends; to assess the market and regulatory impacts of Big Data evolutions.A Renowned Scientific Council Including members from the following institutions : Centrale Paris, Columbia, Imperial College London, Sorbonne, Stanford, Pierre & Marie Curie, HEC Paris, Toronto, Evry, Göteborg, Cambridge, TSE, Dauphine, Zurich &Geneva.Big Data or Smart Data? Big Data : 3V Volume, Variety and Velocity The more you get, the Best it is? More and more data do not always give better correlations. Big Data have to be Smart Data. Granular Data collection should be as important as correlations. New jobs are going to emerge: Data Scientists integrate models and data approaches.From Data to Information Roberto Rigobon Professor of Applied Economics, Sloan School of Management, MIT.  The Bilion Prices Project : calculate inflaction with online prices collected on a daily basis all over the world Pr. Roberto Rigobon and its research team at MIT focused on Argentina among 20 countries studied. BBP points out a huge difference (expected) with the Argentinian National Institute of Statistics.Christian Gourieroux, Professor at the University of Toronto and and its PhD student, Andrew Hencic. The daily Bitcoin/USD exchange rate series displays episodes of local trends which can be modeled, and interpreted, as speculative bubbles. This paper uses a noncausal autoregressive process with Cauchy errors to model and predict the Bitcoin/USD exchange rate. Bitcoin and Data Analysis Andrew HencicEIF – Louis Bachelier Awards Best Paper Award in Finance for Sophie Moinas and Sébastien Pouget, scholars at the Toulouse School of Economics. Paper : « The bubble game : an experimental analysis of speculation. Best Hot Topic Paper Award for Pierre Henry Larbordère, scholars at Ecole Polytechnique and quatitative research analyst at Société Générale, for its paper : « Model-Independent Bounds for Option Prices – a Mass Transport Approach ». Best Young Researcher Award in Finance for : •Mathieu Rosenbaum, Professor at University of Paris – Pierre & Marie Curie and at Ecole Polytechnique. •Christophe Pérignon, Professor of Finance at HEC Paris.Mathieu Rosenbaum Professor at : University of Paris – Pierre & Marie Curie Ecole Polytechnique Best Young Researcher Award in Finance 2014 Market microstructure and High Frequency trading •Statistical approach to build new models •Optimization of HFT methods •Collaborative research between economists, mathematicians and physicists. •Access to banks’ databaseLouis Bachelier Review - Big Data Big Data, what is at stake for the academic world and the industry? Informatics and Statistcs, the need for cooperation. Empirical research, the need for Big (and Smart) Data. Les Cahiers Louis Bachelier is the Academic Review of the Institut regarding hot academic topics. French best scholars addresses their last research and results. www.strategie.gouv.fr Analyse des big data Quels usages, quels défis ? 11/2013 No LA Note D 08 ’ANALyse La multiplication croissante des données produites et le développement d’outils informatiques permettant de les analyser offre d’innombrables possibilités tant pour l’État que pour les entreprises. Il ne fait aucun doute que le traitement de ces masses de données, ou big data, jouera un rôle primordial dans la société de demain, car il trouve des applications dans des domaines aussi variés que les sciences, le marketing, les services client, le développement durable, les transports, la santé, ou encore l’éducation. Par ailleurs, le potentiel économique de ce secteur est indéniable et les retombées en termes d’emploi et de création de richesse seront non négligeables. Son développement nécessite toutefois de bien comprendre les enjeux qui y sont liés. C'est l'objectif de cette note, qui s'attache à détailler ce qu'est l'analyse des big data et présente les usages possibles de ces technologies, qu'il s'agisse de rendre la gestion plus efficace, d'améliorer les services rendus ou de prévenir des phénomènes nuisibles (épidémies, criminalité, etc.). Elle expose les principales difficultés associées à ces usages : garantir la confidentialité et le respect de la vie privée. Enfin, elle montre comment diffé- rents pays et entreprises ont d’ores et déjà investi dans ce secteur. g Marie-Pierre Hamel et DavidMarguerit, département Questions sociales2 L’accroissement des données produites par les entreprises, les particuliers, les scientifiques et les acteurs publics, couplé au développement d’outils informatiques, offre de nouvelles perspectives d’analyses. Ces dernières ont des répercussions importantes en termes de création d’emploi, de recherche et développement ou d’amélioration des services et de leur gestion1 . Cette note définit tout d’abord ce qu’est l’analyse des big data. Elle montre en quoi c'est un phénomène nouveau et à quelles évolutions sociales et techniques il est lié. Elle détaille ensuite les usages et les possibilités offertes par les analyses de masses de données et leurs applications concrètes. Puis elle s’attache à signaler les principaux risques associés à ces usages. L’analyse des big data peut engendrer des inquiétudes du fait du croisement d'un grand nombre de données. Ainsi, se pose la question des conditions nécessaires au respect de la vie privée et à la sécurité des données. Enfin, cette note présente les grandes stratégies mises en œuvre par le secteur privé et les gouvernements de différents pays et détermine quelles sont les conditions indispensables au développement de l’analyse des big data. DÉFINIR L’ANALYSE DES BIG DATA Big data et 5 V Le volume de données numériques augmente de manière exponentielle : 90 % de l’ensemble des données aujourd’hui disponibles ont été créées ces deux dernières années2 . Alors que l’on parlait il y a peu de gigaoctets (109 octets), on parle maintenant plutôt de téraoctets (1012 octets), de pétaoctets (1015 octets), d’exaoctets (1018 octets) et même de zettaoctets (1021 octets) 3 . Cette augmentation s’explique principalement par les évolutions techniques et d’infrastructures. Entre 1990 et 2011, le pourcentage des utilisateurs d’internet et de téléphones mobiles au niveau mondial est passé respectivement de 0,05 % à 32,7 %4 et de 0,21 % à 85,5 %5 . Entre les troisièmes trimestres de 2011 et de 2012, les ventes mondiales de tablettes numériques et de smartphones ont pour leur part augmenté de 45,2 %6 . Ericsson prédit qu’il y aura 50 milliards d’objets connectés (encadré 1) dans le monde d’ici à 2020, contre environ 12 milliards aujourd’hui 7 . Le développement d’applications et de réseaux sociaux liés à ces nouvelles technologies explique aussi la création de données. L’avènement d’outils comme le cloud computing (encadré 1) permet par ailleurs de stocker des données à moindre coût. Globalement, le prix d’un gigaoctet pour un disque dur est passé d’environ 16 USD (12,30 euros) en février 2000 à 0,10 USD (0,07 euros) en août 20108 . Les eNjeux 1. World Economic Forum (2012), Big Data, Big Impact: New Possibilities for International Development. 2. Brasseur C.(2013), Enjeux et usages du big data.Technologies, méthodes et mises en œuvre, Paris, Lavoisier, p. 30. 3. 1 téraoctet représente par exemple 6 millions de livres, 1 pétaoctet représente 2 milliards de photos numériques de résolution moyenne, et 1,8 zettaoctets représentent toutes les informations enregistrées en 2011. 4. Banque mondiale (2013), World Development Indicators. 5. Ibid. 6. IDC – Press Release (2012), Smartphones Drive Third Quarter Growth in the Worldwide Mobile Phone Market, According to IDC, 25 octobre. 7. Ericsson White Paper(2011), More than 50 Billion Connected Devices. 8. http://ns1758.ca/winch/winchest.html.3 www.strategie.gouv.fr 11/2013 No 08 LA Note D’ANALyse 9. Brasseur C.(2013), op. cit., p. 30. 10. Data center : en français, “centre de traitement de données”. Il s’agit d’un site physique sur lequel se trouvent regroupés des équipements constituants du système d’information d’une entreprise ou d’une institution, que ce stockage soit interne et/ou externe à l’entreprise, exploité ou non avec le soutien de prestataires. 11. Gille L. etMarchandise J.-F.(dir.)(2013), La dynamique d’Internet. Prospective 2030, étude réalisée pour le Commissariat à la stratégie et à la prospective, Paris, Études, n° 1. 12. Mayer-Schönberger V. et Cukier K.(2013), Big Data. A Revolution That WillTransform How We Live, Work, and Think, Boston, New York, Eamon Dolan, Houghton Mifflin Harcourt, p. 60. 13. http://www.smartplanet.fr/smart-technology/fin-des-embouteillages-lautoroute-du-futur-plus-efficace-a-273-17768/. 14. http://talkingtechno.com/2013/02/26/un-faux-tweet-plombe-le-cours-de-bourse-dune-entreprise-le-web-et-la-folie-des-rumeurs/. 15. GFII(2012), Dossier de synthèse de la journée d’étude du GFII “Big data : exploiter de grands volumes de données : quels enjeux pour les acteurs du marché de l’information et de la croissance ?”. eNcADré 1. éLéMeNts De DéfiNitioN Big data : Énormes volumes de données structurées et non structurées, difficilement gérables avec des solutions classiques de stockage et de traitement 9 . Ces données proviennent de sources diverses et sont(pour la plupart) produites en temps réel. cloud computing : Désigne des prestations à distance – logiciels, stockage de données – physiquement réparties dans des data centers10 et non pas sur le terminal de l’utilisateur. Datamining : Ensemble de techniques ayant pour objet l’extraction d’un savoir à partir de grandes quantités de données, par des méthodes automatiques ou semiautomatiques. internet des objets : Désigne les objets connectés à internet qui transmettent des données numériques par le biais de puces radiofréquences (RFID). Ces objets peuvent communiquer entre eux. On les retrouve dans la grande distribution, dans les objets du quotidien (podomètres connectés, domotique, compteurs électriques intelligents), dans les avions, les voitures, dans le monde médical, etc. 11 . open data : Processus d’ouverture des données publiques ou privées pour les rendre disponibles à l’ensemble de la population sans restriction juridique, technique ou financière. L’open data contribue à l’augmentation des données disponibles à l’analyse. Tout l’intérêt des masses de données ne réside pas uniquement dans leur quantité. Le volume à partir duquel il est possible de parler de big data ne fait d’ailleurs pas l’unanimité. L’analyse des big data comprend quatre autres critères que l’on retrouve de façon plus ou moins simultanée : vitesse, variété, véracité, valeur. La vitesse réfère aux délais d’actualisation et d’analyse des données numériques. Les données ne sont plus traitées en différé, mais en temps réel (ou quasi réel). Selon les cas, il est même possible de ne plus stocker les informations, mais de les analyser en flux (streaming). Cette rapidité peut être primordiale. Au Canada, en analysant en temps réel les informations sur l’état de santé de bébés prématurés avec un logiciel d’aide au diagnostic (encadré 2), des infections ont pu être détectées vingtquatre heures avant la manifestation de symptômes visibles12 . Autre exemple : en croisant les données de capteurs installés sur des éoliennes avec celles relatives à la météo ou aux marées, il est possible d’optimiser leur orientation en temps réel, de mieux prévoir les temps de maintenance, etc. De la même façon, des voitures autopilotées, “communicantes” entre elles et avec l’environnement, sont aussi en développement pour éviter les accidents (données venant de capteurs des voitures, de capteurs sous les routes, données de prévision météo, données historiques/statistiques de densité de trafic, etc.) 13 . Autre caractéristique, les données analysées ne sont plus forcément structurées comme dans les analyses anté- rieures,mais peuvent être du texte, des images, du contenu multimédia, des traces numériques, des objets connectés, etc. (variété). Par exemple, alors qu’il n’existait auparavant pas de systèmes permettant d'analyser automatiquement du texte, il est aujourd’hui possible d’étudier l’état de l’opinion via les tweets (social medias analysis), ou encore de proposer une aide au diagnostic en se basant sur la littérature médicale (encadré 2). Les acteurs du secteur mentionnent aussi la véracité ou la qualité des données. Par exemple, comment l'analyste peut-il s’assurer que les données de réseaux sociaux comme Facebook ne sont pas des rumeurs ou des diffusions malveillantes ? En 2013, une information d’un faux compte Twitter a dégradé le cours de l’action d’une société cotée au NASDAQ. Le tweet a entraîné l’échange de 300 000 actions en deux minutes, et une baisse de 25 % de la valeur de l’action14 .Autre exemple : un capteur défectueux utilisé dans un système de conduite assistée peut causer un accident. À ces quatre V s’ajoute souvent un cinquième, qui désigne la valeur qu’il est possible de tirer de ces données, les usages qu’elles produisent 15 . Outils et méthodes Pour répondre aux besoins provenant d’entreprises comme Google ou Facebook, des logiciels capables de traiter de gigantesques volumes de données structurées et non structurées ont vu le jour, pour la plupart il y a moins de cinq ans. Ces logiciels, souvent open source comme Hadoop, peuvent distribuer des données simultanément sur plusieurs serveurs. D’autres logiciels, à4 l’image de MapReduce¸ servent à effectuer des calculs en parallèle avec ces données distribuées. On bénéficie ainsi de la puissance de calcul concomitante de multiples serveurs banalisés en cluster (secteurs). Pour améliorer le traitement des données, les logiciels doivent être capables de détecter l’information intéressante : on parle alors de datamining16 (encadré 1). De plus, l’analyste utilise une méthode inductive et non plus déductive : il cherche à établir des corrélations entre plusieurs informations sans hypothèses prédéfinies. Le projet BrainsSCANr a permis la fabrication d’un logiciel qui, en s'appuyant sur 3,5 millions de résumés d’articles scientifiques, fait automatiquement un lien entre des parties du cerveau et certaines maladies. Les corrélations faibles sont les plus intéressantes, car elles représentent celles qui n’ont pas souvent fait l’objet de recherches. Ainsi, un lien entre “migraine” et “striatum” a été mis au jour, l’ordinateur ouvrant de lui-même une nouvelle piste de recherche17 . Les logiciels, évolutifs, peuvent aussi appréhender l’environnement des données et apprendre des résultats antérieurs. On parle alors de machine learning ou d’apprentissage automatique (encadré 2). eNcADré 2. WAtsoN-iBM Watson est un programme informatique d’intelligence artificielle conçu par IBM dans le but de répondre à des questions formulées en langage naturel. Pour développer ce programme, IBM s’est donné un objectif ludique. Il s’agissait de remporter le jeu télévisé américain Jeopardy! contre des champions. Ce jeu consiste en l’énoncé de réponses pour lesquelles les candidats ont à trouver les questions correspondantes. Le programme informatique doit pouvoir comprendre l’énoncé (en langage naturel) et trouver la question dans un temps de réflexion comparable à celui des humains. Ce programme d’intelligence artificielle utilise le logiciel Hadoop (voir supra) afin de parcourir une grande quantité de contenus (200 millions de pages lors de sa victoire à Jeopardy!)très rapidement(en moins de trois secondes pour Jeopardy!). Watson évalue la probabilité que la réponse qu’il trouve soit la bonne, répondant seulement si celle-ci est jugée assez élevée. IBMcherche maintenant à commercialiserl’utilisation de Watson.Watson est par exemple utile dans le domaine du diagnostic médical. En analysantles symptômes etles données médicales fournis par un médecin (en langage naturel), etles connaissances emmagasinées (dictionnaires médicaux, littérature scientifique, études de cas, etc.), selon un modèle de machine learning qui lui permet d’apprendre des diagnostics antérieurs, Watson propose un diagnostic. Ce dernier est évalué selon une probabilité et le raisonnement est explicité. D’autres applications sont envisagées : dans les métiers du droit(étant donné l’importance des législations, des réglementations, etc.), l’analyse de dossiers, le conseil financier, etc. La technologie big data est également associée au développement de logiciels capables de rendre intelligibles les résultats – rendu possible par l'émergence de nouveaux outils de visualisation (images, diagrammes, animations). COMPRENDRE LE POTENTIEL DES ANALYSES DES BIG DATA Simplifier et adapter les services L’analyse des big data permet tout d’abord de mieux écouter les usagers, de mieux comprendre leurs modes d’utilisation des services et d’affiner l’offre. Google Analytics propose par exemple aux entreprises d’améliorer la conception de leur site internet par l’analyse des visites des internautes. Ces applications ont aussi leur utilité dans le secteur public. Avec l’éducation en ligne (dont les Massive Open Online Courses – MOOC), on peut analyser les activités des élèves (temps consacré, façon de suivre les programmes, arrêt-retour dans les vidéos pédagogiques, recherches internet parallèles, etc.) pour améliorer les modes d’enseignement. Dans le domaine des transports, on modélise les déplacements des populations pour adapter les infrastructures et les services (horaires des trains, etc.). À cette fin, les données provenant des pass de transports en commun, des vélos et des voitures “communes”, mais aussi de la géolocalisation (données cellulaires et systèmes de localisation par satellites) de personnes ou de voitures, sont utilisées. Dans un autre domaine, celui de la logistique, à la suite du séisme qui s’est produit en Haïti en 2010, les mouvements de foule ont été analysés à l’aide des données cellulaires pour faciliter la distribution de l’aide18 .Toujours en Haïti, l’épidémie de choléra qui s’est développée après le tremblement de terre a été mieux combattue grâce à l’étude des déplacements des personnes contaminées19 . Autre exemple, les analyses peuvent faciliter la recherche d’emploi. Il s’agit de combiner les qualifications des indi- 16. Brasseur C.(2013), op. cit. 17. Fischmann S.(2013), Sciences et technologies de l’information et de la communication. Big data, partie 2 : le quatrième paradigme de la science, Bulletins électroniques États-Unis, n° 336, Ambassade de France aux États-Unis / ADIT. 18. World Economic Forum (2012), op. cit., p. 5. 19. Ibid.5 www.strategie.gouv.fr 11/2013 No 08 LA Note D’ANALyse 20.TechAmerica Foundation (2012), Demystifying Big Data: A Practical Guide To Transforming The Business of Government, p. 15. 21. Hamel M.-P.(2012), “Fraude, indus, non-recours : comment faciliter le juste paiement des prestations sociales ?”, La Note d'analyse, Centre d’analyse stratégique, n° 306, novembre ; Hamel M.-P.(2013), “Comment utiliser les technologies numériques pour poursuivre l'amélioration des relations entre l'administration et ses usagers ?”, La Note d'analyse, Centre d’analyse stratégique, n° 317, janvier. 22. Yiu C.(2012),The Big Data Opportunity: Making Government Faster, Smarter and More Personal, Policy Exchange, p. 13. 23.TechAmerica Foundation (2012), Demystifying Big Data: A Practical Guide To Transforming The Business of Government, p. 12 ; McKinsey Global Institute (2011), Big Data. The Next Frontier for Innovation, Competition, and Productivity, 156 p. 24. Jouniaux P.(2013), “Big data au service de la sécurité du transport aérien : l’analyse des données de vol”,Télécom, n° 169, juillet. 25. À ce sujet, voir Siegel E.(2013), Predictive Analytics:The Power to Predict Who Will Click, Buy, Lie, or Die, John Wiley & Sons. d’économiser des ressources23 . Une entreprise peut, par exemple, suivre ses ventes en temps réel pour mieux réapprovisionner ses stocks. De même, une administration publique peut suivre l’activité des agents, le versement de prestations, l’accroissement des demandes, etc. Les possibilités sont multiples et s’appliquent à une infinité de secteurs. Le datamining (encadré 1) de masses de données est par exemple très performant pour détecter les fraudes. En analysant quantité de données sur des populations de fraudeurs, on découvrira certains profils types qui n’étaient pas “visibles”. Il est alors possible de mieux cibler les contrôles (l’administration douanière fran- çaise commençe à utiliser ces technologies). Le traitement en temps réel permet aussi de lancer des alertes : l’émission d’une contravention pourrait par exemple permettre de détecter qu’un individu en congé maladie ne devrait pas se trouver dans un département différent de celui où il réside. En matière d’énergie et de développement durable, les systèmes de compteurs intelligents (électricité, gaz, eau) rationalisent la consommation énergétique. En plus d’offrir aux citoyens la possibilité de mieux contrôler leur consommation, ils permettent de couper à distance, avec l’accord des clients, l’alimentation d’équipements pour éviter les surcharges du réseau. De même, en analysant les données provenant de capteurs sur les avions et en les associant à des données météo, on modifie les couloirs aériens pour réaliser des économies de carburant, on améliore la conception, la maintenance des avions ou leur sécurité24 . Prédire et prévenir L’analyse des masses de données permet plus spécifiquement d’anticiper, avec un certain degré de certitude, des comportements ou des besoins25 . La société Critéo vend, par exemple, des services de publicités ciblées sous forme de bannières affichées sur les sites consultés. Il s’agit d’analyser une importante quantité d’informations sur les habitudes de consommation des internautes pour établir des corrélations, et ainsi prévoir leurs achats. De la même façon, l’enseigne américaine Target parvient à identifier les femmes qui attendent un enfant pour leur proposer des produits pour nourrisson. À cette fin, les analystes ont corrélé des millions de données à l’aide de cartes de fidélité de femmes ouvrant une liste de cadeaux vidus avec les offres d’emploi (issues des sites internet de type Le Bon Coin, des sites d’entreprises, des sites administratifs, etc.). Les analyses permettent aussi d’identifier les formations pertinentes, d’anticiper les reconversions, d’adapter la recherche aux besoins du marché20 . L’entreprise Monster.fr utilise ainsi un logiciel, conçu sur le modèle d’un site de rencontre, qui vise à trouver l’employeur idéal en croisant les compétences, mais aussi les affinités “psychologiques”, les caractéristiques des individus embauchés, etc. L’analyse de masses de données permet également de mieux comprendre les sentiments ou les besoins des citoyens. Pour la campagne de réélection de Barack Obama en 2012, les conseillers ont analysé localement les messages sur Twitter pour adapter en direct le discours du président.Autre exemple, en France, la mairie de Toulouse a demandé en 2013 à la société Apicube d’analyser 1,6 million de documents (tweet, Facebook, blogs, forums, etc.) pour mieux connaître les sujets de préoccupation des citoyens. Ces analyses ont toutefois leurs limites en termes de représentativité de la population. Elles permettent encore d’envoyer à un usager des informations sur des services publics ou privés suivant l’évolution, en temps quasi réel, de sa situation. On peut imaginer qu’une information fournie par un employeur déclenche l’octroi d’une prestation sociale ou en facilite le calcul 21 . L’amélioration des services publics passe aussi par la limitation des demandes de pièces justificatives, la majorité des informations se trouvant déjà dans les masses de données détenues par les institutions publiques. Au Royaume-Uni, pour les demandes de nouveaux permis, l’agence en charge des permis de conduire et de l’immatriculation des véhicules peut récupérer les photographies et les signatures nécessaires dans les données en ligne du service en charge des passeports (si le demandeur a un passeport) 22 . Les analyses permettent également de préremplir les formulaires administratifs en croisant les données. Améliorer les performances gestionnaires Les analyses de données massives peuvent accroître la transparence administrative, faciliter l’évaluation des services, assister la prise de décision, ou permettre6 de naissance. Ils ont observé qu’elles commençaient à acheter des crèmes sans parfum à environ trois mois de grossesse, puis certains suppléments alimentaires à un stade de grossesse plus avancé. Ces profils de comportements ont ensuite été étendus à toute la clientèle. Target s’est toutefois retrouvé au cœur d’un scandale, un père ayant découvert la grossesse de sa fille mineure parce qu’elle recevait ces publicités ciblées26 . Dans le domaine de la santé, il est possible de mieux prévenir certaines maladies ou épidémies, ou d’améliorer le traitement des patients. En analysant les recherches des internautes sur Google, une équipe est parvenue à détecter plus rapidement l’arrivée des épidémies de grippe27 . Autre exemple, en s’intéressant aux données disponibles sur Facebook, des chercheurs ont détecté les adolescents ayant des comportements à risque pour cibler les campagnes de prévention28 . Les technologies associées aux big data permettent aussi des avancées spectaculaires dans l’analyse du génome humain. Alors qu’il a fallu dix ans et 3 milliards USD (2,3 milliards d’euros) pour réaliser le premier séquen- çage humain complet, il est maintenant possible d’en réaliser un en quelques jours et pour environ 1 000 USD (760 euros) 29 . Ces connaissances, couplées à d’autres informations, permettent de mieux comprendre l’évolution de pathologies, d’améliorer les mesures de prévention ou encore les protocoles de soins (encadré 3). eNcADré 3. coHorte coNstANces La cohorte Constances est une enquête épidémiologique ayant pour objectif de suivre à long terme un échantillon représentatif de 200 000 personnes affiliées au régime général de la Sécurité sociale30 . Elle est menée en partenariat par l’Institut national de la santé et de la recherche médicale (INSERM), l’université Versailles-Saint Quentin, la Caisse nationale d’assurance maladie des travailleurs salariés (CNAMTS), et la Caisse nationale d’assurance vieillesse (CNAV), avec le soutien du ministère de la Santé. Les personnes enquêtées, âgées de 18 à 69 ans à l’inclusion, ont été sélectionnées par tirage au sort. Les volontaires doivent répondre annuellement à un questionnaire et passer un examen de santé tous les cinq ans. Ces données sont ensuite appariées tous les ans avec celles de la CNAMTS (SNIIRAM31 et PMSI 32 ), de la CNAV (SNGC33 ) et de l’INSERM (données sur les causes de décès). L’équipe de recherche souhaite intégrer ultérieurement dans la cohorte des données sous forme d’images, par exemple des résultats de résonance magnétique ou de séquençage du génome. Le croisement des données sur la séquence d’ADN, les pathologies déclarées et l’environnement de vie (type de profession, lieu d’habitation, etc.) permettra notamment d’améliorer la compréhension des mécanismes de l’épigénétique34 . La prévention des crimes est l’une des applications possibles de l’analyse des masses de données. La police et l’université de Memphis ont développé un programme (Blue Crush), maintenant utilisé par de nombreuses villes, qui permet d’identifier les zones et les heures où des délits sont le plus à même d’avoir lieu, afin d’optimiser l’affectation des services35 . De la même façon, la ville de New York a développé un système pour détecter les logements où des incendies sont le plus susceptibles de se produire (squats, taudis, appartements surpeuplés, découpés en plusieurs “lots”, ne respectant pas les règles de sécurité). Il s’agit de croiser quantité de données issues de différents services et agences municipaux portant sur les cinq dernières années : informations sur les logements, procédures d’expulsion, impayés de gaz, d’électricité, de taxes municipales, visites d’ambulance, taux de criminalité, historique des incendies, etc. En appliquant des techniques de datamining à ces masses de données, on détermine des profils types de plaintes reçues sur la “hotline” de la ville (à propos de nuisances sonores, de troubles du voisinage, sur des suroccupations présumées). Lors de contrôles, ces profils sont le plus susceptibles de déboucher sur la détection de logements où les normes de sécurité ne sont pas respectées. Avant les analyses, 13 % des inspections donnaient finalement lieu à des évacuations pour des raisons de sécurité, contre environ 70 % aujourd’hui 36 . 26. Mayer-Schönberger V. et Cukier K.(2013), op. cit., p. 58. 27. Ginsberg J. et al.( 2009), “Detecting influenza epidemics using search engine query data”, Nature, n° 457, p. 1012-1014. 28. Moreno M. et al.(2012), “Associations between displayed alcohol references on facebook and problem drinking among college students”, Archives of Pediatrics & Adolescent Medicine, 166(2), p. 157-163. 29. Fischmann S.(2013) op. cit. 30. http://www.constances.fr/fr/. 31. Le Système national d'informations inter régimes d'assurance maladie (SNIIRAM) donne des informations sur les remboursements de l’assurance maladie aux particuliers. 32. Le Programme de médicalisation des systèmes d’information (PMSI): il renseigne les séjours hospitaliers des patients à des fins de remboursements. 33. Le Système national de gestion des carrières (SNGC)regroupe les informations sur la carrière des assurés : salaires, emplois occupés, congé maternité, invalidité, chômage, etc. 34. L’épigénétique est l’expression différenciée des gènes en fonction de l’environnement. En d’autres termes, deux personnes porteuses d’un même gène peuvent, ou non, développer une maladie selon l’influence de l’environnement sur ce gène. 35. http://www.memphispolice.org/blue%20crush.htm. 36. Mayer-Schönberger V. et Cukier K.(2013), op. cit., p. 185-189.7 www.strategie.gouv.fr 11/2013 No 08 LA Note D’ANALyse 37. http://www.washingtonpost.com/wp-srv/special/politics/prism-collection-documents/. 38. Loi 78-17 du 6 janvier 1978 modifiée. 39. Directive 95/46/CE du Parlement européen et du Conseil, du 24 octobre 1995, relative à la protection des personnes physiques à l’égard du traitement des données à caractère personnel et à la libre circulation de ces données, JOCE n° L 281 du 23/11/1995, p. 31. Proposition de règlement du Parlement européen et du Conseil relatif à la protection des personnes physiques à l’égard du traitement des données à caractère personnel et à la libre circulation de ces données (règlement général sur la protection des données), Bruxelles, le 25 janvier 2012, COM(2012) 11 final, 2012/0011 (COD). 40. Levallois-Barth C.(2013), Big data et protection des données personnelles : un défi(quasi)impossible ?,Télécom, n° 169, juillet. 41. À ce sujet, voir le premier cahier “Innovation et prospective” de la CNIL, Vie privée à l’horizon 2020, p. 32-33. 42. Levallois-Barth C.(2013), op. cit. 43. Ibid. 44. Pas de motif légitime à invoquer dans le cadre de la prospection commerciale. 45. Levallois-Barth C.(2013), op. cit. 46. CNIL, Décision n° 2013-025 du 10 juin 2013 de la présidente de la CNIL mettant en demeure la société GOOGLE INC. PRENDRE EN COMPTE LES RISQUES Le développement de l’analyse de masses de données doit s’accompagner d’un questionnement relatif à la protection des données. Le récent scandale “Prism” sur la transmission de données d’utilisateurs d’internet à des fins de surveillance – entre des compagnies comme Google, Yahoo !, Microsoft, Apple, Aol, You Tube, Skype, Paltalk ou Facebook et les services de renseignements américains (National Security Agency) – a d’ailleurs donné une attention considérable à cette problématique et pourrait avoir de lourdes conséquences pour le secteur 37 . Respecter la vie privée Traiter les données à caractère personnel En France, l’usage des données à caractère personnel est réglementé par la loi “Informatique et Libertés38 ”. Dans sa version modifiée, cette loi transpose directement la directive européenne de 1995 relative à la protection des données que le projet de règlement européen du 25 janvier 2012 doit réviser 39 . Pour la loi, la donnée personnelle concerne toutes les informations relatives à une personne physique identifiée ou qui peut être identifiée par des éléments qui lui sont propres. Pour déterminer si une personne est identifiable, tous les moyens auxquels l’analyste peut avoir accès sont pris en considération. Beaucoup de données peuvent alors permettre cette identification – comme un numéro de téléphone, des données de géolocalisation ou une adresse IP –, et surtout lorsqu’elles sont combinées à d’autres40 . Leur utilisation peut aussi se faire à la suite d’une anonymisation qui suppose de détruire le lien entre l’information et l’identité. Cependant, compte tenu des possibilités de croisement des données permises par l’analyse des big data, cette anonymisation est quasiment impossible à obtenir. Toutes les données doivent-elles pour autant être considérées comme personnelles41 ? Leur utilisation étant souvent fort utile, comme dans le champ de la santé, cette voie serait contreproductive si elle conduisait à empêcher toute exploitation de données imparfaitement anonymisées. L’anonymisation a, en tout cas, le mérite de compliquer la tâche de ceux qui seraient mal intentionnés42 . La loi “Informatique et Libertés” précise par ailleurs que ces données personnelles doivent être collectées et traitées pour des finalités déterminées, explicites et légitimes. Seules les données pertinentes pour un usage défini peuvent donc être collectées. Leur durée de conservation ne doit pas excéder le temps nécessaire à l’atteinte des objectifs pour lesquels elles sont collectées (passé ce délai, prévaut le “droit à l’oubli” ou l’obligation de destruction des données). Même si les données ne sont pas enregistrées mais traitées en temps réel, la loi s’applique. Dans le cadre des débats européens sur le projet de règlement européen du 25 janvier 2012, la position de la Commission est que la finalité de l’utilisation des données personnelles devrait être clairement établie. Avec l’analyse des big data, il est cependant difficile d’anticiper quel usage il en sera fait. La collecte ciblée et le principe de suppression entrent par ailleurs en contradiction avec la nécessité d’un volume de données le plus important possible43 . La loi “Informatique et Libertés” reconnaît aussi le droit d’être informé de la collecte et de l’utilisation des données, et en particulier de la finalité du traitement, de l’identité du responsable du traitement ou des destinataires des données et des droits dont ils disposent (des droits d’accès, de rectification, d’opposition peuvent être exercés pour motif légitime) 44 . Selon le même principe, la Commission européenne veut demander un consentement explicite par type de données. La législation est cependant allégée lorsque les données collectées sont très vite anonymisées. Le consentement, lorsqu’il est requis par la loi, est en tout cas supposé offrir à la personne un pouvoir. Il désigne toute manifestation de volonté libre, spécifique ou informée45 . Selon la CNIL et pour plusieurs autorités européennes de protection des données personnelles, cette autorisation donnée dans un contexte spécifique ne correspond pas aux pratiques actuelles de Google. On reproche ainsi à l’entreprise un manque de transparence et d’information envers les usagers concernant l’utilisation de leurs données et la maîtrise de celles-ci 46 .8 Même s’il est explicitement demandé, le consentement peut être biaisé ou manipulé – la personne pouvant être poussée à le donner 47 . Cependant, dans certains cas, par exemple pour détecter plus rapidement des épidémies, le champ du consentement pourrait être élargi aux fins de l’intérêt général 48 . La question du consentement rejoint celle du “détenteur de la donnée”. Qui peut avoir accès aux données disponibles sur Internet, comme les données publiques des réseaux sociaux ? D’abord gratuites, la plupart sont maintenant payantes et constituent l’actif principal d’entreprises comme Facebook ou Google, d’où leur opposition à la législation européenne. Alors que les organisations produisaient et utilisaient jusqu’à maintenant leurs propres données, des data brokers revendent aujourd’hui les données d’entreprises ou encore de l’État à divers acteurs49 . On estime ainsi que la société américaine Acxiom, spé- cialisée dans le recueil et la vente d’informations, et qui a dégagé un revenu de 1,15 milliard de dollars en 2012, posséderait en moyenne 1 500 données sur 700 millions d’individus dans le monde50 . Traiter les données administratives En ce qui concerne la collecte et le traitement des données personnelles dont dispose l’administration, l’individu béné- ficie là encore du droit d’en être informé et de donner son consentement. Toutefois, dans le cadre des procédures administratives, de nombreuses obligations légales restreignent ses droits. Le consentement n’est par exemple pas requis lorsqu’une autorité administrative est légalement habilitée à obtenir, dans le cadre d’une mission particulière ou de l’exercice d’un droit de communication, la transmission directe d’informations par une autre autorité administrative51 . L’usager n’a alors aucun recours : c’est plutôt la CNIL qui autorise en amont les échanges. Le consentement à la transmission d’informations peut, par ailleurs, être difficile à maîtriser : pour un patient, le fait de remettre sa carte vitale à un médecin revient par exemple à consentir à ce que ce dernier ait accès aux données relatives à l’historique de ses remboursements52 . La transmission de données à des personnes extérieures à l’administration n’est en principe pas permise, mais des exceptions apparaissent, comme l’accès à des données de géolocalisation lorsqu’un usager utilise des services comme Proxima mobile53 . L’administration peut aussi – dans certains cas spécifiques prévus par une loi – vendre des données, comme les données de carte grise, sauf opposition de l’automobiliste qui peut cocher (s’il la remarque) une case sur son certificat de demande. Inté- ressants dans le cadre des big data, certains de ces usages reflètent une moins bonne prise en compte de la protection des données personnelles par l’administration. La CNIL réfléchit aux réglementations qui pourraient encadrer les analyses. Plus généralement, à côté des risques liés au traitement des données à caractère personnel, les progrès importants qui peuvent en résulter – pour le traitement de pathologies, l’octroi de droits sociaux ou encore la protection de l’environnement par exemple – doivent être mis dans la balance. Assurer la sécurité des données Au-delà des règles de traitement, se pose la question de la sécurité des outils utilisés pour traiter ces données. Les masses de données sont généralement stockées dans des clouds (encadré 1). Toutefois, les créateurs de ces technologies instaureraient régulièrement des backdoors54 leur permettant d’avoir accès à l’ensemble des données stockées. Ainsi, quelles que soient ces données, elles seraient théoriquement accessibles par le fournisseur du service. De plus, le Patriot Act, mis en place aux États-Unis après les attentats du 11 septembre 2001, accorde aux autorités américaines le droit d’accéder directement aux données cloud stockées sur les serveurs des sociétés américaines (ou des entreprises étrangères ayant des intérêts économiques dans le pays), et ce quel que soit leur lieu d'implantation. Pour assurer la sécurité de ces données personnelles, alors que les principaux clouds utilisés en France sont étrangers et que le recours à ces technologies de stockage s’est accru de 30 % en 201255 , l’État français finance, à hauteur de 150 millions d’euros, deux clouds computing nationaux dans le cadre d’un partenariat 47. Levallois-Barth C.(2013), op. cit. 48. Ibid. 49. Dans un rapport publié en 2012, la Commission fédérale américaine du commerce s’est souciée de l’essor de la profession d’information broker. Elle demande entre autres à ce que les citoyens puissent avoir accès aux informations que ces “vendeurs d’informations” ont sur eux. FederalTrade Commission (2012), Protecting Consumer Privacy in an Era of Rapid Change, mars. 50. http://www.zdnet.fr/actualites/data-brokers-aux-etats-unis-votre-vie-privee-est-en-vente-39789295.htm. 51. Article 6 de l’ordonnance du 8 décembre 2005, loi Informatique et Libertés. Cluzel-Métayer L.(2013), “Les téléservices publics face au droit à la confidentialité des données”, Revue française d’administration publique, n° 146, 2013/2, p. 405-418. 52. Cluzel-Métayer L.(2013), op. cit., p. 405-418. 53. Proxima mobile, disponible depuis mars 2010, est le portail des services aux citoyens sur terminal mobile. Cet outil permet d’identifier des services d’intérêt général, gratuits et sans publicité, accessibles sur terminaux mobiles, qui cherchent à faciliter la vie quotidienne de tous les citoyens. Diverses applications pour smartphones, dont une application du service des impôts, sont par exemple disponibles à partir de ce portail. 54. Les backdoors sont des points d’accès confidentiel à un système d’exploitation, à un programme ou à un service en ligne installés par le concepteur. 55. http://blog.markess.fr/2013/05/barometre-markess-des-prestataires-du-cloud-computing-2013.html.9 www.strategie.gouv.fr 11/2013 No 08 LA Note D’ANALyse 56. Le projet de cloud public Andromède s’est concrétisé en 2012 au travers de la création de Numergy et de Cloudwatt, deux sociétés nées de partenariats public-privé avec SFR et Bull d’un côté, et Orange etThales de l’autre. 57. Achiary A., Hamelin J. et Auverlot D.(2013), “Cybersécurité, l’urgence d’agir”, La note d’analyse, Centre d’analyse stratégique, n° 324, mars. 58. Voir les guides de sécurité sur la méthode de gestion des risques “IL” et sur le catalogue de mesures de sécurité à mettre en place, édités récemment par la CNIL. 59. Premier ministre, ANSSI, ministère du Budget, des Comptes publics et de la Réforme de l’État(DGME), Référentiel général de sécurité. Version 1.0 du 6 mai 2010. 60. Mayer-Schönberger V. et Cukier K(2013), op. cit., p. 157-163. 61. Reynaudi M. et Sauneron S.(2012), “Médecine prédictive : les balbutiements d’un concept aux enjeux considérables”, La note d’analyse, Centre d’analyse stratégique, n° 289, octobre. 62. Voir par exemple au sujet de la création de séries télévisées : http://www.salon.com/2013/02/01/how_netflix_is_turning_viewers_into_puppets/. 63.Tata Consultancy Service (2013),The Emerging Big Returns on Big Data. A TCS 2013 GlobalTrend Study. http://www.lesechos-conferences.fr/data/classes/produit_partenaire/fichier_5183_540.pdf. public-privé56 . Il est essentiel de poursuivre ces initiatives, tout en sensibilisant les acteurs privés aux risques sur les libertés et la vie privée57 . Pour protéger les données, des recommandations de la CNIL portent par ailleurs sur la sécurité des systèmes d’information et la gestion des risques liés au traitement des données personnelles58 . On vise à protéger les ordinateurs et les données stockées contre les intrusions, les virus, ou les dommages causés aux données. Le projet de règlement européen en cours d’adoption vise aussi à mettre à la charge des responsables de traitement informatique des obligations, comme celle de prendre en compte la protection des données dès la conception des systèmes (privacy by design). Concernant les échanges d’informations entre administrations, des outils de sécurisation sont mis à disposition par le Secrétariat général pour la modernisation de l’action publique (SGMAP). Le Référentiel général de sécurité (RGS) veut sécuriser, en fixant des règles, les échanges électroniques entre les usagers et les autorités administratives et entre les autorités administratives59 . La Plateforme d’échange de confiance (PEC) met, pour sa part, en place un système d’intermédiation entre les administrations et les partenaires/usagers pour leur permettre de communiquer en confiance. Protéger les libertés individuelles Certains usages des big data posent par ailleurs des risques pour les libertés individuelles. Comme cela a été dit plus haut, de nombreux États américains utilisent des logiciels qui permettent de prédire les moments ou les lieux où des crimes sont les plus à même d’être commis. Cela signifie que les individus les plus susceptibles de commettre un crime à un moment et un lieu donnés pourront sans doute être identifiés avec beaucoup de précision60 . Comment tirer profit de ces connaissances sans mettre en péril les libertés individuelles ? En permettant de mieux anticiper les comportements, mais aussi l’apparition de maladies associées à des profils génétiques, ces technologies pourraient aussi être utilisées par les services de santé ou les compagnies d’assurance pour refuser des traitements ou des clients, encadrer les comportements des assurés, etc. 61 . Quels garde-fous mettre en place ? À un autre niveau, la connaissance des comportements permettra sans doute de créer des produits de consommation, mais aussi des produits “culturels” (téléséries, cinéma, etc.) ou des services correspondant, au plus près, aux attentes, aux goûts et aux désirs des individus62 . Des questions comme celle du libre choix se posent alors. PROMOUVOIR LES BIG DATA Dans le secteur privé Les pays qui instaurent une stratégie nationale pour encourager l’analyse des big data font figure d’exception. Les sommes investies par le secteur public (voir infra) sont d’ailleurs minimes par rapport aux investissements privés. Selon une enquête internationale réalisée en 2012-2013 auprès de 1 217 entreprises ayant un chiffre d’affaires supérieur à 1 milliard USD (759,6 millions d’euros), 643 entreprises ont eu une stratégie big data en 2012 ; parmi celles-ci, 7 % ont investi au moins 500 millions USD (379,8 millions d’euros) et 15 % au moins 100 millions (75,9 millions d’euros) 63 . Les États-Unis sont sans doute le pays le plus avancé en termes de stratégie big data. En mars 2012, l’administration américaine a annoncé un investissement de 200 millions USD (154 millions d’euros) pour améliorer les technologies (stockage, analyse, collecte des données), accélérer la recherche en science et en ingénierie, renforcer la sécurité nationale, transformer l’enseignement et l’apprentissage, et développer une main-d’œuvre qualifiée dans le secteur. L’Irlande aspire pour sa part à devenir le pays de réfé- rence des technologies big data. Le Plan d’action pour l’emploi de 2013 prévoit le développement d’une filière big data depuis la formation de la main-d’œuvre jusqu’à la création ou l’installation d’entreprises. S’y ajoute un investissement de 1 million d’euros pour développer un centre de recherche dont les grandes orientations seront définies par un consortium d’entreprises privées. De son côté, la Commission européenne a entre autres mis en place le programme Big Data Public Private Forum (2012). Sur une période de vingt-six mois, 3 millions d’euros seront au total investis pour la création d’un forum internet visant à définir les grandes orientations en10 matière d’analyse des big data au sein de l’Union européenne. Ce projet veut fournir une plateforme de discussion sur l’émergence d’une économie de la donnée pour l’industrie, la recherche et les décideurs politiques. La France est entrée très récemment dans la course à l’analyse des big data. Dans le cadre des investissements d’avenir, sept projets traitant des big data ont été sélectionnés pour recevoir 11,5 millions d’euros, quatre autres projets sont en cours d’instruction et un nouvel appel à projets devrait avoir lieu avant la fin de 2013. Les projets financés rassemblent une grande diversité d’acteurs : concepteurs de systèmes informatiques, éditeurs de logiciels, intégrateurs de technologies, laboratoires de recherche et un nombre important de start-up. Les retombées attendues sont multiples, touchant au marketing ou à la recherche génétique. En parallèle, la ministre déléguée auprès du ministre du Redressement productif chargée des petites et moyennes entreprises, de l'innovation et de l’économie numérique a créé une mission ayant pour but de définir les grandes orientations nécessaires à l’émergence d’une filière big data. Pour la période 2013-2018, cette mission préconise de créer un “incubateur” parisien avec un investissement de 300 millions d’euros provenant de fonds publicsprivés. Elle estime que la valeur générée par cet investissement pourrait atteindre 2,8 milliards d’euros et créer dix mille emplois directs sur la période64 . Environ cent start-up spécialisées dans les applications big data doivent ainsi être financées. Plusieurs autres travaux insistent sur le développement de la filière en France. Citons le rapport de la Commission innovation 2025 qui fait du développement des analyses big data l’une des “sept ambitions pour une France innovante et dynamique65 ”, mais aussi le rapport La nouvelle France industrielle présenté par Arnaud Montebourg en septembre 2013, qui désigne les big data comme l’un des 34 plans prioritaires66 . La France investit également dans le développement d’outils spécifiques de stockage de données (voir supra) ou encore dans la création de moteurs de recherche nationaux comme Quaero67 . La majorité des données créées sur internet sont en effet détenues par des entreprises étrangères, et principalement états-uniennes. En France, la part de marché de Google sur les moteurs de recherche était estimée à 90,9 % en avril 201368 . Cette situation est problématique, d’une part en termes de 64. http://www.afdel.fr/actualites/categorie/actualite-afdel/article/big-data-filiere-d-avenir-pour-la-france-les-propositions-de-l-afdel. 65. Commission innovation 2025 (2013), Un principe et sept ambitions pour l’innovation, commission présidée par Anne Lauvergeon, Paris, La Documentation française, octobre. 66. Ministère du Redressement productif, La nouvelle France industrielle, Paris, 2013. 67. À l’origine un projet franco-allemand, puis seulement français. 68. http://www.atinternet.fr/documents/barometre-des-moteurs-avril-2013/. 69. McKinsey Global Institute (2011), Big Data.The Next Frontier for Innovation, Competition, and Productivity, 156 p. 70.Télécom ParisTech. compétitivité et de création de “richesse”, d’autre part en termes de relations stratégiques : il peut être préoccupant que des acteurs étrangers et/ou privés en sachent davantage que l’État français quant aux habitudes de vie, aux comportements, aux préoccupations, etc. des citoyens. Précisons finalement que la demande en spécialistes de l’analyse de données massives est en plein essor. Il n’existe pas d’estimation nationale officielle, mais, à titre indicatif, l’institut Mc Kinsey Global estime que les besoins en analyses de masses de données induiront, aux ÉtatsUnis d’ici à 2018, le recrutement de 140 000 à 190 000 spécialistes69 . Ces technologies nécessitent la maîtrise d’outils mathé- matiques et statistiques de très haut niveau. Des compé- tences dans le domaine de l’informatique, et notamment en programmation, sont également requises. Élément important, les spécialistes doivent pouvoir travailler main dans la main avec les services commerciaux et avec les gestionnaires, et être au fait des règles concernant la sécurité et le respect de la vie privée. Pour l’heure, la plupart des analystes de données massives ont suivi une formation soit en informatique, soit en mathématiquesstatistiques, puis se sont formés en autodidacte. Une première formation de niveau master a toutefois ouvert ses portes en septembre 2013 à Paris70 . Elle ne pourra cependant pas répondre à toute la demande et aux besoins. Dans le secteur public Bien qu’il soit difficile d’appréhender l’ensemble des usages amenés à se développer, l’analyse des big data est un atout important pour l’administration. Peu de pays ont cependant mis en place des stratégies spécifiques en la matière. L’Australie fait figure d’exception en voulant améliorer la gestion et les services publics à l’aide des analyses de masses de données. Dans son plan stratégique concernant les Technologies de l’information et de la communication (TIC) pour la période 2012-2015, le bureau de la gestion de l'information du gouvernement préconise par exemple d’établir un centre d’excellence pour l’analyse et la gestion des big data rattaché à l’ensemble du gouvernement, ou encore de rendre les données accessibles entre administrations. D’autres pays, tel le Royaume-Uni, concentrent plutôt leurs efforts dans des secteurs spécifiques comme celui11 www.strategie.gouv.fr 11/2013 No 08 LA Note D’ANALyse 71. CNIL (2013), Workshop OpenCNIL Open Data, Paris, 4 juillet. 72. Mayer-Schönberger V. et Cukier K.(2013), op. cit., p. 60. 73. Les auteurs tiennent à remercier pour leur aide précieuse : Agnès Benassy-Quéré et Antoine Bozio (Conseil d’alayse économique), Denis Berthault(LexisNexis), Rémi Bilbault et Ruth Martinez (GFII), Pascal Caillerez (Décideur public – Systèmes d’information), Jean-Pierre Camilleri, Mehdi Benchoufi, Alexandre Bredimas et Christian Delom (Club Jade), Christine Chambaz, Alain Folliet et Marie-Noëlle Séhabiague (CNAF), Stéphan Clemençon (Telecom Paris Tech), Julien Damon (Sciences Po), Bertrand Diard (Talend), Joël Hamelin et Antton Achiary (CGSP), Charles Huot(TEMIS), Mathieu Jacomy (Médialab), Mathieu Jeandron et Annelise Massiera (DISIC), Nadia Joubert, Philippe Louviau, Rémi Favier et Bruno Nicoulaud (DNLF), Maxime Lesur et Bernard Ourghanlian (Microsoft), Claire Levallois-Barth (Institut Mines- Télécom), André Loth (DREES), Hammou Messatfa, Christophe Burgaud, David Kerr et Laura Haas (IBM), Philippe Niewbourg (Decideo), Judicaël Phan, Geoffrey Delcroix et Delphine Carnel(CNIL), Vincent Poubelle (CNAV), Pascal Saubion et Jean-Paul Leroux (Orange), Henri Verdier(Etalab), Marie Zins et Marcel Goldberg (INSERM). de la santé. Les pouvoirs publics doivent financer, à hauteur de 90 millions de livres sterling (106 millions d’euros), l’institut Big data de l’université d’Oxford. Cet institut réalisera des analyses pour améliorer la détection, la surveillance, le traitement et la prévention d’un large éventail de maladies. En France, que ce soit au niveau de la conception, de la mise en œuvre ou de l’évaluation des politiques publiques, mais aussi dans la gestion quotidienne des administrations, les analyses empiriques sont globalement peu utilisées. En ce sens, au-delà des contraintes associées à la protection de données, l’analyse des big data nécessite d’instaurer une culture de la donnée qui fait encore défaut. Il existe ainsi des quantités énormes de données “publiques” qui ne sont pas valorisées. Étroitement liée à ce manque de recours aux analyses empiriques, la difficulté pour les administrations est d’investir dans des technologies dont les retombées sont difficilement chiffrables et dont la mise en œuvre peut s’avérer délicate (contraintes juridiques, partage des données entre administrations, etc.). Alors que les logiciels de type open source existent, des investissements sont nécessaires pour normaliser les données, pour sécuriser les échanges, mais aussi pour recruter ou former des analystes (voir supra). Le peu de recours aux analyses de données dans la gestion et la prise de décision s’explique en partie par le cloisonnement des données. Le partage d’informations entre administrations et avec des acteurs externes est indispensable pour donner plus de valeur à l’analyse des big data, la richesse des analyses résidant essentiellement dans le rapprochement des données entre lesquelles on n’avait pas présupposé de relations. Pour encourager les échanges, des normes de sécurité des échanges ont cependant été mises en place (voir supra). Des outils comme le Référentiel général d’interopérabilié (RGI), qui fixe les règles techniques permettant d’assurer l’interopérabilité des systèmes d’information, encouragent aussi le partage. Le mouvement d’open data (encadré 1) doit par ailleurs contribuer à ce décloisonnement. Autre exemple, depuis 2010, le Centre d’accès sécurisé distant (CASD) donne accès, de façon très encadrée, aux chercheurs (publics-privés) à des données individuelles (INSEE et Services statistiques ministériels). LA Note D’ANALyse 11/2013 - No08 Le nombre de données continue à croître et les outils d’analyse vont se perfectionner. Sans présager des futurs usages, l’analyse des big data est sans aucun doute vouée à gagner en importance, certains parlant même de révolution72 . Loin d’être un simple effet de mode, l’analyse permet de traiter des pathologies, de créer de nouvelles technologies, d’accroître nos connaissances, de prévenir des catastrophes, d’organiser les services, etc. D’un autre côté, l’analyse des données massives comporte des risques liés au respect de la vie privée, à la confidentialité, au libre-arbitre, auxquels il convient de réfléchir dès maintenant 73 . Mots clés : masse de données, analyse, données personnelles, administration électronique, prédiction. coNcLusioN Les responsables prévoient d’intégrer à ce dispositif des outils informatiques permettant des analyses de type big data71 . Bien que divers formats de données puissent être croisés, il est par ailleurs important de faire en sorte que les données soient le plus harmonisées possible. Les données récoltées par deux administrations, à des niveaux géographiques différents ou pour des temporalités variables, ne seront par exemple pas ou difficilement compatibles. Cette incompatibilité s’explique par le fait que les données administratives ne sont généralement pas recueillies à des fins d’analyse, mais pour la gestion interne. Dans la mesure du possible, une réflexion sur la compatibilité des données entre administrations devrait être menée.www.strategie.gouv.fr Retrouvez les dernières actualités du Commissariat général à la stratégie et à la prospective sur : g www.strategie.gouv.fr g CommissariatStrategieProspective g DerNières PuBLicAtioNs à coNsuLter www.strategie.gouv.fr,rubrique publications Créé par décret du 22 avril 2013, le Commissariat général à la stratégie et à la prospective se substitue au Centre d’analyse stratégique. Lieu d’échanges et de concertation, le Commissariat général apporte son concours au Gouvernement pour la détermination des grandes orientations de l’avenir de la nation et des objectifs à moyen et long termes de son développement économique, social, culturel et environnemental. Il contribue, par ailleurs, à la préparation des réformes décidées par les pouvoirs publics. Notes d’analyse : N° 01 g Un fonds européen pour l’emploi des jeunes - Proposition pour une initiative (juin 2013) N° 02 g Internet : prospective 2030 (juin 2013) N° 03 g Approvisionnements en métaux critiques : un enjeu pour la compétitivité des industries française et européenne ? (juillet 2013) N° 04 g Les compagnies aériennes européennes sont-elles mortelles ? Perspectives à vingt ans (juillet 2013) N° 05 g Pour un secteur des semences diversifié et innovant (octobre 2013) N° 06 g Intensifier et réorienter les transferts de technologies bas carbone pour lutter contre le changement climatique (octobre 2013) N° 07 g Doha, Varsovie, des conférences de transition vers un accord climatique mondial en 2015 (octobre 2013) La Note d’analyse n° 08 - novembre 2013 est une publication du Commissariat général à la stratégie et à la prospective Directeur de la publication : Jean Pisani-Ferry, commissaire général Directeur de la rédaction : HervéMonange, adjoint au commissaire général Secrétaires de rédaction : Delphine Gorges, Valérie Senné Impression : Commissariat général à la stratégie et à la prospective Dépôt légal : novembre 2013 - N° ISSN : 1760-5733 Contact presse : Jean-Michel Roullé, responsable de la communication - 01 42 75 61 37 / 06 46 55 38 38 jean-michel.roulle@strategie.gouv.fr Commissariat général à la stratégie et à la prospective - 18, rue de Martignac - 75700 Paris SP 07 - Tél. 01 42 75 60 00 Big DATA : effet de mode ou levier stratégique avis d’experts Livre blanc produit dans le cadre du Salon par :> 2 Une semaine sans voir émerger une nouvelle conférence ou un nouvel article sur le Big Data est un peu une semaine unique en son genre depuis ces derniers mois. En construisant le CONGRES CONEXT, il était évident que nous allions, nous aussi, aborder cette thématique, mais plus que simplement vous proposer un panel sur le sujet... Nous avons privilégié un parti-pris : proposer à des auditeurs du Mastère Spécialisé Marketing Direct et Commerce Electronique de SKEMA Business School d’interviewer plus de 12 experts d’horizons différents sur ce sujet et restituer sous forme d’une synthèse ces différents regards croisés. Le Big Data un vrai levier pour booster son activité en profondeur ? ou simple poudre aux yeux ?... Nous  livrons les propos de ces experts à votre propre analyse et vous souhaitons bonne lecture. Brigitt ALBRECHT ROHN SKEMA Business School Yann KERVAREC EURATECHNOLOGIES Big Data www.skema-bs.fr > 2 www.euratechnologies.comDéfinition De plus en plus médiatisé, ce terme reste méconnu, incompris ou mal interprété, certainement en grande partie de par sa terminologie anglo-saxonne et la diversité de ce qu’il englobe. C’est la création en continu de données de plus en plus diversifiées dans leurs contenus (images, vidéos, audio, etc.), leur mise à disposition et leur exploitation maintenant possible en temps réel qui ont fait émerger ce concept. La définition de Gartner en 2011 explique les dimensions du Big Data par la combinaison des 3 V : > Volume > Vitesse > Variété des données. Certains experts considèrent qu’à partir du moment où l’on est en présence de l’une des variables, on se trouve dans un contexte Big Data. La définition communément acceptée par les principaux “acteurs” (éditeurs de logiciels, spécialistes de l’innovation dans les entreprises ou dans le secteur public) se résume à la création de valeur par la combinaison de ces 3V. Néanmoins, le concept amène à des positions très tranchées tant sur son évolution et ses enjeux que sur les conditions initiales d’une approche Big Data dans un secteur. Quel seuil “minimum” de Volume, Vitesse et Variété de données est requis pour s’interroger sur la nécessité d’exploiter des solutions Big Data ? Y-a-t’il un “V” qui prime sur les autres? > 3 Le phénomène Big DataDéfinition Si on se base sur le critère du volume uniquement, selon Patrick Bertolo, le Big Data n’a de raison que si l’on traite des Péta Octets de données. La volumétrie n’étant pas encore existante en de telles proportions dans la majorité des entreprises, cela réduirait le champ des possibles du Big Data à certains secteurs uniquement. On ne peut pas se focaliser sur un critère seulement, il faut considérer le cycle de vie des données : de la captation des données produites par des tiers à l’agrégation avec des données internes, la valeur et l’intégrité de la donnée brute, la sécurisation du stockage de ces données, leur analyse et leur mise en perspective. Pour Mouloud Dey, le volume n’est pas le critère le plus déterminant. Si l’entreprise est confrontée à un problème économique particulier, pour lequel l’analyse des données internes combinées à des données externes générées par l’Open date peut apporter de nouvelles réponses, ou de nouveaux modèles économiques, alors, cette problématique justifie des conditions d’une solution Big Data. Djeraba Chabane estime quant à lui que le phénomène n’est pas nouveau, il est simplement amplifié par Internet qui est la partie visible de l’iceberg. Mais d’autres applications moins visibles génèrent énormément de données, notamment les applications autour de la vidéo. Pour le chercheur, 3 mots clés résument les Big Data : « volume, flux et complexité » . > 4 V comme VOLUME Définition Certes, les données sont de plus en plus nombreuses et rapides, mais pour René Lefebure, c’est la vitesse à laquelle les modèles doivent être fournis qui justifie le Big Data. Plus on se base sur du temps réel, plus on est dans la problématique Big Data. Les données sont de plus en plus nombreuses et pour la plupart de plus en plus volatiles. Progressivement, le traitement immédiat de la donnée sera l’élément clef d’un modèle. Patrick Nicholson complète : le coût du stockage a baissé, le temps réel prend un vrai essor donc les grands distributeurs doivent pouvoir faire autre chose que de l’analyse transactionnelle, mais que font-ils réellement ? Un des enjeux serait de pouvoir proposer des offres avant l’entrée en magasin et non après le passage en caisse. Pour Patrice Poiraud, la vitesse revêt un aspect primordial en termes d’avantage concurrentiel : avoir un ou des produits de qualité est important, et nous savons le faire en France, mais le ROI est minoré sans la capacité à faire rapidement des offres pertinentes dans un contexte mondialisé. La vitesse est un enjeu important. > 5 V comme VITESSEDéfinition Bien qu’il existe plusieurs approches du Big Data, pour Matt Bailey, c’est la capacité de donner une valeur supplémentaire à des données internes traditionnelles en les combinant avec une grande variété d’autres sources de données externes. Par exemple, croiser les données sur les ventes et les données météorologiques régionales, ou corréler les ventes de produits en visualisant les habitudes d’achat à l’aide de vidéos . La variété est aussi une contrainte pour les entreprises car comme le rappelle Djeraba Chabane : aujourd’hui le stockage coûte moins cher grâce au Cloud mais l’indexation et le datamining coûtent très chers si l’information n’est pas structurée . La nécessité de mixer des données internes et externes pour en extraire une valeur supplémentaire est évidente . Pour résumer Au delà de la terminologie et des constantes de la définition, chaque entreprise, qu’elle soit une grande entreprise ou une PME, privée ou publique, doit au préalable se repositionner sur la problématique métier pour laquelle elle veut apporter une réponse et faire le point sur ses acquis stratégiques. Elle déterminera ensuite la nécessité ou non de se lancer dans le Big Data. Si la prolifération des données et les capacités de stockage ont fait du Big Data une réalité, il s’avère, pour une entreprise, que les Big Data sont une opportunité business. Alors selon Matt Bailey cette entreprise n’en est qu’à la première étape, l’étape suivante est l’organisation de ces données, c’est le principal obstacle à l’utilisation de Big Data. Ce phénomène est-il une évolution induite par Internet ou une véritable révolution pour l’ensemble des acteurs économiques? > 6 V comme VARIÉTÉÉvolution Le battage médiatique et la littérature concernant le Big Data ces dernières années lui confèrent un statut de phénomène révolutionnaire. Cependant dès 2011, le constat est clair, les Big Data existent depuis 20 ans mais elles sont au cœur des préoccupations scientifiques plutôt qu’économiques. Il devient évident que l’explosion d’Internet et des données clients impliquent que les entreprises doivent investir dans l’analyse des données. Alors que la puissance du datamining devenait limpide, dit Fayyad, les motivations économiques pour investir dans ce domaine émergeaient aussi. MIT Technology Review -The New Big Data- Erica Naone Août 2011. Dans un contexte où la concurrence se renforce, où les doutes persistent sur une reprise économique, il était urgent d’intégrer l’analyse des données à tous les niveaux de décision de l’entreprise. Et rattraper, pour certaines entreprises, un retard en matière de culture de la donnée et de prise de décision en temps réel. Cette évolution, qu’est en réalité le Big Data, est exponentielle comme l’explique Djeraba Chabane et représente un phénomène majeur mais ne date pas d’hier. Si le Datamining est apparu, c’est pour exploiter un nombre croissant de données. Par ailleurs les opérateurs de télécommunications, le secteur de la banque assurance n’ont pas attendu l’apparition du concept Big Data pour gérer de grands volumes de données. > 7Évolution Dans l’ étude Big Data@work en 2012 pour IBM Institute of BusinessValue, on note les deux tendances significatives qui font évoluer le contexte : > 1. La numérisation quasi-systématique crée désormais de nouveaux types de groupes de données volumineux en temps réel pour un grand nombre d’industries. Ces dernières étant la plupart non structurées, elles ne peuvent être stockées dans les entrepôts de données traditionnels, structurés et relationnels. > 2. Les technologies et techniques d’analyse avancées actuelles aident les organisations à extraire des connaissances grâce aux données avec des niveaux de sophistication, de précisions et de vitesse impensables avant ce jour. Mouloud Dey souligne également que l’évolution technologique démocratise le Big Data, notamment en ce qui concerne l’augmentation des capacités de stockage et la réduction de leur coût. Il existe par ailleurs des positions plus tranchées. Pour Philippe Nieuwbourg, le Big Data est un concept marketing venant définir et formaliser une situation déjà existante dans le monde. C’est un relais de croissance pour les fournisseurs de solutions informatiques. Mais relativiser le phénomène Big Data ne remet pas en cause la nécessité pour les entreprises d’exploiter leurs données, notamment pour les entreprises dont elles sont l’ADN et qui n’ont pas attendu cette médiatisation pour s’y intéresser. Comme le confirme Matt Bailey, le business centré sur la data a toujours été un fondement de la VAD. Les données sont devenues de plus en plus nombreuses et ont pris des aspects variés. Cette évolution a fait un bond en avant en raison de la quantité de stockage disponible ces dernières années. Yan Claeyssen renchérit sur cette position en précisant que c’est le contexte qui guide l’évolution, et que pour les VAD-istes, le e-business a accéléré le phénomène. > 8Révolution Au delà des aspects techniques soulevés par le Big Data, la révolution viendra selon Mouloud Dey des usages et permettra de créer ou de renouveler des modèles économiques si on évite de tomber dans la simple génération de revenus publicitaires. Il ajoute : si l’apport des Big Data permet d’utiliser des informations anonymisées pour un usage cohérent (aménagement du territoire plutôt que surveillance des citoyens), on peut considérer ce phénomène comme une véritable lame de fond. Elle pourrait être destructrice sur certains secteurs traditionnels, en ce sens qu’elle laissera l’opportunité à de nouveaux entrants de se positionner en contestataires sur des marchés “légitimes” (par exemple, les opérateurs téléphoniques qui pourraient remettre en cause la légitimité des banques avec l’émergence du paiement sans contact). Yan Claeyssen confirme : certains business modèles exploitent la donnée par des algorithmes plus puissants et permettent d’aller plus vite en personnalisant la relation avec le consommateur. La révolution est quantitative et qualitative. Cet aspect révolutionnaire ne va pas se cantonner à la transaction commerciale, mais va également remettre en cause un certain nombre de croyances et de pratiques au sein des entreprises. L’entreprise n’est plus la seule détentrice des datas, comme le souligne René Lefebure. Le stockage de données est accessible sur le cloud computing à des coûts relativement faibles et évolutifs en fonction des besoins et de la volumétrie. Les modèles économiques vont se construire sur de nouvelles technologies Open data. > 9Cependant, l’aspect métier des informaticiens et des dataminers va être bousculé car la structuration actuelle des données et les modélisations apprises sont dépassées dans un contexte Big Data. Patrice Poiraud renchérit en précisant que le Datamining est le degré zéro du Big Data, mais que ça n’est plus suffisant, puisqu’on analyse uniquement le passé. La Business Intelligence intègre maintenant 3 étapes : le descriptif, le prédictif et le prescriptif c’est à dire, l’analyse de ce qui va se passer, l’optimisation des modèles mais surtout leur automatisation. Le Big Data semble donc prometteur, même si peu de preuves sont apportées. Comme le note René Lefebure, les entreprises sont relativement réticentes à communiquer, c’est encore un peu secret. Etude Gartner Sept 2013 > 56 % des entreprises interrogées déclarent que l’item « comment extraire de la valeur du Big Data » figure parmi leurs premiers challenges, > pour 26% d’entre elles, c’est leur priorité n°1 Révolution > 10La production de données est telle pour Djeraba Chabane, que le phénomène Big Data est majeur et qu’il ne risque pas de s’arrêter. Plusieurs nuances peuvent être apportées à ce stade : > D’une part, l’entreprise doit être au préalable data-centric et tirer partie de ses propres données avant de vouloir les enrichir avec des données externes pour Matt Bailey. > D’autre part, Philippe Nieuwbourg précise que l’enjeu reste la capacité à les analyser et à en tirer profit. Toutes les entreprises et organisations ont un gisement de valeur au travers de leurs données, le Big Data est une génération de valeurs en tant qu’analyse de ces données. C’est l’analytics qu’on va appliquer aux données qui va justifier le Big Data, et non la collecte de données en soi. > Pour Yan Claeyssen aussi : la combinaison des 3V rend possible énormément de choses, il y a un fort potentiel, mais attention au fantasme. L’exploitation est le plus gros enjeu. Des solutions et méthodes ont été mises en place dans des entreprises comme Google ou Amazon pour lesquelles le Big Data a vraiment du sens. Il préfère parler, pour des entreprises plus modestes, de Valued Data et précise que dans cet océan de données, l’enjeu de la valeur est de déterminer lesquelles sont exploitables de manière intelligente. Tous nos experts s’accordent à dire que l’ensemble des secteurs est concerné, même s’ils ne sont pas tous générateurs d’autant de données. La santé est évidemment un enjeu majeur. Dans ce cadre, l’enjeu est la connaissance et la prévention au travers de recoupements de nombreuses données, et non une éventuelle génération de valeur (détection de maladie plus en amont, répartition de vaccins de populations à risque en fonction de la propagation de virus). La Valeur, le 4e V ? Pour l’entreprise > 11Les secteurs les plus en pointe sur le sujet de la data sont : > les télécommunications (qualité de service en temps réel), > les banques (prévention des fraudes) et assurances (gestion du risque), > l’industrie (amélioration des capacités de production, réduction des coûts de maintenance traités en préventif et non en curatif), > les transports (optimisation de trafics et des taux de remplissage), > l’éducation au travers des MOOC (Massive Open Online Courses) pour comprendre les comportements des apprenants, et adapter les programmes. Le Big Data est également prometteur dans un contexte de marketing, qu’il soit relationnel ou produits (innovants et connectés à des services associés). Il faut cependant prendre garde à ne pas tout labelliser “Big Data”. Dans de nombreux cas, les entreprises n’en sont encore qu’au stade du datamining et/ou d’un CRM évolué. La Valeur, le 4e V ? Pour l’entreprise > 12Dans un contexte marketing le phénomène Big Data peut générer de la valeur pour l’entreprise, mais il vient aussi bousculer la relation avec le consommateur. Les consommateurs ou citoyens peuvent-ils en tirer un avantage ? Est-ce le début d’un nouvel équilibre entre les marques et les consommateurs ? Doit on espérer un bénéfice individuel ou collectif ? s’interroge Patrick Bertolo. L’enjeu collectif se positionne vraisemblablement sur des orientations stratégiques de santé publique ou d’éducation. Pour Mouloud Dey, les bénéfices sont collectifs pour le citoyen mais rien n’est encore prouvé. Dans le cadre de la santé, les données collectives pourraient aider la recherche, mais cela implique un partage de données personnelles et intimes. Gilles Venturi complète en parlant de confort de vie du citoyen, dans le cadre d’une meilleure prévision des embouteillages par exemple, et René Lefebure, par l’optimisation des temps de trajet et de transport, et donc de gain en économie d’énergie. D’un point de vue purement marketing, si le Big Data se réduit à des coupons, promotions, publicités mieux ciblées, selon Mouloud Dey, il n’y aura pas de changement fondamental dans la vie du consommateur. Les sollicitations seront éphémères, voire intrusives et risqueront d’accentuer le ras le bol de l’utilisation des données personnelles. Yan Claeyssen y décèle pour le consommateur d’avantage de fluidité, un parcours et une expérience de marque mieux personnalisés en offrant des services supplémentaires, des produits innovants et moins de saturation publicitaire. La limite du Big Data en termes d’enjeux individuel et collectif reste la transparence des entreprises ou des organisations dans l’exploitation des données, et la possibilité pour les individus de gérer leurs propres données. D’où l’émergence de projets tels que Midata au Royaume-Uni ou Mesinfos en France pour encourager les entreprises à partager leurs données avec les consommateurs. La Valeur, le 4e V ? Pour le consommateur/citoyen > 13Le Big Data est-il une problématique réservée aux grandes entreprises ? La réponse est négative pour Patrice Poiraud pour qui la grande taille d’une entreprise peut avoir certaines contraintes comme un historique plus complexe alors que les petites entreprises sont plus agiles dans la mise en place du Big Data sous forme de solutions cloud ou intégrées. Matt Bailey constate que si la multinationale possède des moyens et des ressources pour analyser de grandes quantités de données, une PME pourra utiliser des jeux de données plus petits, plus spécifiques et y trouver tout autant de valeur. Pour Mouloud Dey, une start-up peut créer d’entrée de jeu son modèle économique en se basant intensivement sur la donnée sans être une grosse entreprise qui en a accumulé depuis 30 ans. Et pour arbitrer sur le sujet, Yan Claeyssen conclut qu’il s’agit plus d’une question d’agilité, de vision, d’opportunisme ou de pragmatisme que de taille. Si il doit y avoir une différence entre les entreprises, elle se fera entre celles qui ont pris l’habitude de collecter, intégrer et exploiter la donnée en tant qu’actif stratégique et les autres. Les premières considéreront le Big Data comme une évolution naturelle créatrice de plus de valeur. Les secondes essayeront de composer avec leurs données propres, structurées en silos, ce qui sera long, complexe et coûteux. Une fracture ? Grandes vs Petites entreprises > 14Patrick Bertolo précise qu’il faut respecter un certain équilibre dans la chaîne nécessaire au Big Data. Il faut relativiser les investissements avec les résultats attendus, capitaliser sur les outils existants dans l’entreprise et les agréger avec d’autres outils. Il ne doit pas y avoir de maillon faible dans la chaîne. Pour Gilles Venturi, l’infrastructure à mettre en place s’envisage en 3 couches : > des serveurs dédiés ou sur le Cloud, > combinés avec des outils qui permettront de gérer les bases de stockages de traitement (Hadoop), > et des outils de Business Intelligence et de visualisation. Cette façon de procéder est très linéaire : on augmente les investissements et les capacités de traitement au fur et à mesure des besoins, avec une espérance de ROI de 6 à 12 mois. Et les chantiers à prioriser seraient : > la mise en place des moteurs de recommandations > l’écoute active des réseaux sociaux et l’interaction avec le consommateur > l’étude et le décodage des parcours consommateurs sous l’angle expérience client (tracking web mais également tracking physique dans les centres commerciaux en utilisant des données anonymisées). Ces chantiers ont une connotation Big Data parce qu’ils impliquent des analyses et des applications en temps réel. Le Cloud Computing a beaucoup démocratisé l’approche Big Data en offrant des capacités de stockage plus importantes à des coûts accessibles. Pour René Lefebure, l’équation économique est plus basse qu’avant : la technologie est moins onéreuse, et il est possible et intéressant de passer des contrats à l’utilisation. Vers une stratégie Big Data : premiers pas Etude Gartner Sept 2013 > 29 % des entreprises considèrent l’infrastructure et/ou l’architecture comme un des premiers défis du Big Data > 15Les différentes données : Deux types de données existent : les données nominales et les données anonymisées. D’un point de vue légal, la conservation des données nominales peut-être facteur de risque puisque les entreprises n’ont pas le droit de tout conserver ad vitam. Comme le souligne Blandine Poidevin : les entreprises (françaises et européennes) ne pourront jamais s’affranchir des lois, impliquant des sanctions pénales, stipulant que, même avec l’accord de l’intéressé, elles ne peuvent conserver la donnée personnelle indéfiniment. Grégory Delfosse du Cabinet BRM insiste aussi sur la pertinence de la donnée stockée. Aujourd’hui la législation européenne est basée sur un principe de proportionnalité des données collectées et de transparence. Ainsi, la loi exige des acteurs qu’ils ne collectent que les données strictement nécessaires et pour une finalité bien spécifiée de sorte qu’il parait aujourd’hui difficile pour une entreprise de garder des données qui ne sont pas « utiles » pour elle. En ce qui concerne les données anonymisées qui ne sont pas sous contrainte juridique, il y a lieu de se demander s’il faut garder tout ou partie des informations. Vers une stratégie Big Data : quelles données ? > 16Tout ou partie ? La plupart des experts optent pour le stockage d’une partie seulement des données. Pour Christophe Cousin, iI faut limiter au maximum les données dans les bases car cela a beaucoup d’effets pervers, cela coûte cher, cela ne sert à rien, on s’y perd. Il faut être extrêmement sélectif et se poser la question de ce qu’est une donnée utile. Mais avant tout, il faut replacer la conservation des données dans le contexte de l’activité de l’entreprise. Comme le précise Philippe Nieuwbourg : si la structure des produits change en permanence, la donnée historique a moins de valeur et il n’est pas utile de la stocker. Si l’on prend l’exemple de l’industrie forestière, la durée de vie d’un arbre est de 70 ans, alors que les produits de grande distribution ont une durée de vie de quelques saisons. Pour Patrick Nicholson : vouloir tout stocker est absurde, on ne sait pas forcément ce qu’on va faire des données conservées. Ce sont des projets reportés et donc qui n’aboutissent jamais. Une donnée ne vaut que si on sait ce qu’on veut en faire, elle devient alors une information stratégique. Il faut distinguer les données des informations : la donnée est ce qu’on mesure à un instant T, une information est ce qui permet de faire des différences entre les consommateurs. René Lefebure précise que dans un cadre de Big Data on travaille sur des données non ACID, et le flux est tel qu’on peut se permettre d’en perdre une partie : 95% du flux est constitué de bruit. L’enjeu est de trouver les 5% d’informations pertinentes, celles qui ont été benchmarkées au regard d’un indicateur économique, ou qui ont une valeur stratégique. Vers une stratégie Big Data : quelles données ? > 17> 18 La donnée se périme très vite et peut avoir deux valeurs différentes selon l’activité et l’usage que l’on veut en faire, précise Mouloud Dey. Elle doit avoir du sens par rapport au métier. Par exemple, la géolocalisation peut être perçue dans un contexte d’instantanéité, ou de récurrence, selon les besoins de l’activité de l’entreprise. Envoyer un SMS offrant un café parce que le consommateur passe tous les matins devant un Starbucks café est pertinent pour le fidéliser, le proposer lors d’un passage unique l’est moins. Qu’elles soient anonymisées ou non, Patrice Poiraud estime que lorsqu’on garde longtemps les données, elles coûtent de plus en plus cher en stockage, se périment et elles deviennent dangereuses juridiquement. Il faut mettre en place une gouvernance des données stricte qui doit prendre en compte les aspects légaux et les stratégies commerciales. En guise de conclusion, Djeraba Chabane estime qu’ il faut trouver un équilibre entre les deux, l’important est de savoir où on va. Vers une stratégie Big Data : quelles données ? Etude Gartner Sept 2013 > 27 % des entreprises entreprises interrogées placent les problématiques de risques et de gouvernance (Sécurité, vie privée, qualité des données) dans le top des défis du Big Data > 18> 19 Les sources de données Après avoir considéré les problématiques soulevées par le phénomène Big Data, nos experts s’accordent à dire qu’il faut s’attacher en premier lieu aux données internes et propres à l’entreprise. Comme le précise Matt Bailey, les entreprises doivent être conscientes de la richesse des données qu’elles ont à disposition en interne, et de la manière de les exploiter pour en retirer de la valeur avant de vouloir les enrichir par des données externes. L’important est la capacité à cartographier les données internes pour en avoir une représentation utilisable. Il faut s’assurer par exemple d’avoir une vision à 360° de notre client pour Patrick Poiraud. Il y a des données client dans le CRM, dans le support client, à la logistique et au service après vente. Rien que de pouvoir agglomérer ces données et d’avoir une vue interne à 360°, c’est déjà pertinent. Puis on peut agglomérer des données externes et établir des micro segmentations comportementales, alors tout ce qu’on mettra en place sera d’autant plus efficace. La base est d’avoir une vue globale du client. Dans un deuxième temps, il faut développer un projet Big Data à l’échelle de l’entreprise et s’attacher à répondre aux besoins des différents métiers. Ce projet doit être transversal à l’entreprise et accompagné par la Direction, mais qui du Marketing ou de la DSI va porter le projet? Vers une stratégie Big Data : quelles données ? Etude Gartner Sept 2013 Un des 3 premiers défis du Big Data pour 33 % des entreprises interrogées est d’intégrer de multiples sources de données > 19> 20 Un “3e homme” est souvent évoqué en tant que Datascientist ou Chief Data Officer. Pour Matt Bailey, c’est un profil en forte demande actuellement, avec une palette de compétences extrêmement rares. Une personne doit être capable d’analyser d’énormes quantités de données et de trouver des corrélations. Cependant, ces corrélations doivent être applicables, rentables et réalisables. Donc, des compétences en matière de données, de la créativité dans l’interprétation des données et la validation des corrélations, mais aussi une connaissance de l’entreprise pour voir comment cela peut être utilisé ou trouver des modèles qui améliorent la rentabilité. Ces compétences mixées sont donc extrêmement difficiles à trouver aux USA et encore plus en Europe, où le cursus de formation est faible. Il faudra quelques années pour trouver en nombre suffisant ces “couteaux suisses” de la data. Les Data scientists connaissent les méthodes et outils statistiques, informatiques, maîtrisent les algorithmes, établissent les cahiers des charges techniques et fonctionnels, font l’interface entre la DSI, les directions métiers et le Marketing selon Yan Claeyssen. Enfin, si ces compétences sont clairement nécessaires, faut-il opter pour une solution externe ou faire le choix d’utiliser des ressources internes ? Yan Claeyssen privilégie de commencer par des POC, petits projets apprenants (Proof Of Concept ), où l’on met en place des pilotes pour exploiter des données de manière fonctionnelle et pragmatique sans nécessairement recruter de nouvelles ressources. De la même manière René Lefebure décrit qu’une courbe d’apprentissage devra être mise en place et il faudra trouver le chemin critique du projet. Gilles Venturi précise que chaque entreprise doit trouver sa manière d’exploiter les données, et d’en tirer un ROI sur 6 à 12 mois. Il n’existe pas de projet “one size fits all”. D’un point de vue plus prosaïque, un des investissement qui ne sera jamais perdu est la formation car comme le rappelle Djeraba Chabane : “la formation est un pré requis essentiel avant de se lancer”. Vers une stratégie Big Data : quelle organisation ? > 20 Etude Gartner Sept 2013 Pour 34 % des entreprises interrogées : acquérir les compétences et les capacités requises figure dans le top des défis du Big Data.> 21 Oui, le Big Data fait le buzz et ceux qui pratiquent l’analyse de données depuis 30 ans observent avec amusement l’effervescence qui l’entoure. Mais pour les autres, une fois cette question résolue, que faire ? Attendre encore un an et voir arriver un nouveau concept “data” ? Il faut répondre aux questions soulevées par le Big Data : est-ce que l’entreprise exploite toutes ses datas correctement et suffisamment pour piloter ses opérations et sa stratégie ? Est-ce que l’intégration de données externes lui permettrait d’améliorer ses performances ? Dans un environnement cross canal, avec des clients volatiles, face à des innovations qui changent la donne comme l’impression 3D et des nouveaux business modèles comme le leasing sur les biens de consommation, la crise fragilise les entreprises et exige de la rentabilité à court terme. Il est impératif de faire le point sur la cartographie des données détenues par l’entreprise, sa capacité à en extraire de la valeur. Il faut définir une question métier prioritaire et mettre en place les solutions pour y répondre, que ceux-ci soient étiquetés Big Data ou pas. Ce premier “petit projet” de génération de valeur au travers des data propres et tierces doit démontrer à court terme son efficacité pour permettre d’engager d’autres projets de plus en plus complexes et ambitieux. L’entreprise évitera ainsi de laisser une autoroute à la concurrence. Pour nos métiers marketing et plus particulièrement en retail, le consommateur attend de notre offre produits/services plus de pertinence aux vues des informations qu’il partage. Restons vertueux et ouverts dans notre usage des données personnelles. Demain nos limites ne seront pas techniques mais juridiques. Conclusion .../... > 21> 22 Une question se pose : quel sera notre rôle dans cet univers de la donnée? Y ’aura-t’il un pilote dans l’avion ? Qui sera ce pilote ? Les technologies de la donnée ne remettent pas en cause nos rôles de managers, elles enrichissent nos métiers pour nous concentrer sur le pilotage, l’arbitrage, l’innovation et la stratégie. Il y a certainement nécessité à renforcer les équipes en statisticiens et mathématiciens en attendant que les cursus soient pertinents pour former de futurs “Data scientists”. En 1909, le Blériot XI franchissait la Manche, 100 ans plus tard l’A380 réalisait son premier vol inaugural transatlantique. Entre ces deux avions, une galaxie de technologies mais toujours un pilote dans le cockpit ! Conclusion > 22> 23 Nous tenons à remercier les personnes sans qui la réalisation de ce travail n’aurait pu être possible : > Bien sûr les experts qui ont eu l’amabilité de nous consacrer de leur temps > Les personnes qui nous ont mis en contact avec ces experts : Sylvain Bertrand (ORANGE Business), Julie Moreau, Gaëlle Duvet (Sté MEURA), Grégoire De Lassence (SAS), Gaëlle Vallée (ORANGE). Remerciements> 24 > Matt Bailey https://linkedin.com/in/mattbaileysitelogic > Patrick Bertolo https://fr.linkedin.com/pub/patrickbertolo/3/344/ab0 > Me Martine Ricouart-Maillet Cabinet BRM https://fr.linkedin.com/pub/martine-ricouartmaillet/0/2a2/713 > Djeraba Chabane http://fr.linkedin.com/pub/chabanedjeraba/15/9b0/a68 > Yan Claeyssen https://fr.linkedin.com/pub/ yan-claeyssen/1/1b8/a8b > Christophe Cousin https://fr.linkedin.com/pub/christophecousin/0/36/565 > Mouloud Dey https://fr.linkedin.com/in/moulouddey/ > René Lefebure https://fr.linkedin.com/pub/ rene-lefebure/8/729/572/ Les experts> 25 Les experts > Patrick Nicholson patrick.nicholson@skema.edu > Philippe Nieuwbourg https://ca.linkedin.com/in/pnieuwbourg/ > Me Blandine Poidevin https://fr.linkedin.com/pub/blandinepoidevin/0/813/135/ > Patrice Poiraud https://fr.linkedin.com/pub/patricepoiraud/15/9ab/901 > Gilles Venturi https://fr.linkedin.com/in/gillesventuri/> 26 Les Rédacteurs > Amaury Bouretz - MDCE SKEMA http://fr.linkedin.com/pub/amaury-bouretz/29/a46/19/ > Régine Garric Advielle - MDCE SKEMA http://fr.linkedin.com/pub/regine-garric-advielle/6b/15/22/ > Anne Le Bihan - MDCE SKEMA http://fr.linkedin.com/pub/anne-guillemin-le-bihan/76/b5b/89/ MDCE SKEMA http://www.skema-mdce.fr/ Les liens étroits qu’entretient Télécom ParisTech avec l’industrie en font un témoin privilégié de l’émergence du phénomène « Big Data » et de son impact technologique, sociétal et économique, ainsi qu’un acteur légitime dans le domaine de la formation et de la recherche. Thales, Safran, Airbus Group, Criteo, SAS, Capgemini, Orange, Xebia, Ezakus et McKinsey participent aux comités de veille et de perfectionnement du Mastère Spécialisé, comme aux enseignements, aux études de cas et mises en situation professionnelle. Les Mastères Spécialisés sont des formations intensives et professionnelles dont l’objectif est de permettre à de jeunes diplômés et/ou à des ingénieurs venant d’horizons divers, d’acquérir une spécialisation de haut niveau correspondant à des besoins identifiés par les entreprises et de se doter ainsi d’une double compétence reconnue sur le marché du travail. Mastère Spécialisé Près de 1 500 étudiants choisissent Télécom ParisTech chaque année. Plus de 300 start-up y ont été créées. L'école est ainsi au service de l'économie et de la société française par les ingénieurs qu'elle forme, par les recherches dont elle transfère les résultats à l'industrie, par les entreprises qu'elle aide à faire naître et grandir au sein de ses deux incubateurs. La formation initiale La formation continue La recherche L'innovation Renseignements et inscriptions http://masteres.telecom-paristech.fr Tél : 01 45 81 75 97 Contact : masteres@telecom-paristech.fr 37/39 rue Dareau, 75014 Paris Une définition du programme en étroite collaboration avec les entreprises „ Un réseau de plus de 14 600 diplômés dont 2 000 Mastères Spécialisés. Télécom ParisTech forme ses diplômés à innover et entreprendre dans un monde numérique ! Mastère Spécialisé BIG DATA : GESTION ET ANALYSE DES DONNÉES MASSIVES (BGD) Le Mastère Spécialisé (MS) est accrédité par la Conférence des grandes écoles 4 missions dans le domaine des technologies de l'information Rejoignez le secteur le plus stratégique de l’économie numérique Appréhendez les challenges économiques et juridiques du Big Data Mesurez l’impact de l’utilisation des algorithmes de Machine Learning Accompagnez votre entreprise dans les changements liés à l’exploitation de ses données Conception graphique : RectoVerso 01 46 24 10 09 Document non contractuel - mars 2014 L’objectif de cette Chaire de l’institut Mines Télécom est notamment de contribuer aux réflexions sur la régulation juridique, éthique, économique et technique des informations personnelles et des identités numériques. Elle a été créée en partenariat avec : 3 Valeurs et Politiques des Informations Personnelles Claire Levallois-Barth Cette chaire témoigne de l’excellence des équipes de recherche de l’École dans ces domaines stratégiques pour Télécom ParisTech, et de la reconnaissance de ces compétences par les entreprises du secteur, ellesmêmes de plus en plus focalisées sur les besoins de traitement optimisé de l’énorme masse de données disponibles sur les différents canaux. La chaire est créée avec le soutien de la et est financée par et Yves Rocher. Big Data & Market Insights Pr. Talel Abdessalem 2 Big Data : Gestion et analyse des données massives CAR : Conception et architecture de réseaux CASI : Conception et architecture des systèmes informatiques CPD-CPM : Concepteur de projet digital (en partenariat avec l’INA) IDL : Ingénierie du logiciel Télécom ParisTech propose 14 programmes de Mastères Spécialisés à de jeunes diplômés et à des ingénieurs venant d’horizons divers, pour leur permettre d’acquérir ou de compléter une compétence dans un des grands domaines d'élection de l’École. MPT : Management de projets technologiques (en partenariat avec l’ESSEC) RM : Radio-Mobiles SCHD : Systèmes de communications à haut débit SIRF : Signal, images et reconnaissance des formes SSIR : Sécurité des systèmes informatiques et des réseaux ARS : Architecture réseaux et sécurité ATOMS : Architecte télécom orienté multiservices MSIR : Management des systèmes d’information en réseaux (en partenariat avec l’ESSEC) REgNum : Régulation de l’économie numérique (en partenariat avec l’ARCEP du Burkina Faso) MS à temps plein Executive MS Réseaux et architecture Internet Management des SI Systèmes de communications Cybersécurité Systèmes embarqués 3 chaires dédiées au Big Data Une équipe de réputation internationale sur le sujet du « Machine Learning » ou apprentissage statistique ; domaine à l'interface des mathématiques et de l'informatique. Quatre entreprises prestigieuses sont les partenaires de cette chaire : 1 Machine Learning for Big Data Pr. Stéphan Clémençon Doc Big Data_Mise en page 1 28/03/14 13:44 Page1 2-electrode arrester Series/Type: EF800X Ordering code: B88069X2641xxxx a) Version/Date: Issue 03 / 2008-01-18 Version: 6 Content of header bars 1 and 2 of data sheet will be automatically entered in headers and footers! Please fill in the table and then change the color to "white" (or invisible). This ensures that the table disappears for the customer PDF. To update the data sheet, click on the symbol "Preview" and then "Close". Please do not alter the header or footer when copying the content. Identification/Classification 1: (header 1 + top left header bar) Surge arrester Identification/Classification 2: (header 2 + bottom left header bar) 2-electrode arrester Ordering code: (top right header bar) B88069X2641xxxx a) Series/Type: (top right header bar) EF800X Preliminary data (optional): (if necessary) Department: KB AB E / KB AB PM Date: Issue 03 / 2008-01-18 © EPCOS AG 2008. Reproduction, publication and dissemination of this document, enclosures hereto and the information contained therein without EPCOS' prior express consent is prohibited. Surge arrester B88069X2641xxxx a) 2-electrode arrester EF800X KB AB E / KB AB PM Issue 03 / 2008-01-18 Please read Cautions and warnings and Page 2 of 4 Important notes at the end of this document. Features Applications ƒ Standard size ƒ High follow current capability ƒ Very fast response time ƒ Stable performance over life ƒ Very low capacitance ƒ High insulation resistance ƒ RoHS-compatible ƒ Application with high follow current ƒ Power supply Electrical specifications DC spark-over voltage 1) 2) 680 ... 1000 V Impulse spark-over voltage at 100 V/µs - for 99 % of measured values - typical values of distribution at 1 kV/µs - for 99 % of measured values - typical values of distribution < 1200 < 1000 < 1300 < 1100 V V V V Service life 10 operations 50 Hz, 1 s 5 A 1 operation 50 Hz, 0.18 s (9 cycles) 65 A 10 operations 8/20 µs 5 kA 1 operation 8/20 µs 10 kA Max. follow current during one voltage half cycle at 50 Hz 200 A Insulation resistance at 100 Vdc > 10 GΩ Capacitance at 1 MHz < 1.5 pF Arc voltage at 1 A Glow to arc transition current Glow voltage ~ 22 < 0.5 ~ 140 V A V Weight ~ 1.5 g Operation and storage temperature -40 ... +90 °C Climatic category (IEC 60068-1) 40/ 90/ 21 Marking, red positive EF 800 YY O EF - Series 800 - Nominal voltage YY - Year of production O - Non radioactive a) xxxx = S102 (100 pcs on 5 stripes) = T502 (500 pcs on tape and reel) 1) At delivery AQL 0.65 level II, DIN ISO 2859 2) In ionized mode Terms in accordance with ITU-T Rec. K.12 and DIN 57845/VDE0845 Surge arrester B88069X2641xxxx a) 2-electrode arrester EF800X KB AB E / KB AB PM Issue 03 / 2008-01-18 Please read Cautions and warnings and Page 3 of 4 Important notes at the end of this document. Dimensional drawing Cautions and warnings ƒ Surge arrester must be selected so that the maximum expected follow current can be quenched. ƒ The follow current must be limited so that the arrester can be properly extinguished when the surge has decayed. The arrester might otherwise heat up and ignite adjacent components. ƒ Surge arresters must not be operated directly in power supply networks. ƒ Surge arresters may become hot in case of longer periods of current stress (danger of burning). ƒ Surge arresters may be used only within their specified values. In case of overload, the head contacts may fail or the component may be destroyed. ƒ Damaged surge arresters must not be re-used. Not to scale Dimensions in mm Non controlled document Important notes Page 4 of 4 The following applies to all products named in this publication: 1. Some parts of this publication contain statements about the suitability of our products for certain areas of application. These statements are based on our knowledge of typical requirements that are often placed on our products in the areas of application concerned. We nevertheless expressly point out that such statements cannot be regarded as binding statements about the suitability of our products for a particular customer application. As a rule, EPCOS is either unfamiliar with individual customer applications or less familiar with them than the customers themselves. For these reasons, it is always ultimately incumbent on the customer to check and decide whether an EPCOS product with the properties described in the product specification is suitable for use in a particular customer application. 2. We also point out that in individual cases, a malfunction of passive electronic components or failure before the end of their usual service life cannot be completely ruled out in the current state of the art, even if they are operated as specified. In customer applications requiring a very high level of operational safety and especially in customer applications in which the malfunction or failure of a passive electronic component could endanger human life or health (e.g. in accident prevention or life-saving systems), it must therefore be ensured by means of suitable design of the customer application or other action taken by the customer (e.g. installation of protective circuitry or redundancy) that no injury or damage is sustained by third parties in the event of malfunction or failure of a passive electronic component. 3. The warnings, cautions and product-specific notes must be observed. 4. In order to satisfy certain technical requirements, some of the products described in this publication may contain substances subject to restrictions in certain jurisdictions (e.g. because they are classed as hazardous). Useful information on this will be found in our Material Data Sheets on the Internet (www.epcos.com/material). Should you have any more detailed questions, please contact our sales offices. 5. We constantly strive to improve our products. Consequently, the products described in this publication may change from time to time. The same is true of the corresponding product specifications. Please check therefore to what extent product descriptions and specifications contained in this publication are still applicable before or when you place an order. We also reserve the right to discontinue production and delivery of products. Consequently, we cannot guarantee that all products named in this publication will always be available. The aforementioned does not apply in the case of individual agreements deviating from the foregoing for customer-specific products. 6. Unless otherwise agreed in individual contracts, all orders are subject to the current version of the “General Terms of Delivery for Products and Services in the Electrical Industry” published by the German Electrical and Electronics Industry Association (ZVEI). 7. The trade names EPCOS, BAOKE, Alu-X, CeraDiode, CSSP, MiniBlue, MKK, MLSC, MotorCap, PCC, PhaseCap, PhaseMod, SIFERRIT, SIFI, SIKOREL, SilverCap, SIMDAD, SIMID, SineFormer, SIOV, SIP5D, SIP5K, ThermoFuse, WindCap are trademarks registered or pending in Europe and in other countries. Further information will be found on the Internet at www.epcos.com/trademarks. Introduction Ce document détaille la procédure de mise à jour du firmware du SSD Crucial m4 via notre utilitaire de mise à jour Windows. L’utilitaire consiste en un seul fichier exécutable qui contient tous les codes nécessaires pour procéder à la mise à jour. La création d’un support de démarrage distinct est inutile. Ce programme est destiné à la mise à jour du firmware depuis les révisions 0001, 0002, 0009, 0309, 000F et 010G vers la révision 040H. REMARQUE : Cette mise à jour du firmware ne s’applique pas à tous les SSD Micron acquis seuls ou en tant que matériel de première monte d’un ordinateur. Les mises à jour de firmware de ces disques là seront, le cas échéant, fournies par le fabricant de l’ordinateur ou seront disponibles sur www.micron.com. Cette mise à jour du firmware ne concerne pas n’importe quel disque Micron RealSSD C300. De même, elle ne doit pas être utilisée pour un SED (Self Encrypting Drive) Micron RealSSD C400. Cette mise à jour s’applique uniquement aux disques m4 2,5” et ne doit pas être utilisée pour mettre à jour des disques m4 mSATA. AVERTISSEMENT : Comme pour toutes mises à jour, il est fortement recommandé de sauvegarder ou de copier tous vos fichiers importants auparavant. Cette procédure de mise à jour du firmware s’effectue sous votre seule responsabilité. Si elle est exécutée correctement, il n’y aura aucune perte de données système ou utilisateur présentes sur le disque. Toutefois, une interruption de la mise à jour, quelle qu’en soit l’origine, peut entraîner le dysfonctionnement de votre SSD. Si cette mise à jour est appliquée sur un ordinateur portable, il est fortement recommandé de le brancher en secteur pendant la procédure. Instructions générales Procédez aux opérations suivantes avant de démarrer la procédure de mise à jour du firmware : 1. Sauvegarde du contenu du SSD Il est fortement recommandé de procéder à une sauvegarde complète du système avant de démarrer cette mise à jour du firmware. Si la procédure de mise à jour est interrompue (coupure d’alimentation ou défaillance matérielle de toute nature), il est possible que le SSD ne fonctionne pas correctement. 2. Utiliser une alimentation CA Veillez à ce que votre ordinateur portable ou de bureau soit relié à une alimentation CA pendant la mise à jour. Il est déconseillé de n’utiliser que la batterie pendant la procédure. Ne débranchez l’alimentation à aucun moment de la procédure de mise à jour du firmware car cela pourrait aboutir à un déroulement incomplet de celle-ci et donc, rendre le SSD inutilisable. 3. Désactiver/supprimer les mots de passe associés au disque La protection par mots de passe, comme le cryptage du disque contenant le SE ou les mots de passe du BIOS, peut bloquer les mises à jour du firmware. Le cryptage du disque peut être désactivé via le SE ou le logiciel de cryptage. Pour désactiver un mot de passe de BIOS, vous devez éditer les paramètres de votre BIOS. Veuillez consulter le manuel utilisateur de votre ordinateur pour savoir comment procéder. Entrez dans le BIOS (généralement en appuyant sur les touches « Suppr », « F2 » ou « F12 » au démarrage de l’ordinateur) et désactivez tous les mots de passe éventuellement associés au SSD. 4. Mettre à jour Microsoft .NET Framework Pour être compatible avec Windows 7 et 8, cet utilitaire de mise à jour du firmware a été conçu avec Microsoft .NET Framework 4. Il se peut que certains utilisateurs de Windows 7 doivent mettre à jour leur version de .NET Framework pour exécuter cet utilitaire. Si le message d’erreur suivant apparaît à l’exécution de l’utilitaire de mise à jour, veuillez mettre à jour .NET Framework via Windows Update. Guide pratique de mise à jour du firmware d’un SSD Guide de mise à jour du firmware du SSD Crucial® m4 2,5” vers la révision 040H - Windows 7 et 8 (mise à jour depuis les versions 0001, 0002, 0009, 0309, 000F, 010G vers la version 040H)Guide pratique de mise à jour du firmware d’un SSD Guide de mise à jour du firmware du SSD Crucial® m4 2,5” vers la révision 040H - Windows 7 et 8 (mise à jour depuis les versions 0001, 0002, 0009, 0309, 000F, 010G vers la version 040H) Téléchargez la mise à jour du firmware 1. Avant de commencer le téléchargement du firmware, fermez tous les autres programmes, sauf votre navigateur internet. 2. Recherchez l’utilitaire Windows de mise à jour du firmware associé à votre SSD Crucial m4 à l’adresse : http://www. crucial.com/support/ firmware.aspx 3. Cliquez sur le lien correspondant et sélectionnez Enregistrer pour télécharger le fichier *.ZIP contenant l’utilitaire de mise à jour pour votre système. 4. Double-cliquez sur le fichier *.ZIP pour extraire son contenu. Enregistrez les fichiers extraits sur votre bureau. Lancez la mise à jour du firmware 1. Si ce n’est pas déjà fait, copiez l’utilitaire de mise à jour sur votre bureau. 2. Double-cliquez sur l’icône pour lancer l’utilitaire de mise à jour. 3. Une fenêtre de contrôle des comptes d’utilisateurs s’affichera : Assurez-vous que l’éditeur soit bien Micron Technology, Inc. Si ce n’est pas le cas, sélectionnez No (Non) pour interrompre cette opération. Cliquez sur Yes (Oui) pour continuer si la signature du fichier est exacte. 4. Vous devez accepter le Contrat de Licence pour poursuivre. Lorsque la fenêtre suivante apparaît, cliquez sur le bouton « Licence ». 5. Parcourez et lisez le Contrat de Licence du logiciel. Pour continuer, cliquez sur le bouton Accept (Accepter). 6. L’utilitaire est prêt à démarrer la procédure de mise à jour. Avant de cliquer sur Continue (Continuer), assurez-vous que toutes les autres tâches ont été sauvegardées et toutes les applications ouvertes ont été fermées. Un clic sur Continue (Continuer) déclenchera la procédure. Windows sera arrêté et l’ordinateur redémarré. 7. Votre ordinateur redémarrera sur l’utilitaire de mise à jour. L’écran affichera ceci : 8. Après le chargement complet de l’utilitaire de mise à jour, ces éléments apparaîtront à l’écran : La mise à jour est possible depuis les révisions 0001, 0002, 0009, 0309, 000F ou 010G du firmware ; c’est pourquoi l’une d’entre elles peut apparaître sur l’écran ci-dessus (juste en dessous du numéro de série de votre disque). Si votre disque m4 est absent de la liste affichée sur l’écran ci-dessus, veuillez vous reporter au paragraphe « Astuces de dépannage » à la page suivante. 9. L’utilitaire mettra à jour votre firmware immédiatement en affichant cette mention : 10.Sur la plupart des systèmes, cette procédure durera entre 30 et 60 secondes. Dans certains cas, cela peut être plus long. 11. À la fin de la procédure, le message suivant apparaîtra : 12.Après quelques secondes, le système redémarrera à nouveau, relançant Windows. 13.Lorsque Windows a correctement redémarré, la mise à jour du firmware est terminée.Astuces de dépannage • Bien que tout ait été mis enœuvre pourtesterla compatibilité de ce logiciel avec différentes configurations de systèmes et de jeux de composants, il est impossible de procéder à des essais sur tous les systèmes existants. Par conséquent, certains systèmes (anciens par exemple) peuvent se heurter des problèmes de compatibilité. • Si vous rencontrez des difficultés après le redémarrage de l’utilitaire, vérifiez que vous avez désactivé tous les mots de passe du BIOS. • Si votre disque m4 n’est pas reconnu lors de l’étape 8 du paragraphe « Lancez la mise à jour du firmware », il peut s’avérer nécessaire d’exécuter cette mise à jour en mode IDE et non AHCI, sur certains systèmes anciens. Si un basculement du mode IDE ou AHCI est nécessaire, il peut falloir redémarrer le système au moyen d’un support externe tel qu’un CD-ROM amorçable. Des instructions d’exécution de la mise à jour 040H à partir d’un support amorçable sont disponibles sur la page d’assistance consacrée aux SSD http://www.crucial.com/support/firmware.aspx • Certains systèmes empêchent les mises à jour de firmware en mode RAID. Dans ce cas, le basculement en mode AHCI ou IDE peut aider à terminer la mise à jour. Toutes les configurations RAID devraient être conservées après la mise à jour, lorsque le système rebascule en mode RAID mais vérifiez ceci dans le manuel utilisateur de votre système avant de démarrer la procédure. • Les cartes RAID périphériques ne transmettront pas les commandes nécessaires aux mises à jour du firmware. Il se peut que vous deviez déplacer le disque cible sur un adaptateur de bus hôte SATA ou un connecteur SATA de la carte mère qui facilite ces commandes. • Cet utilitaire de mise à jour du firmware peut ne pas fonctionner sur des ordinateurs fixes, portables ou des tablettes disposant d’une interface UEFI. Nous mettrons à disposition un outil de mise à jour séparé qui prendra en charge les mises à jour du firmware sous UEFI (Unified Extensible Firmware Interface). Vérification de la version actuelle du firmware Dans Windows 7, l’utilisateur peut vérifier la version actuelle du firmware du disque en suivant la procédure suivante : • Cliquez sur le bouton “Démarrer” de Windows, puis sur “Ordinateur”. • Faites un clic droit sur l’icône correspondant à votre disque et sélectionnez “Propriétés”. • Dans la fenêtre qui s’affiche, sélectionnez l’onglet “Matériel”. • Dans la liste Tous les lecteurs de disque, sélectionnez votre disque m4 et cliquez sur “Propriétés”. • Dans la fenêtre suivante, sélectionnez l’onglet “Détails”. • Dans le menu déroulant Propriété, sélectionnez “Numéros d’identification du matériel” et les mentions suivantes apparaîtront : • La version actuelle du firmware est entourée en rouge sur la capture d’écran ci-dessus. Si la révision du firmware est la 040H, aucune autre action n’est nécessaire.©2012 Micron Technology, Inc. Tous droits réservés. Ces informations peuvent être modifiées sans avis préalable. Crucial et le logo Crucial sont des marques commerciales ou marques de service de Micron Technology, Inc. Toutes les autres marques commerciales et marques de service sont la propriété de leurs détenteurs respectifs. REVISION: 04/12/12 FW040H Notes de version du firmware Le firmware du SSD m4 a été mis à jour de la version 010G à 040H. Le firmware 040H est recommandé pour tous les disques disposant de la version 010G, ou précédentes. Il comporte des améliorations et corrections cumulatives par rapport à ces versions, susceptibles d’améliorer l’expérience utilisateur globale. Comme le firmware 010G, la version 040H contient des améliorations par rapport à la version 000F et aux révisions précédentes, notamment pour les systèmes sous Windows 8 et les nouveaux UltraBook, même si des améliorations peuvent également être constatées sur les systèmes sous Windows 7 et autres systèmes d’exploitation. Toute version du firmware du m4 fonctionnera normalement sous Windows 8, même sans ces améliorations de fonctionnement. Voici un résumé des différences entre la version 010G et 040H, quel que soit le système d’exploitation : • Amélioration de la fiabilité en cas de coupure d’alimentation inattendue.* Réduction significative des effets de durées de redémarrage prolongées après une coupure d’alimentation inattendue. • Correction d’un problème concernant le statut du lecteur lors de l’exécution du test SMART Drive Self Test (n’affecte pas les données d’attribut SMART). • Amélioration du processus de mise à jour pour Windows 8. • Amélioration des algorithmes de gestion de l’usure du SSD afin de réduire leur influence sur les débits. * Une « coupure d’alimentation inattendue » lorsqu’une coupure d’alimentation n’est pas précédée d’une commande ATA de VEILLE IMMÉDIATE ou autre commande identique. La VEILLE IMMÉDIATE est une commande système qui avertit le dispositif de stockage d’une coupure d’alimentation imminente ou d’un passage en modes basse consommation tels que la VEILLE ou VEILLE PROLONGÉE. Généralement, la VEILLE IMMÉDIATE ne se déclenche pas quand la coupure d’alimentation est due à une coupure de connexion électrique, une batterie épuisée ou au maintien du bouton Power pendant au moins 4 secondes. Bien que le nouveau firmware réduise significativement le risque, ce type de coupures d’alimentation inattendues peuvent entraîner un temps de redémarrage plus long à la mise sous tension suivante. D’un autre côté, un arrêt normal sur un système Windows ou Mac déclenchera la commande VEILLE IMMÉDIATE auparavant, permettant ainsi un démarrage sans encombre lors de sa remise sous tension. Versions précédentes Rév. A………………………………………………………… 4 Décembre 2012 • Version initiale Introduction Ce document décrit le processus de mise à jour du microprogramme sur l’unité Crucial m4 SSD en utilisant votre fonction de mise à jour Windows. La fonction est un seul fichier exécutable qui contient tous les codes nécessaires pour faire une mise à jour. La création d’une unité amorçable séparée n’est pas nécessaire. Ce programme peut être utilisé pour la mise à jour du Microprogramme de Révisions 0001, 0002, 0009, 0309 ou 000F vers Révision 010G. ATTENTION : Cette mise à jour pour microprogramme ne s’applique pas à toute unité Micron SSD qui a été achetée séparément ou comme équipement d’origine dans le système informatique. Toute mise à jour pour microprogramme pour une telle unité sera mise à disposition, si besoin, par le fabricant de l’ordinateur ou sur www.micron.com. Cette mise à jour pour microprogramme ne s’applique pas aux unités Micron RealSSD C300. La mise à jour ne devrait pas être utilisée non plus pour toute unité Micron RealSSD C400 Self Encrypting Drive (SED) [Unité Auto-Encryptage]. Cette mise à jour est uniquement destinée aux unités 2.5’’ m4 et ne devrait pas être utilisée pour mettre à jour des unités mSATA m4. AVERTISSEMENT : Comme pour toute mise à jour pour microprogramme, il est fortement recommandé de faire une sauvegarde ou des copies des fichiers importants avant d’exécuter cette mise à jour. L’exécution de la mise à jour pour microprogramme est entièrement à votre risque. Si exécutée correctement, le système ou les données sur l’unité ne seront pas perdus. Cependant, si le processus est interrompu, votre unité SSD peut ne pas fonctionner correctement. Si cette mise à jour est effectuée sur un ordinateur notebook, il est fortement recommandé d’utiliser un adaptateur courant alternatif pour alimenter l’ordinateur en électricité. Instructions Générales Complétez les étapes suivantes avant de démarrer le processus de mise à jour pour microprogramme : 1. Faire une sauvegarde de l’unité SSD Il est fortement recommandé de faire une sauvegarde complète avant de démarrer cette procédure de mise à jour. Si la mise à jour est interrompue (coupure de courant ou panne d’équipement…), il est possible que l’unité SSD ne fonctionne pas correctement. 2. Utiliser du courant alternatif Assurez-vous que votre ordinateur portable ou PC est alimenté avec du courant alternatif pendant le processus de mise à jour. Il n’est pas recommandé d’utiliser uniquement la batterie pendant la mise à jour. Ne coupez pas le courant pendant le processus de mise à jour pour microprogramme car ceci pourrait donner un résultat incomplet et rendre votre unité SSD inutilisable. 3. Désactiver/Supprimer les Mots de passe sur l’Unité La protection par mot de passe, comme l’encryptage sur unité OS ou des mots de passe au niveau BIOS, peuvent bloquer les mises à jour du microprogramme. L’encryptage de l’unité peut être désactivé dans l’OS ou l’outil de logiciel que vous utilisez pour l’encryptage. Pour désactiver un mot de passe BIOS, il faut régler les paramètres BIOS sur votre ordinateur. Consultez le mode d’emploi de votre ordinateur pour les détails concernant le réglage de ces paramètres. Rentrez le BIOS (normalement en appuyant sur « Supprimer », « F2 » ou « F12 » pendant le démarrage de l’écran) et désactivez tout mot de passe que vous avez pu programmer sur l’unité SSD. 4. Mise à jour Microsoft.NET Framework Afin de pouvoir être compatible avec Windows 7 et Windows 8, cet outil de mise à jour pour microprogramme est construit sous Microsoft.NET Framework 4. Certains utilisateurs Windows 7 doivent mettre à jour leur version .NET Framework afin de pouvoir activer cet outil. Si le message d’erreur suivant s’affiche quand vous utilisez la mise à jour pour microprogramme, utilisez la fonction Windows Update [mise à jour Windows] pour mettre à jour .NET Framework. Guide pour la Mise à Jour du Microprogramme SSD Guide pour la mise à jour du microprogramme Crucial® m4 2.5’’ Révision 000F pour Windows 7 + Windows 8 (Mise à jour du Rév 0001,0002, 0009, 0309, 000F vers Rév 010G)Guide pour la Mise à Jour du Microprogramme SSD Guide pour la mise à jour du microprogramme Crucial® m4 2.5’’ Révision 000F pour Windows 7 + Windows 8 (Mise à jour du Rév 0001,0002, 0009, 0309, 000F vers Rév 010G) Télécharger la Mise à jour pour Microprogramme 1. Avant de commencer le processus de mise à jour pour microprogramme, fermez tous les programmes sauf votre navigateur Internet. 2. Trouvez la Fonction Mise à jour Microprogramme Windows associé avec votre unité Crucial m4 SSD sur http://www. crucial.com/support/firmware.aspx 3. Cliquez sur le lien pour la Fonction Mise à jour Microprogramme Windows et sélectionnez Save pour télécharger le fichier ZIP qui contient l’outil mise à jour microprogramme, sur votre système. 4. Double-cliquez sur le fichier ZIP pour extraire les fichiers. Sauvegardez-les sur votre PC. Exécuter la Mise à jour pour Microprogramme 1. Si vous ne l’avez pas encore fait, copiez le fichier fonction mise à jour sur votre PC. 2. Double-cliquez sur l’icône pour démarrer la fonction de mise à jour. 3. Un cadre Gestion du Compte Utilisateur apparait : Assurez-vous que l’Editeur Vérifié est bien « Micron Technology, Inc. ». Si ce n’est pas le cas, sélectionnez « No » pour arrêter cette opération. Cliquez « Yes » pour continuer si le fichier est correctement signé. 4. Vous devez accepter l’Accord de Licence afin de pouvoir continuer. Quand vous voyez la fenêtre suivante, cliquez sur la touche « License ». 5. Lisez l’Accord de License pour le Logiciel. Si vous souhaitez continuer, cliquez sur la touche « Accept ». 6. La fonction est prête à démarrer le processus de mise à jour. Avant de cliquer sur « Continue », assurez-vous que tout votre travail est sauvegardé et que les applications ouvertes sont fermées. En cliquant sur « Continue », le processus commencera, Windows sera fermé et votre ordinateur sera redémarré. 7. Votre ordinateur redémarre et va vers l’outil de mise à jour. Vous voyez le message suivant sur votre écran : 8. Une fois l’outil de mise à jour complètement chargé, vous voyez le suivant : Il est acceptable de faire une mise à jour du microprogramme de la révision 0001, 0002, 0009, 0309 ou 010G donc vous voyez peut-être une de ces révisions sur l’écran (juste en dessous le numéro de série de votre unité). Si votre unité m4 n’est pas listée sur l’écran, vérifiez la section « Astuces Dépannage » en dessous. 9. La fonction exécutera immédiatement la mise à jour de votre unité, indiquant le message suivant : 10.Sur la plupart des systèmes, ce processus prend entre 30 et 60 secondes. Certains systèmes peuvent prendre plus longtemps. 11. Une fois ce processus complété, le message suivant s’affiche : 12.Après quelques secondes, le système sera réinitialisé à nouveau, Windows redémarre. 13.Quand Windows redémarre normalement, le processus de mise à jour pour microprogramme est complété.Astuces Dépannage • Malgré des efforts faits pour tester la compatibilité de ce logiciel avec des configurations de différents systèmes et de jeux de composants, il n’est pas possible de tester tout système disponible. Certains systèmes (par ex. des systèmes plus anciens) peuvent donc avoir des problèmes de compatibilité. • Si vous avez des problèmes après la réinitialisation de l’outil, vérifiez que vous avez bien désactivé les mots de passe BIOS sur l’unité. • Si votre unité RealSSD m4 n’est pas reconnue pendant l’étape 8 de la section « Exécuter la Mise à jour pour Microprogramme » ci-dessus, il peut être nécessaire d’exécuter cette mise à jour sur certains systèmes plus anciens en mode IDE au lieu du mode AHCI. Quand vous devez changer le système en mode IDE ou AHCI, il peut être nécessaire de réinitialiser le système en utilisant un média externe comme un CD-ROM amorçable. Des instructions pour exécuter la mise à jour 010G à partir des médias amorçables sont disponibles sur la page SSD Support sur http://www.crucial.com/support/firmware.aspx • Certains systèmes bloquent une mise à jour pour microprogramme quand en mode RAID. Dans ce cas, changer en mode AHCI ou IDE peut aider à compléter le processus de mise à jour. Toute configuration RAID doit être préservée après la mise à jour pour quand le système est à nouveau mis en mode RAID, mais vérifiez le mode d’emploi pour votre système avant de continuer. • Des cartes périphériques RAID ne font pas passer les commandes nécessaires pour exécuter des mises à jour pour microprogramme. Vous devez peut-être déplacer l’unité cible vers un adaptateur de bus hôte SATA ou un connecteur SATA sur la carte-mère qui accepte ces commandes. • Cetoutil demise à jour pourmicroprogramme ne fonctionne peut-être pas correctement sur des PCs, notebooks ou tablettes avec BIOS-UEFI. Nous proposerons un outil de mise à jour séparément qui accepte les mises à jour pour microprogramme avec UEFI [interface micrologicielle extensible unifiée]. Validation de la Révision Actuelle du Microprogramme Windows 7 permet à l’utilisateur de vérifier la révision actuelle du microprogramme pour l’unité en suivant les étapes suivantes : • Cliquez sur Windows « Start » et sélectionnez « Computer ». • Sur l’icône du disque, représentant votre unité, faites un clic-droit et sélectionnez « Properties ». • Dans la fenêtre qui s’ouvre par la suite, vous sélectionnez l’onglet « Hardware ». • Dans la liste All Disk Drives, vous sélectionnez votre unité C400 et vous cliquez sur « Properties ». • Dans la fenêtre suivante qui s’ouvre, sélectionnez la page « Details ». • Dans le menu déroulant Property, sélectionnez « Hardware Ids « , ensuite vous voyez le suivant : • La révision actuelle du microprogramme est entourée en rouge. Si la révision du microprogramme indique « 010G », aucune action supplémentaire est nécessaire.REVISION : 11/5/12 FW010G ©2012 Micron Technology, Inc Tous droits réservés. L’information peut être modifiée sans notification. Crucial et le logo Crucial sont des marques commerciales de Micron Technology, Inc. Toute autre marque commerciale et marque de service est la propriété des propriétaires respectifs. Notes de Publication pour Microprogramme Le microprogramme pour l’unité SSD m4 est mis à jour de la version 000F vers la version 010G. Microprogramme 010G est une option pour toute personne qui utilise actuellement la version 000F comme la nouvelle version comprend des améliorations incrémentales mais est recommandé si l’utilisateur a eu des problèmes avec la version actuelle. La version 010G comprend des améliorations spécifiques pour Windows 8 et des nouveaux systèmes UltraBook, même si Windows 7 et d’autres systèmes et des plates-formes informatiques peuvent également voir des améliorations. Toute version m4 pour microprogramme fonctionnera normalement dans Windows 8. Cependant, les améliorations suivantes ont été ajoutées pour répondre aux nouvelles exigences de certification pour ce système d’exploitation : Améliorations pour Windows 8 • Meilleur Time-to-ready (« TTR ») après un cycle de détente. TTR est maintenant moins de 850 millisecondes pour tous les points de capacité. Un « cycle de détente » est une séquence OFF-ON suite à une commande STANDBY IMMEDIATE envoyée par l’hôte et acceptée par l’unité SSD. STANDBY IMMEDIATE est typiquement envoyée durant une mise à l’arrêt du système d’exploitation. • Ce changement améliore également le temps resumefrom-sleep afin de répondre aux nouvelles exigences Windows 8. • Le temps de réponse a été réduit de 50ms à 20ms (typique). Consommation d’électricité améliorée pour certains ordinateurs notebook • HIPM (Host Initiated Power Management) n’est plus accepté. Dans certains ordinateurs notebook, HIPM peut interférer avec la capacité de SSD de rentrer et de rester dans des modes basse consommation en utilisant DIPM (Device Initiated Power Management). Utiliser DIPM seul est la méthode la plus efficace pour conserver la puissance SSD. • SATA pin 11 (Device Activity Signal) est électroniquement isolé de l’hôte quand l’unité SSD est en mode basse consommation. Ceci élimine une voie de fuite potentielle qui peut consommer de l’électricité pendant que l’unité SSD soit en veille. Ceci n’affecte pas la plupart des systèmes informatiques. Historique des Révisions Rév. A…………………………...............………….25 septembre 2012 • Publication Initiale Summary This white paper addresses the energy consumption of DRAM in computing applications and the opportunities to maximize energy savings by targeting more efficient products for data center servers. Micron estimates module power savings at 24 percent; this has the potential to achieve energy savings of 5.5 billion kilowatt hours (kWh) on a global basis annually. At typical industrial power costs1 ($0.06 per kWh), the savings are more than $300 million per year. Michael Sporer Regional Sales Manager, Micron Memory Products Group ©2008 Micron Technology, Inc. All rights reserved 1 The power demands of data centers require memory innovationsThe power demands of data centers require memory innovations Introduction The U.S. EPA Energy Star program is conducting a study to assess opportunities for energy efficiency improvements to computer servers and data centers2. This is in response to Public Law 109-431, which was passed and signed into law December 20, 20063. This legislation requires an investigation down to the microchip level. As a manufacturer of semiconductor memory products used in server systems, Micron intends to proactively address these opportunities. Justification A recent study conducted by Dr. Jonathan Koomey4 with the Lawrence Berkeley National Laboratory (LBL) and funded by Advanced Micro Devices (AMD), illustrated the significant and growing energy use by data centers. Data centers are rooms, floors or sometimes entire buildings that house computer, storage, and networking equipment. Data centers can serve up Web pages, stream media, enable Internet access, and run simulations of any kind of research. They can also provide computing power for traditional and private uses like banking or other financial transactions. The computers in data centers, called servers, are similar to PCs in that they have the same basic microchips—the CPU and memory. Unlike PCs, servers in data centers are packed together as densely as possible and use substantial amounts of electricity, the majority of which ends up in the form of heat, which then must be removed from the servers. The power delivery to the systems is provided through uninterruptible power supplies (UPS) that are not 100 percent efficient and also produce copious amounts of heat as well. The heat must be carefully and continuously managed to keep the systems running within their specified operating temperature and humidity ranges. Regardless of the type and efficiency of the cooling system, the heat must be removed from the data center in one way or another. To do so requires additional energy be used to operate the cooling infrastructure. ©2008 Micron Technology, Inc. All rights reserved 2 The data centers’ incremental overhead power consumption due to inefficiencies and cooling is estimated to be equal to the amount that is consumed by servers, storage, and networkingIntroduction The data centers’ incremental overhead power consumption due to inefficiencies and cooling is estimated to be equal to the amount that is consumed by servers, storage, and networking. The user of a single PC, workstation, or laptop doesn’t see system heat generation ias a concern, but for data centers, managing the overhead is as important as the servers themselves. If system power is reduced, then the available overhead can handle a greater IT load and perform more useful work in the same power envelope. The Role Memory Plays in the Challenges of Servers and Energy Use The memory content in servers has been growing at a rapid pace and is expected to continue to do so for a variety of reasons. In general, software with more functionality requires both greater computational ability as well as a larger memory footprint. However, some factors are more applicable to servers than PCs. First is the proliferation of multi-core CPUs executing single-threaded applications. Each thread requires its own memory space, therefore doubling the number of CPU cores requires doubling the memory. A recent seminar5 on server design cited this rule of thumb: 1GB per (1 GHz × # cores) This equation reinforces the idea that each CPU core mandates an increase in memory space. Another factor driving memory content growth and server power consumption is the adoption of virtualization technologies. A server running a virtualized environment is able to achieve a higher utilization which, in turn, increases the total power consumption of the server. Once again, the importance of energy efficient component selection increases. By analogy, a car will burn very little fuel if it isn’t driven. Virtualization, or anything that increases server operation, is like adding a new driver to the mix. Now the car gets driven more and energy efficiency becomes a greater concern. Traditionally, the CPU has been the component that consumes the most power in the system. Improvements in CPU power consumption now place a greater scrutiny on the other components. Where memory once played a distant second to CPUs in the ranking of system power consumption, now, in some cases, it exceeds the power consumption of the CPU. The power demands of data centers require memory innovations ©2008 Micron Technology, Inc. All rights reserved 3 The memory content in servers has been growing at a rapid pace and is expected to continue to do so for a variety of reasonsThe power demands of data centers require memory innovations Energy Efficient Memory Advantages Micron’s new energy efficient Aspen Memory® product line includes several new products that have a lower power consumption compared to legacy standard products. These technologies are intended for use in both client machines—PCs, laptops, workstations—as well as in servers. The new products are 1Gb-based, DDR2 reduced chip count (RCC) modules; and 1.5V DDR2 FBDIMMs. The 1.5V DDR2 SDRAM operates at 1.5V instead of 1.8V. The 1Gb-based, DDR2 RCC modules provide the same memory capacity and performance as a DIMM built using legacy (currently 512Mb) devices, but use half as many higher density (1Gb) DRAM devices (see Appendix A for product details). The combined savings of these two technologies is estimated to be 24 percent of the memory DIMM power consumption. For reasons previously cited, extrapolating the savings to the system level is difficult; instead, we have directly measured power savings at the power supply input of the server under test. Under minimum and maximum loading conditions and using commercially available systems, Micron has measured between 1.5 to 1.8 watts per 2GB DIMM improvement in power consumption when comparing standard legacy products to 1Gb-based, DDR2 reduced chip count DIMMs. Measurements made in a lab environment using modified commercial hardware with the adaptations required to support 1.5V DDR2 on FBDIMMs show power reductions in the 1.5 to 2.0 watts per 4GB 1.5V DIMM attributed only to the DRAM. Additional power savings could be possible using a low-voltage advanced memory buffer (AMB) chip, which is also on the FBDIMM. For the purpose of the analyses that follow, it is necessary to convert these savings into a percentage basis. We will assume a conservative 24 percent DIMM-level savings for the 1Gb-based, DDR2 RCC DIMM and 1.5V DDR2 SDRAM. ©2008 Micron Technology, Inc. All rights reserved 4 The combined savings of these two technologies—1Gbbased, DDR2 reduced chip count modules and 1.5V DDR2 SDRAM devices—is estimated to be 24 percent of the memory DIMM power consumptionThe power demands of data centers require memory innovations Data Centers and Energy Use According to Dr. Koomey’s report, data center servers consumed 616 billion kWh worldwide in 2005. The historical growth rate of this figure has been 15 percent annually from the year 2000 to 2005. Estimating the power consumption attributed to memory is a difficult challenge. A computer system has multiple memory sockets that can be fully or partially populated with memory modules, and the memory module density can also vary. In addition to these physical variations, the portion of power attributed to memory also depends on the type of workload and memory utilization. Certainly, further study is needed in this area. For the purpose of this paper we are going to assume memory accounts for 20 percent7 of the total system power budget in a server. The reader can adjust this assumption as needed. Micron has come up with an alternative method for estimating DRAM power consumption (summarized here; details in Appendix C). This method incorporates analysts’ data to estimate the total DRAM production in a given year and the DRAM consumption by market segment. This method also makes assumptions regarding hours of operation as well as system utilization to estimate power consumption and potential savings. (Figure 2 provides the estimate for calendar year 2008.) The production of DRAM is quantified in terms of 512Mb equivalent units. For example, a single 1Gb DRAM is equivalent to two 512Mb devices. First, we divide the market into three categories: server, client, and other. The client-machine category includes desktops, laptops, and workstations. The other category is a catch-all for non-computing markets and is not considered in this analysis. Given these market segments, it’s apparent that the client market consumes four times as many DRAM equivalent units as the server market. Next, we consider the hours of operation and system utilization on an annual basis. Servers operate 24 hours a day, 7 days a week; client machines operate approximately 8 hours a day, 5 days a week. Server utilization is assumed to be 15 percent; client, 5 percent. By applying the usage model to each DRAM market, we conclude that despite the four-to-one difference in shipments, the DRAM in servers consumes more power than all DRAM in the client machines. ©2008 Micron Technology, Inc. All rights reserved 5 Estimation of Memory Power Consumption and Potential Savings Illustrates the potential savings. For a detailed description, see Appendix B. 2005 61 billion kWh servers 12 billion kWh servers 20% 24% 2.9 billion kWh potential savings in 2005 34 billion kWh non-memoryThe power demands of data centers require memory innovations Next, we consider the total available 1Gb DRAM which could be used to build the 1Gb-based, DDR2 RCC DIMMs (see Appendix A for RCC details). For 2008, all 1Gb DRAM production is estimated to be enough to provide for 98 percent of the total demand for servers or 24 percent of the total demand for client machines. Finally, we look at the potential power savings for all the 1Gb-based, DDR2 RCC DIMMs if they were installed into either client machines or servers. When we analyze this power-savings comparison, we see that although the DIMM power requirements and potential savings are identical in either application, the cumulative energy savings is substantial for the server market due the longer hours of operation and higher utilization factors of server platforms. In this example, 462 million kWh energy savings would be achieved for energy efficient DRAM devices sold this year. This approach would conserve 2.3 billion kWh over a five-year product lifecycle. ©2008 Micron Technology, Inc. All rights reserved 6 Savings in servers are much greater because, unlike client machines, servers are always running Estimation of power conusmption based on annual DRAM manufacturing and market usage 13,849 million 512Mb EQ DRAM produced 1,870 million in servers 7,478 million in client machines 66MW potential savings 13MW potential savings 53MW could be saved by steering all available 1Gb DRAM to servers instead of client machines in 2008 463 million kWh per year 2,314 million kWh potential savings in 2008 9,348 million in servers and client machines 135MW total power for all DRAM in servers 109MW total power for all DRAM in client machines 67.5% High use Low use If all 1Gb went into servers as RCC If all 1Gb went into client machines as RCC Straight conversion to kWh annually Assume 5-year lifecycle; extrapolate to the entire installed base 20% Other marketsThe power demands of data centers require memory innovations Comparing the Two Methods Let’s attempt to correlate the two estimation methods. First we need to look at the differences so we can compensate accordingly. The first method is based on data from 2005 and assumes both 1Gb-based, DDR2 RCC DIMMs and 1.5V devices are placed into the installed base. The second method is based on data for 2008 and assumes only 1Gb-based, DDR2 RCC DIMMs are used (see figure below). To extrapolate from 2005 to 2008, we will assume a 15 percent annual growth rate consistent with the previous five years. As a first approximation we will assume that the savings from 1.5V DDR2 devices and 1Gb-based, DDR2 RCC modules are equal. As shown below, both methods demonstrate 4.5 billion kWh annual potential savings for DRAM in servers. The aggregate data center energy savings would be doubled when considering the incremental overhead and cooling energy costs. Alternately, instead of reducing power consumption, these savings could be used to support more IT equipment within the existing infrastructure, resulting in better asset utilization and deferring the need for new data center construction. ©2008 Micron Technology, Inc. All rights reserved 7 Comparing the Two Methods for Estimating Energy Savings 4.4 billion kWh in 2008 -4.6 billion kWh from both RCC and 1.5V devices 4.5 billion kWh from both RCC and 1.5V devices Savings from overhead roughly equal to IT load; therefore, 4.5 billion x 2 = -9 billion kWh savings 2.9 billion kWh in 2005 potential saving from RCC and 1.5V devices 2.3 billion kWh in 2008 potential saving from RCC only Data Center Use Calculation DRAM Production Calculation Extrapolate to 2008 based on 15% annual growth historical trend Reasonable agreementThe power demands of data centers require memory innovations Conclusion This paper brings together three important findings for memory with respect to energy consumption in computing applications. First, we highlight the growing memory content per server due to the increasing deployment of multi-core CPUs. We also discuss the relative importance of memory as CPUs and other sub-assemblies are being optimized for lower energy consumption. Second, we demonstrate two methods for estimating the energy consumption and potential savings of DRAM in both the general computing market and data centers. This also reinforces the idea that the greatest opportunity for power savings is in data center applications due to servers’ high utilization. Finally, we show how a significant reductions in power consumption can be achieved by adopting high-density 1Gb-based, DDR2 reduced chip count modules with 1.5V DDR2 SDRAM devices. ©2008 Micron Technology, Inc. All rights reserved 8 The greatest opportunity for power savings is in data center applications due to servers’ high utilizationThe power demands of data centers require memory innovations Appendix A: Product Availability Micron has introduced a product line which features products that are optimized for low power consumption and have superior performance compared to standard products. 1.5V DDR2 Devices The 1.5V DDR2, DIMMs, and motherboards that can use this technology are currently under development. Please contact Micron for the latest status. 1Gb-based, DDR2 Reduced Chip Count DIMMs Currently, 1Gb-based, DDR2 reduced chip count modules are available for a wide range of computer applications. These 1Gb-based, DDR2 RCC modules provide the same memory capacity and performance as a DIMM built using legacy (currently 512Mb) devices while using half as many higher density (1Gb) DRAM chips. For existing systems that can address 1Gb DRAM technology, the 1Gb-based, DDR2 RCC modules should easily work. Systems that use registered DIMMs or fully buffered DIMMs (FBDIMMs) and can support a 4GB density should be able to use 2GB reduced chip count DIMMs, which are built using the same 1Gb DRAM technology. Some systems require DIMMs to be installed in matched pairs. For these systems, pairing a reduced chip count DIMM with a standard DIMM could reduce system performance or possibly cause the system to stop functioning. Oftentimes, a memory upgrade or a firmware or BIOS update will solve the problem. Refer to your system manufacturer for compatibility questions. ©2008 Micron Technology, Inc. All rights reserved 9 Micron’s Aspen Memory® product line features modules that are optimized for low power consumptionThe power demands of data centers require memory innovations For some of the more common system questions, check the Micron® motherboard compatibility page from www.micron.com. For additional compatibility questions, refer to your system manufacturer. TABLE 1: Quick Reference for Reduced Chip Count DIMMs Note: Even numbers are for standard DIMMs; odd numbers are for ECC (error correction code) DIMMs. Appendix B: Derivation from LBL/AMD8 White Paper Calculating energy use and potential energy savings has not yet become a standard practice for data centers. Because of this, many calculations for determining actual energy use can be inaccurate. This situation is further complicated by the fact that power equipment efficiency is commonly calculated as the difference between power out and power in. Power consumed by memory in servers varies significantly depending on many factors. The two primary factors are the memory capacity of the server relative to the power consumed by the rest of the system and the second factor is the actual amount of memory installed. We assume 20 percent of the power is consumed by memory. 61 billion × 0.2 = 12 billion kWh By implementing 1.5V chips in reduced chip count server modules, data centers could reduce system memory power consumption by approximately 24 percent, which would be a reduction of 2.9 billion kWh. 12 billion × 0.24 = 2.9 billion kWh ©2008 Micron Technology, Inc. All rights reserved 10 4 or 5 8 or 9 16 or 18 512MB 1GB 2GB 8 or 9 16 or 18 32 or 36 DIMM Density Number of Chips on a DIMM Standard Reduced Chip CountThe power demands of data centers require memory innovations Assuming a power cost of $0.06 per kWh a 24 percent drop in power consumption translates into an average annual savings of $0.174 billion ($174 million)9. 2.9 billion × 0.06 = $174 million > ~$150 million Including the savings in overhead power raises this to 5.8 billion kWh and more than ~$300 million, respectively. Appendix C: DRAM Energy Consumption Based on Manufacturing and Market Another method for determining total energy consumption focuses on cumulative DRAM production and the applications into which DRAM is placed. According to market analysts although 13.5 percent of total DRAM gets placed into servers; the majority—54 percent—goes into workstations, PCs, and laptops (client machines). (The remainder goes into market segments not covered in this paper.) A typical client machine is operated approximately eight hours a day, five days a week. Utilization of clients is typically cited at 5 percent. Many government regulatory agencies have instituted energy efficiency requirements, with EnergyStar in the United States as one such example. Given these factors, the total energy consumed by DRAM in client machines is reasonably low, even when the power switch is on throughout the day. Compare that to a typical server in a data center that is powered on twenty-four hours a day, seven days a week. Utilization of servers is typically cited at about 15 percent. Table 2 shows the difference in total DRAM power consumption between client and server machines. ©2008 Micron Technology, Inc. All rights reserved 11The power demands of data centers require memory innovations TABLE 2: Use Percentages of Client Machines and Servers Note: Client machines limited to desktop, laptop, and workstations. In Table 2, total power equals the sum of : Percent of DRAM market × [Power-on hours × [%Utilization × DIMM Power (Utilized) + (1-%Utilization) × DIMM Power (Idle)]] Table 2 shows that, although client machines have four times more DRAM than servers, the total DRAM power consumed by servers is nearly equal, if not slightly higher, than power consumed by client machines. Initially, the implications might not be apparent. Of course, putting more energy efficient DRAM in either application will save power. The problem, however, is that advanced, energy efficient DRAM technology is not widely available. Given the limited availability, the question is what is the best use of what little is available? To determine what is available, we need to examine the total worldwide production of advanced DRAM products. Market analyst data in Table 3 shows the distribution of forecasted DRAM production and use for 2007 and 2008. ©2008 Micron Technology, Inc. All rights reserved 12 54 24 5 6 2 0 0.29 45 % % % Watts per DIMM Watts per DIMM Watts per DIMM % 13.5 100 15 6 2 0 0.35 55 Clients Servers Units Percent of DRAM market Annual power-on hours Utilization DIMM Power Utilized Idle Sleep Total Power: Percent of totalThe power demands of data centers require memory innovations TABLE 3: Projected Distribution of DRAM Production Notes: 1. Average of Gartner, iSupply, and IDC. 2. iSupply 4Q06 report. 3. 6W/DIMM typical for system in use; 2W for system idle; 0W for client in E-star or off. www.sun.com/servers/coolthreads/t2000/calc/ www.sun.com/servers/x64/x2200/calc/ 4. Calculated. 5. Maximum savings assumes all 1Gb DRAM goes into this market segment. The key will be the availability of 1Gb DRAM within the 2007-2008 time frame. A 1Gb DRAM built on advanced process technology will have power consumption on par with a 512Mb device built on older processes. The 1Gb DRAM enables a 2GB DIMM to be built using 18 chips rather than the 36 chips required with 512Mb DRAM. Table 3 projects that in 2007, 1Gb DRAM shipments will only be 4 percent of total production, but will increase in 2008 to 13 percent. Since the server market is roughly one-fourth the size of the client market, it is possible to achieve a much higher market penetration in the server market. In 2008 the available 1Gb DRAM will be large enough to service 98 percent of the projected demand for servers. The client machines’ low power-on hours and low utilization shown in Table 2, combined with the market size estimates in Table 3, indicate a baseline power consumption 109MW in 2008. However, since the available 1Gb DRAM could only serve 24 percent of the total client machine market, the potential savings would be 13.28MW. ©2008 Micron Technology, Inc. All rights reserved 13 512Mb EQ % % % MW MW % % MW MW MW million kWh million kWh TOTAL production 1Gb as % total Client Server DRAM in Client: Power DRAM in Server: Power 1Gb supply/demand client 1Gb supply/demand server Max Client savings Max Server Savings Annual delta from putting 1Gb in servers Annual delta Power 5 year lifecycle savings 1 1 2 2 3 3 4 4 4, 5 4, 5 4 4 4 9,203 4% 54% 13.5% 72 90 8% 31% 2.80 13.93 11.13 97.5 488 13,849 13% 54% 13.5% 109 135 24% 98% 13.28 66.11 52.83 462.8 2,314 Units 2007 2008 NotesBy comparison, the available 1Gb DRAM could serve 98 percent of the total server market. Applying the same mathematical computation as before produces a power savings of 66.1MW—a difference of 52MW. Significant power savings is achieved simply by channeling a scarce DRAM resource into a market segment where utilization is the highest. These results represent a reduction of 0.463B kWh for equipment installed during 2008. If we assume this represents only one-fifth of data center servers, and if we extrapolate that to the entire installed base, we find the estimated savings would be 2.3B kWh. This estimate only assumes reduced chip count technology; adding in 1.5V DDR2 FBDIMMs would add another 2.3B KWh, which brings the total annual IT load savings to 4.6B kWh. Finally, when the overhead power consumption is added into the mix, an equal amount of overhead energy can be saved with regard to reduced cooling, supply inefficiencies, etc. In other words, another 4.6B kWh could be saved, bringing the total potential savings to more than 9B kWh annually. Currently, the effective service life of servers is five years or longer due to the depreciation schedule imposed by Internal Revenue Service. Dr. Koomey’s report indicates a server life of three to five years. Micron’s investigation revealed on a limited dataset that if a server was no longer capable of meeting customer requirements inside the 5 year schedule, it would be repurposed for a less intensive workload. Thus, most servers can be expected to run for a minimum of five years, with many running much longer. In contrast, client machines are typically expensed or depreciated on a shorter service life schedule. The power demands of data centers require memory innovations ©2008 Micron Technology, Inc. All rights reserved 14The power demands of data centers require memory innovations Footnotes: 1. Energy Information Administration: Official energy statistics from the U.S. Government: www.eia.doe.gov/cneaf/electricity/epm/table5_3.html 2. Enterprise Server and Data Center Energy Efficiency Initiatives: www.energystar.gov/index.cfm?c=products.pr_servers_datacenters 3. http://clerk.house.gov/evs/2006/roll369.xml 4. http://enterprise.amd.com/Downloads/svrpwrusecompletefinal.pdf 5. University of Washington Television Webcast: www.uwtv.org/programs/displayevent.aspx?rID=2879 : Urs Holzle presenting. 6. http://enterprise.amd.com/Downloads/svrpwrusecompletefinal.pdf 7. Ibid. 8. Memory power consumption in a fully loaded server is estimated in the range of 25% to 66%. This analysis assumes 20% on the basis that we do not have a clear understanding of memory content per system; www.energystar.gov/index.cfm?c=products.pr_esads_conf_media The presenter is Gregg Papadopoulos, CTO of Sun Microsystems. 9. http://enterprise.amd.com/Downloads/svrpwrusecompletefinal.pdf. Note (7) of this document states that total electricity consumption (including cooling and auxiliary equipment) is twice that of the direct server power consumption, based on typical industry practice ©2008 Micron Technology, Inc. All rights reserved 15About Micron Micron Technology, Inc., one of the world’s most efficient and innovative semiconductor companies, manufactures and markets a full line of DRAM components and modules, NAND Flash memory, CMOS image sensors, and other semiconductors. Our broad product line includes both legacy and leading-edge solutions, offered in multiple generations, densities, configurations, and packages to meet the diverse needs of our customers. With operations in 18 countries, customers can count on us to deliver the expert design, manufacturing, sales, and technical support—and ultimately, the high-performance, advanced semiconductor solutions—that go into successful product designs. Products and specifications discussed herein are subject to change by Micron without notice. Products are warranted only to meet Micron’s production data sheet specifications. All information discussed herein is provided “AS IS” and without warranties of any kind. Micron, the Micron logo, Crucial, and the Crucial logo are trademarks of Micron Technology, Inc. All other trademarks are the property of their respective owners. The power demands of data centers require memory innovations ©2008 Micron Technology, Inc. All rights reserved 16 EZ Gig IV User’s Guide Cloning Software with Data SelectTABLE OF CONTENTS EZ Gig - Getting Started 4 Cloning as Easy as 1-2-3 4 Compatibility 4 System Requirements 5 Connecting Your Hard Drive 6 EZ Gig Start Up Options 6 Creating a Bootable EZ Gig CD 7 Cloning your hard drive with EZ Gig 8 Selecting the Source Drive 9 Selecting the Destination Drive 10 Speed Test 10 Drive Verification 11 Data Select 12 Using the Data Select feature 13 Analyzing files 14 Selecting Folders to Omit 15 Advanced Options 16 Verify Copy 16 Copy Free Areas 16 SmartCopy 16 Media Direct (Dell) 16 More Advanced Options 17 FastCopy 17 SafeRescue 17 CachedMemory 17 SharedMemory 17 Animation 17 HotCopy / LiveImage 18 Avoid exclusive read access 18 Partitions 19 Resizing your partitions manually 20Start Clone 21 Interupting the Cloning Process 22 Aborting the Cloning Process 22 Interupting the Verification process 22 Congratulations your Clone is Complete 23 FAQs 24 Load errors 24 Error #5002 and ‘Disk error’ 24 Keyboard and mouse 24 General problems 25 Slowed down system 25 Read, write and verification errors 25 IDE/ATA/SATA 25 Hard disk not recognized 25 IDE controller not found 26 Source & Destination Size Differences 26 Equal Size 26 Small to large 26 Large to small 26 Automatic troubleshooting 27 Intensive reading/writing 27 Read errors 27 Write errors 27 Verification errors 27 Contacting Technical Support 29 RMA Policy 29 Warranty Conditions 304 www.apricorn.com Cloning as Easy as 1-2-3 Upgrading your notebook hard drive is one the easiest ways to increase performance and capacity. EZ Gig makes this process simple by copying all of your data, OS, email and settings to your new drive in just three simple steps. EZ Gig - Getting Started Compatibility EZ Gig is compatible with the latest Apricorn Upgrade products, including DriveWire, SATA Wire, Velocity Solo and EZ Upgrade. Before commencing, please ensure that your new hard drive is connected to your computer using one of the below products. NOTE: Before starting the cloning process EZ Gig automatically verifies which Apricorn upgrade product is being used. If used without one of the products below, EZ Gig will not work. EZ Upgrade DriveWire SATA Wire SATA Wire 3.0 Velocity Solowww.apricorn.com 5 System Requirements Hardware: 1 GHz Intel® Pentium® or Atom™ processor or equivalent 256MB RAM Available USB port CD ROM or CD-RW drive Keyboard: standard, PS/2 or USB Mouse: serial, PS/2 or USB (optionally, can be operated with keyboard only) Operating systems: Microsoft: Windows® 7, XP or Vista™ NOTE: When used with Windows 2000 you must boot to the EZ Gig III CD to clone your drive Supported Media: IDE/ATA hard disks, CompactFlash via IDE SATA hard disks (internal & external) SCSI hard disks (internal & external) USB hard disks (internal & external) Hub Devices - USB devices may also be connected via a USB Hub, however for achieving the highest possible data transfer rate it is recommended that you connect them directly to your computer Supported controllers: PCI IDE controller Bus master IDE controller SATA controller with IDE interface SATA-II controller with AHCI interface USB UHCI & OHCI controller (USB 1.1) USB EHCI controller (USB 2.0) USB 3.0 x HCI (USB 3.0)6 www.apricorn.com Connecting Your Hard Drive Before starting the EZ Gig software, please ensure that your new hard drive is connected to your notebook’s USB port via one of Apricorn’s Upgrade products listed on the previous page. EZ Gig Start Up Options Depending on how you received EZ Gig, you have two options. 1. If you have EZ Gig on a CD, please choose the Start option (proceed to page 7 of this manual to continue). 2. If you downloaded EZ Gig from Apricorn’s website, you can either choose the Start option (go to page 7) or create a bootable EZ Gig CD to use in the future (go to page 8 for instructions).www.apricorn.com 7 Creating a Bootable EZ Gig CD If you downloaded EZ Gig from Apricorn’s website, you have the option of creating a bootable EZ Gig CD, floppy disk or thumb drive to use in the future. To create a bootable media disk follow the appropriate directions below: • If you want to create a bootable floppy disk, choose the desired drive at ‘Floppy drive’ and click “Create floppy”. • To create a bootable CD/DVD, choose the desired drive at ‘CD/ DVD writer’ and click “Create CD/DVD”. • To create a bootable USB key, choose the desired drive at ‘USB medium’ and click “Make bootable”. Follow the instructions and wait until the installation program reports successful creation of the bootable medium. Once you have created you bootable media device, click “Exit” and then choose “Start EZ Gig”.8 www.apricorn.com Cloning your hard drive with EZ Gig 1. Click the “Let’s Get Started” button to proceed. 2. EZ Gig will then scan for connected drives. This may take a few moments.www.apricorn.com 9 Selecting the Source Drive Once EZ Gig has scanned for connected drives, you will be asked to select your Source Drive. This is the drive you would like to copy from and in most cases is the internal drive in your notebook. NOTE: Your computer’s internal drive will usually be denoted by the prefix AHCI or IDE. Select the appropriate drive from the menu and click “Next” to continue. 10 www.apricorn.com Selecting the Destination Drive Once you have selected your Source Drive, EZ Gig will ask you to select your Destination Drive. This is the drive you would like to copy to and in most cases is the external drive connected to your notebook’s USB port. NOTE: Your external drive will be denoted by the prefix USB Select the appropriate drive from the menu and click “Next” to continue. Click the Speed Test icon on either the Source or Destination drive for an estimate of the drive’s read speed. From this estimate, a rough estimate of the clone time may be gauged Speed Testwww.apricorn.com 11 Drive Verification You are almost ready to start your clone, but before you do, EZ Gig asks that you verify that the choosen drives are correct. If they are you have one of two options. Either click “Next” to continue (go to page 21) or to deselect files from the cloning process, press the “Data Select” button (go to page 12). If you need to change your drive selection, click the “Back” button At this point you can also modify the default options for your clone using the “Advanced Options” button. Only select this option if you would like to change your options from the default (go to page 16 for more info on Advanced Options).12 www.apricorn.com Data Select EZ Gig’s Data Select feature provides a simple method to deselect data folders from the cloning process which is helpful when migrating from a large HDD to a smaller SSD and perfect for creating a Boot Disk. This gives you the option to run your OS and applications from a fast, smaller SSD boot drive, while keeping your documents and media files on your original hard drive. There are two ways to get to the Data Select feature: 1. If the Destination drive is smaller than the Source drive, EZ Gig will direct you to the below screen. To deselect files from the clone click the “Data Select” button, this will open the Data Select feature. 2. On the “You are almost ready to Clone” screen, you may press the “Data Select” button to open the Data Select feature.www.apricorn.com 13 Using the Data Select feature The Data Select feature shows the capacity of the: • Destination Drive • Source Drive • Available Capacity If the Source drive is smaller than the Destination drive, the available capacity will be highlighted in orange and shown as a negative value. EZ Gig will only proceed with a clone if the available capacity is positive (i.e. the Destination capacity is larger than the Source capacity.) In order to decrease the size of the clone (i.e. the Source image), EZ Gig enables you to deselect files from the cloning process to save space. The files you may deselect from the cloning process are from the folders: 1. Documents 2. My Videos 3. My Music 4. My Pictures14 www.apricorn.com Analyzing files To analyze the amount of space used by each of the folders, select the checkbox to the left, under the “Select Folders to Analyze” column. EZ Gig will then analyze the space used in the ajoining “Space Used” column. To analyze the amount of space used by each folder, select the appropriate checkbox. EZ Gig will then display the space used in the ajoining columnwww.apricorn.com 15 Selecting Folders to Omit To select folders to omit, select the checkboxes to the right, under the “Select Folders to Omit” column. Any selection from this column will automatically be reflected in an updated amount for the “Available Capacity” value. Once the “Available Capacity” value is positive, you will have the option to “Apply” the changes. Once you hit the “Apply” button, you will be directed to the “You are almost ready to Clone” screen. The Data Select button will have a check mark to the left, indicating that you have choosen to omit files from the clone. To continue with the clone, click the “Next” button (go to page 21).16 www.apricorn.com Advanced Options Compares the data of source and target after copying. If verify copy is chosen, the free areas between partitions will also be copied. This option has no influence on the copying performance itself, but offers the possibility to synchronize the data of the source and target after the copying process. However, the whole process of copying and verifying then normally takes approximately the double amount of time. Choose this option according to your needs of copying and your time available. Verify Copy SmartCopy enables you to clone your file systems in a fraction of time usually required - this option is chosen by default SmartCopy This option is off when doing a default clone, but when selected allows you to copy free space between partitions from your internal drive to your external drive. Copy Free Areas Used to deactivate MediaDirect software on the Destination drive. Check your Dell notebook specs to see if you have Media Direct on your system. Media Direct (Dell)www.apricorn.com 17 To access additional advanced options, click on the Apricorn logo in the bottom right corner of the “Advanced Options” window More Advanced Options FastCopy Special copy algorithm. Can increase the regular copy speed up to double. SafeRescue Special algorithm for data recovery. Tries to recover as large areas on the drive as possible. Can also stay turned on for normal copies. CachedMemory Use fast intermediate memory. SharedMemory Use fast data transfers. Animation Switch off copy animation, may lead to a slight speed increase.18 www.apricorn.com HotCopy / LiveImage Allows or denies EZ Gig access to the Windows shadow copy mechanism. If this option is deselected, EZ Gig is not able to create copies or file images of the system volume or of volumes, which are used by other programs at the same time. Avoid exclusive read access Usually, EZ Gig when running on Windows, at first tries to reserve the source drive for exclusive access. This is the most reliable way for creating an identical copy, but it may interfere with other programs running at the same time. If this option is selected, EZ Gig tries to create a HotCopy or a LiveImage at first.www.apricorn.com 19 Partitions When used in the Default mode, EZ Gig will automatically resize your partitions according to the new hard drive space. However, EZ Gig also gives the option of keeping your partition sizes the same or allows you to resize your partition sizes manually.20 www.apricorn.com Resizing your partitions manually To resize your partition manually: 1. Choose the “Manually” radio button on the “Advanced Options” window. 2. Once this radio button is selected, click the “Apply Changes” button. The “Adjust Partitions” window (shown left) will pop up. Positions and sizes of the partitions to be copied to the Destination drive are displayed graphically in a bar. The original size of the partition is displayed in dark green, while the additionally assigned space is displayed in light green. The size of partitions displayed in black cannot be altered. Free space not yet assigned to any partition is displayed in white. 3. To resize, click the desired partition’s extended space (light green portion) and drag with your mouse. You can also use the [+] and [-] cursor keys to the same effect. 4. Once you have resized the partitions to the desired size, choose “Apply Adjustment” which will then close the window. 5. Once the “Adjust Partition” window is closed, close the “Advanced Options” window by clicking the “Close Window” button.www.apricorn.com 21 Start Clone Now you’re ready! Press the “Start Clone” button to start the cloning process. EZ Gig will keep you up-to-date with the status of the clone throughout the entire process with a progress bar and percentage completed. Depending on your system size a clone can take anywhere from several minutes to a couple of hours.22 www.apricorn.com Aborting the Cloning Process Interupting the Verification process If you chose the “Verify Copy” option before starting the clone, EZ Gig will automatically compare the information on the “Source” and “Destination” drives once the clone is complete. If this process is interupted or stopped at anytime, the aborted verification run will have no influence on the copied data. The copy itself is already finished at that point of time. When the final report is read, EZ Gig will report that the clone is only partially verified. Interupting the Cloning Process If the cloning process aborted, a new clone must be commenced. The cloning process can be stopped at anytime using the “Stop” button. Continue cloning by clicking “Continue copying”. To stop the clone completely, select “Abort copying.”www.apricorn.com 23 Congratulations your Clone is Complete Once your clone is complete, EZ Gig will let you know with a pop up window. To get a report of the cloning process, click the “Details” button. The final report will outline the number of sector copied, read errors, write errors and if verified, will also report verification errors. Once you have finished your clone, click “Quit EZ Gig”. You will then be prompted to turn your computer off and disconnect the attached hard drive.24 www.apricorn.com FAQs Load errors During the start of the program, before EZ Gig is loaded itself, a message and a progress bar will appear on the boot screen. In case of an error, one of the following error codes will be indicated here. Error #5002 and ‘Disk error’ This error will be displayed if the boot medium is not readable when booting the program. The error is reported by the BIOS of the computer and points to a defective data carrier or a problem with the used boot drive. In many cases, in particular when booting from a floppy disk, an incompatibility between drive and data carrier is the cause. Principally this problem can be fixed. Please try the following steps, at best in the indicated order: • Try again to boot the program, perhaps with/without cold start. • Create once again a bootable disk (page 7). • Floppy disk: format the floppy disk (no quick format) before creating a new one. • Floppy disk: use another floppy disk. • Use (if possible) another boot drive. NOTE: If you didn’t receive EZ Gig as an installation package but on a bootable disk and if a disk shows this problems also after multiple trials on different devices, please contact Support. Keyboard and mouse EZ Gig supports keyboards and mice with PS/2 standard or USB connector. This also includes many wireless mice, given they are connected as a true USB device. Input devices connected with Bluetooth are currently not supported. In this case, please connect a separate USB device. If keyboard or mouse (or both) do not function with EZ Gig, this is usually due to a wrong legacy emulation setting in BIOS setup. On most computers, you can fix this problem by changing (activating or deactivating, depending on the current setting) the emulation for PS/2 devices in BIOS setup. Please consult your computer manual on how to change this setting since it may be named differently according to the respective BIOS. In most of the cases, you can find it under the name USB Legacy Support or USB Keyboard Support (often under Integrated Peripherals or Advanced Options).www.apricorn.com 25 NOTE: In some of the cases, problems with the PS/2 keyboard and/or mouse occurred with an activated emulation for PS/2 devices. If you do not use any USB input de-vices, please switch off the PS/2 emulation in the BIOS setup. General problems Slowed down system If you think the speed of the total system or the copying speed – also with IDE and SCSI devices – is too slow, a USB controller can be the cause, even if it is not used. Read, write and verification errors If EZ Gig reports errors, these are usually defective areas on the respective medium. However, general problems with the hardware can possibly also cause (putative) read and write errors. This is mostly noticeable by a very high number of displayed errors. First of all, try to fix the problem via the help instructions for the respective hardware types (IDE, SCSI, USB) because the causes are usually found there. If the problems cannot be fixed this way either, deactivate step by step the following options, at best in the indicated order: • CachedMemory • Read cache and write cache • FastCopy • DMA • SharedMemory If the problem does not occur any more after having deactivated a certain option, the previously deactivated options can be reactivated as a test. IDE/ATA/SATA Hard disk not recognized If EZ Gig does not recognize a hard disk, there can be several reasons. Perhaps the controller which the disk is connected to has not been found (See next section: IDE controller not found). A further possible reason can be a non-standardly connected hard disk. This is for example the case if a hard disk is configured as slave and if a CD/DVD drive or no drive at all is connected at the same IDE channel as master. Normally, EZ Gig can handle that, too.26 www.apricorn.com NOTE: If an SATA hard disk is not recognized, this can also be due to the used SATA controller. IDE controller not found There are the following three reasons why EZ Gig has not automatically recognized an IDE controller: • The IDE controller/channel is deactivated, e.g. on an onboard IDE controller. Activate the IDE controller/channel via the BIOS setup. • Standard IDE controllers (ISA) are not taken into account if PCI IDE controllers are available. Connect the respective hard disk to a PCI IDE controller in this case or deactivate the PCI IDE controller or controllers. • The used controller does not correspond to the PCI IDE standard. Although most controllers support this standardized programming interface, there are some controllers which have only a proprietary programming interface. Connect the corresponding drives to another controller (PCI IDE controller). Source & Destination Size Differences Equal Size If source and target are of the same size, EZ Gig creates an absolutely identical copy(clone). On this clone, all sectors on source and target, from the first to the last sector, are 100% identical, provided that the process was error-free. Small to large If the source is smaller than the target, EZ Gig copies only the data that is available on the source. This data is copied from the beginning of the source onto the beginning of the target medium. The area at the end of the target medium, which is larger than the source, remains unaffected. Apart from that the unaffected area remains possibly unused during a later usage, such a copy is usually comparable to a real clone as far as the capacity of use is concerned because the target contains entirely all data of the source Large to small If the source is bigger than the target, EZ Gig will direct you to the Data Select feature. EZ Gig’s Data Select provides a simple method to deselect data folders from the cloning process. EZ Gig will only allow to proceed with the clone, once the available capacity on the target drive is a positive value.www.apricorn.com 27 Automatic troubleshooting In case of occurring errors, EZ Gig tries to troubleshoot them the best possible. If this is not possible, the errors will be mentioned in a corresponding error statistic in the detailed report after the clone is complete. Intensive reading/writing In case of read or write errors, EZ Gig uses different strategies in order to still be able to read or write this data, if possible. The time used for defective areas depends to a large extent on the respective medium. According to the medium and its state, several seconds up to minutes can be needed for the recovery trials. Therefore, it is recommended to always activate the option SafeRescue because then handling defective sectors takes place after the copying of all intact areas has been finished. The process can then be aborted if it takes too long without losing the data of the intact areas. Read errors During the copying process, read errors can only occur on the source medium. EZ Gig then tries to read the defective areas immediately after the termination of the copying process (with the option SafeRescue) with the help of special data recovery strategies within a single troubleshooting run. During the troubleshooting run, the number of the indicated read errors can reduce according to the areas on the source medium, which could be recovered. NOTE: Read errors, that occur during the verification run, are not counted as read errors but as verification errors. Write errors Write errors can only occur during the copying process and only on the target medium. EZ Gig then tries to read the defective areas immediately after the termination of the copying process (with the option SafeRescue) with the help of special data recovery strategies within a proper troubleshooting run. During the troubleshooting run, the number of the indicated write errors can decrease according to the areas on the target medium, which could be recovered. Verification errors When the option Verifying is activated, EZ Gig executes a verification run after the copying process. A verification error is counted if the data of two sectors on source and target do not correspond. Furthermore, read errors, 28 www.apricorn.com which occur during the verification run in one or both of the areas to be compared, are also counted as verification errors. Therefore, the number of verification errors gives you absolute information on how exactly source and target correspond to each other after the copying process. In case of an error-free copying process, EZ Gig should not report any verification errors and signalize a 100% conformity of source and target.30 www.apricorn.com Warranty Conditions Warranty: Apricorn offers a 1 to 3 year warranty on its upgrade products against defects in materials and workmanship under normal use. The warranty period is effective from the date of purchase (validated by your original receipt) either directly from Apricorn or an authorized reseller. Disclaimer and terms of the warranties: The warranty becomes effective on the date of purchase and must be verified with your sales receipt or invoice displaying the date of product purchase. Apricorn will, at no additional charge, repair or replace defective parts with new parts or serviceable used parts that are equivalent to new in performance. All exchanged parts and products replaced under this warranty will become the property of Apricorn. This warranty does not extend to any product not purchased directly from Apricorn or an authorize reseller or to any product that has been damaged or rendered defective: 1. As a result of accident, misuse, Neglect, abuse or failure and/or inability to follow the written instructions provided in this instruction guide: 2. By the use of parts not manufactured or sold by Apricorn; 3. By modification of the product; or 4. As a result of service, alternation or repair by anyone other than Apricorn and shall be void. This warranty does not cover normal wear and tear. No other warranty, either express or implied, including any warranty or merchantability and fitness for a particular purpose, has been or will be made by or on behalf of Apricorn or by operation of law with respect to the product or its installation, use, operation, replacement or repair. Apricorn shall not be liable by virtue of this warranty, or otherwise, for any incidental, special or consequential damage including any loss of data resulting from the use or operation of the product, whether or not Apricorn was apprised of the possibility of such damages. Copyright © Apricorn, Inc. 2011. All rights reserved. Windows is a registered trademark of Microsoft Corporation. All other trademarks and copyrights referred to are the property of their respective owners. Distribution of substantively modified versions of this document is prohibited without the explicit permission of the copyright holder. Distribution of the work or derivative work in any standard (paper) book form for commercial purposes is prohibited unless prior permission is obtained from the copyright holder. DOCUMENTATION IS PROVIDED AS IS AND ALL EXPRESS OR IMPLIED CONDITIONS, REPRESENTATIONS AND WARRANTIES, INCLUDING ANY IMPLIED WARRANTY OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE OR NON-INFRINGEMENT, ARE DISCLAIMED, EXCEPT TO THE EXTENT THAT SUCH DISCLAIMERS ARE HELD TO BE LEGALLY INVALID.12191 Kirkham Road Poway, CA, U.S.A. 92064 1-858-513-2000 Hold nothing back. Designed for extreme enthusiasts, demanding gamers, and overclockers who want to squeeze every ounce of performance out of their systems, Crucial Ballistix Elite modules are designed to dominate. Built for unmatched gaming performance, Elite modules include thermal sensors that work in tandem with our Ballistix M.O.D. utility to provide real-time temperature monitoring when overclocking. Elite modules also employ a finned heat spreader for improved heat dissipation, an XMP profile for easy configuration, and an extruded metal design. With some of the fastest speeds and timings available, it’s tough to lose when you’re equipped with Ballistix Elite memory. Unleash your memory. Control the temperature. Ballistix Elite modules utilize integrated heat spreaders to showcase one of the best DRAM features available – the Ballistix M.O.D. utility for real time temperature monitoring. Designed exclusively to support Ballistix high-end modules, the Ballistix M.O.D. utility (Memory Overview Display), allows you to load up your system while also keeping internal temperatures in check. With our real-time temperature monitoring technology, keep tabs on your Elite modules and push your system to the top of its game. Outlast the competition. To ensure reliability, we test every single Elite memory module in our Systems Compatibility Group to make certain that it meets our exacting specifications. If it doesn’t meet or exceed the advanced performance levels that we advertise, then it doesn’t leave our doors. That’s reliability. Elite performance memory is backed by a limited lifetime warranty and manufactured from premium-quality DRAM. Available in DDR3 modules for the latest cutting-edge platforms. Crucial – quality you can depend on. Crucial is a trusted name when it comes to DRAM, and that’s no coincidence. As a brand of Micron, one of the largest manufacturers of DRAM in the world, we work with our engineers to design, refine, test, manufacture, and support our extensive line of memory modules. For more than fifteen years we’ve kept gamers, PC enthusiasts, and overclockers happy with premium-quality memory and outstanding customer service. Don’t settle for anything less. Crucial® Ballistix® Elite Series Memory revision: 10/22/12 1 Performance DRAM PRODUCT HIGHLIGHTS: • Performance memory for extreme enthusiasts, demanding gamers, and overclockers • Thermal sensors and custom M.O.D. utility monitor temperatures in real time for easier overclocking • Finned extruded metal heat spreader delivers superior heat dissipation • XMP profiles for advanced speeds and timings • Premium-quality DRAM • Limited lifetime warrantyCrucial Ballistix Elite Part Number Density Speed Latency Voltage Bandwidth UPC BLE2G3D1608DE1TX0 2GB DDR3-1600 CL8 (8-8-8-24) 1.5V PC3-12800 (12.8 GB/s) 649528755575 BLE2G3D1869DE1TX0 2GB DDR3-1866 CL9 (9-9-9-27) 1.5V PC3-14900 (14.9 GB/s) 649528755681 BLE2G3D1608CE1TX0 2GB DDR3-1600 CL8 (8-8-8-24) 1.65V PC3-12800 (12.8 GB/s) 649528754790 BLE2G3D1869CE1TX0 2GB DDR3-1866 CL9 (9-9-9-24) 1.65V PC3-14900 (14.9 GB/s) 649528755322 BLE2G3D2139CE1TX0 2GB DDR3-2133 CL9 (9-10-9-24) 1.65V PC3-17000 (17.0 GB/s) 649528754936 BLE4G3D1608DE1TX0 4GB DDR3-1600 CL8 (8-8-8-24) 1.5V PC3-12800 (12.8 GB/s) 649528755636 BLE4G3D1869DE1TX0 4GB DDR3-1866 CL9 (9-9-9-27) 1.5V PC3-14900 (14.9 GB/s) 649528755537 BLE8G3D1869DE1TX0 8GB DDR3-1866 CL9 (9-9-9-27) 1.5V PC3-14900 (14.9 GB/s) 649528757821 Crucial Ballistix Elite Dual Channel Kits Part Number Density Speed Latency Voltage Bandwidth UPC BLE2KIT2G3D1608DE1TX0 4GB Kit (2x2GB) DDR3-1600 CL8 (8-8-8-24) 1.5V PC3-12800 (12.8 GB/s) 649528755582 BLE2KIT2G3D1869DE1TX0 4GB Kit (2x2GB) DDR3-1866 CL9 (9-9-9-27) 1.5V PC3-14900 (14.9 GB/s) 649528755698 BLE2KIT4G3D1608DE1TX0 8GB Kit (2x4GB) DDR3-1600 CL8 (8-8-8-24) 1.5V PC3-12800 (12.8 GB/s) 649528755643 BLE2KIT4G3D1869DE1TX0 8GB Kit (2x4GB) DDR3-1866 CL9 (9-9-9-27) 1.5V PC3-14900 (14.9 GB/s) 649528755544 BLE2KIT8G3D1869DE1TX0 16GB Kit (2x8GB) DDR3-1866 CL9 (9-9-9-27) 1.5V PC3-14900 (14.9 GB/s) 649528757838 Crucial Ballistix Elite Three Channel Kits Part Number Density Speed Latency Voltage Bandwidth UPC BLE3KIT2G3D1608DE1TX0 6GB Kit (3x2GB) DDR3-1600 CL8 (8-8-8-24) 1.5V PC3-12800 (12.8 GB/s) 649528755599 BLE3KIT4G3D1608DE1TX0 12GB Kit (3x4GB) DDR3-1600 CL8 (8-8-8-24) 1.5V PC3-12800 (12.8 GB/s) 649528755650 revision: 10/22/12 2 ©2012 Micron Technology, Inc. All rights reserved. Information is subject to change without notice. All trademarks and service marks are property of their respective owners. Performance DRAM Guide!pratique!de!mise!à!jour!du!firmware!d'un!SSD Guide!de!mise!à!jour!du!firmware!du!SSD!Crucial®!m4!2,5"!vers!la!version!070H!@ à!partir!d'un!CD/d'une!clé!USB (mise à!jour!depuis!les!versions!0001,!0002,!0009,!0309,!000F,!010G,!040H!vers!la!version!070H) Introduction Ce! document! détaille! la! procédure! de! mise! à! jour! du! firmware du! SSD! Crucial! m4! via! une! clé! USB! ou! un! CD! et! une! image! ISO! de! démarrage.! L'image! ISO! contient! la! mise! à! jour! 070H! du! firmware! et! un! code! de! démarrage!DOS. Cette! procédure! est! destinée! à! la! mise! à! jour! du! firmware! depuis! les! versions!0001,!0002,!0009,!0309,!000F,!010G!et!040H!vers!la!version!070H. REMARQUE : Cette!mise!à!jour!du! firmware!ne!s'applique!pas à! tous!les! SSD!Micron!acquis!seuls!ou!en!tant!que!matériel!de!première!monte!d'un! ordinateur.! Les!mises!à!jour! de! firmware! de! ces! disques@là! seront,!le! cas! échéant,!fournies!par!le!fabricant!de!l'ordinateur!ou!seront!disponibles!sur! www.micron.com.! Cette! mise! à! jour! du! firmware! ne! concerne! pas! n'importe! quel! disque!Micron! RealSSD! C300.! De! même,! elle! ne! doit! pas! être! utilisée! pour! un! SED! (Self! Encrypting! Drive) Micron! RealSSD! C400.! Cette!mise!à!jour! s'applique! uniquement!aux! disques!m4! 2,5"!et! ne! doit! pas!être!utilisée!pour!mettre!à!jour!des!disques!m4 mSATA. AVERTISSEMENT : Comme! pour! toutes! mises! à! jour,! il! est! fortement! recommandé! de! sauvegarder! ou! de! copier! tous! vos! fichiers! importants! auparavant.! Cette! procédure! de!mise! à! jour! du! firmware! s'effectue! sous! votre! seule! responsabilité.! Si! elle! est! exécutée! correctement,! il! n'y! aura! aucune!perte!de!données! système!ou!utilisateur!présentes! sur!le!disque.! Toutefois,! une! interruption! de! la! mise! à! jour,! quelle! qu'en! soit! l'origine,! peut!entraîner!le!dysfonctionnement!de!votre!SSD.!Si!cette!mise!à!jour!est! appliquée!sur!un!ordinateur!portable,!il!est!fortement!recommandé!de!le! brancher!en!secteur!pendant!la!procédure. Instructions!générales Procédez!aux!opérations!suivantes!avant!de!démarrer!la!procédure!de! mise!à!jour!du!firmware : 1.!Sauvegarde!du!contenu!du!SSD Il!est! fortement!recommandé!de!procéder!à!une!sauvegarde!complète! du! système! avant! de! démarrer! cette! mise! à! jour! du! firmware.! Si! la! procédure! de!mise!à!jour!est!interrompue! (coupure! d'alimentation!ou! défaillance! matérielle! de! toute! nature),! il! est! possible que! le! SSD! ne! fonctionne!pas!correctement. 2.!Utiliser!une!alimentation!CA Veillez!à!ce!que!votre!ordinateur!portable!ou!de!bureau!soit!relié!à!une! alimentation! CA! pendant! la!mise!à!jour.!Il!est! déconseillé! de! n'utiliser! que! la! batterie! pendant! la! procédure.! Ne! débranchez! l'alimentation! à! aucun! moment! de! la! procédure! de! mise! à! jour! du! firmware! car! cela! pourrait!aboutir!à!un!déroulement!incomplet!de!celle@ci!et!donc,!rendre! le!SSD!inutilisable. 3.!Éditer!les!paramètres!du!BIOS Pour! exécuter! les! opérations! suivantes,! vous! devrez! peut@être! éditer! les! paramètres! de! BIOS! de! votre! ordinateur.! Veuillez! consulter! le! manuel! utilisateur! de! votre! ordinateur! pour! savoir! comment!procéder. a)!Désactivez/supprimez!les!mots!de!passe!associés!au!disque Entrez! dans! le! BIOS! (généralement! en! appuyant! sur! les! touches! « Suppr »,! « F2 »! ou! « F12 »! au! démarrage! de! l'ordinateur)! et! désactivez!tous!les!mots!de!passe!éventuellement!associés!au!SSD.! Une!protection!par!mots!de!passe!peut!bloquer!les!mises!à!jour!du! firmware. b)!Vérifiez!l'ordre!de!démarrage Si!votre!système!ne!démarre!pas!à!partir!du!CD!ou!de!la!clé!USB,! vous!devrez!accéder!aux!paramètres!de!votre!BIOS.!Dans!l'éditeur! du!BIOS,!vérifiez!l'ordre!de!démarrage.!Par!défaut,!la!plupart!des! systèmes!démarre!à!partir!du!lecteur!de!CD@ROM!avant!le!lecteur! système.! D'un! fabricant! de! BIOS! à! l'autre,! vous! trouverez! une! option! dénommée! « Priorités! de! démarrage! des! périphériques »! (Boot$Device$ Priority),! « Priorités! de! chargement! au! démarrage »! (Boot$ Load$ Order)! ou! « Caractéristiques! avancées! du! BIOS »! (Advanced$BIOS$Features).!Veillez!à!ce!que!le!système!démarre!sur! le!CD!ou!la!clé!USB!de!démarrage!avant!le!disque!contenant!le!SE. Téléchargez!la!mise!à!jour!du!firmware 1. Avant! de! commencer! le! téléchargement! du! firmware,! fermez! tous!les!autres!programmes,!sauf!votre!navigateur!internet. 2. Recherchez! l'utilitaire! Windows! de! mise! à! jour! vers! le! firmware 070H! associé! à! votre! SSD! Crucial! à! l'adresse : http://www.crucial.com/support/firmware.aspx 3. Cliquez! sur! le! lien! correspondant! et! vous! serez! invité! à! Ouvrir,! Enregistrer! ou!Annuler.!Cliquez! sur!Enregistrer! pour! télécharger! l'image!ISO!et!la!sauvegarder!dans!votre!système.! 4. Copiez! ce! fichier! sur! le! bureau! ou! dans! un! autre! dossier! facilement! accessible! ultérieurement! et! fermez! le! fenêtre! de! téléchargement!à!la!fin!de!celui@ci. Créer!un!support!de!démarrage!avec!fichier!ISO Option!1 :!Graver!un!CD!de!démarrage Remarque : Windows 7!dispose!d'un!logiciel!de!gravure!optique!de! disques. 1. Utilisez! le! logiciel! de! gravure! de! votre! choix! pour! graver! l'image!ISO!du!firmware!sur!un!CD.Option!2 :!Créer!une!clé!USB!de!démarrage Remarque : pour!utiliser!cette!option,!votre!système!doit!prendre! en!charge!le!démarrage!à!partir!d'une!clé!USB. 1. Munissez@vous! d'une! clé! USB! préalablement! formatée! (256 Mo,! ou!plus). 2.!!Ouvrez!un!installeur!USB.!Si!vous!n'en!disposez!pas,!vous!pouvez,! par!exemple,! télécharger!gratuitement!l'installeur!USB!universel! (disponible! sur! www.pendrivelinux.com/universal@usb@installer@ easy@as@1@2@3/). 3. Une! fenêtre! de! sécurité!et/ou!le! contrat! de!licence!apparaîtront! peut@être. 4.!!Si!vous!utilisez!l'installeur!USB!universel : • À!l'étape 1,!atteignez!le!bas!de!la!liste!déroulante!et!sélectionnez! la!dernière!option :!Try$Unlisted$Linux$ISO. • Passez! à! l'étape 2! et! recherchez! l'ISO! du! firmware! téléchargée! précédemment. • À! l'étape! 3,! sélectionnez! la! clé! USB! sur! laquelle! vous! souhaitez! installer!l'ISO.! • Cliquez! sur! le! bouton! Create (Créer)! et! sur! Format$ E:\Drive (Formater,! efface! le! contenu).! Répondez! Yes (Oui)! à! l'avertissement!indiquant!la!réécriture!de!votre!clé!USB.! • Après! l'apparition/la! disparition! d'une! série! d'écrans,! la! clé!USB! est!chargée. Lancez!la!mise!à!jour!du!firmware! 1. Insérez!le!CD!ou!la!clé!USB!de!démarrage!contenant!l'image!ISO! dans!votre!ordinateur. 2. Démarrez! l'ordinateur! à! partir! du! support! de! démarrage.! Cela! lance!automatiquement!la!mise!à!jour!du!firmware.! 3. Après! le! chargement! complet! de! l'utilitaire! de! mise! à! jour,! ces! éléments!apparaîtront!à!l'écran : La! mise! à! jour! étant! possible! depuis! n'importe! quelle! version! précédente,! 0001,! 0002,! 0009,! 0309,! 000F,! 010G!ou! 040H,!l'une!ou! l'autre!de!ces!révisions!peut!donc!apparaître!sur!l'écran!ci@dessus.!Si! votre!disque!m4!est!absent!de!la!liste!affichée!sur!l'écran!ci@dessus,! veuillez!vous!reporter!au!paragraphe!« Astuces!de!dépannage »!à!la! page!suivante. 4. Avant!la!demande!de!mise!à!jour!du! firmware,!il!se!peut!que!la! mention! Waiting! for! DRQ! s'affiche.! Ce! type! de! message! est! normal.!Tapez!yes!(oui)!en!minuscules!lorsqu'il!vous!est!demandé! si! vous! souhaitez! mettre! à! jour! le! firmware.! L'écran! suivant! apparaîtra : 5. Sur!la!plupart!des!systèmes,!cette!procédure!durera!entre!30!et! 60!secondes.!Dans!certains!cas,!cela!peut!être!plus!long. 6. À!la!fin!de!la!procédure,!le!message!suivant!apparaîtra : 7. IMPORTANT !! Le! numéro! de! version! sera! indiqué.! Si! la! version! s'affichant! n'est! PAS! la! 070H,! recommencez! la! procédure! à! l'étape 1! du! paragraphe! précédent! « Lancez! la! mise! à! jour! du! firmware ».! Vous! pouvez! reprendre! la! procédure! en! tapant! « AUTOEXEC.BAT »!à!l'invite!de!commande!A:\>. 8. Si! vous! doutez! de! la! version! de! votre! firmware! ou! si! vous! souhaitez!en!avoir!la!confirmation,!vous!pouvez!taper : dosmcli!``verbose!`d! à!l'invite!de!commande!A:\>.!La!version!du!firmware!est!indiquée! sur! la! dernière! ligne.! Si la! version! s'affichant! n'est! PAS! la!070H,! recommencez!la!procédure!à!l'étape 1!du!paragraphe!précédent! « Lancez! la! mise! à! jour! du! firmware ».! REMARQUE :! Cette! commande!fera!apparaître!sous!forme!de!liste,!non!seulement!le! SSD!Crucial,!mais!plus!généralement,!tous!les!disques!ATA. 9. Retirez! le! support! de! démarrage!et! arrêtez! votre! ordinateur!en! appuyant!longuement!sur!le!bouton!Power.! 10. Rallumez!l'ordinateur.!Au!redémarrage,!vous!pouvez!rétablir!les! réglages! d'origine! de! tout! paramètre! du! BIOS! éventuellement! modifié. 11. La!procédure!est!terminée. Astuces!de!dépannage • Bien! que! tout!ait!été!mis!en!œuvre! pour! tester!la!compatibilité! de! ce!logiciel!avec! différentes! configurations! de! systèmes!et! de! jeux! de! composants,! il! est! impossible! de! procéder! à! des! essais! sur! tous! les! systèmes! existants.! Par! conséquent,! certains! systèmes! (anciens! par! exemple)! peuvent! se! heurter! des! problèmes!de!compatibilité. • Si! votre! disque! m4! n'est! pas! reconnu! lors! de! l'étape! 3! du! paragraphe!« Lancez!la!mise!à!jour!du!firmware », il!peut!s'avérer! nécessaire!d'exécuter!cette!mise!à!jour!en!mode!IDE!et!non!AHCI,! sur!certains!systèmes!anciens.!Pour!cela,!procédez!ainsi : • Sur!un! ordinateur! de! bureau,! assurez@vous! que! votre! disque! connecté! à! l'un! des! 4! ports! présents! sur! le! bus! SATA! et! habituellement! numérotés! de! 0! à! 3.! Certaines! cartes! mères! ne! prenant! pas! en! charge! la! connexion! à! chaud! de! périphériques!SATA,!il!est! recommandé! d'arrêter l'ordinateur! avant!de!changer!les!branchements!aux!ports. • Dans!le!BIOS,!passez!du!mode!SATA!au!mode!IDE,!hérité!(Legacy)! ou!compatibilité!(compatibility).!Recherchez!le!paramètre!« SATA! Configuration »! (configuration$ SATA)! ou! « Integrated! Peripherals »!(Périphériques$intégrés). • Sauvegardez!vos!réglages!et!sortez!du!BIOS. • Exécutez! les! instructions à! partir! de! l'étape 1! du! paragraphe! précédent!« Lancez!la!mise!à!jour!du!firmware ».• La!plupart!des!systèmes!empêchent!les!mises!à!jour!de!firmware! en!mode!RAID.!Dans!ce!cas,!le!basculement!en!mode!AHCI!ou!IDE! peut! aider! à! terminer! la! mise! à! jour.! Toutes! les! configurations! RAID! devraient!être! conservées! après! la!mise! à! jour,! lorsque! le! système! rebascule! en! mode! RAID! mais! vérifiez! ceci! dans! le! manuel! utilisateur! de! votre! système! avant! de! démarrer! la! procédure. • Les! cartes! RAID! périphériques! ne! transmettront! pas! les! commandes!nécessaires!aux!mises!à!jour!du!firmware. Il!se!peut! que! vous! deviez! déplacer! le! disque! cible! sur! un! adaptateur! de! bus! hôte! SATA! ou! un! connecteur! SATA! de! la! carte! mère! qui! facilite!ces!commandes. • Cet!utilitaire!de!mise!à!jour!du!firmware!peut!ne!pas!fonctionner! sur! des! ordinateurs! fixes,! portables! ou! des! tablettes! disposant! d'une! interface! UEFI.! Nous! mettrons! à! disposition! un! outil! de! mise! à! jour! séparé! qui! prendra! en! charge! les! mises! à! jour! du! firmware!sous!UEFI!(Unified$Extensible$Firmware$Interface). Notes!de!version!du!firmware Le!firmware!du!SSD!m4!a!été!mis!à!jour!de!la!version!040H!à!070H. Le! firmware 070H!est! recommandé!pour! tous!les!disques!disposant! de!la!version! 040H,! ou! précédentes. Il! comporte! des!améliorations! et! corrections! cumulatives! par! rapport! à! ces! versions,! susceptibles! d'améliorer!l'expérience!utilisateur!globale. À!l'instar!des!récentes!versions!du!firmware,!la!version!070H!contient! des!améliorations!par!rapport!à!la!version!000F,!notamment!pour!les! systèmes! sous!Windows 8! et! les! nouveaux!UltraBook,!même! si! des! améliorations! peuvent! également! être! constatées! sur! les! systèmes! sous!Windows 7!et!autres!systèmes!d'exploitation. Toute!version!du! firmware!du!m4!fonctionnera!normalement!sous!Windows 8,!même! sans!ces!améliorations!de!fonctionnement. Voici!un!résumé!des!différences!entre!la!version!040H!et!070H,! quel!que!soit!le!système!d'exploitation : • Résolution! d'un! problème! de! synchronisation! à! la! mise! sous! tension,!susceptible!d'entraîner!un!blocage!du!disque!et!de!ce!fait,! une! impossibilité! de! communiquer! avec! l'ordinateur! hôte. En! général,! le! blocage! se! produit! à! la!mise! sous! tension! ou bien! au! retour!du!mode!Veille!ou!Veille!prolongée. La!plupart!du! temps,! un! redémarrage! élimine! le! blocage! et! le! fonctionnement! normal! peut! reprendre.! Cette! défaillance! n'a!été! observée! que! lors! d'un! essai!en!usine!et!nous!pensons!que!ce!processus!de!défaillance!ne! s'est!pas!déroulé!en!dehors!de!l'usine.!! Par!mesure!de!précaution,! cette! correction! est! désormais! intégrée! à! toutes! les! nouvelles! versions,!quel!que!soit!le!format. Les!utilisateurs!qui!le!souhaitent! peuvent! appliquer! la! correction! pour! éviter que! cet! échec! se! produise! à! la!mise! sous! tension. À! ce! jour,! ce! problème! n'a! pas! été!identifié!comme!étant!à!l'origine!de!retours!de!produits. Une! réinitialisation! du! système! devrait! normalement! résoudre! une! défaillance!de!cette!nature. Versions!précédentes Rév.!A…………………….....................……………………………………!2!avril!2013 •!Version!initiale ©2013!Micron!Technology,!Inc.!Tous!droits!réservés.!Ces!informations!peuvent!être!modifiées!sans!avis!préalable.!Crucial!et!le!logo!Crucial!sont!des marques!commerciales!et!marques!de!service!de!Micron! Technology,!Inc.!Toutes!les!autres!marques!commerciales!et!marques!de!service sont!la!propriété!de!leurs!détenteurs!respectifs.!Révision!02/04/13!070H Crucial® DDR4 Memory Technology 2002 2004 2007 2014 20% DECREASE from DDR3 300% INCREASE from DDR3 100% INCREASE from DDR3 16.6% DECREASE from DDR2 300% INCREASE from DDR2 166.5% INCREASE from DDR2 28% DECREASE from DDR 100% INCREASE from DDR 50.3% INCREASE from DDR Technological advancements by the numbers, starting with DDR Next-gen memory. Next-gen performance. MORE DENSITY 2x Density ©2013 Micron Technology, Inc. All rights reserved. Information is subject to change without notice. Crucial and the Crucial logo are trademarks of Micron Technology, Inc. All other trademarks and service marks are property of their respective owners. NOTE: This infographic contains forward-looking statements regarding the production of DDR4. Actual events or results may dier materially from those contained in the forward-looking statements. Please refer to the documents Micron files on a consolidated basis from time to time with the Securities and Exchange Commission, specifically Micron's most recent Form 10-K and Form 10-Q. These documents contain and identify important factors that could cause the actual results for Micron on a consolidated basis to dier materially from those contained in our forward-looking statements (see Certain Factors). Although we believe that the expectations reflected in the forward-looking statements are reasonable, we cannot guarantee future results, levels of activity, performance or achievements. MORE SPEED 2x Faster Why Speed Matters Faster application load times. Increased responsiveness. Increased ability to handle the data-intensive programs of tomorrow. Speeds to power the systems of tomorrow. MORE EFFICIENT Up to 20% less power Energy Ecient Reduced System Temps Less heat generated per module makes it easy to keep your system cool. DDR3 (1.5V) DDR4 (1.2V) Lower Energy Costs Less voltage means big savings for data centers and large-scale applications. $$$ Longer Battery Life Less voltage allows for longer battery life. Smaller dies allow more gigabits per component. Gigabit Why Density Matters DDR4 allows you to get more out of a single memory module. More capacity per component allows for higher density modules. 8Gb DDR4 Component 4Gb DDR3 Component Higher density modules allow for greater RAM capacity, which will pave the way for next-gen performance. Up to 16GB DDR4 UDIMMs 2.5 VOLTS SPEED 266 MT/s DENSITY 128Mb 1.8 VOLTS SPEED 400 MT/s DENSITY 256Mb 1.5 VOLTS SPEED 1066 MT/s DENSITY 1Gb 1.2 VOLTS SPEED 2133 MT/s DENSITY 4Gb 2133+ MT/s DDR4 DDR3 1066 MT/s DDR2 400 MT/s DDR 266 MT/s DDR4 2133 MT/s Technologie de mémoire DDR4 Crucial® 2002 2004 2007 2014 20% DE BAISSE par rapport à DDR3 300% D’AUGMENTATION par rapport à DDR3 100% D’AUGMENTATION par rapport à DDR3 16.6% DE BAISSE par rapport à DDR2 300% D’AUGMENTATION par rapport à DDR2 166.5% D’AUGMENTATION par rapport à DDR2 28% DE BAISSE par rapport à DDR 100% D’AUGMENTATION par rapport à DDR 50.3% D’AUGMENTATION par rapport à DDR Avancées technologiques en fonction des chires, en commençant par DDR Mémoire nouvelle génération. Performance nouvelle génération. DENSITÉ SUPÉRIEURE 2x plus dense ©2013 Micron Technology, Inc. Tous droits réservés. Informations pouvant être modifiées sans préavis. Crucial et le logo Crucial sont des marques de commerce de Micron Technology, Inc. Toutes les autres marques de commerce et de service sont la propriété de leurs propriétaires respectifs. NOTA : cet infographique contient des déclarations prospectives concernant la production du DDR4. Les événements ou résultats réels peuvent être substantiellement diérents de ceux qui sont contenus dans les déclarations prospectives. Veuillez vous référer aux fichiers de documents de Micron déposés sur une base consolidée à intervalles réguliers auprès de la Securities and Exchange Commission, plus précisément le Formulaire 10-K et le Formulaire 10-Q les plus récents de Micron. Ces documents contiennent et identifient les facteurs importants qui pourraient causer des diérences substantielles entre les résultats réels de Micron sur une base consolidée et ceux qui sont indiqués dans nos déclarations prospectives (voir Certains facteurs). Bien que nous pensions que les attentes reflétées dans les déclarations prospectives soient raisonnables, nous ne pouvons pas garantir des résultats, des niveaux d’activité, des performances ou des accomplissements futurs. PLUS RAPIDE 2x plus rapide Pourquoi la vitesse compte Chargement plus rapide des applications. Réactivité améliorée. Capacité accrue de traiter les programmes à grand volume de données de l’aveznir. Des vitesses capables d'alimenter les systèmes du futur. PLUS EFFICACE Jusqu’à 20 % en moins en consommation Haut rendement énergétique Moins de surchaue Moins de chaleur par module = votre système a moins tendance à surchauer. DDR3 (1,5 V) DDR4 (1,2 V) Coût énergétique inférieur Moins de consommation = économies importantes pour les centres de données et les applications de grande envergure. $$$ Durée de vie de la batterie plus longue Moins de consommation pour une durée de vie de la batterie plus accrue. La taille inférieure des puces permet plus de gigabits par composant. Gigabit Pourquoi la densité compte La DDR4 vous permet de bénéficier de bien plus qu'un simple module de mémoire. La capacité supérieure par composant permet des modules de densité plus élevée. Composant DDR4 de 8 Gbit Composant DDR3 de 4 Gbit Les modules de densité plus élevée permettent une capacité de RAM supérieure, ce qui ouvrira la voie pour une performance nouvelle génération. Des DDR4 UDIMM de jusqu’à 16 Go 2,5 VOLTS VITESSE 266 MT/s 1,2 VOLTS VITESSE 2133 MT/s DENSITÉ 4 Gbit DENSITÉ 1 Gbit DENSITÉ 128 Mbit 1,8 VOLTS VITESSE 400 MT/s DENSITÉ 256 Mbit 1,5 VOLTS VITESSE 1066 MT/s 2133+ MT/s DDR4 DDR3 1066 MT/s DDR2 400 MT/s DDR 266 MT/s DDR4 2133 MT/s Ti400, Ti300 and Ti200 Thermal Imagers with LaserSharp® Auto Focus Get accurate readings and consistently in-focus images Fluke Thermal Imagers Experience. Performance. Confidence. Quickly capture an in-focus image with the pull of a trigger and wirelessly share measurements with your team anytime, anywhere with the Fluke ConnectTM ShareLiveTM video call. • Quickly get accurate readings and in-focus images with LaserSharp® Auto Focus • Save Reporting Time. Make better decisions faster than before. Organize your measurements by asset in one location with EquipmentLogTM history. • Brilliantly detailed quality images. Pixel for pixel the best spatial resolution available. • Precisely blended visual and infrared images with crucial details to assist in identifying potential problems—IR-Fusion® technology with AutoBlendTM mode • Standard and radiometric video recording and video streaming* • Text and voice recording/annotation allows you to save additional details to image files • Extensive memory options—Removable micro SD memory card, on-board flash memory, save-to-USB capability, direct download via USB-to-PC connection * Firmware updates for these features are not available yet in all countries. Users notified via SmartView Technical Data Three-phase Full Visible Three-phase Full Infrared Three-phase AutoBlend Mode Superior Image Quality Spatial Resolution Ti400 1.31 mRad Ti300 1.75 mRad Ti200 2.09 mRad Resolution Ti400 320x240 (76,800 pixels) Ti300 240X180 (43,200 pixels) Ti200 200X150 (30,000 pixels) Field of View Ti400, Ti300, Ti200 24 °H x 17 °V Built with Now compatible with Fluke Connect™ Mobile App IR-Fusion® Technology with AutoBlendTM Mode Precisely blended visual and infrared images with crucial details to assist in identifying potential problems.2 Fluke Corporation Ti400, Ti300 and Ti200 Thermal Imagers with LaserSharp® Auto Focus Detailed specifications Ti400 Ti300 Ti200 Key features IFOV with standard lens (spatial resolution) 1.31 mRad 1.75 mRad 2.09 mRad Resolution 320x240 (76,800 pixels) 240X180 (43,200 pixels) 200X150 (30,000 pixels) Field of view 24 °H x 17 °V Minimum focus distance 15 cm (approx. 6 in) IFOV with optional telephoto lens 0.65 mRad 0.87 mRad 1.05 mRad Field of view 12 °H x 9 °V Minimum focus distance 45 cm (approx. 18 in) IFOV with optional wide-angle lens 2.62 mRad 3.49 mRad 4.19 mRad Field of view 46 °H x 34 °V Minimum focus distance 15 cm (approx. 6 in) LaserSharp® Auto Focus Yes, for consistently in-focus images. Every. Single. Time. Advanced manual focus Yes Wireless connectivity Yes, to PC, iPhone® and iPad® (iOS 4s and later), Android™ 4.3 and up, and WiFi to LAN* Fluke ConnectTM App compatible* Yes* (where available) CNXTM Wireless System* Yes* (where available) IR-Fusion® technology Yes AutoBlendTM mode Yes Picture-In-Picture (PIP) Yes Ruggedized touchscreen display (Capacitive) 8.9 cm (3.5 in) diagonal landscape color VGA (640 x 480) LCD with backlight Rugged, ergonomic design for one-handed use Yes Thermal sensitivity (NETD) ≤ 0.05 °C at 30 °C target temp (50 mK) ≤ 0.075 °C at 30 °C target temp (75 mK) Temperature measurement range (not calibrated below -10 °C) -20 °C to +1200 °C (-4 °F to +2192 °F) -20 °C to +650 °C (-4 °F to +1202 °F) Level and span Smooth auto and manual scaling Fast auto toggle between manual and auto modes Yes Fast auto-rescale in manual mode Yes Minimum span (in manual mode) 2.0 °C (3.6 °F) Minimum span (in auto mode) 3.0 °C (5.4 °F) Built-in digital camera (visible light) 5 megapixel industrial performance Frame rate 9 Hz Laser pointer Yes Torch Yes Data storage and image capture Extensive memory options Removable micro SD memory card, on-board flash memory, save-to-USB capability, direct download via USB-to-PC connection Image capture, review, save mechanism One-handed image capture, review, and save capability File formats Non-radiometric (.bmp) or (.jpeg) or fully-radiometric (.is2); No analysis software required for non-radiometric (.bmp, .jpg and .avi*) files Memory review Thumbnail view navigation and review selection Software SmartView® software, Fluke ConnectTM, and SmartView® Mobile App—full analysis and reporting software Export file formats with SmartView® software BMP, DIB, GIF, JPE, JFIF, JPEG, JPG, PNG, TIF, and TIFF Voice annotation 60 seconds maximum recording time per image; reviewable playback on camera IR-PhotoNotesTM Yes Text annotation* Yes Video recording* Standard and Radiometric Streaming video Via USB to PC and HDMI to HDMI compatible screen File formats video* Non-radiometric (MPEG - encoded .AVI) and fully-radiometric (.IS3)* Auto capture (temperature and interval)* Yes*3 Fluke Corporation Ti400, Ti300 and Ti200 Thermal Imagers with LaserSharp® Auto Focus Detailed specifications Remote control and operation (for special and advanced applications) Yes — Ti400 Ti300 Ti200 Battery Batteries (field-replaceable, rechargeable) Two lithium ion smart battery packs with five-segment LED display to show charge level Battery life Four+ hours continuous use per battery pack (assumes 50 % brightness of LCD and average usage) Battery charge time 2.5 hours to full charge AC battery charging system Two-bay AC battery charger (110 V AC to 220 V AC, 50/60 Hz) (included), or in-imager charging. AC mains adapters included in 9 Hz versions. Optional 12 V automotive charging adapter. AC operation AC operation with included power supply (110 V AC to 220 V AC, 50/60 Hz). AC mains adapters included. Power saving User selectable sleep and power off modes Temperature measurement Accuracy ± 2 °C or 2 % (at 25 °C nominal, whichever is greater) On-screen emissivity correction Yes (both number and table) On-screen reflected background temperature compensation Yes On-screen transmission correction Yes Color Palettes Standard Palettes 8: Ironbow, Blue-Red, High Contrast, Amber, Amber Inverted, Hot Metal, Grayscale, Grayscale Inverted Ultra ContrastTM Palettes 8: Ironbow Ultra, Blue-Red Ultra, High Contrast Ultra, Amber Ultra, Amber Inverted Ultra, Hot Metal Ultra, Grayscale Ultra, Grayscale Inverted Ultra General specifications Color alarms (temperature alarms) High-temperature , low-temperature, and isotherm Infrared spectral band 7.5 μm to 14 μm (long wave) Operating temperature -10 °C to +50 °C (14 °F to 122 °F) Storage temperature -20 °C to +50 °C (-4 °F to 122 °F) without batteries Relative humidity 10 % to 95 % non-condensing Center-point temperature measurement Yes Spot markers User selectable hot spot and cold spot markers, 3 user definable spot markers on camera and in Smartview® Center box (MIN-MAX-AVG) Expandable-contractable measurement box with MIN-MAX-AVG temp Safety standards UL 61010-1:2012 CAN/CSA-C22.2 No.61010-1-12 IEC 61010-1 3rd Edition (2010) Electromagnetic compatibility EN 61326-1:2006 IEC 61326-1:2005 C Tick IEC/EN 61326-1 US FCC CFR 47, Part 15 Subpart B Class B Vibration 0.03 g2/Hz (3.8 grms), 2.5g IEC 68-2-6 Shock 25 g, IEC 68-2-29 Drop Engineered to withstand 2 meter (6.5 feet) drop with standard lens Size (H x W x L) 27.7 cm x 12.2 cm x 16.7 cm (10.9 in x 4.8 in x 6.5 in) Weight (battery included) 1.04 Kg (2.3 lb) Enclosure rating IP54 (protected against dust, limited ingress; protection against water spray from all directions) Warranty Two-years (standard), extended warranties are available. Recommended calibration cycle Two-years (assumes normal operation and normal aging) Supported languages Czech, Dutch, English, Finnish, French, German, Hungarian, Italian, Japanese, Korean, Polish, Portuguese, Russian, Simplified Chinese, Spanish, Swedish, Traditional Chinese, and Turkish * Firmware updates for these features are not available yet in all countries. Users notified via SmartView® software when available. 4 Fluke Corporation Ti400, Ti300 and Ti200 Thermal Imagers with LaserSharp® Auto Focus Ordering information FLK-Ti400 9Hz Thermal Imager, 9 Hz FLK-Ti300 9Hz Thermal Imager, 9 Hz FLK-Ti200 9Hz Thermal Imager, 9 Hz Included Thermal imager with standard infrared lens; ac power supply and battery pack charger (including main adapters); two, rugged lithium ion smart battery packs; USB cable; HDMI video cable; SmartView® software available via free download; rugged, hard carrying case; soft transport bag; adjustable hand strap; warranty registration card. Optional accessories FLK-LENS/TELE2 Infrared Telephoto Lens (2X magnification) FLK-LENS/WIDE2 Infrared Wide Angle Lens TI-CAR-CHARGER Car Charger FLK-TI-VISOR3 Sun Visor BOOK-ITP Introduction to Thermography Principles Book TI-TRIPOD3 Tripod Mounting Accessory FLK-Ti-SBP3 Additional Smart Battery FLK-TI-SBC3 Additional Smart Battery Charger Visit the Fluke website to get complete details on these products or ask your local Fluke sales representative. RF connection time (binding time) may take up to 1 minute. Built with Fluke Connect with ShareLiveTM is the only wireless measurement system that lets you stay in contact with your entire team without leaving the field. The Fluke Connect mobile app is available for AndroidTM (4.3 and up) and iOS (4s and later) and works with over 20 different Fluke products—the largest system of connected test tools in the world. And more are on the way. Go to the Fluke website to find out more. See it. Save it. Share it. All the facts, right in the field. Smart phone not included with purchase. All trademarks are the property of their respective owners. Smart phone, wireless service, and data plan not included with purchase. The first 5GB of storage is free. Compatible with Android™ (4.3 and up) and iOS (4s and later). Apple and the Apple logo are trademarks of Apple Inc., registered in the U.S. and other countries. App Store is a service mark of Apple Inc. Google Play is a trademark of Google Inc. Fluke Europe B.V. P.O. Box 1186 5602 BD Eindhoven The Netherlands Web: www.fluke.co.uk For more information call: In Europe/M-East/Africa +31 (0)40 267 5100 or Fax +31 (0)40 267 5222 Fluke. Keeping your world up and running.® Fluke (UK) Ltd. 52 Hurricane Way Norwich, Norfolk NR6 6JB United Kingdom Tel.: +44 (0) 20 7942 0700 Fax: +44 (0) 20 7942 0701 E-mail: industrial@uk.fluke.nl Web: www.fluke.co.uk ©2014 Fluke Corporation. Specifications subject to change without notice. 5/2014 Pub_ID: 13036-eng Modification of this document is not permitted without written permission from Fluke Corporation. Download the app at: Crucial Ballistix Sport XT Memory Performance memory for gamers and enthusiasts XMP profile for advanced speeds and timings Tall, aggressive heat spreader Premium-quality DRAM Easy to install Limited lifetime warranty Get ready to play. Engineered to deliver fast and reliable performance memory for enthusiasts and mainstream users alike, the Crucial Ballistix Sport series is a great place to start. Touting all the usual benefits of a memory upgrade — faster load times, better system responsiveness, and increased ability to handle data-intensive games — Ballistix Sport modules also feature an array of additional features. With an eye-catching design, premium-quality DRAM, and a stylish integrated heat spreader for thermal performance, Ballistix Sport makes it easy to take your game to the next level. Since Ballistix Sport performance memory is budget-friendly and compatible with nearly every type of system, you’ll be hard pressed to find a better win. Ballistix Sport XT modules: aggressive performance. Ballistix Sport XT memory offers faster and more aggressive performance. Designed for gamers who are comfortable changing BIOS settings to unleash their memory’s full potential, Sport XT modules offer blazing-fast DDR3 speeds and are available in higher densities. With an expanded heat spreader that offers more surface area for heat dissipation, Sport XT modules enable better thermal performance. Coupled with an aggressive design and XMP profiles for easy configuration in Intel®-supported systems, Sport XT modules deliver no-hassle performance so you can own your opponents. 1/231 PRELIMINARY DATA January 2005 This is preliminary information on a new product now in development or undergoing evaluation. Details are subject to change without notice. uPSD33xx Turbo Series Fast 8032 MCU with Programmable Logic FEATURES SUMMARY ■ FAST 8-BIT TURBO 8032 MCU, 40MHz – Advanced core, 4-clocks per instruction – 10 MIPs peak performance at 40MHz (5V) – JTAG Debug and In-System Programming – Branch Cache & 6 instruction Prefetch Queue – Dual XDATA pointers with auto incr & decr – Compatible with 3rd party 8051 tools ■ DUAL FLASH MEMORIES WITH MEMORY MANAGEMENT – Place either memory into 8032 program address space or data address space – READ-while-WRITE operation for InApplication Programming and EEPROM emulation – Single voltage program and erase – 100K guaranteed erase cycles, 15-year retention ■ CLOCK, RESET, AND SUPPLY MANAGEMENT – SRAM is Battery Backup capable – Flexible 8-level CPU clock divider register – Normal, Idle, and Power Down Modes – Power-on and Low Voltage reset supervisor – Programmable Watchdog Timer ■ PROGRAMMABLE LOGIC, GENERAL PURPOSE – 16 macrocells – Create shifters, state machines, chipselects, glue-logic to keypads, panels, LCDs, others ■ COMMUNICATION INTERFACES – I2C Master/Slave controller, 833KHz – SPI Master controller, 10MHz – Two UARTs with independent baud rate – IrDA protocol support up to 115K baud – Up to 46 I/O, 5V tolerant on 3.3V uPSD33xxV Figure 1. Packages ■ A/D CONVERTER – Eight Channels, 10-bit resolution, 6µs ■ TIMERS AND INTERRUPTS – Three 8032 standard 16-bit timers – Programmable Counter Array (PCA), six 16-bit modules for PWM, CAPCOM, and timers – 8/10/16-bit PWM operation – 11 Interrupt sources with two external interrupt pins ■ OPERATING VOLTAGE SOURCE (±10%) – 5V devices use both 5.0V and 3.3V sources – 3.3V devices use only 3.3V sourceuPSD33xx 2/231 Table 1. Device Summary Part Number 1st Flash (bytes) 2nd Flash (bytes) SRAM (bytes) GPIO 8032 Bus VCC VDD Pkg. Temp. uPSD3312D-40T6 64K 16K 2K 37 No 3.3V 5.0V TQFP52 –40°C to 85°C uPSD3312DV-40T6 64K 16K 2K 37 No 3.3V 3.3V TQFP52 –40°C to 85°C uPSD3333D-40T6 128K 32K 8K 37 No 3.3V 5.0V TQFP52 –40°C to 85°C uPSD3333DV-40T6 128K 32K 8K 37 No 3.3V 3.3V TQFP52 –40°C to 85°C uPSD3333D-40U6 128K 32K 8K 46 Yes 3.3V 5.0V TQFP80 –40°C to 85°C uPSD3333DV-40U6 128K 32K 8K 46 Yes 3.3V 3.3V TQFP80 –40°C to 85°C uPSD3334D-40U6 256K 32K 8K 46 Yes 3.3V 5.0V TQFP80 –40°C to 85°C uPSD3334DV-40U6 256K 32K 8K 46 Yes 3.3V 3.3V TQFP80 –40°C to 85°C uPSD3354D-40T6 256K 32K 32K 37 No 3.3V 5.0V TQFP52 –40°C to 85°C uPSD3354DV-40T6 256K 32K 32K 37 No 3.3V 3.3V TQFP52 –40°C to 85°C uPSD3354D-40U6 256K 32K 32K 46 Yes 3.3V 5.0V TQFP80 –40°C to 85°C uPSD3354DV-40U6 256K 32K 32K 46 Yes 3.3V 3.3V TQFP80 –40°C to 85°C3/231 uPSD33xx TABLE OF CONTENTS FEATURES SUMMARY . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1 SUMMARY DESCRIPTION. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7 PIN DESCRIPTIONS . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8 uPSD33xx HARDWARE DESCRIPTION . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 13 MEMORY ORGANIZATION . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 15 Internal Memory (MCU Module, Standard 8032 Memory: DATA, IDATA, SFR) . . . . . . . . . . . . 16 External Memory (PSD Module: Program memory, Data memory). . . . . . . . . . . . . . . . . . . . . . 16 8032 MCU CORE PERFORMANCE ENHANCEMENTS . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 17 Pre-Fetch Queue (PFQ) and Branch Cache (BC) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 19 PFQ Example, Multi-cycle Instructions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 19 Aggregate Performance . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 19 MCU MODULE DISCRIPTION . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 21 8032 MCU REGISTERS . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 21 Stack Pointer (SP) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 21 Data Pointer (DPTR) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 21 Program Counter (PC). . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 21 Accumulator (ACC) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 21 B Register (B). . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 21 General Purpose Registers (R0 - R7). . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 22 Program Status Word (PSW) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 22 SPECIAL FUNCTION REGISTERS (SFR) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 23 8032 ADDRESSING MODES . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 30 Register Addressing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 30 Direct Addressing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 30 Register Indirect Addressing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 30 Immediate Addressing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 30 External Direct Addressing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 30 External Indirect Addressing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 30 Indexed Addressing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 31 Relative Addressing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 31 Absolute Addressing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 31 Long Addressing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 31 Bit Addressing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 31 uPSD33xx INSTRUCTION SET SUMMARY . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 32uPSD33xx 4/231 DUAL DATA POINTERS. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 37 Data Pointer Control Register, DPTC (85h). . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 37 Data Pointer Mode Register, DPTM (86h) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 38 DEBUG UNIT. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 39 INTERRUPT SYSTEM. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 40 Individual Interrupt Sources. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 43 MCU CLOCK GENERATION . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 46 MCU_CLK . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 46 PERIPH_CLK . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 46 POWER SAVING MODES . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 48 Idle Mode . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 48 Power-down Mode. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 48 Reduced Frequency Mode . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 48 OSCILLATOR AND EXTERNAL COMPONENTS . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 51 I/O PORTS of MCU MODULE. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 53 MCU Port Operating Modes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 53 MCU BUS INTERFACE. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 62 Bus Read Cycles (PSEN or RD) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 62 Bus Write Cycles (WR) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 62 Controlling the PFQ and BC . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 62 SUPERVISORY FUNCTIONS . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 65 External Reset Input Pin, RESET_IN . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 65 Low VCC Voltage Detect, LVD. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 66 Power-up Reset . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 66 JTAG Debug Reset . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 66 Watchdog Timer, WDT . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 66 STANDARD 8032 TIMER/COUNTERS . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 69 Standard Timer SFRs . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 69 Clock Sources . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 69 SFR, TCON . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 71 SFR, TMOD. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 71 Timer 0 and Timer 1 Operating Modes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 71 Timer 2 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 74 SERIAL UART INTERFACES. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 81 UART Operation Modes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 815/231 uPSD33xx Serial Port Control Registers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 82 UART Baud Rates . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 84 More About UART Mode 0 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 85 More About UART Mode 1 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 87 More About UART Modes 2 and 3 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 89 IrDA INTERFACE . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 92 Pulse Width Selection . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 94 I 2C INTERFACE . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 95 I2C Interface Main Features . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 95 Communication Flow . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 96 Operating Modes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 98 Bus Arbitration . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 98 Clock Synchronization . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 98 General Call Address . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 98 Serial I/O Engine (SIOE) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 99 I 2C Interface Control Register (S1CON) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 100 I 2C Interface Status Register (S1STA) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 102 I2C Data Shift Register (S1DAT). . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 104 I 2C Address Register (S1ADR) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 104 I 2C START Sample Setting (S1SETUP) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 105 I 2C Operating Sequences . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 108 SPI (SYNCHRONOUS PERIPHERAL INTERFACE) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 112 SPI Bus Features and Communication Flow . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 113 Full-Duplex Operation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 113 Bus-Level Activity . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 113 SPI SFR Registers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 115 SPI Configuration . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 116 Dynamic Control . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 116 ANALOG-TO-DIGITAL CONVERTOR (ADC) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 120 Port 1 ADC Channel Selects. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 120 PROGRAMMABLE COUNTER ARRAY (PCA) WITH PWM . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 123 PCA Block . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 123 PCA Clock Selection . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 125 Operation of TCM Modes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 126 Capture Mode. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 126 Timer Mode . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 126 Toggle Mode . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 126 PWM Mode - (X8), Fixed Frequency. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 126 PWM Mode - (X8), Programmable Frequency . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 128 PWM Mode - Fixed Frequency, 16-bit . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 129uPSD33xx 6/231 PWM Mode - Fixed Frequency, 10-bit . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 129 Writing to Capture/Compare Registers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 129 Control Register Bit Definition . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 129 TCM Interrupts . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 132 PSD MODULE . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 133 PSD Module Functional Description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 134 Memory Mapping . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 138 Runtime Control Register Definitions (csiop). . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 145 PSD Module Detailed Operation. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 147 PSD Module Reset Conditions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 193 AC/DC PARAMETERS . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 202 MAXIMUM RATING. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 204 DC AND AC PARAMETERS. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 204 PACKAGE MECHANICAL INFORMATION . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 225 PART NUMBERING . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 229 REVISION HISTORY. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2307/231 uPSD33xx SUMMARY DESCRIPTION The Turbo uPSD33xx Series combines a powerful 8051-based microcontroller with a flexible memory structure, programmable logic, and a rich peripheral mix to form an ideal embedded controller. At its core is a fast 4-cycle 8032 MCU with a 6-byte instruction prefetch queue (PFQ) and a 4-entry fully associative branching cache (BC) to maximize MCU performance, enabling loops of code in smaller localities to execute extremely fast. Code development is easily managed without a hardware In-Circuit Emulator by using the serial JTAG debug interface. JTAG is also used for InSystem Programming (ISP) in as little as 10 seconds, perfect for manufacturing and lab development. The 8032 core is coupled to Programmable System Device (PSD) architecture to optimize the 8032 memory structure, offering two independent banks of Flash memory that can be placed at virtually any address within 8032 program or data address space, and easily paged beyond 64K bytes using on-chip programmable decode logic. Dual Flash memory banks provide a robust solution for remote product updates in the field through In-Application Programming (IAP). Dual Flash banks also support EEPROM emulation, eliminating the need for external EEPROM chips. General purpose programmable logic (PLD) is included to build an endless variety of glue-logic, saving external logic devices. The PLD is configured using the software development tool, PSDsoft Express, available from the web at www.st.com/psm, at no charge. The uPSD33xx also includes supervisor functions such as a programmable watchdog timer and low-voltage reset. Figure 2. Block Diagram PA0:7 PB0:7 PD1:2 PC0:7 MCU Bus P4.0:7 P1.0:7 P3.0:7 uPSD33xx SYSTEM BUS Dedicated Pins Supervisor: Watchdog and Low-Voltage Reset 1st Flash Memory: 64K, 128K, or 256K Bytes 2nd Flash Memory: 16K or 32K Bytes SRAM: 2K, 8K, or 32K Bytes Programmable Decode and Page Logic General Purpose Programmable Logic, 16 Macrocells (8) GPIO, Port A (80-pin only) (8) GPIO, Port B (4) GPIO, Port C (2) GPIO, Port D JTAG ICE and ISP 8032 Address/Data/Control Bus (80-pin device only) VCC, VDD, GND, Reset, Crystal In Turbo 8032 Core PFQ & BC (3) 16-bit Timer/ Counters (2) External Interrupts I 2 C SPI (8) 10-bit ADC UART0 (8) GPIO, Port 1 (8) GPIO, Port 3 (8) GPIO, Port 4 UART1 Optional IrDA Encoder/Decoder 16-bit PCA (6) PWM, CAPCOM, TIMER AI08875uPSD33xx 8/231 PIN DESCRIPTIONS Figure 3. TQFP52 Connections Note: 1. For 5V applications, VDD must be connected to a 5.0V source. For 3.3V applications, VDD must be connected to a 3.3V source. 2. These signals can be used on one of two different ports (Port 1 or Port 4) for flexibility. Default is Port1. 3. VREF and 3.3V AVCC are shared in the 52-pin package only. ADC channels must use AVCC as VREF for the 52-pin package. 39 P1.5/SPIRXD(2)/ADC5 38 P1.4/SPICLK(2)/ADC4 37 P1.3/TXD1(IrDA)(2)/ADC3 36 P1.2/RXD1(IrDA)(2)/ADC2 35 P1.1/T2X(2)/ADC1 34 P1.0/T2(2)/ADC0 33 VDD(1) 32 XTAL2 31 XTAL1 30 P3.7/SCL 29 P3.6/SDA 28 P3.5/C1 27 P3.4/C0 PD1/CLKIN PC7 JTAG TDO JTAG TDI DEBUG 3.3V VCC PC4/TERR VDD(1) GND PC3/TSTAT PC2/VSTBY JTAG TCK JTAG TMS 1 2 3 4 5 6 7 8 9 10 11 12 13 52 51 50 49 48 47 46 45 44 43 42 41 40 PB0 PB1 PB2 PB3 PB4 AVCC/VREF(3) PB5 GND RESET_IN PB6 PB7 P1.7/SPISEL(2)/ADC7 P1.6/SPITXD(2)/ADC6 14 15 16 17 18 19 20 21 22 23 24 25 26 SPISEL(2)/PCACLK1/P4.7 SPITXD(2)/TCM5/P4.6 SPIRXD(2)/TCM4/P4.5 SPICLK(2)/TCM3/P4.4 TXD1(IrDA)(2)/PCACLK0/P4.3 GND RXD1(IrDA)(2)/TCM2/P4.2 T2X(2)/TCM1/P4.1 T2(2)/TCM0/P4.0 RXD0/P3.0 TXD0/P3.1 EXTINT0/TG0/P3.2 EXTINT1/TG1/P3.3 AI078229/231 uPSD33xx Figure 4. TQFP80 Connections Note: NC = Not Connected Note: 1. For 5V applications, VDD must be connected to a 5.0V source. For 3.3V applications, VDD must be connected to a 3.3V source. 2. These signals can be used on one of two different ports (Port 1 or Port 4) for flexibility. Default is Port1. 60 P1.5/SPIRXD(2)/ADC5 59 P1.4/SPICLK(2)/ADC4 58 P1.3/TXD1(IrDA)(2)/ADC3 57 MCU A11 56 P1.2/RXD1(IrDA)(2)/ADC2 55 MCU A10 54 P1.1/T2X(2)/ADC1 53 MCU A9 52 P1.0/T2(2)/ADC0 51 MCU A8 50 VDD(1) 49 XTAL2 48 XTAL1 47 MCU AD7 46 P3.7/SCL 45 MCU AD6 44 P3.6/SDA 43 MCU AD5 42 P3.5/C1 41 MCU AD4 PD2/CSI P3.3/TG1/EXINT1 PD1/CLKIN ALE PC7 JTAG TDO JTAG TDI DEBUG PC4/TERR 3.3V VCC NC VDD(1) GND PC3/TSTAT PC2/VSTBY JTAG TCK NC SPISEL(2)/PCACLK1/P4.7 SPITXD(2)/TCM5/P4.6 JTAG TMS 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 80 79 78 77 76 75 74 73 72 71 70 69 68 67 66 65 64 63 62 61 PB0 P3.2/EXINT0/TG0 PB1 P3.1/TXD0 PB2 P3.0/RXD0 PB3 PB4 AVCC PB5 VREF GND RESET_IN PB6 PB7 RD P1.7/SPISEL(2)/ADC7 PSEN WR P1.6/SPITXD(2)/ADC6 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 PA7 PA6 SPIRXD(2)/TCM4/P4.5 PA5 SPICLK(2)/TCM3/P4.4 PA4 TXD1(IrDA)(2)/PCACLK0/P4.3 PA3 GND RXD1(IrDA)(2)/TCM2/P4.2 T2X(2)/TCM1/P4.1 PA2 T2(2)/TCM0/P4.0 PA1 PA0 MCU AD0 MCU AD1 MCU AD2 MCU AD3 P3.4/C0 AI07823uPSD33xx 10/231 Table 2. Pin Definitions Port Pin Signal Name 80-Pin No. 52-Pin No.(1) In/Out Function Basic Alternate 1 Alternate 2 MCUAD0 AD0 36 N/A I/O External Bus Multiplexed Address/ Data bus A0/D0 MCUAD1 AD1 37 N/A I/O Multiplexed Address/ Data bus A1/D1 MCUAD2 AD2 38 N/A I/O Multiplexed Address/ Data bus A2/D2 MCUAD3 AD3 39 N/A I/O Multiplexed Address/ Data bus A3/D3 MCUAD4 AD4 41 N/A I/O Multiplexed Address/ Data bus A4/D4 MCUAD5 AD5 43 N/A I/O Multiplexed Address/ Data bus A5/D5 MCUAD6 AD6 45 N/A I/O Multiplexed Address/ Data bus A6/D6 MCUAD7 AD7 47 N/A I/O Multiplexed Address/ Data bus A7/D7 MCUA8 A8 51 N/A O External Bus, Addr A8 MCUA9 A9 53 N/A O External Bus, Addr A9 MCUA10 A10 55 N/A O External Bus, Addr A10 MCUA11 A11 57 N/A O External Bus, Addr A11 P1.0 T2 ADC0 52 34 I/O General I/O port pin Timer 2 Count input (T2) ADC Channel 0 input (ADC0) P1.1 T2X ADC1 54 35 I/O General I/O port pin Timer 2 Trigger input (T2X) ADC Channel 1 input (ADC1) P1.2 RxD1 ADC2 56 36 I/O General I/O port pin UART1 or IrDA Receive (RxD1) ADC Channel 2 input (ADC2) P1.3 TXD1 ADC3 58 37 I/O General I/O port pin UART or IrDA Transmit (TxD1) ADC Channel 3 input (ADC3) P1.4 SPICLK ADC4 59 38 I/O General I/O port pin SPI Clock Out (SPICLK) ADC Channel 4 input (ADC4) P1.5 SPIRxD ADC6 60 39 I/O General I/O port pin SPI Receive (SPIRxD) ADC Channel 5 input (ADC5) P1.6 SPITXD ADC6 61 40 I/O General I/O port pin SPI Transmit (SPITxD) ADC Channel 6 input (ADC6) P1.7 SPISEL ADC7 64 41 I/O General I/O port pin SPI Slave Select (SPISEL) ADC Channel 7 input (ADC7) P3.0 RxD0 75 23 I/O General I/O port pin UART0 Receive (RxD0) P3.1 TXD0 77 24 I/O General I/O port pin UART0 Transmit (TxD0) P3.2 EXINT0 TGO 79 25 I/O General I/O port pin Interrupt 0 input (EXTINT0)/Timer 0 gate control (TG0) P3.3 INT1 2 26 I/O General I/O port pin Interrupt 1 input (EXTINT1)/Timer 1 gate control (TG1) P3.4 C0 40 27 I/O General I/O port pin Counter 0 input (C0)11/231 uPSD33xx P3.5 C1 42 28 I/O General I/O port pin Counter 1 input (C1) P3.6 SDA 44 29 I/O General I/O port pin I 2C Bus serial data (I2CSDA) P3.7 SCL 46 30 I/O General I/O port pin I 2C Bus clock (I2CSCL) P4.0 T2 TCM0 33 22 I/O General I/O port pin Program Counter Array0 PCA0-TCM0 Timer 2 Count input (T2) P4.1 T2X TCM1 31 21 I/O General I/O port pin PCA0-TCM1 Timer 2 Trigger input (T2X) P4.2 RXD1 TCM2 30 20 I/O General I/O port pin PCA0-TCM2 UART1 or IrDA Receive (RxD1) P4.3 TXD1 PCACLK0 27 18 I/O General I/O port pin PCACLK0 UART1 or IrDA Transmit (TxD1) P4.4 SPICLK TCM3 25 17 I/O General I/O port pin Program Counter Array1 PCA1-TCM3 SPI Clock Out (SPICLK) P4.5 SPIRXD TCM4 23 16 I/O General I/O port pin PCA1-TCM4 SPI Receive (SPIRxD) P4.6 SPITXD 19 15 I/O General I/O port pin PCA1-TCM5 SPI Transmit (SPITxD) P4.7 SPISEL PCACLK1 18 14 I/O General I/O port pin PCACLK1 SPI Slave Select (SPISEL) VREF 70 N/A I Reference Voltage input for ADC RD 65 N/A O READ Signal, external bus WR 62 N/A O WRITE Signal, external bus PSEN 63 N/A O PSEN Signal, external bus ALE 4 N/A O Address Latch signal, external bus RESET_IN 68 44 I Active low reset input XTAL1 48 31 I Oscillator input pin for system clock XTAL2 49 32 O Oscillator output pin for system clock DEBUG 8 5 I/O I/O to the MCU Debug Unit PA0 35 N/A I/O General I/O port pin All Port A pins support: 1. PLD Macro-cell outputs, or 2. PLD inputs, or 3. Latched Address Out (A0-A7), or 4. Peripheral I/O Mode PA1 34 N/A I/O General I/O port pin PA2 32 N/A I/O General I/O port pin PA3 28 N/A I/O General I/O port pin PA4 26 N/A I/O General I/O port pin PA5 24 N/A I/O General I/O port pin PA6 22 N/A I/O General I/O port pin PA7 21 N/A I/O General I/O port pin Port Pin Signal Name 80-Pin No. 52-Pin No.(1) In/Out Function Basic Alternate 1 Alternate 2uPSD33xx 12/231 Note: 1. N/A = Signal Not Available on 52-pin package. PB0 80 52 I/O General I/O port pin All Port B pins support: 1. PLD Macro-cell outputs, or 2. PLD inputs, or 3. Latched Address Out (A0-A7) PB1 78 51 I/O General I/O port pin PB2 76 50 I/O General I/O port pin PB3 74 49 I/O General I/O port pin PB4 73 48 I/O General I/O port pin PB5 71 46 I/O General I/O port pin PB6 67 43 I/O General I/O port pin PB7 66 42 I/O General I/O port pin JTAGTMS TMS 20 13 I JTAG pin (TMS) JTAGTCK TCK 16 12 I JTAG pin (TCK) PC2 VSTBY 15 11 I/O General I/O port pin SRAM Standby voltage input (VSTBY) PLD Macrocell output, or PLD input PC3 TSTAT 14 10 I/O General I/O port pin Optional JTAG Status (TSTAT) PLD, Macrocell output, or PLD input PC4 TERR 9 7 I/O General I/O port pin Optional JTAG Status (TERR) PLD, Macrocell output, or PLD input JTAGTDI TDI 7 4 I JTAG pin (TDI) JTAGTDO TDO 6 3 O JTAG pin (TDO) PC7 5 2 I/O General I/O port pin PLD, Macrocell output, or PLD input PD1 CLKIN 3 1 I/O General I/O port pin 1. PLD I/O 2. Clock input to PLD and APD PD2 CSI 1 N/A I/O General I/O port pin 1. PLD I/O 2. Chip select ot PSD Module 3.3V-VCC 10 6 VCC - MCU Module AVCC 72 47 Analog VCC Input VDD 3.3V or 5V 12 8 VDD - PSD Module VDD - 3.3V for 3V VDD - 5V for 5V VDD 3.3V or 5V 50 33 VDD - PSD Module VDD - 3.3V for 3V VDD - 5V for 5V GND 13 9 GND 29 19 GND 69 45 NC 11 N/A NC 17 N/A Port Pin Signal Name 80-Pin No. 52-Pin No.(1) In/Out Function Basic Alternate 1 Alternate 213/231 uPSD33xx uPSD33xx HARDWARE DESCRIPTION The uPSD33xx has a modular architecture built from a stacked die process. There are two die, one is designated “MCU Module” in this document, and the other is designated “PSD Module” (see Figure 5., page 14). In all cases, the MCU Module die operates at 3.3V with 5V tolerant I/O. The PSD Module is either a 3.3V die or a 5V die, depending on the uPSD33xx device as described below. The MCU Module consists of a fast 8032 core, that operates with 4 clocks per instruction cycle, and has many peripheral and system supervisor functions. The PSD Module provides the 8032 with multiple memories (two Flash and one SRAM) for program and data, programmable logic for address decoding and for general-purpose logic, and additional I/O. The MCU Module communicates with the PSD Module through internal address and data busses (A8 – A15, AD0 – AD7) and control signals (RD, WR, PSEN, ALE, RESET). There are slightly different I/O characteristics for each module. I/Os for the MCU module are designated as Ports 1, 3, and 4. I/Os for the PSD Module are designated as Ports A, B, C, and D. For all 5V uPSD33xx devices, a 3.3V MCU Module is stacked with a 5V PSD Module. In this case, a 5V uPSD33xx device must be supplied with 3.3VCC for the MCU Module and 5.0VDD for the PSD Module. Ports 3 and 4 of the MCU Module are 3.3V ports with tolerance to 5V devices (they can be directly driven by external 5V devices and they can directly drive external 5V devices while producing a VOH of 2.4V min and VCC max). Ports A, B, C, and D of the PSD Module are true 5V ports. For all 3.3V uPSD33xxV devices, a 3.3V MCU Module is stacked with a 3.3V PSD Module. In this case, a 3.3V uPSD33xx device needs to be supplied with a single 3.3V voltage source at both VCC and VDD. I/O pins on Ports 3 and 4 are 5V tolerant and can be connected to external 5V peripherals devices if desired. Ports A, B, C, and D of the PSD Module are 3.3V ports, which are not tolerant to external 5V devices. Refer to Table 3 for port type and voltage source requirements. 80-pin uPSD33xx devices provide access to 8032 address, data, and control signals on external pins to connect external peripheral and memory devices. 52-pin uPSD33xx devices do not provide access to the 8032 system bus. All non-volatile memory and configuration portions of the uPSD33xx device are programmed through the JTAG interface and no special programming voltage is needed. This same JTAG port is also used for debugging of the 8032 core at runtime providing breakpoint, single-step, display, and trace features. A non-volatile security bit may be programmed to block all access via JTAG interface for security. The security bit is defeated only by erasing the entire device, leaving the device blank and ready to use again. Table 3. Port Type and Voltage Source Combinations Device Type VCC for MCU Module VDD for PSD Module Ports 3 and 4 on MCU Module Ports A, B, C, and D on PSD Module 5V: uPSD33xx 3.3V 5.0V 3.3V but 5V tolerant 5V 3.3V: uPSD33xxV 3.3V 3.3V 3.3V but 5V tolerant 3.3V. NOT 5V tolerantuPSD33xx 14/231 Figure 5. uPSD33xx Functional Modules 10-bit ADC Dedicated Memory Interface Prefetch, Branch Cache Enhanced MCU Interface Decode PLD PSD Page Register SRAM JTAG ISP CPLD - 16 MACROCELLS Reset Logic WDT Internal Reset Port 3 Port 1 Dual UARTs Interrupt 3 Timer / Counters 256 Byte SRAM Turbo 8032 Core PSD Internal Bus 8032 Internal Bus PSD Reset LVD I 2 C Unit Port D GPIO Port C JTAG and GPIO Secondary Flash Reset Input uPSD33XX JTAG DEBUG 8-Bit Die-to-Die Bus Main Flash PCA PWM Counters Reset Pin Ext. Bus SPI VCC Pins 3.3V VDD Pins 3.3V or 5V MCU Module PSD Module Port 3 - UART0, Intr, Timers Port 1 - Timer, ADC, SPI Port 4 - PCA, PWM, UART1 Port 3 I 2 C XTAL Clock Unit Port A,B,C PLD I/O and GPIO AI0784215/231 uPSD33xx MEMORY ORGANIZATION The 8032 MCU core views memory on the MCU module as “internal” memory and it views memory on the PSD module as “external” memory, see Figure 6. Internal memory on the MCU Module consists of DATA, IDATA, and SFRs. These standard 8032 memories reside in 384 bytes of SRAM located at a fixed address space starting at address 0x0000. External memory on the PSD Module consists of four types: main Flash (64K, 128K, or 256K bytes), a smaller secondary Flash (16K, or 32K), SRAM (2K, 8K, or 32K bytes), and a block of PSD Module control registers called CSIOP (256 bytes). These external memories reside at programmable address ranges, specified using the software tool PSDsoft Express. See the PSD Module section of this document for more details on these memories. External memory is accessed by the 8032 in two separate 64K byte address spaces. One address space is for program memory and the other address space is for data memory. Program memory is accessed using the 8032 signal, PSEN. Data memory is accessed using the 8032 signals, RD and WR. If the 8032 needs to access more than 64K bytes of external program or data memory, it must use paging (or banking) techniques provided by the Page Register in the PSD Module. Note: When referencing program and data memory spaces, it has nothing to do with 8032 internal SRAM areas of DATA, IDATA, and SFR on the MCU Module. Program and data memory spaces only relate to the external memories on the PSD Module. External memory on the PSD Module can overlap the internal SRAM memory on the MCU Module in the same physical address range (starting at 0x0000) without interference because the 8032 core does not assert the RD or WR signals when accessing internal SRAM. Figure 6. uPSD33xx Memories • External memories may be placed at virtually any address using software tool PSDsoft Express. • The SRAM and Flash memories may be placed in 8032 Program Space or Data Space using PSDsoft Express. • Any memory in 8032 Data Space is XDATA. 64KB, 128KB, or 256KB 16KB or 32KB Main Flash Internal SRAM on MCU Module External Memory on PSD Module IDATA SFR DATA Secondary Flash 2KB, 8KB, or 32KB SRAM 256 Bytes CSIOP 384 Bytes SRAM Direct or Indirect Addressing FF 80 7F 128 Bytes 128 Bytes 128 Bytes 0 Indirect Addressing Fixed Addresses Direct Addressing AI07843uPSD33xx 16/231 Internal Memory (MCU Module, Standard 8032 Memory: DATA, IDATA, SFR) DATA Memory. The first 128 bytes of internal SRAM ranging from address 0x0000 to 0x007F are called DATA, which can be accessed using 8032 direct or indirect addressing schemes and are typically used to store variables and stack. Four register banks, each with 8 registers (R0 – R7), occupy addresses 0x0000 to 0x001F. Only one of these four banks may be enabled at a time. The next 16 locations at 0x0020 to 0x002F contain 128 directly addressable bit locations that can be used as software flags. SRAM locations 0x0030 and above may be used for variables and stack. IDATA Memory. The next 128 bytes of internal SRAM are named IDATA and range from address 0x0080 to 0x00FF. IDATA can be accessed only through 8032 indirect addressing and is typically used to hold the MCU stack as well as data variables. The stack can reside in both DATA and IDATA memories and reach a size limited only by the available space in the combined 256 bytes of these two memories (since stack accesses are always done using indirect addressing, the boundary between DATA and IDATA does not exist with regard to the stack). SFR Memory. Special Function Registers (Table 5., page 24) occupy a separate physical memory, but they logically overlap the same 128 bytes as IDATA, ranging from address 0x0080 to 0x00FF. SFRs are accessed only using direct addressing. There 86 active registers used for many functions: changing the operating mode of the 8032 MCU core, controlling 8032 peripherals, controlling I/O, and managing interrupt functions. The remaining unused SFRs are reserved and should not be accessed. 16 of the SFRs are both byte- and bit-addressable. Bit-addressable SFRs are those whose address ends in “0” or “8” hex. External Memory (PSD Module: Program memory, Data memory) The PSD Module has four memories: main Flash, secondary Flash, SRAM, and CSIOP. See the PSD MODULE section for more detailed information on these memories. Memory mapping in the PSD Module is implemented with the Decode PLD (DPLD) and optionally the Page Register. The user specifies decode equations for individual segments of each of the memories using the software tool PSDsoft Express. This is a very easy point-and-click process allowing total flexibility in mapping memories. Additionally, each of the memories may be placed in various combinations of 8032 program address space or 8032 data address space by using the software tool PSDsoft Express. Program Memory. External program memory is addressed by the 8032 using its 16-bit Program Counter (PC) and is accessed with the 8032 signal, PSEN. Program memory can be present at any address in program space between 0x0000 and 0xFFFF. After a power-up or reset, the 8032 begins program execution from location 0x0000 where the reset vector is stored, causing a jump to an initialization routine in firmware. At address 0x0003, just following the reset vector are the interrupt service locations. Each interrupt is assigned a fixed interrupt service location in program memory. An interrupt causes the 8032 to jump to that service location, where it commences execution of the service routine. External Interrupt 0 (EXINT0), for example, is assigned to service location 0x0003. If EXINT0 is going to be used, its service routine must begin at location 0x0003. Interrupt service locations are spaced at 8-byte intervals: 0x0003 for EXINT0, 0x000B for Timer 0, 0x0013 for EXINT1, and so forth. If an interrupt service routine is short enough, it can reside entirely within the 8-byte interval. Longer service routines can use a jump instruction to somewhere else in program memory. Data Memory. External data is referred to as XDATA and is addressed by the 8032 using Indirect Addressing via its 16-bit Data Pointer Register (DPTR) and is accessed by the 8032 signals, RD and WR. XDATA can be present at any address in data space between 0x0000 and 0xFFFF. Note: the uPSD33xx has dual data pointers (source and destination) making XDATA transfers much more efficient. Memory Placement. PSD Module architecture allows the placement of its external memories into different combinations of program memory and data memory spaces. This means the main Flash, the secondary Flash, and the SRAM can be viewed by the 8032 MCU in various combinations of program memory or data memory as defined by PSDsoft Express. As an example of this flexibility, for applications that require a great deal of Flash memory in data space (large lookup tables or extended data recording), the larger main Flash memory can be placed in data space and the smaller secondary Flash memory can be placed in program space. The opposite can be realized for a different application if more Flash memory is needed for code and less Flash memory for data.17/231 uPSD33xx By default, the SRAM and CSIOP memories on the PSD Module must always reside in data memory space and they are treated by the 8032 as XDATA. However, the SRAM may optionally reside in program space in addition to data space if it is desired to execute code from SRAM. The main Flash and secondary Flash memories may reside in program space, data space, or both. These memory placement choices specified by PSDsoft Express are programmed into non-volatile sections of the uPSD33xx, and are active at power-up and after reset. It is possible to override these initial settings during runtime for In-Application Programming (IAP). Standard 8032 MCU architecture cannot write to its own program memory space to prevent accidental corruption of firmware. However, this becomes an obstacle in typical 8032 systems when a remote update to firmware in Flash memory is required using IAP. The PSD module provides a solution for remote updates by allowing 8032 firmware to temporarily “reclassify” Flash memory to reside in data space during a remote update, then returning Flash memory back to program space when finished. See the VM Register (Table 78., page 143) in the PSD Module section of this document for more details. 8032 MCU CORE PERFORMANCE ENHANCEMENTS Before describing performance features of the uPSD33xx, let us first look at standard 8032 architecture. The clock source for the 8032 MCU creates a basic unit of timing called a machine-cycle, which is a period of 12 clocks for standard 8032 MCUs. The instruction set for traditional 8032 MCUs consists of 1, 2, and 3 byte instructions that execute in different combinations of 1, 2, or 4 machine-cycles. For example, there are one-byte instructions that execute in one machine-cycle (12 clocks), one-byte instructions that execute in four machine-cycles (48 clocks), two-byte, two-cycle instructions (24 clocks), and so on. In addition, standard 8032 architecture will fetch two bytes from program memory on almost every machinecycle, regardless if it needs them or not (dummy fetch). This means for one-byte, one-cycle instructions, the second byte is ignored. These one-byte, one-cycle instructions account for half of the 8032's instructions (126 out of 255 opcodes). There are inefficiencies due to wasted bus cycles and idle bus times that can be eliminated. The uPSD33xx 8032 MCU core offers increased performance in a number of ways, while keeping the exact same instruction set as the standard 8032 (all opcodes, the number of bytes per instruction, and the native number a machine-cycles per instruction are identical to the original 8032). The first way performance is boosted is by reducing the machine-cycle period to just 4 MCU clocks as compared to 12 MCU clocks in a standard 8032. This shortened machine-cycle improves the instruction rate for one-byte, one-cycle instructions by a factor of three (Figure 7., page 18) compared to standard 8051 architectures, and significantly improves performance of multiple-cycle instruction types. The example in Figure 7 shows a continuous execution stream of one-byte, one-cycle instructions. The 5V uPSD33xx will yield 10 MIPS peak performance in this case while operating at 40MHz clock rate. In a typical application however, the effective performance will be lower since programs do not use only one-cycle instructions, but special techniques are implemented in the uPSD33xx to keep the effective MIPS rate as close as possible to the peak MIPS rate at all times. This is accomplished with an instruction Pre-Fetch Queue (PFQ) and a Branch Cache (BC) as shown in Figure 8., page 18.uPSD33xx 18/231 Figure 7. Comparison of uPSD33xx with Standard 8032 Performance Figure 8. Instruction Pre-Fetch Queue and Branch Cache MCU Clock Standard 8032 Fetch Byte for Instruction A Execute Instruction A and Fetch a Second Dummy Byte Turbo uPSD33XX Execute Instruction and Pre-Fetch Next Instruction 4 clocks (one machine cycle) 12 clocks (one machine cycle) 1-byte, 1-Cycle Instructions Dummy Byte is Ignored (wasted bus access) Execute Instruction and Pre-Fetch Next Instruction Execute Instruction and Pre-Fetch Next Instruction Instruction A Instruction B Instruction C Instruction A Turbo uPSD33XX executes instructions A, B, and C in the same amount of time that a standard 8032 executes only instruction A. one machine cycle one machine cycle AI08808 Branch 4 Code Branch 4 Code Branch 4 Code Branch 4 Code Branch 4 Code Branch 4 Code Previous Branch 4 8032 Program MCU Memory on PSD Module Instruction Pre-Fetch Queue (PFQ) 6 Bytes of Instruction Instruction Byte Wait Stall 8 Instruction Byte 8 Current Branch Address Compare Branch Cache (BC) 16 AI08809 Address 16 Address Load on Branch Address Match Branch 3 Code Branch 3 Code Branch 3 Code Branch 3 Code Branch 3 Code Branch 3 Code Previous Branch 3 Branch 2 Code Branch 2 Code Branch 2 Code Branch 2 Code Branch 2 Code Branch 2 Code Previous Branch 2 Branch 1 Code Branch 1 Code Branch 1 Code Branch 1 Code Branch 1 Code Branch 1 Code Previous Branch 1 Address19/231 uPSD33xx Pre-Fetch Queue (PFQ) and Branch Cache (BC) The PFQ is always working to minimize the idle bus time inherent to 8032 MCU architecture, to eliminate wasted memory fetches, and to maximize memory bandwidth to the MCU. The PFQ does this by running asynchronously in relation to the MCU, looking ahead to pre-fetch code from program memory during any idle bus periods. Only necessary bytes will be fetched (no dummy fetches like standard 8032). The PFQ will queue up to six code bytes in advance of execution, which significantly optimizes sequential program performance. However, when program execution becomes non-sequential (program branch), a typical pre-fetch queue will empty itself and reload new code, causing the MCU to stall. The Turbo uPSD33xx diminishes this problem by using a Branch Cache with the PFQ. The BC is a four-way, fully associative cache, meaning that when a program branch occurs, it's branch destination address is compared simultaneously with four recent previous branch destinations stored in the BC. Each of the four cache entries contain up to six bytes of code related to a branch. If there is a hit (a match), then all six code bytes of the matching program branch are transferred immediately and simultaneously from the BC to the PFQ, and execution on that branch continues with minimal delay. This greatly reduces the chance that the MCU will stall from an empty PFQ, and improves performance in embedded control systems where it is quite common to branch and loop in relatively small code localities. By default, the PFQ and BC are enabled after power-up or reset. The 8032 can disable the PFQ and BC at runtime if desired by writing to a specific SFR (BUSCON). The memory in the PSD module operates with variable wait states depending on the value specified in the SFR named BUSCON. For example, a 5V uPSD33xx device operating at a 40MHz crystal frequency requires four memory wait states (equal to four MCU clocks). In this example, once the PFQ has one or more bytes of code, the wait states become transparent and a full 10 MIPS is achieved when the program stream consists of sequential one-byte, one machine-cycle instructions as shown in Figure 7., page 18 (transparent because a machine-cycle is four MCU clocks which equals the memory pre-fetch wait time that is also four MCU clocks). But it is also important to understand PFQ operation on multi-cycle instructions. PFQ Example, Multi-cycle Instructions Let us look at a string of two-byte, two-cycle instructions in Figure 9., page 20. There are three instructions executed sequentially in this example, instructions A, B, and C. Each of the time divisions in the figure is one machine-cycle of four clocks, and there are six phases to reference in this discussion. Each instruction is pre-fetched into the PFQ in advance of execution by the MCU. Prior to Phase 1, the PFQ has pre-fetched the two instruction bytes (A1 and A2) of instruction A. During Phase one, both bytes are loaded into the MCU execution unit. Also in Phase 1, the PFQ is prefetching the first byte (B1) of instruction B from program memory. In Phase 2, the MCU is processing Instruction A internally while the PFQ is pre-fetching the second byte (B2) of Instruction B. In Phase 3, both bytes of instruction B are loaded into the MCU execution unit and the PFQ begins to pre-fetch bytes for the third instruction C. In Phase 4 Instruction B is processed and the prefetching continues, eliminating idle bus cycles and feeding a continuous flow of operands and opcodes to the MCU execution unit. The uPSD33xx MCU instructions are an exact 1/3 scale of all standard 8032 instructions with regard to number of cycles per instruction. Figure 10., page 20 shows the equivalent instruction sequence from the example above on a standard 8032 for comparison. Aggregate Performance The stream of two-byte, two-cycle instructions in Figure 9., page 20, running on a 40MHz, 5V, uPSD33xx will yield 5 MIPs. And we saw the stream of one-byte, one-cycle instructions in Figure 7., page 18, on the same MCU yield 10 MIPs. Effective performance will depend on a number of things: the MCU clock frequency; the mixture of instructions types (bytes and cycles) in the application; the amount of time an empty PFQ stalls the MCU (mix of instruction types and misses on Branch Cache); and the operating voltage. A 5V uPSD33xx device operates with four memory wait states, but a 3.3V device operates with five memory wait states yielding 8 MIPS peak compared to 10 MIPs peak for 5V device. The same number of wait states will apply to both program fetches and to data READ/WRITEs unless otherwise specified in the SFR named BUSCON. In general, a 3X aggregate performance increase is expected over any standard 8032 application running at the same clock frequency.uPSD33xx 20/231 Figure 9. PFQ Operation on Multi-cycle Instructions Figure 10. uPSD33xx Multi-cycle Instructions Compared to Standard 8032 Inst A, Byte 1 Three 2-byte, 2-cycle Instructions on uPSD33XX PFQ MCU Execution Inst A, Byte 2 Inst B, Byte 1 Inst B, Byte 2 Inst C, Byte 1 Inst C, Byte 2 Previous Instruction A1 A2 Process A B1 B2 Process B C1 C2 AI08810 Process C Continue to Pre-Fetch Next Inst 4-clock Macine Cycle Instruction A Instruction B Instruction C Pre-Fetch Inst A Pre-Fetch Inst B Pre-Fetch Inst C Phase 1 Phase 2 Phase 3 Phase 4 Phase 6 Phase 5 A1 A2 Inst A B1 B2 Inst B C1 C2 Inst C Three 2-byte, 2-cycle Instructions, uPSD33XX vs. Standard 8032 uPSD33XX Std 8032 72 Clocks (12 clocks per cycle) 24 Clocks Total (4 clocks per cycle) Byte 1 Byte 2 Process Inst A Byte 1 Byte 2 Process Inst B Byte 1 Byte 2 Process Inst C AI08811 1 Cycle 1 Cycle21/231 uPSD33xx MCU MODULE DISCRIPTION This section provides a detail description of the MCU Module system functions and peripherals, including: ■ 8032 MCU Registers ■ Special Function Registers ■ 8032 Addressing Modes ■ uPSD33xx Instruction Set Summary ■ Dual Data Pointers ■ Debug Unit ■ Interrupt System ■ MCU Clock Generation ■ Power Saving Modes ■ Oscillator and External Components ■ I/O Ports ■ MCU Bus Interface ■ Supervisory Functions ■ Standard 8032 Timer/Counters ■ Serial UART Interfaces ■ IrDA Interface ■ I 2C Interface ■ SPI Interface ■ Analog to Digital Converter ■ Programmable Counter Array (PCA) Note: A full description of the 8032 instruction set may be found in the uPSD33xx Programmers Guide. 8032 MCU REGISTERS The uPSD33xx has the following 8032 MCU core registers, also shown in Figure 11. Figure 11. 8032 MCU Registers Stack Pointer (SP) The SP is an 8-bit register which holds the current location of the top of the stack. It is incremented before a value is pushed onto the stack, and decremented after a value is popped off the stack. The SP is initialized to 07h after reset. This causes the stack to begin at location 08h (top of stack). To avoid overlapping conflicts, the user must initialize the top of the stack to 20h if all four banks of registers R0 - R7 are used, and the user must initialize the top of stack to 30h if all of the 8032 bit memory locations are used. Data Pointer (DPTR) DPTR is a 16-bit register consisting of two 8-bit registers, DPL and DPH. The DPTR Register is used as a base register to create an address for indirect jumps, table look-up operations, and for external data transfers (XDATA). When not used for addressing, the DPTR Register can be used as a general purpose 16-bit data register. Very frequently, the DPTR Register is used to access XDATA using the External Direct addressing mode. The uPSD33xx has a special set of SFR registers (DPTC, DPTM) to control a secondary DPTR Register to speed memory-to-memory XDATA transfers. Having dual DPTR Registers allows rapid switching between source and destination addresses (see details in DUAL DATA POINTERS, page 37). Program Counter (PC) The PC is a 16-bit register consisting of two 8-bit registers, PCL and PCH. This counter indicates the address of the next instruction in program memory to be fetched and executed. A reset forces the PC to location 0000h, which is where the reset jump vector is stored. Accumulator (ACC) This is an 8-bit general purpose register which holds a source operand and receives the result of arithmetic operations. The ACC Register can also be the source or destination of logic and data movement operations. For MUL and DIV instructions, ACC is combined with the B Register to hold 16-bit operands. The ACC is referred to as “A” in the MCU instruction set. B Register (B) The B Register is a general purpose 8-bit register for temporary data storage and also used as a 16- bit register when concatenated with the ACC Register for use with MUL and DIV instructions. AI06636 Accumulator B Register Stack Pointer Program Counter Program Status Word General Purpose Register (Bank0-3) Data Pointer Register PCH DPTR(DPH) A B SP PCL PSW R0-R7 DPTR(DPL)uPSD33xx 22/231 General Purpose Registers (R0 - R7) There are four banks of eight general purpose 8- bit registers (R0 - R7), but only one bank of eight registers is active at any given time depending on the setting in the PSW word (described next). R0 - R7 are generally used to assist in manipulating values and moving data from one memory location to another. These register banks physically reside in the first 32 locations of 8032 internal DATA23/231 uPSD33xx SPECIAL FUNCTION REGISTERS (SFR) A group of registers designated as Special Function Register (SFR) is shown in Table 5., page 24. SFRs control the operating modes of the MCU core and also control the peripheral interfaces and I/O pins on the MCU Module. The SFRs can be accessed only by using the Direct Addressing method within the address range from 80h to FFh of internal 8032 SRAM. Sixteen addresses in SFR address space are both byte- and bit-addressable. The bit-addressable SFRs are noted in Table 5. 86 of a possible 128 SFR addresses are occupied. The remaining unoccupied SFR addresses (designated as “RESERVED” in Table 5) should not be written. Reading unoccupied locations will return an undefined value. Note: There is a separate set of control registers for the PSD Module, designated as csiop, and they are described in the PSD MODULE, page 133. The I/O pins, PLD, and other functions on the PSD Module are NOT controlled by SFRs. SFRs are categorized as follows: ■ MCU core registers: IP, A, B, PSW, SP, DPTL, DPTH, DPTC, DPTM ■ MCU Module I/O Port registers: P1, P3, P4, P1SFS0, P1SFS1, P3SFS, P4SFS0, P4SFS1 ■ Standard 8032 Timer registers TCON, TMOD, T2CON, TH0, TH1, TH2, TL0, TL1, TL2, RCAP2L, RCAP2H ■ Standard Serial Interfaces (UART) SCON0, SBUF0, SCON1, SBUF1 ■ Power, clock, and bus timing registers PCON, CCON0, BUSCON ■ Hardware watchdog timer registers WDKEY, WDRST ■ Interrupt system registers IP, IPA, IE, IEA ■ Prog. Counter Array (PCA) control registers PCACL0, PCACH0, PCACON0, PCASTA, PCACL1, PCACH1, PCACON1, CCON2, CCON3 ■ PCA capture/compare and PWM registers CAPCOML0, CAPCOMH0, TCMMODE0, CAPCOML1, CAPCOMH1, TCMMODE2, CAPCOML2, CAPCOMH2, TCMMODE2, CAPCOML3, CAPCOMH3, TCMMODE3, CAPCOML4, CAPCOMH4, TCMMODE4, CAPCOML5, CAPCOMH5, TCMMODE5, PWMF0, PMWF1 ■ SPI interface registers SPICLKD, SPISTAT, SPITDR, SPIRDR, SPICON0, SPICON1 ■ I 2C interface registers S1SETUP, S1CON, S1STA, S1DAT, S1ADR ■ Analog to Digital Converter registers ACON, ADCPS, ADAT0, ADAT1 ■ IrDA interface register IRDACONuPSD33xx 24/231 Table 5. SFR Memory Map with Direct Address and Reset Value SFR Addr (hex) SFR Name Bit Name and Reset Value (hex) Reg. Descr. 7 6 5 4 3 2 10 with Link 80 RESERVED 81 SP SP[7:0] 07 Stack Pointer (SP), page 21 82 DPL DPL[7:0] 00 Data Pointer (DPTR), p age 21 83 DPH DPH[7:0] 00 84 RESERVED 85 DPTC – AT – – – DPSEL[2:0] 00 Table 13., page 37 86 DPTM – – – – MD1[1:0] MD0[1:0] 00 Table 14., page 38 87 PCON SMOD0 SMOD1 – POR RCLK1 TCLK1 PD IDLE 00 Table 24., page 50 88(1) TCON TF1 <8Fh> TR1 <8Eh> TF0 <8Dh> TR0 <8Ch> IE1 <8Bh> IT1 <8Ah> IE0 <89h> IT0 <88h> 00 Table 39., page 70 89 TMOD GATE C/T M1 M0 GATE C/T M1 M0 00 Table 40., page 72 8A TL0 TL0[7:0] 00 Standard Timer SFRs, pag e 69 8B TL1 TL1[7:0] 00 8C TH0 TH0[7:0] 00 8D TH1 TH1[7:0] 00 8E P1SFS0 P1SFS0[7:0] 00 Table 29., page 60 8F P1SFS1 P1SFS1[7:0] 00 Table 30., page 60 90(1) P1 P1.7 <97h> P1.6 <96h> P1.5 <95h> P1.4 <94h> P1.3 <93h> P1.2 <92h> P1.1 <91h> P1.0 <90h> FF Table 25., page 57 91 P3SFS P3SFS[7:0] 00 Table 28., page 60 92 P4SFS0 P4SFS0[7:0] 00 Table 32., page 61 93 P4SFS1 P4SFS1[7:0] 00 Table 33., page 6125/231 uPSD33xx 94 ADCPS – – – – ADCCE ADCPS[2:0] 00 Table 64., page 122 95 ADAT0 ADATA[7:0] 00 Table 65., page 122 96 ADAT1 – – – – – – ADATA[9:8] 00 Table 66., page 122 97 ACON AINTF AINTEN ADEN ADS[2:0] ADST ADSF 00 Table 63., page 121 98(1) SCON0 SM0 <9Fh> SM1 <9Eh> SM2 <9Dh> REN <9Ch> TB8 <9Bh> RB8 <9Ah> TI <99h> RI <9h8> 00 Table 45., page 82 99 SBUF0 SBUF0[7:0] 00 Figure 25., page 79 9A RESERVED 9B RESERVED 9C RESERVED 9D BUSCON EPFQ EBC WRW1 WRW0 RDW1 RDW0 CW1 CW0 EB Table 35., page 63 9E RESERVED 9F RESERVED A0 RESERVED A1 RESERVED A2 PCACL0 PCACL0[7:0] 00 Table 67., page 124 A3 PCACH0 PCACH0[7:0] 00 Table 67., page 124 A4 PCACON0 EN_ALL EN_PCA EOVF1 PCA_IDL – – CLK_SEL[1:0] 00 Table 70., page 129 A5 PCASTA OVF1 INTF5 INTF4 INTF3 OVF0 INTF2 INTF1 INTF0 00 Table 72., page 131 A6 WDTRST WDTRST[7:0] 00 Table 38., page 68 A7 IEA EADC ESPI EPCA ES1 – – EI2C – 00 Table 18., page 44 SFR Addr (hex) SFR Name Bit Name and Reset Value (hex) Reg. Descr. 7 6 5 4 3 2 10 with LinkuPSD33xx 26/231 A8(1) IE EA – ET2 ES0 ET1 EX1 ET0 EX0 00 Table 17., page 43 A9 TCMMODE 0 EINTF E_COMP CAP_PE CAP_NE MATCH TOGGLE PWM[1:0] 00 Table 73., page 132 AA TCMMODE 1 EINTF E_COMP CAP_PE CAP_NE MATCH TOGGLE PWM[1:0] 00 AB TCMMODE 2 EINTF E_COMP CAP_PE CAP_NE MATCH TOGGLE PWM[1:0] 00 AC CAPCOML 0 CAPCOML0[7:0] 00 Table 67., page 124 AD CAPCOMH 0 CAPCOMH0[7:0] 00 AE WDTKEY WDTKEY[7:0] 55 Table 37., page 68 AF CAPCOML 1 CAPCOML1[7:0] 00 Table 67., page 124 B0(1) P3 P3.7 P3.6 P3.5 P3.4 P3.3 P3.2 P3.1 P3.0 FF Table 26., page 58 B1 CAPCOMH 1 CAPCOMH1[7:0] 00 Table 67., page 124 B2 CAPCOML 2 CAPCOML2[7:0] 00 B3 CAPCOMH 2 CAPCOMH2[7:0] 00 B4 PWMF0 PWMF0[7:0] 00 B5 RESERVED B6 RESERVED B7 IPA PADC PSPI PPCA PS1 – – PI2C – 00 Table 20., page 45 B8(1) IP – – PT2 PS0 PT1 PX1 PT0 PX0 00 Table 19., page 44 B9 RESERVED BA PCACL1 PCACL1[7:0] 00 Table 67., page BB PCACH1 PCACH1[7:0] 00 124 BC Table 2671 page 12027/231 uPSD33xx BD TCMMODE 3 EINTF E_COMP CAP_PE CAP_NE MATCH TOGGLE PWM[1:0] 00 Table 73., page 132 BE TCMMODE 4 EINTF E_COMP CAP_PE CAP_NE MATCH TOGGLE PWM[1:0] 00 BF TCMMODE 5 EINTF E_COMP CAP_PE CAP_NE MATCH TOGGLE PWM[1:0] 00 C0(1) P4 P4.7 P4.6 P4.5 P4.4 P4.3 P4.2 P4.1 P4.0 FF Table 27., page 58 C1 CAPCOML 3 CAPCOML3[7:0] 00 Table 67., page 124 C2 CAPCOMH 3 CAPCOMH3[7:0] 00 C3 CAPCOML 4 CAPCOML4[7:0] 00 C4 CAPCOMH 4 CAPCOMH4[7:0] 00 C5 CAPCOML 5 CAPCOML5[7:0] 00 C6 CAPCOMH 5 CAPCOMH5[7:0] 00 C7 PWMF1 PWMF1[7:0] 00 C8(1) T2CON TF2 EXF2 RCLK TCLK EXEN2 TR2 C/T2 CP/ RL2 00 Table 41., page 75 C9 RESERVED CA RCAP2L RCAP2L[7:0] 00 Standard Timer SFRs, pag e 69 CB RCAP2H RCAP2H[7:0] 00 CC TL2 TL2[7:0] 00 CD TH2 TH2[7:0] 00 CE IRDACON – IRDA_EN BIT_PULS CDIV4 CDIV3 CDIV2 CDIV1 CDIV0 0F Table 48., page 93 D0(1) PSW CY AC F0 RS[1:0] OV – P 00 Program Status Word (PSW), pa ge 22 D1 RESERVED D2 SPICLKD SPICLKD[5:0] – – 04 Table 61., page 118 D3 SPISTAT – – – BUSY TEISF RORISF TISF RISF 02 Table 62., page 119 SFR Addr (hex) SFR Name Bit Name and Reset Value (hex) Reg. Descr. 7 6 5 4 3 2 10 with LinkuPSD33xx 28/231 D4 SPITDR SPITDR[7:0] 00 Table 62., page D5 SPIRDR SPIRDR[7:0] 00 119 D6 SPICON0 – TE RE SPIEN SSEL FLSB SPO – 00 Table 59., page 117 D7 SPICON1 – – – – TEIE RORIE TIE RIE 00 Table 60., page 118 D8(1) SCON1 SM0 SM2
REN TB8 RB8 TI RI 00 Table 46., page 83 D9 SBUF1 SBUF1[7:0] 00 Figure 25., page 79 DA RESERVED DB S1SETUP SS_EN SMPL_SET[6:0] 00 Table 55., page 105 DC S1CON CR2 EN1 STA STO ADDR AA CR1 CR0 00 Table 50., page 100 DD S1STA GC STOP INTR TX_MD B_BUSY B_LOST ACK_R SLV 00 Table 52., page 103 DE S1DAT S1DAT[7:0] 00 Table 53., page 104 DF S1ADR S1ADR[7:0] 00 Table 54., page 104 E0(1) A A[7:0] 00 Accumulat or (ACC), pa ge 21 E1 to EF RESERVED F0(1) B B[7:0] 00 B Register (B), page 21 F1 RESERVED F2 RESERVED F3 RESERVED F4 RESERVED F5 RESERVED F6 RESERVED SFR Addr (hex) SFR Name Bit Name and Reset Value (hex) Reg. Descr. 7 6 5 4 3 2 10 with Link29/231 uPSD33xx Note: 1. This SFR can be addressed by individual bits (Bit Address mode) or addressed by the entire byte (Direct Address mode). F7 RESERVED F8 RESERVED F9 CCON0 – – – DBGCE CPU_AR CPUPS[2:0] 10 Table 21., page 47 FA RESERVED FB CCON2 – – – PCA0CE PCA0PS[3:0] 10 Table 68., page 125 FC CCON3 – – – PCA1CE PCA1PS[3:0] 10 Table 69., page 125 FD RESERVED FE RESERVED FF RESERVED SFR Addr (hex) SFR Name Bit Name and Reset Value (hex) Reg. Descr. 7 6 5 4 3 2 10 with LinkuPSD33xx 30/231 8032 ADDRESSING MODES The 8032 MCU uses 11 different addressing modes listed below: ■ Register ■ Direct ■ Register Indirect ■ Immediate ■ External Direct ■ External Indirect ■ Indexed ■ Relative ■ Absolute ■ Long ■ Bit Register Addressing This mode uses the contents of one of the registers R0 - R7 (selected by the last three bits in the instruction opcode) as the operand source or destination. This mode is very efficient since an additional instruction byte is not needed to identify the operand. For example: Direct Addressing This mode uses an 8-bit address, which is contained in the second byte of the instruction, to directly address an operand which resides in either 8032 DATA SRAM (internal address range 00h- 07Fh) or resides in 8032 SFR (internal address range 80h-FFh). This mode is quite fast since the range limit is 256 bytes of internal 8032 SRAM. For example: Register Indirect Addressing This mode uses an 8-bit address contained in either Register R0 or R1 to indirectly address an operand which resides in 8032 IDATA SRAM (internal address range 80h-FFh). Although 8032 SFR registers also occupy the same physical address range as IDATA, SFRs will not be accessed by Register Indirect mode. SFRs may only be accesses using Direct address mode. For example: Immediate Addressing This mode uses 8-bits of data (a constant) contained in the second byte of the instruction, and stores it into the memory location or register indicated by the first byte of the instruction. Thus, the data is immediately available within the instruction. This mode is commonly used to initialize registers and SFRs or to perform mask operations. There is also a 16-bit version of this mode for loading the DPTR Register. In this case, the two bytes following the instruction byte contain the 16-bit value. For example: External Direct Addressing This mode will access external memory (XDATA) by using the 16-bit address stored in the DPTR Register. There are only two instructions using this mode and both use the accumulator to either receive a byte from external memory addressed by DPTR or to send a byte from the accumulator to the address in DPTR. The uPSD33xx has a special feature to alternate the contents (source and destination) of DPTR rapidly to implement very efficient memory-to-memory transfers. For example: Note: See details in DUAL DATA POINTERS, page 37. External Indirect Addressing This mode will access external memory (XDATA) by using the 8-bit address stored in either Register R0 or R1. This is the fastest way to access XDATA (least bus cycles), but because only 8-bits are available for address, this mode limits XDATA to a size of only 256 bytes (the traditional Port 2 of the 8032 MCU is not available in the uPSD33xx, so it is not possible to write the upper address byte). This mode is not supported by uPSD33xx. For example: MOV A, R7 ; Move contents of R7 to accumulator MOV A, 40h ; Move contents of DATA SRAM ; at location 40h into the accumulator MOV A, @R0 ; Move into the accumulator the ; contents of IDATA SRAM that is ; pointed to by the address ; contained in R0. MOV A, 40# ; Move the constant, 40h, into ; the accumulator MOV DPTR, 1234# ; Move the constant, 1234h, into ; DPTR MOVX A, @DPTR ; Move contents of accumulator to ; XDATA at address contained in ; DPTR MOVX @DPTR, A ; Move XDATA to accumulator MOVX @R0,A ; Move into the accumulator the ; XDATA that is pointed to by ; the address contained in R0.31/231 uPSD33xx Indexed Addressing This mode is used for the MOVC instruction which allows the 8032 to read a constant from program memory (not data memory). MOVC is often used to read look-up tables that are embedded in program memory. The final address produced by this mode is the result of adding either the 16-bit PC or DPTR value to the contents of the accumulator. The value in the accumulator is referred to as an index. The data fetched from the final location in program memory is stored into the accumulator, overwriting the index value that was previously stored there. For example: Relative Addressing This mode will add the two’s-compliment number stored in the second byte of the instruction to the program counter for short jumps within +128 or – 127 addresses relative to the program counter. This is commonly used for looping and is very efficient since no additional bus cycle is needed to fetch the jump destination address. For example: Absolute Addressing This mode will append the 5 high-order bits of the address of the next instruction to the 11 low-order bits of an ACALL or AJUMP instruction to produce a 16-bit jump address. The jump will be within the same 2K byte page of program memory as the first byte of the following instruction. For example: Long Addressing This mode will use the 16-bits contained in the two bytes following the instruction byte as a jump destination address for LCALL and LJMP instructions. For example: Bit Addressing This mode allows setting or clearing an individual bit without disturbing the other bits within an 8-bit value of internal SRAM. Bit Addressing is only available for certain locations in 8032 DATA and SFR memory. Valid locations are DATA addresses 20h - 2Fh and for SFR addresses whose base address ends with 0h or 8h. (Example: The SFR, IE, has a base address of A8h, so each of the eight bits in IE can be addressed individually at address A8h, A9h, ...up to AFh.) For example: MOVC A, @A+DPTR; Move code byte relative to ; DPTR into accumulator MOVC A, @A+PC ; Move code byte relative to PC ; into accumulator SJMP 34h ; Jump 34h bytes ahead (in program ; memory) of the address at which ; the SJMP instruction is stored. If ; SJMP is at 1000h, program ; execution jumps to 1034h. AJMP 0500h ; If next instruction is located at ; address 4000h, the resulting jump ; will be made to 4500h. LJMP 0500h ; Unconditionally jump to address ; 0500h in program memory SETB AFh ; Set the individual EA bit (Enable All ; Interrupts) inside the SFR Register, ; IE. uPSD33xx 32/231 uPSD33xx INSTRUCTION SET SUMMARY Tables 6 through 11 list all of the instructions supported by the uPSD33xx, including the number of bytes and number of machine cycles required to implement each instruction. This is the standard 8051 instruction set. The meaning of “machine cycles” is how many 8032 MCU core machine cycles are required to execute the instruction. The “native” duration of all machine cycles is set by the memory wait state settings in the SFR, BUSCON, and the MCU clock divider selections in the SFR, CCON0 (i.e. a machine cycle is typically set to 4 MCU clocks for a 5V uPSD33xx). However, an individual machine cycle may grow in duration when either of two things happen: 1. a stall is imposed while loading the 8032 PreFetch Queue (PFQ); or 2. the occurrence of a cache miss in the Branch Cache (BC) during a branch in program execution flow. See 8032 MCU CORE PERFORMANCE ENHANCEMENTS, page 17 or more details. But generally speaking, during typical program execution, the PFQ is not empty and the BC has no misses, producing very good performance without extending the duration of any machine cycles. The uPSD33xx Programmers Guide describes each instruction operation in detail. Table 6. Arithmetic Instruction Set Note: 1. All mnemonics copyrighted ©Intel Corporation 1980. Mnemonic(1) and Use Description Length/Cycles ADD A, Rn Add register to ACC 1 byte/1 cycle ADD A, Direct Add direct byte to ACC 2 byte/1 cycle ADD A, @Ri Add indirect SRAM to ACC 1 byte/1 cycle ADD A, #data Add immediate data to ACC 2 byte/1 cycle ADDC A, Rn Add register to ACC with carry 1 byte/1 cycle ADDC A, direct Add direct byte to ACC with carry 2 byte/1 cycle ADDC A, @Ri Add indirect SRAM to ACC with carry 1 byte/1 cycle ADDC A, #data Add immediate data to ACC with carry 2 byte/1 cycle SUBB A, Rn Subtract register from ACC with borrow 1 byte/1 cycle SUBB A, direct Subtract direct byte from ACC with borrow 2 byte/1 cycle SUBB A, @Ri Subtract indirect SRAM from ACC with borrow 1 byte/1 cycle SUBB A, #data Subtract immediate data from ACC with borrow 2 byte/1 cycle INC A Increment A 1 byte/1 cycle INC Rn Increment register 1 byte/1 cycle INC direct Increment direct byte 2 byte/1 cycle INC @Ri Increment indirect SRAM 1 byte/1 cycle DEC A Decrement ACC 1 byte/1 cycle DEC Rn Decrement register 1 byte/1 cycle DEC direct Decrement direct byte 2 byte/1 cycle DEC @Ri Decrement indirect SRAM 1 byte/1 cycle INC DPTR Increment Data Pointer 1 byte/2 cycle MUL AB Multiply ACC and B 1 byte/4 cycle DIV AB Divide ACC by B 1 byte/4 cycle DA A Decimal adjust ACC 1 byte/1 cycle33/231 uPSD33xx Table 7. Logical Instruction Set Note: 1. All mnemonics copyrighted ©Intel Corporation 1980. Mnemonic(1) and Use Description Length/Cycles ANL A, Rn AND register to ACC 1 byte/1 cycle ANL A, direct AND direct byte to ACC 2 byte/1 cycle ANL A, @Ri AND indirect SRAM to ACC 1 byte/1 cycle ANL A, #data AND immediate data to ACC 2 byte/1 cycle ANL direct, A AND ACC to direct byte 2 byte/1 cycle ANL direct, #data AND immediate data to direct byte 3 byte/2 cycle ORL A, Rn OR register to ACC 1 byte/1 cycle ORL A, direct OR direct byte to ACC 2 byte/1 cycle ORL A, @Ri OR indirect SRAM to ACC 1 byte/1 cycle ORL A, #data OR immediate data to ACC 2 byte/1 cycle ORL direct, A OR ACC to direct byte 2 byte/1 cycle ORL direct, #data OR immediate data to direct byte 3 byte/2 cycle SWAP A Swap nibbles within the ACC 1 byte/1 cycle XRL A, Rn Exclusive-OR register to ACC 1 byte/1 cycle XRL A, direct Exclusive-OR direct byte to ACC 2 byte/1 cycle XRL A, @Ri Exclusive-OR indirect SRAM to ACC 1 byte/1 cycle XRL A, #data Exclusive-OR immediate data to ACC 2 byte/1 cycle XRL direct, A Exclusive-OR ACC to direct byte 2 byte/1 cycle XRL direct, #data Exclusive-OR immediate data to direct byte 3 byte/2 cycle CLR A Clear ACC 1 byte/1 cycle CPL A Compliment ACC 1 byte/1 cycle RL A Rotate ACC left 1 byte/1 cycle RLC A Rotate ACC left through the carry 1 byte/1 cycle RR A Rotate ACC right 1 byte/1 cycle RRC A Rotate ACC right through the carry 1 byte/1 cycleuPSD33xx 34/231 Table 8. Data Transfer Instruction Set Note: 1. All mnemonics copyrighted ©Intel Corporation 1980. Mnemonic(1) and Use Description Length/Cycles MOV A, Rn Move register to ACC 1 byte/1 cycle MOV A, direct Move direct byte to ACC 2 byte/1 cycle MOV A, @Ri Move indirect SRAM to ACC 1 byte/1 cycle MOV A, #data Move immediate data to ACC 2 byte/1 cycle MOV Rn, A Move ACC to register 1 byte/1 cycle MOV Rn, direct Move direct byte to register 2 byte/2 cycle MOV Rn, #data Move immediate data to register 2 byte/1 cycle MOV direct, A Move ACC to direct byte 2 byte/1 cycle MOV direct, Rn Move register to direct byte 2 byte/2 cycle MOV direct, direct Move direct byte to direct 3 byte/2 cycle MOV direct, @Ri Move indirect SRAM to direct byte 2 byte/2 cycle MOV direct, #data Move immediate data to direct byte 3 byte/2 cycle MOV @Ri, A Move ACC to indirect SRAM 1 byte/1 cycle MOV @Ri, direct Move direct byte to indirect SRAM 2 byte/2 cycle MOV @Ri, #data Move immediate data to indirect SRAM 2 byte/1 cycle MOV DPTR, #data16 Load Data Pointer with 16-bit constant 3 byte/2 cycle MOVC A, @A+DPTR Move code byte relative to DPTR to ACC 1 byte/2 cycle MOVC A, @A+PC Move code byte relative to PC to ACC 1 byte/2 cycle MOVX A, @Ri Move XDATA (8-bit addr) to ACC 1 byte/2 cycle MOVX A, @DPTR Move XDATA (16-bit addr) to ACC 1 byte/2 cycle MOVX @Ri, A Move ACC to XDATA (8-bit addr) 1 byte/2 cycle MOVX @DPTR, A Move ACC to XDATA (16-bit addr) 1 byte/2 cycle PUSH direct Push direct byte onto stack 2 byte/2 cycle POP direct Pop direct byte from stack 2 byte/2 cycle XCH A, Rn Exchange register with ACC 1 byte/1 cycle XCH A, direct Exchange direct byte with ACC 2 byte/1 cycle XCH A, @Ri Exchange indirect SRAM with ACC 1 byte/1 cycle XCHD A, @Ri Exchange low-order digit indirect SRAM with ACC 1 byte/1 cycle35/231 uPSD33xx Table 9. Boolean Variable Manipulation Instruction Set Note: 1. All mnemonics copyrighted ©Intel Corporation 1980. Mnemonic(1) and Use Description Length/Cycles CLR C Clear carry 1 byte/1 cycle CLR bit Clear direct bit 2 byte/1 cycle SETB C Set carry 1 byte/1 cycle SETB bit Set direct bit 2 byte/1 cycle CPL C Compliment carry 1 byte/1 cycle CPL bit Compliment direct bit 2 byte/1 cycle ANL C, bit AND direct bit to carry 2 byte/2 cycle ANL C, /bit AND compliment of direct bit to carry 2 byte/2 cycle ORL C, bit OR direct bit to carry 2 byte/2 cycle ORL C, /bit OR compliment of direct bit to carry 2 byte/2 cycle MOV C, bit Move direct bit to carry 2 byte/1 cycle MOV bit, C Move carry to direct bit 2 byte/2 cycle JC rel Jump if carry is set 2 byte/2 cycle JNC rel Jump if carry is not set 2 byte/2 cycle JB rel Jump if direct bit is set 3 byte/2 cycle JNB rel Jump if direct bit is not set 3 byte/2 cycle JBC bit, rel Jump if direct bit is set and clear bit 3 byte/2 cycleuPSD33xx 36/231 Table 10. Program Branching Instruction Set Note: 1. All mnemonics copyrighted ©Intel Corporation 1980. Table 11. Miscellaneous Instruction Set Note: 1. All mnemonics copyrighted ©Intel Corporation 1980. Table 12. Notes on Instruction Set and Addressing Modes Mnemonic(1) and Use Description Length/Cycles ACALL addr11 Absolute subroutine call 2 byte/2 cycle LCALL addr16 Long subroutine call 3 byte/2 cycle RET Return from subroutine 1 byte/2 cycle RETI Return from interrupt 1 byte/2 cycle AJMP addr11 Absolute jump 2 byte/2 cycle LJMP addr16 Long jump 3 byte/2 cycle SJMP rel Short jump (relative addr) 2 byte/2 cycle JMP @A+DPTR Jump indirect relative to the DPTR 1 byte/2 cycle JZ rel Jump if ACC is zero 2 byte/2 cycle JNZ rel Jump if ACC is not zero 2 byte/2 cycle CJNE A, direct, rel Compare direct byte to ACC, jump if not equal 3 byte/2 cycle CJNE A, #data, rel Compare immediate to ACC, jump if not equal 3 byte/2 cycle CJNE Rn, #data, rel Compare immediate to register, jump if not equal 3 byte/2 cycle CJNE @Ri, #data, rel Compare immediate to indirect, jump if not equal 3 byte/2 cycle DJNZ Rn, rel Decrement register and jump if not zero 2 byte/2 cycle DJNZ direct, rel Decrement direct byte and jump if not zero 3 byte/2 cycle Mnemonic(1) and Use Description Length/Cycles NOP No Operation 1 byte/1 cycle Rn Register R0 - R7 of the currently selected register bank. direct 8-bit address for internal 8032 DATA SRAM (locations 00h - 7Fh) or SFR registers (locations 80h - FFh). @Ri 8-bit internal 8032 SRAM (locations 00h - FFh) addressed indirectly through contents of R0 or R1. #data 8-bit constant included within the instruction. #data16 16-bit constant included within the instruction. addr16 16-bit destination address used by LCALL and LJMP. addr11 11-bit destination address used by ACALL and AJMP. rel Signed (two-s compliment) 8-bit offset byte. bit Direct addressed bit in internal 8032 DATA SRAM (locations 20h to 2Fh) or in SFR registers (88h, 90h, 98h, A8h, B0, B8h, C0h, C8h, D0h, D8h, E0h, F0h).37/231 uPSD33xx DUAL DATA POINTERS XDATA is accessed by the External Direct addressing mode, which uses a 16-bit address stored in the DPTR Register. Traditional 8032 architecture has only one DPTR Register. This is a burden when transferring data between two XDATA locations because it requires heavy use of the working registers to manipulate the source and destination pointers. However, the uPSD33xx has two data pointers, one for storing a source address and the other for storing a destination address. These pointers can be configured to automatically increment or decrement after each data transfer, further reducing the burden on the 8032 and making this kind of data movement very efficient. Data Pointer Control Register, DPTC (85h) By default, the DPTR Register of the uPSD33xx will behave no different than in a standard 8032 MCU. The DPSEL0 Bit of SFR register DPTC shown in Table 13, selects which one of the two “background” data pointer registers (DPTR0 or DPTR1) will function as the traditional DPTR Register at any given time. After reset, the DPSEL0 Bit is cleared, enabling DPTR0 to function as the DPTR, and firmware may access DPTR0 by reading or writing the traditional DPTR Register at SFR addresses 82h and 83h. When the DPSEL0 bit is set, then the DPTR1 Register functions as DPTR, and firmware may now access DPTR1 through SFR registers at 82h and 83h. The pointer which is not selected by the DPSEL0 bit remains in the background and is not accessible by the 8032. If the DPSEL0 bit is never set, then the uPSD33xx will behave like a traditional 8032 having only one DPTR Register. To further speed XDATA to XDATA transfers, the SFR bit, AT, may be set to automatically toggle the two data pointers, DPTR0 and DPTR1, each time the standard DPTR Register is accessed by a MOVX instruction. This eliminates the need for firmware to manually manipulate the DPSEL0 bit between each data transfer. Detailed description for the SFR register DPTC is shown in Table 13. Table 13. DPTC: Data Pointer Control Register (SFR 85h, reset value 00h) Bit 7 Bit 6 Bit 5 Bit 4 Bit 3 Bit 2 Bit 1 Bit 0 – AT – – – – – DPSEL0 Details Bit Symbol R/W Definition 7 – – Reserved 6 AT R,W 0 = Manually Select Data Pointer 1 = Auto Toggle between DPTR0 and DPTR1 5-1 – – Reserved 0 DPSE0 R,W 0 = DPTR0 Selected for use as DPTR 1 = DPTR1 Selected for use as DPTRuPSD33xx 38/231 Data Pointer Mode Register, DPTM (86h) The two “background” data pointers, DPTR0 and DPTR1, can be configured to automatically increment, decrement, or stay the same after a MOVX instruction accesses the DPTR Register. Only the currently selected pointer will be affected by the increment or decrement. This feature is controlled by the DPTM Register defined in Table 14. The automatic increment or decrement function is effective only for the MOVX instruction, and not MOVC or any other instruction that uses the DTPR Register. Firmware Example. The 8051 assembly code illustrated in Table 15 shows how to transfer a block of data bytes from one XDATA address region to another XDATA address region. Auto-address incrementing and auto-pointer toggling will be used. Table 14. DPTM: Data Pointer Mode Register (SFR 86h, reset value 00h) Table 15. 8051 Assembly Code Example Note: 1. The code loop where the data transfer takes place is only 3 lines of code. Bit 7 Bit 6 Bit 5 Bit 4 Bit 3 Bit 2 Bit 1 Bit 0 – – – – MD11 MD10 MD01 MD00 Details Bit Symbol R/W Definition 7-4 – – Reserved 3-2 MD[11:10] R,W DPTR1 Mode Bits 00: DPTR1 No Change 01: Reserved 10: Auto Increment 11: Auto Decrement 1-0 MD[01:00] R,W DPTR0 Mode Bits 00: DPTR0 No Change 01: Reserved 10: Auto Increment 11: Auto Decrement MOV R7, #COUNT ; initialize size of data block to transfer MOV DPTR, #SOURCE_ADDR ; load XDATA source address base into DPTR0 MOV 85h, #01h ; load DPTC to access DPTR1 pointer MOV DPTR, #DEST_ADDR ; load XDATA destination address base into DPTR1 MOV 85h, #40h ; load DPTC to access DPTR0 pointer and auto toggle MOV 86h, #0Ah ; load DPTM to auto-increment both pointers LOOP: MOVX(1) A, @DPTR ; load XDATA byte from source into ACC. ; after load completes, DPTR0 increments and DPTR ; switches DPTR1 MOVX(1) @DPTR, A ; store XDATA byte from ACC to destination. ; after store completes, DPTR1 increments and DPTR ; switches to DPTR0 DJNZ(1) R7, LOOP ; continue until done MOV 86h, #00 ; disable auto-increment MOV 85h, #00 ; disable auto-toggle, now back to single DPTR mode39/231 uPSD33xx DEBUG UNIT The 8032 MCU Module supports run-time debugging through the JTAG interface. This same JTAG interface is also used for In-System Programming (ISP) and the physical connections are described in the PSD Module section, JTAG ISP and JTAG Debug, page 195. Debugging with a serial interface such as JTAG is a non-intrusive way to gain access to the internal state of the 8032 MCU core and various memories. A traditional external hardware emulator cannot be completely effective on the uPSD33xx because of the Pre-Fetch Queue and Branch Cache. The nature of the PFQ and BC hide the visibility of actual program flow through traditional external bus connections, thus requiring on-chip serial debugging instead. Debugging is supported by Windows PC based software tools used for 8051 code development from 3rd party vendors listed at www.st.com/psm. Debug capabilities include: ■ Halt or Start MCU execution ■ Reset the MCU ■ Single Step ■ 3 Match Breakpoints ■ 1 Range Breakpoint (inside or outside range) ■ Program Tracing ■ Read or Modify MCU core registers, DATA, IDATA, SFR, XDATA, and Code ■ External Debug Event Pin, Input or Output Some key points regarding use of the JTAG Debugger. – The JTAG Debugger can access MCU registers, data memory, and code memory while the MCU is executing at full speed by cycle-stealing. This means “watch windows” may be displayed and periodically updated on the PC during full speed operation. Registers and data content may also be modified during full speed operation. – There is no on-chip storage for Program Trace data, but instead this data is scanned from the uPSD33xx through the JTAG channel at runtime to the PC host for proccessing. As such, full speed program tracing is possible only when the 8032 MCU is operating below approximately one MIPS of performance. Above one MIPS, the program will not run real-time while tracing. One MIPS performance is determined by the combination of choice for MCU clock frequency, and the bit settings in SFR registers BUSCON and CCON0. – Breakpoints can optionally halt the MCU, and/ or assert the external Debug Event pin. – Breakpoint definitions may be qualified with read or write operations, and may also be qualified with an address of code, SFR, DATA, IDATA, or XDATA memories. – Three breakpoints will compare an address, but the fourth breakpoint can compare an address and also data content. Additionally, the fouth breakpoint can be logically combined (AND/OR) with any of the other three breakpoints. – The Debug Event pin can be configured by the PC host to generate an output pulse for external triggering when a break condition is met. The pin can also be configured as an event input to the breakpoint logic, causing a break on the falling-edge of an external event signal. If not used, the Debug Event pin should be pulled up to VCC as described in the section, Debugging the 8032 MCU Module., page 201. – The duration of a pulse, generated when the Event pin configured as an output, is one MCU clock cycle. This is an active-low signal, so the first edge when an event occurs is high-to-low. – The clock to the Watchdog Timer, ADC, and I 2C interface are not stopped by a breakpoint halt. – The Watchdog Timer should be disabled while debugging with JTAG, else a reset will be generated upon a watchdog time-out.uPSD33xx 40/231 INTERRUPT SYSTEM The uPSD33xx has an 11-source, two priority level interrupt structure summarized in Table 16. Firmware may assign each interrupt source either high or low priority by writing to bits in the SFRs named, IP and IPA, shown in Table 16. An interrupt will be serviced as long as an interrupt of equal or higher priority is not already being serviced. If an interrupt of equal or higher priority is being serviced, the new interrupt will wait until it is finished before being serviced. If a lower priority interrupt is being serviced, it will be stopped and the new interrupt is serviced. When the new interrupt is finished, the lower priority interrupt that was stopped will be completed. If new interrupt requests are of the same priority level and are received simultaneously, an internal polling sequence determines which request is selected for service. Thus, within each of the two priority levels, there is a second priority structure determined by the polling sequence. Firmware may individually enable or disable interrupt sources by writing to bits in the SFRs named, IE and IEA, shown in Table 16., page 41. The SFR named IE contains a global disable bit (EA), which can be cleared to disable all 11 interrupts at once, as shown in Table 17., page 43. Figure 13., page 42 illustrates the interrupt priority, polling, and enabling process. Each interrupt source has at least one interrupt flag that indicates whether or not an interrupt is pending. These flags reside in bits of various SFRs shown in Table 16., page 41. All of the interrupt flags are latched into the interrupt control system at the beginning of each MCU machine cycle, and they are polled at the beginning of the following machine cycle. If polling determines one of the flags was set, the interrupt control system automatically generates an LCALL to the user’s Interrupt Service Routine (ISR) firmware stored in program memory at the appropriate vector address. The specific vector address for each of the interrupt sources are listed in Table 16., page 41. However, this LCALL jump may be blocked by any of the following conditions: – An interrupt of equal or higher priority is already in progress – The current machine cycle is not the final cycle in the execution of the instruction in progress – The current instruction involves a write to any of the SFRs: IE, IEA, IP, or IPA – The current instruction is an RETI Note: Interrupt flags are polled based on a sample taken in the previous MCU machine cycle. If an interrupt flag is active in one cycle but is denied serviced due to the conditions above, and then later it is not active when the conditions above are finally satisfied, the previously denied interrupt will not be serviced. This means that active interrupts are not remembered. Every poling cycle is new. Assuming all of the listed conditions are satisfied, the MCU executes the hardware generated LCALL to the appropriate ISR. This LCALL pushes the contents of the PC onto the stack (but it does not save the PSW) and loads the PC with the appropriate interrupt vector address. Program execution then jumps to the ISR at the vector address. Execution precedes in the ISR. It may be necessary for the ISR firmware to clear the pending interrupt flag for some interrupt sources, because not all interrupt flags are automatically cleared by hardware when the ISR is called, as shown in Table 16., page 41. If an interrupt flag is not cleared after servicing the interrupt, an unwanted interrupt will occur upon exiting the ISR. After the interrupt is serviced, the last instruction executed by the ISR is RETI. The RETI informs the MCU that the ISR is no longer in progress and the MCU pops the top two bytes from the stack and loads them into the PC. Execution of the interrupted program continues where it left off. Note: An ISR must end with a RETI instruction, not a RET. An RET will not inform the interrupt control system that the ISR is complete, leaving the MCU to think the ISR is still in progress, making future interrupts impossible.41/231 uPSD33xx Table 16. Interrupt Summary Interrupt Source Polling Priority Vector Addr Flag Bit Name (SFR.bit position) 1 = Intr Pending 0 = No Interrupt Flag Bit AutoCleared by Hardware? Enable Bit Name (SFR.bit position) 1 = Intr Enabled 0 = Intr Disabled Priority Bit Name (SFR.bit position) 1= High Priority 0 = Low Priority Reserved 0 (high) 0063h – – – – External Interrupt INT0 1 0003h IE0 (TCON.1) Edge - Yes Level - No EX0 (IE.0) PX0 (IP.0) Timer 0 Overflow 2 000Bh TF0 (TCON.5) Yes ET0 (IE.1) PT0 (IP.1) External Interrupt INT1 3 0013h IE1 (TCON.3 Edge - Yes Level - No EX1 (IE.2) PX1 (IP.2) Timer 1 Overflow 4 001Bh TF1 (TCON.7) Yes ET1 (IE.3) PT1 (IP.3) UART0 5 0023h RI (SCON0.0) TI (SCON0.1) No ES0 (IE.4) PS0 (IP.4) Timer 2 Overflow or TX2 Pin 6 002Bh TF2 (T2CON.7) EXF2 (T2CON.6) No ET2 (IE.5) PT2 (IP.5) SPI 7 0053h TEISF, RORISF, TISF, RISF (SPISTAT[3:0]) Yes ESPI (IEA.6) PSPI (IPA.6) Reserved 8 0033h – – – – I 2C 9 0043h INTR (S1STA.5) Yes EI2C (IEA.1) PI2C (IPA.1) ADC 10 003Bh AINTF (ACON.7) No EADC (IEA.7) PADC (IPA.7) PCA 11 005Bh OFVx, INTFx (PCASTA[0:7]) No EPCA (IEA.5) PPCA (IPA.5) UART1 12 (low) 004Bh RI (SCON1.0) TI (SCON1.1) No ES1 (IEA.4) PS1 (IPA.4)uPSD33xx 42/231 Figure 13. Enabling and Polling Interrupts Reserved Ext INT0 Ext INT1 Timer 0 UART0 Timer 1 SPI USB Timer 2 High LowInterrupt Polling Sequence Interrupt Sources IE/IEA IP/IPA Priority Global Enable ADC PCA I 2 C UART1 AI0784443/231 uPSD33xx Individual Interrupt Sources External Interrupts Int0 and Int1. External interrupt inputs on pins EXTINT0 and EXTINT1 (pins 3.2 and 3.3) are either edge-triggered or level-triggered, depending on bits IT0 and IT1 in the SFR named TCON. When an external interrupt is generated from an edge-triggered (falling-edge) source, the appropriate flag bit (IE0 or IE1) is automatically cleared by hardware upon entering the ISR. When an external interrupt is generated from a level-triggered (low-level) source, the appropriate flag bit (IE0 or IE1) is NOT automatically cleared by hardware. Timer 0 and 1 Overflow Interrupt. Timer 0 and Timer 1 interrupts are generated by the flag bits TF0 and TF1 when there is an overflow condition in the respective Timer/Counter register (except for Timer 0 in Mode 3). Timer 2 Overflow Interrupt. This interrupt is generated to the MCU by a logical OR of flag bits, TF2 and EXE2. The ISR must read the flag bits to determine the cause of the interrupt. – TF2 is set by an overflow of Timer 2. – EXE2 is generated by the falling edge of a signal on the external pin, T2X (pin P1.1). UART0 and UART1 Interrupt. Each of the UARTs have identical interrupt structure. For each UART, a single interrupt is generated to the MCU by the logical OR of the flag bits, RI (byte received) and TI (byte transmitted). The ISR must read flag bits in the SFR named SCON0 for UART0, or SCON1 for UART1 to determine the cause of the interrupt. SPI Interrupt. The SPI interrupt has four interrupt sources, which are logically ORed together when interrupting the MCU. The ISR must read the flag bits to determine the cause of the interrupt. A flag bit is set for: end of data transmit (TEISF); data receive overrun (RORISF); transmit buffer empty (TISF); or receive buffer full (RISF). I 2C Interrupt. The flag bit INTR is set by a variety of conditions occurring on the I2C interface: received own slave address (ADDR flag); received general call address (GC flag); received STOP condition (STOP flag); or successful transmission or reception of a data byte.The ISR must read the flag bits to determine the cause of the interrupt. ADC Interrupt. The flag bit AINTF is set when an A-to-D conversion has completed. PCA Interrupt. The PCA has eight interrupt sources, which are logically ORed together when interrupting the MCU.The ISR must read the flag bits to determine the cause of the interrupt. – Each of the six TCMs can generate a "match or capture" interrupt on flag bits OFV5..0 respectively. – Each of the two 16-bit counters can generate an overflow interrupt on flag bits INTF1 and INTF0 respectively. Tables 17 through Table 20., page 45 have detailed bit definitions of the interrupt system SFRs. Table 17. IE: Interrupt Enable Register (SFR A8h, reset value 00h) Note: 1. 1 = Enable Interrupt, 0 = Disable Interrupt Bit 7 Bit 6 Bit 5 Bit 4 Bit 3 Bit 2 Bit 1 Bit 0 EA – ET2 ES0 ET1 EX1 ET0 EX0 Details Bit Symbol R/W Function 7 EA R,W Global disable bit. 0 = All interrupts are disabled. 1 = Each interrupt source can be individually enabled or disabled by setting or clearing its enable bit. 6 – R,W Do not modify this bit. It is used by the JTAG debugger for instruction tracing. Always read the bit and write back the same bit value when writing this SFR. 5(1) ET2 R,W Enable Timer 2 Interrupt 4(1) ES0 R,W Enable UART0 Interrupt 3(1) ET1 R,W Enable Timer 1 Interrupt 2(1) EX1 R,W Enable External Interrupt INT1 1(1) ET0 R,W Enable Timer 0 Interrupt 0(1) EX0 R,W Enable External Interrupt INT0uPSD33xx 44/231 Table 18. IEA: Interrupt Enable Addition Register (SFR A7h, reset value 00h) Note: 1. 1 = Enable Interrupt, 0 = Disable Interrupt Table 19. IP: Interrupt Priority Register (SFR B8h, reset value 00h) Note: 1. 1 = Assigns high priority level, 0 = Assigns low priority level Bit 7 Bit 6 Bit 5 Bit 4 Bit 3 Bit 2 Bit 1 Bit 0 EADC ESPI EPCA ES1 – – EI2C – Details Bit Symbol R/W Function 7(1) EADC R,W Enable ADC Interrupt 6(1) ESPI R,W Enable SPI Interrupt 5(1) EPCA R,W Enable Programmable Counter Array Interrupt 4(1) ES1 R,W Enable UART1 Interrupt 3 – – Reserved, do not set to logic '1.' 2 – – Reserved, do not set to logic '1.' 1(1) EI2C R,W Enable I2C Interrupt 0 – – Reserved, do not set to logic '1.' Bit 7 Bit 6 Bit 5 Bit 4 Bit 3 Bit 2 Bit 1 Bit 0 – – PT2 PS0 PT1 PX1 PT0 PX0 Details Bit Symbol R/W Function 7 – – Reserved 6 – – Reserved 5(1) PT2 R,W Timer 2 Interrupt priority level 4(1) PS0 R,W UART0 Interrupt priority level 3(1) PT1 R,W Timer 1 Interrupt priority level 2(1) PX1 R,W External Interrupt INT1 priority level 1(1) PT0 R,W Timer 0 Interrupt priority level 0(1) PX0 R,W External Interrupt INT0 priority level45/231 uPSD33xx Table 20. IPA: Interrupt Priority Addition register (SFR B7h, reset value 00h) Note: 1. 1 = Assigns high priority level, 0 = Assigns low priority level Bit 7 Bit 6 Bit 5 Bit 4 Bit 3 Bit 2 Bit 1 Bit 0 PADC PSPI PPCA PS1 – – PI2C – Details Bit Symbol R/W Function 7(1) PADC R,W ADC Interrupt priority level 6(1) PSPI R,W SPI Interrupt priority level 5(1) PPCA R,W PCA Interrupt level 4(1) PS1 R,W UART1 Interrupt priority level 3 – – Reserved 2 – – Reserved 1(1) PI2C R,W I 2C Interrupt priority level 0 – – ReserveduPSD33xx 46/231 MCU CLOCK GENERATION Internal system clocks generated by the clock generation unit are derived from the signal, XTAL1, shown in Figure 14. XTAL1 has a frequency fOSC, which comes directly from the external crystal or oscillator device. The SFR named CCON0 (Table 21., page 47) controls the clock generation unit. There are two clock signals produced by the clock generation unit: ■ MCU_CLK ■ PERIPH_CLK MCU_CLK This clock drives the 8032 MCU core and the Watchdog Timer (WDT). The frequency of MCU_CLK is equal to fOSC by default, but it can be divided by as much as 2048, shown in Figure 14. The bits CPUPS[2:0] select one of eight different divisors, ranging from 2 to 2048. The new frequency is available immediately after the CPUPS[2:0] bits are written. The final frequency of MCU_CLK is fMCU. MCU_CLK is blocked by either bit, PD or IDL, in the SFR named PCON during MCU Power-down Mode or Idle Mode respectively. MCU_CLK clock can be further divided as required for use in the WDT. See details of the WDT in SUPERVISORY FUNCTIONS, page 65. PERIPH_CLK This clock drives all the uPSD33xx peripherals except the WDT. The Frequency of PERIPH_CLK is always fOSC. Each of the peripherals can independently divide PERIPH_CLK to scale it appropriately for use. PERIPH_CLK runs at all times except when blocked by the PD bit in the SFR named PCON during MCU Power-down Mode. JTAG Interface Clock. The JTAG interface for ISP and for Debugging uses the externally supplied JTAG clock, coming in on pin TCK. This means the JTAG ISP interface is always available, and the JTAG Debug interface is available when enabled, even during MCU Idle mode and Powerdown Mode. However, since the MCU participates in the JTAG debug process, and MCU_CLK is halted during Idle and Power-down Modes, the majority of debug functions are not available during these low power modes. But the JTAG debug interface is capable of executing a reset command while in these low power modes, which will exit back to normal operating mode where all debug commands are available again. The CCON0 SFR contains a bit, DBGCE, which enables the breakpoint comparators inside the JTAG Debug Unit when set. DBGCE is set by default after reset, and firmware may clear this bit at run-time. Disabling these comparators will reduce current consumption on the MCU Module, and it’s recommended to do so if the Debug Unit will not be used (such as in the production version of an end-product). Figure 14. Clock Generation Logic XTAL1 /2 XTAL1 /4 XTAL1 /2048 Q Q Q M U X XTAL1 (default) XTAL1 /8 XTAL1 /16 Q Q XTAL1 /32 XTAL1 /1024 Q Q 0 1 2 3 4 5 6 7 XTAL1 (fOSC) PCON[1]: PD, Power-Down Mode PCON[2:0]: CPUPS[2:0], Clock Pre-Scaler Select PCON[0]: IDL, Idle Mode Clock Divider MCU_CLK (fMCU) (to: 8032, WDT) PERIPH_CLK (fOSC) (to: TIMER0/1/2, UART0/1, PCA0/1, SPI, I2C, ADC) 3 AI0919747/231 uPSD33xx Table 21. CCON0: Clock Control Register (SFR F9h, reset value 10h) Bit 7 Bit 6 Bit 5 Bit 4 Bit 3 Bit 2 Bit 1 Bit 0 – – – DBGCE CPUAR CPUPS[2:0] Details Bit Symbol R/W Definition 7 – – Reserved 6 – – Reserved 5 – – Reserved 4 DBGCE R,W Debug Unit Breakpoint Comparator Enable 0 = JTAG Debug Unit comparators are disabled 1 = JTAG Debug Unit comparators are enabled (Default condition after reset) 3 CPUAR R,W Automatic MCU Clock Recovery 0 = There is no change of CPUPS[2:0] when an interrupt occurs. 1 = Contents of CPUPS[2:0] automatically become 000b whenever any interrupt occurs. 2:0 CPUPS R,W MCUCLK Pre-Scaler 000b: fMCU = fOSC (Default after reset) 001b: fMCU = fOSC/2 010b: fMCU = fOSC/4 011b: fMCU = fOSC/8 100b: fMCU = fOSC/16 101b: fMCU = fOSC/32 110b: fMCU = fOSC/1024 111b: fMCU = fOSC/2048uPSD33xx 48/231 POWER SAVING MODES The uPSD33xx is a combination of two die, or modules, each module having it’s own current consumption characteristics. This section describes reduced power modes for the MCU Module. See the section, Power Management, page 137 for reduced power modes of the PSD Module. Total current consumption for the combined modules is determined in the DC specifications at the end of this document. The MCU Module has three software-selectable modes of reduced power operation. ■ Idle Mode ■ Power-down Mode ■ Reduced Frequency Mode Idle Mode Idle Mode will halt the 8032 MCU core while leaving the MCU peripherals active (Idle Mode blocks MCU_CLK only). For lowest current consumption in this mode, it is recommended to disable all unused peripherals, before entering Idle mode (such as the ADC and the Debug Unit breakpoint comparators). The following functions remain fully active during Idle Mode (except if disabled by SFR settings). ■ External Interrupts INT0 and INT1 ■ Timer 0, Timer 1 and Timer 2 ■ Supervisor reset from: LVD, JTAG Debug, External RESET_IN_, but not the WTD ■ ADC ■ I 2C Interface ■ UART0 and UART1 Interfaces ■ SPI Interface ■ Programmable Counter Array An interrupt generated by any of these peripherals, or a reset generated from the supervisor, will cause Idle Mode to exit and the 8032 MCU will resume normal operation. The output state on I/O pins of MCU ports 1, 3, and 4 remain unchanged during Idle Mode. To enter Idle Mode, the 8032 MCU executes an instruction to set the IDL bit in the SFR named PCON, shown in Table 24., page 50. This is the last instruction executed in normal operating mode before Idle Mode is activated. Once in Idle Mode, the MCU status is entirely preserved, and there are no changes to: SP, PSW, PC, ACC, SFRs, DATA, IDATA, or XDATA. The following are factors related to Idle Mode exit: – Activation of any enabled interrupt will cause the IDL bit to be cleared by hardware, terminating Idle Mode. The interrupt is serviced, and following the Return from Interrupt instruction (RETI), the next instruction to be executed will be the one which follows the instruction that set the IDL bit in the PCON SFR. – After a reset from the supervisor, the IDL bit is cleared, Idle Mode is terminated, and the MCU restarts after three MCU machine cycles. Power-down Mode Power-down Mode will halt the 8032 core and all MCU peripherals (Power-down Mode blocks MCU_CLK and PERIPH_CLK). This is the lowest power state for the MCU Module. When the PSD Module is also placed in Power-down mode, the lowest total current consumption for the combined die is achieved for the uPSD33xx. See Power Management, page 137 in the PSD Module section for details on how to also place the PSD Module in Power-down mode. The sequence of 8032 instructions is important when placing both modules into Power-down Mode. The instruction that sets the PD Bit in the SFR named PCON (Table 24., page 50) is the last instruction executed prior to the MCU Module going into Power-down Mode. Once in Power-down Mode, the on-chip oscillator circuitry and all clocks are stopped. The SFRs, DATA, IDATA, and XDATA are preserved. Power-down Mode is terminated only by a reset from the supervisor, originating from the RESET_IN_ pin, the Low-Voltage Detect circuit (LVD), or a JTAG Debug reset command. Since the clock to the WTD is not active during Powerdown mode, it is not possible for the supervisor to generate a WDT reset. Table 22., page 49 summarizes the status of I/O pins and peripherals during Idle and Power-down Modes on the MCU Module. Table 23., page 49 shows the state of 8032 MCU address, data, and control signals during these modes. Reduced Frequency Mode The 8032 MCU consumes less current when operating at a lower clock frequency. The MCU can reduce it’s own clock frequency at run-time by writing to three bits, CPUPS[2:0], in the SFR named CCON0 described in Table 21., page 47. These bits effectively divide the clock frequency (fOSC) coming in from the external crystal or oscillator device. The clock division range is from 1/2 to 1/2048, and the resulting frequency is fMCU. This MCU clock division does not affect any of the peripherals, except for the WTD. The clock driving the WTD is the same clock driving the 8032 MCU core as shown in Figure 14., page 46.49/231 uPSD33xx MCU firmware may reduce the MCU clock frequency at run-time to consume less current when performing tasks that are not time critical, and then restore full clock frequency as required to perform urgent tasks. Returning to full clock frequency is done automatically upon an MCU interrupt, if the CPUAR Bit in the SFR named CCON0 is set (the interrupt will force CPUPS[2:0] = 000). This is an excellent way to conserve power using a low frequency clock until an event occurs that requires full performance. See Table 21., page 47 for details on CPUAR. See the DC Specifications at the end of this document to estimate current consumption based on the MCU clock frequency. Note: Some of the bits in the PCON SFR shown in Table 24., page 50 are not related to power control. Table 22. MCU Module Port and Peripheral Status during Reduced Power Modes Note: 1. The Watchdog Timer is not active during Idle Mode. Other supervisor functions are active: LVD, external reset, JTAG Debug reset Table 23. State of 8032 MCU Bus Signals during Power-down and Idle Modes Mode Ports 1, 3, 4 PCA SPI I 2C ADC SUPERVISOR UART0, UART1 TIMER 0,1,2 EXT INT0, 1 Idle Maintain Data Active Active Active Active Active(1) Active Active Active Power-down Maintain Data Disabled Disabled Disabled Disabled Disabled Disabled Disabled Disabled Mode ALE PSEN_ RD_ WR_ AD0-7 A8-15 Idle 0 1 1 1 FFh FFh Power-down 0 1 1 1 FFh FFhuPSD33xx 50/231 Table 24. PCON: Power Control Register (SFR 87h, reset value 00h) Bit 7 Bit 6 Bit 5 Bit 4 Bit 3 Bit 2 Bit 1 Bit 0 SMOD0 SMOD1 – POR RCLK1 TCLK1 PD IDL Details Bit Symbol R/W Function 7 SMOD0 R,W Baud Rate Double Bit (UART0) 0 = No Doubling 1 = Doubling (See UART Baud Rates, page 84 for details.) 6 SMOD1 R,W Baud Rate Double Bit for 2nd UART (UART1) 0 = No Doubling 1 = Doubling (See UART Baud Rates, page 84 for details.) 5 – – Reserved 4 POR R,W Only a power-on reset sets this bit (cold reset). Warm reset will not set this bit. '0,' Cleared to zero with firmware '1,' Is set only by a power-on reset generated by Supervisory circuit (see Power-up Reset, page 66 for details). 3 RCLK1 R,W Received Clock Flag (UART1) (See Table 41., page 75 for flag description.) 2 TCLK1 R,W Transmit Clock Flag (UART1) (See Table 41., page 75 for flag description) 1 PD R,W Activate Power-down Mode 0 = Not in Power-down Mode 1 = Enter Power-down Mode 0 IDL R,W Activate Idle Mode 0 = Not in Idle Mode 1 = Enter Idle Mode51/231 uPSD33xx OSCILLATOR AND EXTERNAL COMPONENTS The oscillator circuit of uPSD33xx devices is a single stage, inverting amplifier in a Pierce oscillator configuration. The internal circuitry between pins XTAL1 and XTAL2 is basically an inverter biased to the transfer point. Either an external quartz crystal or ceramic resonator can be used as the feedback element to complete the oscillator circuit. Both are operated in parallel resonance. Ceramic resonators are lower cost, but typically have a wider frequency tolerance than quartz crystals. Alternatively, an external clock source from an oscillator or other active device may drive the uPSD33xx oscillator circuit input directly, instead of using a crystal or resonator. The minimum frequency of the quartz crystal, ceramic resonator, or external clock source is 1MHz if the I2C interface is not used. The minimum is 8MHz if I2C is used. The maximum is 40MHz in all cases. This frequency is fOSC, which can be divided internally as described in MCU CLOCK GENERATION, page 46. The pin XTAL1 is the high gain amplifier input, and XTAL2 is the output. To drive the uPSD33xx device externally from an oscillator or other active device, XTAL1 is driven and XTAL2 is left opencircuit. This external source should drive a logic low at the voltage level of 0.3 VCC or below, and logic high at 0.7V VCC or above, up to 5.5V VCC. The XTAL1 input is 5V tolerant. Most of the quartz crystals in the range of 25MHz to 40MHz operate in the third overtone frequency mode. An external LC tank circuit at the XTAL2 output of the oscillator circuit is needed to achieve the third overtone frequency, as shown in Figure 15., page 52. Without this LC circuit, the crystal will oscillate at a fundamental frequency mode that is about 1/3 of the desired overtone frequency. Note: In Figure 15., page 52 crystals which are specified to operate in fundamental mode (not overtone mode) do not need the LC circuit components. Since quartz crystals and ceramic resonators have their own characteristics based on their manufacturer, it is wise to also consult the manufacturer’s recommended values for external components.uPSD33xx 52/231 Figure 15. Oscillator and Clock Connections Crystal or Resonator Usage Direct Drive XTAL1 (in) XTAL1 (in) XTAL2 (out) XTAL2 (out) C1 C2 XTAL (fOSC) L1 C3 External Ocsillator or No Connect Active Clock Source XTAL (fOSC) C1 = C2 C3 L1 Ceramic Resonator 40 - 50pF None Crystal, fundamental mode (3-40MHz) 15-33pF None None None Crystal, overtone mode (25-40MHz) 20pF 10nF 2.2µH AI0919853/231 uPSD33xx I/O PORTS OF MCU MODULE The MCU Module has three 8-bit I/O ports: Port 1, Port 3, and Port 4. The PSD Module has four other I/O ports: Port A, B, C, and D. This section describes only the I/O ports on the MCU Module. I/O ports will function as bi-directional General Purpose I/O (GPIO), but the port pins can have alternate functions assigned at run-time by writing to specific SFRs. The default operating mode (during and after reset) for all three ports is GPIO input mode. Port pins that have no external connection will not float because each pin has an internal weak pull-up (~150K ohms) to VCC. I/O ports 3 and 4 are 5V tolerant, meaning they can be driven/pulled externally up to 5.5V without damage. The pins on Port 4 have a higher current capability than the pins on Ports 1 and 3. Three additional MCU ports (only on 80-pin uPSD33xx devices) are dedicated to bring out the 8032 MCU address, data, and control signals to external pins. One port, named MCUA[11:8], contains four MCU address signal outputs. Another port, named MCUAD[7:0], has eight multiplexed address/data bidirectional signals. The third port has MCU bus control outputs: read, write, program fetch, and address latch. These ports are typically used to connect external parallel peripherals and memory devices, but they may NOT be used as GPIO. Notice that only four of the eight upper address signals come out to pins on the port MCUA[11:8]. If additional high-order address signals are required on external pins (MCU addresses A[15:12]), then these address signals can be brought out as needed to PLD output pins or to the Address Out mode pins on PSD Module ports. See PSD Module section, “Latched Address Output Mode, page 177 for details. Figure 16., page 55 represents the flexibility of pin function routing controlled by the SFRs. Each of the 24 pins on three ports, P1, P3, and P4, may be individually routed on a pin-by-pin basis to a desired function. MCU Port Operating Modes MCU port pins can operate as GPIO or as alternate functions (see Figure 17., page 56 through Figure 19., page 57). Depending on the selected pin function, a particular pin operating mode will automatically be used: ■ GPIO - Quasi-bidirectional mode ■ UART0, UART1 - Quasi-bidirectional mode ■ SPI - Quasi-bidirectional mode ■ I2C - Open drain mode ■ ADC - Analog input mode ■ PCA output - Push-Pull mode ■ PCA input - Input only (Quasi-bidirectional) ■ Timer 0,1,2 - Input only (Quasi-bidirectional) GPIO Function. Ports in GPIO mode operate as quasi-bidirectional pins, consistent with standard 8051 architecture. GPIO pins are individually controlled by three SFRs: ■ SFR, P1 (Table 25., page 57) ■ SFR, P3 (Table 26., page 58) ■ SFR, P4 (Table 27., page 58) These SFRs can be accessed using the Bit Addressing mode, an efficient way to control individual port pins. GPIO Output. Simply stated, when a logic '0' is written to a bit in any of these port SFRs while in GPIO mode, the corresponding port pin will enable a low-side driver, which pulls the pin to ground, and at the same time releases the high-side driver and pull-ups, resulting in a logic'0' output. When a logic '1' is written to the SFR, the low-side driver is released, the high-side driver is enabled for just one MCU_CLK period to rapidly make the 0-to1 transition on the pin, while weak active pull-ups (total ~150K ohms) to VCC are enabled. This structure is consistent with standard 8051 architecture. The high side driver is momentarily enabled only for 0-to-1 transitions, which is implemented with the delay function at the latch output as pictured in Figure 17., page 56 through Figure 19., page 57. After the high-side driver is disabled, the two weak pull-ups remain enabled resulting in a logic '1' output at the pin, sourcing IOH uA to an external device. Optionally, an external pull-up resistor can be added if additional source current is needed while outputting a logic '1.'uPSD33xx 54/231 GPIO Input. To use a GPIO port pin as an input, the low-side driver to ground must be disabled, or else the true logic level being driven on the pin by an external device will be masked (always reads logic '0'). So to make a port pin “input ready”, the corresponding bit in the SFR must have been set to a logic '1' prior to reading that SFR bit as an input. A reset condition forces SFRs P1, P3, and P4 to FFh, thus all three ports are input ready after reset. When a pin is used as an input, the stronger pullup “A” maintains a solid logic '1' until an external device drives the input pin low. At this time, pull-up “A” is automatically disabled, and only pull-up “B” will source the external device IIH uA, consistent with standard 8051 architecture. GPIO Bi-Directional. It is possible to operate individual port pins in bi-directional mode. For an output, firmware would simply write the corresponding SFR bit to logic '1' or '0' as needed. But before using the pin as an input, firmware must first ensure that a logic '1' was the last value written to the corresponding SFR bit prior to reading that SFR bit as an input. GPIO Current Capability. A GPIO pin on Port 4 can sink twice as much current than a pin on either Port 1 or Port 3 when the low-side driver is outputting a logic '0' (IOL). See the DC specifications at the end of this document for full details. Reading Port Pin vs. Reading Port Latch. When firmware reads the GPIO ports, sometimes the actual port pin is sampled in hardware, and sometimes the port SFR latch is read and not the actual pin, depending on the type of MCU instruction used. These two data paths are shown in Figure 17., page 56 through Figure 19., page 57. SFR latches are read (and not the pins) only when the read is part of a read-modify-write instruction and the write destination is a bit or bits in a port SFR. These instructions are: ANL, ORL, XRL, JBC, CPL, INC, DEC, DJNZ, MOV, CLR, and SETB. All other types of reads to port SFRs will read the actual pin logic level and not the port latch. This is consistent with 8051 architecture.55/231 uPSD33xx Figure 16. MCU Module Port Pin Function Routing 8 P3 P1 P4 M C U A D M C U A GPIO (8) UART0 (2) TIMER0/1 (4) I 2C (2) GPIO (8) GPIO (8) TIMER2 (2) UART1 (2) SPI (4) ADC (8) PCA (8) 8032 MCU CORE Low Addr & Data[7:0] 8 Available on PSD Hi Address [15:12] Hi Address [11:8] 4 Module Pins MCU Module 4 On 80-pin Devices Only Ports C N T L RD, WR, PSEN, ALE 4 SFR 8 8 SFR SFR SFR SFR SFR AI09199uPSD33xx 56/231 Figure 17. MCU I/O Cell Block Diagram for Port 1 Figure 18. MCU I/O Cell Block Diagram for Port 3 P1.X Pin Analog_Alt_Func_En Analog_Pin_In D Q PRE SFR P1.X Latch 8032 Data Bus Bit GPIO P1.X SFR Write Latch MCU_Reset P1.X SFR Read Latch (for R-M-W instructions) P1.X SFR Read Pin Select_Alternate_Func Digital_Pin_Data_In IN 1 IN 0 MUX Y VCC VCC VCC SEL WEAK PULL-UP, B STONGER PULL-UP, A LOW SIDE HIGH SIDE DELAY, 1 MCU_CLK DELAY, 1 MCU_CLK Q Digital_Alt_Func_Data_Out AI09600 P3.X Pin Digital_Pin_Data_In D Q PRE SFR P3.X Latch 8032 Data Bus Bit GPIO P3.X SFR Write Latch MCU_Reset P3.X SFR Read Latch (for R-M-W instructions) P3.X SFR Read Pin Select_Alternate_Func Disables High-Side Driver IN 1 IN 0 MUX Y VCC VCC VCC SEL Enable_I2C WEAK PULL-UP, B STONGER PULL-UP, A LOW SIDE HIGH SIDE DELAY, 1 MCU_CLK DELAY, 1 MCU_CLK Q Digital_Alt_Func_Data_Out AI0960157/231 uPSD33xx Figure 19. MCU I/O Cell Block Diagram for Port 4 Table 25. P1: I/O Port 1 Register (SFR 90h, reset value FFh) Note: 1. Write '1' or '0' for pin output. Read for pin input, but prior to READ, this bit must have been set to '1' by firmware or by a reset event. Bit 7 Bit 6 Bit 5 Bit 4 Bit 3 Bit 2 Bit 1 Bit 0 P1.7 P1.6 P1.5 P1.4 P1.3 P1.2 P1.1 P1.0 Details Bit Symbol R/W Function(1) 7 P1.7 R,W Port pin 1.7 6 P1.6 R,W Port pin 1.6 5 P1.5 R,W Port pin 1.5 4 P1.4 R,W Port pin 1.4 3 P1.3 R,W Port pin 1.3 2 P1.2 R,W Port pin 1.2 1 P1.1 R,W Port pin 1.1 0 P1.0 R,W Port pin 1.0 P4.X Pin Digital_Pin_Data_In D Q PRE SFR P4.X Latch 8032 Data Bus Bit GPIO P4.X SFR Write Latch MCU_Reset P4.X SFR Read Latch (for R-M-W instructions) P4.X SFR Read Pin Select_Alternate_Func For PCA Alternate Function IN 1 IN 0 MUX Y VCC VCC VCC SEL Enable_Push_Pull WEAK PULL-UP, B STONGER PULL-UP, A LOW SIDE HIGH SIDE DELAY, 1 MCU_CLK DELAY, 1 MCU_CLK Q Digital_Alt_Func_Data_Out AI09602uPSD33xx 58/231 Table 26. P3: I/O Port 3 Register (SFR B0h, reset value FFh) Note: 1. Write '1' or '0' for pin output. Read for pin input, but prior to READ, this bit must have been set to '1' by firmware or by a reset event. Table 27. P4: I/O Port 4 Register (SFR C0h, reset value FFh) Note: 1. Write '1' or '0' for pin output. Read for pin input, but prior to READ, this bit must have been set to '1' by firmware or by a reset event. Bit 7 Bit 6 Bit 5 Bit 4 Bit 3 Bit 2 Bit 1 Bit 0 P3.7 P3.6 P3.5 P3.4 P3.3 P3.2 P3.1 P3.0 Details Bit Symbol R/W Function(1) 7 P3.7 R,W Port pin 3.7 6 P3.6 R,W Port pin 3.6 5 P3.5 R,W Port pin 3.5 4 P3.4 R,W Port pin 3.4 3 P3.3 R,W Port pin 3.3 2 P3.2 R,W Port pin 3.2 1 P3.1 R,W Port pin 3.1 0 P3.0 R,W Port pin 3.0 Bit 7 Bit 6 Bit 5 Bit 4 Bit 3 Bit 2 Bit 1 Bit 0 P4.7 P4.6 P4.5 P4.4 P4.3 P4.2 P4.1 P4.0 Details Bit Symbol R/W Function(1) 7 P4.7 R,W Port pin 4.7 6 P4.6 R,W Port pin 4.6 5 P4.5 R,W Port pin 4.5 4 P4.4 R,W Port pin 4.4 3 P4.3 R,W Port pin 4.3 2 P4.2 R,W Port pin 4.2 1 P4.1 R,W Port pin 4.1 0 P4.0 R,W Port pin 4.059/231 uPSD33xx Alternate Functions. There are five SFRs used to control the mapping of alternate functions onto MCU port pins, and these SFRs are depicted as switches in Figure 16., page 55. ■ Port 3 uses the SFR, P3SFS (Table 28., page 60). ■ Port 1 uses SFRs, P1SFS0 (Table 29., page 60) and P1SFS1 (Table 30., page 60). ■ Port 4 uses SFRs, P4SFS0 (Table 32., page 61) and P4SFS1 (Table 33., page 61). Since these SFRs are cleared by a reset, then by default all port pins function as GPIO (not the alternate function) until firmware initializes these SFRs. Each pin on each of the three ports can be independently assigned a different function on a pinby-pin basis. The peripheral functions Timer 2, UART1, and I2C may be split independently between Port 1 and Port 4 for additional flexibility by giving a wider choice of peripheral usage on a limited number of device pins. When the selected alternate function is UART0, UART1, or SPI, then the related pins are in quasibidirectional mode, including the use of the highside driver for rapid 0-to-1 output transitions. The high-side driver is enabled for just one MCU_CLK period on 0-to-1 transitions by the delay function at the “digital_alt_func_data_out” signal pictured in Figure 17., page 56 through Figure 19., page 57. If the alternate function is Timer 0, Timer 1, Timer 2, or PCA input, then the related pins are in quasibidirectional mode, but input only. If the alternate function is ADC, then for each pin the pull-ups, the high-side driver, and the low-side driver are disabled. The analog input is routed directly to the ADC unit. Only Port 1 supports analog functions (Figure 17., page 56). Port 1 is not 5V tolerant. If the alternate function is I2C, the related pins will be in open drain mode, which is just like quasi-bidirectional mode but the high-side driver is not enabled for one cycle when outputting a 0-to-1 transition. Only the low-side driver and the internal weak pull-ups are used. Only Port 3 supports open-drain mode (Figure 18., page 56). I2C requires the use of an external pull-up resistor on each bus signal, typically 4.7KΩ to VCC. If the alternate function is PCA output, then the related pins are in push-pull mode, meaning the pins are actively driven and held to logic '1' by the highside driver, or actively driven and held to logic '0' by the low-side driver. Only Port 4 supports pushpull mode (Figure 19., page 57). Port 4 push-pull pins can source IOH current when driving logic '1,' and sink IOL current when driving logic '0.' This current is significantly more than the capability of pins on Port 1 or Port 3 (see Table 129., page 207). For example, to assign these port functions: ■ Port 1: UART1, ADC[1:0], P1[7:4] are GPIO ■ Port 3: UART0, I2C, P3[5:2] are GPIO ■ Port 4: TCM0, SPI, P4[3:1] are GPIO The following values need to be written to the SFRs: P1SFS0 = 00001111b, or 0Fh P1SFS1 = 00000011b , or 03h P3SFS = 11000011b, or C3h P4SFS0 = 11110001b, or F1h P4SFS1 = 11110000b, or F0huPSD33xx 60/231 Table 28. P3SFS: Port 3 Special Function Select Register (SFR 91h, reset value 00h) Table 29. P1SFS0: Port 1 Special Function Select 0 Register (SFR 8Eh, reset value 00h) Table 30. P1SFS1: Port 1 Special Function Select 1 Register (SFR 8Fh, reset value 00h) Table 31. P1SFS0 and P1SFS1 Details Bit 7 Bit 6 Bit 5 Bit 4 Bit 3 Bit 2 Bit 1 Bit 0 P3SFS7 P3SFS6 P3SFS5 P3SFS4 P3SFS3 P3SFS2 P3SFS1 P3SFS0 Details Port 3 Pin R/W Default Port Function Alternate Port Function P3SFS[i] - 0; Port 3 Pin, i = 0..7 P3SFS[i] - 1; Port 3 Pin, i = 0..7 0 R,W GPIO UART0 Receive, RXD0 1 R,W GPIO UART0 Transmit, TXD0 2 R,W GPIO Ext Intr 0/Timer 0 Gate, EXT0INT/TG0 3 R,W GPIO Ext Intr 1/Timer 1 Gate, EXT1INT/TG1 4 R,W GPIO Counter 0 Input, C0 5 R,W GPIO Counter 0 Input, C1 6 R,W GPIO I 2C Data, I2CSDA 7 R,W GPIO I 2C Clock, I2CCL Bit 7 Bit 6 Bit 5 Bit 4 Bit 3 Bit 2 Bit 1 Bit 0 P1SF07 P1SF06 P1SF05 P1SF04 P1SF03 P1SF02 P1SF01 P1SF00 Details Bit 7 Bit 6 Bit 5 Bit 4 Bit 3 Bit 2 Bit 1 Bit 0 P1SF17 P1SF16 P1SF15 P1SF14 P1SF13 P1SF12 P1SF11 P1SF10 Port 1 Pin R/W Default Port Function Alternate 1 Port Function Alternate 2 Port Function P1SFS0[i] = 0 P1SFS1[i] = x P1SFS0[i] = 1 P1SFS1[i] = 0 P1SFS0[i] = 1 P1SFS1[i] = 1 Port 1 Pin, i = 0.. 7 Port 1 Pin, i = 0.. 7 Port 1 Pin, i = 0.. 7 0 R,W GPIO Timer 2 Count Input, T2 ADC Chn 0 Input, ADC0 1 R,W GPIO Timer 2 Trigger Input, TX2 ADC Chn 1 Input, ADC1 2 R,W GPIO UART1 Receive, RXD1 ADC Chn 2 Input, ADC2 3 R,W GPIO UART1 Transmit, TXD1 ADC Chn 3 Input, ADC3 4 R,W GPIO SPI Clock, SPICLK ADC Chn 4 Input, ADC4 5 R,W GPIO SPI Receive, SPIRXD ADC Chn 5 Input, ADC5 6 R,W GPIO SPI Transmit, SPITXD ADC Chn 6 Input, ADC6 7 R,W GPIO SPI Select, SPISEL_ ADC Chn 7 Input, ADC761/231 uPSD33xx Table 32. P4SFS0: Port 4 Special Function Select 0 Register (SFR 92h, reset value 00h) Table 33. P4SFS1: Port 4 Special Function Select 1 Register (SFR 93h, reset value 00h) Table 34. P4SFS0 and P4SFS1 Details Bit 7 Bit 6 Bit 5 Bit 4 Bit 3 Bit 2 Bit 1 Bit 0 P4SF07 P4SF06 P4SF05 P4SF04 P4SF03 P4SF02 P4SF01 P4SF00 Details Bit 7 Bit 6 Bit 5 Bit 4 Bit 3 Bit 2 Bit 1 Bit 0 P4SF17 P4SF16 P4SF15 P4SF14 P4SF13 P4SF12 P4SF11 P4SF10 Port 4 Pin R/W Default Port Function Alternate 1 Port Function Alternate 2 Port Function P4SFS0[i] = 0 P4SFS1[i] = x P4SFS0[i] = 1 P4SFS1[i] = 0 P4SFS0[i] = 1 P4SFS1[i] = 1 Port 4 Pin, i = 0.. 7 Port 4 Pin, i = 0.. 7 Port 4 Pin, i = 0.. 7 0 R,W GPIO PCA0 Module 0, TCM0 Timer 2 Count Input, T2 1 R,W GPIO PCA0 Module 1, TCM1 Timer 2 Trigger Input, TX2 2 R,W GPIO PCA0 Module 2, TCM2 UART1 Receive, RXD1 3 R,W GPIO PCA0 Ext Clock, PCACLK0 UART1 Transmit, TXD1 4 R,W GPIO PCA1 Module 3, TCM3 SPI Clock, SPICLK 5 R,W GPIO PCA1 Module 4, TCM4 SPI Receive, SPIRXD 6 R,W GPIO PCA1 Module 5, TCM5 SPI Transmit, SPITXD 7 R,W GPIO PCA1 Ext Clock, PCACLK1 SPI Select, SPISEL_uPSD33xx 62/231 MCU BUS INTERFACE The MCU Module has a programmable bus interface. It is based on a standard 8032 bus, with eight data signals multiplexed with eight low-order address signals (AD[7:0]). It also has eight high-order non-multiplexed address signals (A[15:8]). Time multiplexing is controlled by the address latch signal, ALE. This bus connects the MCU Module to the PSD Module, and also connects to external pins only on 80-pin devices. See the AC specifications section at the end of this document for external bus timing on 80-pin devices. Four types of data transfers are supported, each transfer is to/from a memory location external to the MCU Module: – Code Fetch cycle using the PSEN signal: fetch a code byte for execution – Code Read cycle using PSEN: read a code byte using the MOVC (Move Constant) instruction – XDATA Read cycle using the RD signal: read a data byte using the MOVX (Move eXternal) instruction – XDATA Write cycle using the WR signal: write a data byte using the MOVX instruction The number of MCU_CLK periods for these transfer types can be specified at runtime by firmware writing to the SFR register named BUSCON (Table 35., page 63). Here, the number of MCU_CLK clock pulses per bus cycle are specified to maximize performance. Important: By default, the BUSCON Register is loaded with long bus cycle times (6 MCU_CLK periods) after a reset condition. It is important that the post-reset initialization firmware sets the bus cycle times appropriately to get the most performance, according to Table 36., page 64. Keep in mind that the PSD Module has a faster Turbo Mode (default) and a slower but less power consuming Non-Turbo Mode. The bus cycle times must be programmed in BUSCON to optimize for each mode as shown in Table 36., page 64. See PLD NonTurbo Mode, page 192 for more details. Bus Read Cycles (PSEN or RD) When the PSEN signal is used to fetch a byte of code, the byte is read from the PSD Module or external device and it enters the MCU Pre-Fetch Queue (PFQ). When PSEN is used during a MOVC instruction, or when the RD signal is used to read a byte of data, the byte is routed directly to the MCU, bypassing the PFQ. Bits in the BUSCON Register determine the number of MCU_CLK periods per bus cycle for each of these kinds of transfers to all address ranges. It is not possible to specify in the BUSCON Register a different number of MCU_CLK periods for various address ranges. For example, the user cannot specify 4 MCU_CLK periods for RD read cycles to one address range on the PSD Module, and 5 MCU_CLK periods for RD read cycles to a different address range on an external device. However, the user can specify one number of clock periods for PSEN read cycles and a different number of clock periods for RD read cycles. Note 1: A PSEN bus cycle in progress may be aborted before completion if the PFQ and Branch Cache (BC) determines the current code fetch cycle is not needed. Note 2: Whenever the same number of MCU_CLK periods is specified in BUSCON for both PSEN and RD cycles, the bus cycle timing is typically identical for each of these types of bus cycles. In this case, the only time PSEN read cycles are longer than RD read cycles is when the PFQ issues a stall while reloading. PFQ stalls do not affect RD read cycles. By comparison, in many traditional 8051 architectures, RD bus cycles are always longer than PSEN bus cycles. Bus Write Cycles (WR) When the WR signal is used, a byte of data is written directly to the PSD Module or external device, no PFQ or caching is involved. Bits in the BUSCON Register determine the number of MCU_CLK periods for bus write cycles to all addresses. It is not possible to specify in BUSCON a different number of MCU_CLK periods for writes to various address ranges. Controlling the PFQ and BC The BUSCON Register allows firmware to enable and disable the PFQ and BC at run-time. Sometimes it may be desired to disable the PFQ and BC to ensure deterministic execution. The dynamic action of the PFQ and BC may cause varying program execution times depending on the events that happen prior to a particular section of code of interest. For this reason, it is not recommended to implement timing loops in firmware, but instead use one of the many hardware timers in the uPSD33xx. By default, the PFQ and BC are enabled after a reset condition. Important: Disabling the PFQ or BC will seriously reduce MCU performance.63/231 uPSD33xx Table 35. BUSCON: Bus Control Register (SFR 9Dh, reset value EBh) Bit 7 Bit 6 Bit 5 Bit 4 Bit 3 Bit 2 Bit 1 Bit 0 EPFQ EBC WRW[1:0] RDW[1:0] CW[1:0] Details Bit Symbol R/W Definition 7 EPFQ R,W Enable Pre-Fetch Queue 0 = PFQ is disabled 1 = PFQ is enabled (default) 6 EBC R,W Enable Branch Cache 0 = BC is disabled 1 = BC is enabled (default) 5:4 WRW[1:0] R,W WR Wait, number of MCU_CLK periods for WR write bus cycle during any MOVX instruction 00b: 4 clock periods 01b: 5 clock periods 10b: 6 clock periods (default) 11b: 7 clock periods 3:2 RDW[1:0] R,W RD Wait, number of MCU_CLK periods for RD read bus cycle during any MOVX instruction 00b: 4 clock periods 01b: 5 clock periods 10b: 6 clock periods (default) 11b: 7 clock periods 1:0 CW[1:0] R,W Code Wait, number of MCU_CLK periods for PSEN read bus cycle during any code byte fetch or during any MOVC code byte read instruction. Periods will increase with PFQ stall 00b: 3 clock periods - exception, for MOVC instructions this setting results 4 clock periods 01b: 4 clock periods 10b: 5 clock periods 11b: 6 clock periods (default)uPSD33xx 64/231 Table 36. Number of MCU_CLK Periods Required to Optimize Bus Transfer Rate Note: 1. VDD of the PSD Module 2. “Turbo mode PSD” means that the PSD Module is in the faster, Turbo mode (default condition). A PSD Module in Non-Turbo mode is slower, but consumes less current. See PSD Module section, titled “PLD Non-Turbo Mode” for details. MCU Clock Frequency, MCU_CLK (fMCU) CW[1:0] Clk Periods RDW[1:0] Clk Periods WRW[1:0] Clk Periods 3.3V(1) 5V(1) 3.3V(1) 5V(1) 3.3V(1) 5V(1) 40MHz, Turbo mode PSD(2) 545454 40MHz, Non-Turbo mode PSD 6 5 6 5 6 5 36MHz, Turbo mode PSD 545454 36MHz, Non-Turbo mode PSD 6 4 6 4 6 4 32MHz, Turbo mode PSD 545454 32MHz, Non-Turbo mode PSD 5 4 5 4 5 4 28MHz, Turbo mode PSD 434444 28MHz, Non-Turbo mode PSD 5 4 5 4 5 4 24MHz, Turbo mode PSD 434444 24MHz, Non-Turbo mode PSD 4 3 4 4 4 4 20MHz and below, Turbo mode PSD 334444 20MHz and below, Non-Turbo mode PSD 3 3 4 4 4 465/231 uPSD33xx SUPERVISORY FUNCTIONS Supervisory circuitry on the MCU Module will issue an internal reset signal to the MCU Module and simultaneously to the PSD Module as a result of any of the following four events: – The external RESET_IN pin is asserted – The Low Voltage Detect (LVD) circuitry has detected a voltage on VCC below a specific threshold (power-on or voltage sags) – The JTAG Debug interface has issued a reset command – The Watch Dog Timer (WDT) has timed out The resulting internal reset signal, MCU_RESET, will force the 8032 into a known reset state while asserted, and then 8032 program execution will jump to the reset vector at program address 0000h just after MCU_RESET is deasserted. The MCU Module will also assert an active low internal reset signal, RESET, to the PSD Module. If needed, the signal RESET can be driven out to external system components through any PLD output pin on the PSD Module. When driving this “RESET_OUT” signal from a PLD output, the user can choose to make it either active-high or activelow logic, depending on the PLD equation. External Reset Input Pin, RESET_IN The RESET_IN pin can be connected directly to a mechanical reset switch or other device which pulls the signal to ground to invoke a reset. RESET_IN is pulled up internally and enters a Schmitt trigger input buffer with a voltage hysteresis of VRST_HYS for immunity to the effects of slow signal rise and fall times, as shown in Figure 20. RESET_IN is also filtered to reject a voltage spike less than a duration of tRST_FIL. The RESET_IN signal must be maintained at a logic '0' for at least a duration of tRST_LO_IN while the oscillator is running. The resulting MCU_RESET signal will last only as long as the RESET_IN signal is active (it is not stretched). Refer to the Supervisor AC specifications in Table 150., page 221 at the end of this document for these parameter values. Figure 20. Supervisor Reset Generation S Q MCU Clock Sync Noise Filter VCC PIN PULL-UP DELAY, tRST_ACTV R AI09603 RESET_IN RESET to PSD Module MCU_RESET to MCU and Peripherals LVD JTAG Debug WDTuPSD33xx 66/231 Low VCC Voltage Detect, LVD An internal reset is generated by the LVD circuit when VCC drops below the reset threshold, VLV_THRESH. After VCC returns to the reset threshold, the MCU_RESET signal will remain asserted for tRST_ACTV before it is released. The LVD circuit is always enabled (cannot be disabled by SFR), even in Idle Mode and Power-down Mode. The LVD input has a voltage hysteresis of VRST_HYS and will reject voltage spikes less than a duration of tRST_FIL. Important: The LVD voltage threshold is VLV_THRESH, suitable for monitoring both the 3.3V VCC supply on the MCU Module and the 3.3V VDD supply on the PSD Module for 3.3V uPSD33xxV devices, since these supplies are one in the same on the circuit board. However, for 5V uPSD33xx devices, VLV_THRESH is not suitable for monitoring the 5V VDD voltage supply (VLV_THRESH is too low), but good for monitoring the 3.3V VCC supply. In the case of 5V uPSD33xx devices, an external means is required to monitor the separate 5V VDD supply, if desired. Power-up Reset At power up, the internal reset generated by the LVD circuit is latched as a logic '1' in the POR bit of the SFR named PCON (Table 24., page 50). Software can read this bit to determine whether the last MCU reset was the result of a power up (cold reset) or a reset from some other condition (warm reset). This bit must be cleared with software. JTAG Debug Reset The JTAG Debug Unit can generate a reset for debugging purposes. This reset source is also available when the MCU is in Idle Mode and PowerDown Mode (the JTAG debugger can be used to exit these modes). Watchdog Timer, WDT When enabled, the WDT will generate a reset whenever it overflows. Firmware that is behaving correctly will periodically clear the WDT before it overflows. Run-away firmware will not be able to clear the WDT, and a reset will be generated. By default, the WDT is disabled after each reset. Note: The WDT is not active during Idle mode or Power-down Mode. There are two SFRs that control the WDT, they are WDKEY (Table 37., page 68) and WDRST (Table 38., page 68). If WDKEY contains 55h, the WDT is disabled. Any value other than 55h in WDKEY will enable the WDT. By default, after any reset condition, WDKEY is automatically loaded with 55h, disabling the WDT. It is the responsibility of initialization firmware to write some value other than 55h to WDKEY after each reset if the WDT is to be used. The WDT consists of a 24-bit up-counter (Figure 21), whose initial count is 000000h by default after every reset. The most significant byte of this counter is controlled by the SFR, WDRST. After being enabled by WDKEY, the 24-bit count is increased by 1 for each MCU machine cycle. When the count overflows beyond FFFFFh (224 MCU machine cycles), a reset is issued and the WDT is automatically disabled (WDKEY = 55h again). To prevent the WDT from timing out and generating a reset, firmware must repeatedly write some value to WDRST before the count reaches FFFFFh. Whenever WDRST is written, the upper 8 bits of the 24-bit counter are loaded with the written value, and the lower 16 bits of the counter are cleared to 0000h. The WDT time-out period can be adjusted by writing a value other that 00h to WDRST. For example, if WDRST is written with 04h, then the WDT will start counting 040000h, 040001h, 040002h, and so on for each MCU machine cycle. In this example, the WDT time-out period is shorter than if WDRST was written with 00h, because the WDT is an up-counter. A value for WDRST should never be written that results in a WDT time-out period shorter than the time required to complete the longest code task in the application, else unwanted WDT overflows will occur. Figure 21. Watchdog Counter 23 15 7 0 8-bits 8-bits 8-bits SFR, WDRST AI0960467/231 uPSD33xx The formula to determine WDT time-out period is: WDTPERIOD = tMACH_CYC x NOVERFLOW NOVERFLOW is the number of WDT up-counts required to reach FFFFFFh. This is determined by the value written to the SFR, WDRST. tMACH_CYC is the average duration of one MCU machine cycle. By default, an MCU machine cycle is always 4 MCU_CLK periods for uPSD33xx, but the following factors can sometimes add more MCU_CLK periods per machine cycle: – The number of MCU_CLK periods assigned to MCU memory bus cycles as determined in the SFR, BUSCON. If this setting is greater than 4, then machine cycles have additional MCU_CLK periods during memory transfers. – Whether or not the PFQ/BC circuitry issues a stall during a particular MCU machine cycle. A stall adds more MCU_CLK periods to a machine cycle until the stall is removed. tMACH_CYC is also affected by the absolute time of a single MCU_CLK period. This number is fixed by the following factors: – Frequency of the external crystal, resonator, or oscillator: (fOSC) – Bit settings in the SFR CCON0, which can divide fOSC and change MCU_CLK As an example, assume the following: 1. fOSC is 40MHz, thus its period is 25ns. 2. CCON0 is 10h, meaning no clock division, so the period of MCU_CLK is also 25ns. 3. BUSCON is C1h, meaning the PFQ and BC are enabled, and each MCU memory bus cycle is 4 MCU_CLK periods, adding no additional MCU_CLK periods to MCU machine cycles during memory transfers. 4. Assume there are no stalls from the PFQ/BC. In reality, there are occational stalls but their occurance has minimal impact on WDT timeout period. 5. WDRST contains 00h, meaning a full 224 upcounts are required to reach FFFFFh and generate a reset. In this example, tMACH_CYC = 100ns (4 MCU_CLK periods x 25ns) NOVERFLOW = 224 = 16777216 up-counts WDTPERIOD = 100ns X 16777216 = 1.67 seconds The actual value will be slightly longer due to PFQ/ BC. Firmware Example: The following 8051 assembly code illustrates how to operate the WDT. A simple statement in the reset initialization firmware enables the WDT, and then a periodic write to clear the WDT in the main firmware is required to keep the WDT from overflowing. This firmware is based on the example above (40MHz fOSC, CCON0 = 10h, BUSCON = C1h). For example, in the reset initialization firmware (the function that executes after a jump to the reset vector): Somewhere in the flow of the main program, this statement will execute periodically to reset the WDT before it’s time-out period of 1.67 seconds. For example: MOV AE, #AA ; enable WDT by writing value to ; WDKEY other than 55h MOV A6, #00 ; reset WDT, loading 000000h. ; Counting will automatically ; resume as long as 55h in not in ; WDKEYuPSD33xx 68/231 Table 37. WDKEY: Watchdog Timer Key Register (SFR AEh, reset value 55h) Table 38. WDRST: Watchdog Timer Reset Counter Register (SFR A6h, reset value 00h) Bit 7 Bit 6 Bit 5 Bit 4 Bit 3 Bit 2 Bit 1 Bit 0 WDKEY[7:0] Details Bit Symbol R/W Definition [7:0] WDKEY W 55h disables the WDT from counting. 55h is automatically loaded in this SFR after any reset condition, leaving the WDT disabled by default. Any value other than 55h written to this SFR will enable the WDT, and counting begins. Bit 7 Bit 6 Bit 5 Bit 4 Bit 3 Bit 2 Bit 1 Bit 0 WDRST[7:0] Details Bit Symbol R/W Definition [7:0] WDRST W This SFR is the upper byte of the 24-bit WDT up-counter. Writing this SFR sets the upper byte of the counter to the written value, and clears the lower two bytes of the counter to 0000h. Counting begins when WDKEY does not contain 55h.69/231 uPSD33xx STANDARD 8032 TIMER/COUNTERS There are three 8032-style 16-bit Timer/Counter registers (Timer 0, Timer 1, Timer 2) that can be configured to operate as timers or event counters. There are two additional 16-bit Timer/Counters in the Programmable Counter Array (PCA), seePCA Block, page 123 for details. Standard Timer SFRs Timer 0 and Timer 1 have very similar functions, and they share two SFRs for control: ■ TCON (Table 39., page 70) ■ TMOD (Table 40., page 72). Timer 0 has two SFRs that form the 16-bit counter, or that can hold reload values, or that can scale the clock depending on the timer/counter mode: ■ TH0 is the high byte, address 8Ch ■ TL0 is the low byte, address 8Ah Timer 1 has two similar SFRs: ■ TH1 is the high byte, address 8Dh ■ TL1 is the low byte, address 8Bh Timer 2 has one control SFR: ■ T2CON (Table 41., page 75) Timer 2 has two SFRs that form the 16-bit counter, and perform other functions: ■ TH2 is the high byte, address CDh ■ TL2 is the low byte, address CCh Timer 2 has two SFRs for capture and reload: ■ RCAP2H is the high byte, address CBh ■ RCAP2L is the low byte, address CAh Clock Sources When enabled in the “Timer” function, the Registers THx and TLx are incremented every 1/12 of the oscillator frequency (fOSC). This timer clock source is not effected by MCU clock dividers in the CCON0, stalls from PFQ/BC, or bus transfer cycles. Timers are always clocked at 1/12 of fOSC. When enabled in the “Counter” function, the Registers THx and TLx are incremented in response to a 1-to-0 transition sampled at their corresponding external input pin: pin C0 for Timer 0; pin C1 for Timer 1; or pin T2 for Timer 2. In this function, the external clock input pin is sampled by the counter at a rate of 1/12 of fOSC. When a logic '1' is determined in one sample, and a logic '0' in the next sample period, the count is incremented at the very next sample period (period1: sample=1, period2: sample=0, period3: increment count while continuing to sample). This means the maximum count rate is 1/24 of the fOSC. There are no restrictions on the duty cycle of the external input signal, but to ensure that a given level is sampled at least once before it changes, it should be active for at least one full sample period (12 / fOSC, seconds). However, if MCU_CLK is divided by the SFR CCON0, then the sample period must be calculated based on the resultant, longer, MCU_CLK frequency. In this case, an external clock signal on pins C0, C1, or T2 should have a duration longer than one MCU machine cycle, tMACH_CYC. The section, Watchdog Timer, WDT, page 66 explains how to estimate tMACH_CYC.uPSD33xx 70/231 Table 39. TCON: Timer Control Register (SFR 88h, reset value 00h) Bit 7 Bit 6 Bit 5 Bit 4 Bit 3 Bit 2 Bit 1 Bit 0 TF1 TR1 TF0 TR0 IE1 IT1 IE0 IT0 Details Bit Symbol R/W Definition 7 TF1 R Timer 1 overflow interrupt flag. Set by hardware upon overflow. Automatically cleared by hardware after firmware services the interrupt for Timer 1. 6 TR1 R,W Timer 1 run control. 1 = Timer/Counter 1 is on, 0 = Timer/Counter 1 is off. 5 TF0 R Timer 0 overflow interrupt flag. Set by hardware upon overflow. Automatically cleared by hardware after firmware services the interrupt for Timer 0. 4 TR0 R,W Timer 0 run control. 1 = Timer/Counter 0 is on, 0 = Timer/Counter 0 is off. 3 IE1 R Interrupt flag for external interrupt pin, EXTINT1. Set by hardware when edge is detected on pin. Automatically cleared by hardware after firmware services EXTINT1 interrupt. 2 IT1 R,W Trigger type for external interrupt pin EXTINT1. 1 = falling edge, 0 = lowlevel 1 IE0 R Interrupt flag for external interrupt pin, EXTINT0. Set by hardware when edge is detected on pin. Automatically cleared by hardware after firmware services EXTINT0 interrupt. 0 IT0 R,W Trigger type for external interrupt pin EXTINT0. 1 = falling edge, 0 = lowlevel71/231 uPSD33xx SFR, TCON Timer 0 and Timer 1 share the SFR, TCON, that controls these timers and provides information about them. See Table 39., page 70. Bits IE0 and IE1 are not related to Timer/Counter functions, but they are set by hardware when a signal is active on one of the two external interrupt pins, EXTINT0 and EXTINT1. For system information on all of these interrupts, see Table 16., page 41, Interrupt Summary. Bits IT0 and IT1 are not related to Timer/Counter functions, but they control whether or not the two external interrupt input pins, EXTINT0 and EXTINT1 are edge or level triggered. SFR, TMOD Timer 0 and Timer 1 have four modes of operation controlled by the SFR named TMOD (Table 40). Timer 0 and Timer 1 Operating Modes The “Timer” or “Counter” function is selected by the C/T control bits in TMOD. The four operating modes are selected by bit-pairs M[1:0] in TMOD. Modes 0, 1, and 2 are the same for both Timer/ Counters. Mode 3 is different. Mode 0. Putting either Timer/Counter into Mode 0 makes it an 8-bit Counter with a divide-by-32 prescaler. Figure 22 shows Mode 0 operation as it applies to Timer 1 (same applies to Timer 0). In this mode, the Timer Register is configured as a 13-bit register. As the count rolls over from all '1s' to all '0s,' it sets the Timer Interrupt flag TF1. The counted input is enabled to the Timer when TR1 = 1 and either GATE = 0 or EXTINT1 = 1. (Setting GATE = 1 allows the Timer to be controlled by external input pin, EXTINT1, to facilitate pulse width measurements). TR1 is a control bit in the SFR, TCON. GATE is a bit in the SFR, TMOD. The 13-bit register consists of all 8 bits of TH1 and the lower 5 bits of TL1. The upper 3 bits of TL1 are indeterminate and should be ignored. Setting the run flag, TR1, does not clear the registers. Mode 0 operation is the same for the Timer 0 as for Timer 1. Substitute TR0, TF0, C0, TL0, TH0, and EXTINT0 for the corresponding Timer 1 signals in Figure 22. There are two different GATE Bits, one for Timer 1 and one for Timer 0. Mode 1. Mode 1 is the same as Mode 0, except that the Timer Register is being run with all 16 bits. Mode 2. Mode 2 configures the Timer Register as an 8-bit Counter (TL1) with automatic reload, as shown in Figure 23., page 73. Overflow from TL1 not only sets TF1, but also reloads TL1 with the contents of TH1, which is preset with firmware. The reload leaves TH1 unchanged. Mode 2 operation is the same for Timer/Counter 0. Mode 3. Timer 1 in Mode 3 simply holds its count. The effect is the same as setting TR1 = 0. Timer 0 in Mode 3 establishes TL0 and TH0 as two separate counters. The logic for Mode 3 on Timer 0 is shown in Figure 24., page 73. TL0 uses the Timer 0 control Bits: C/T, GATE, TR0, and TF0, as well as the pin EXTINT0. TH0 is locked into a timer function (counting at a rate of 1/12 fOSC) and takes over the use of TR1 and TF1 from Timer 1. Thus, TH0 now controls the “Timer 1“ interrupt flag. Mode 3 is provided for applications requiring an extra 8-bit timer on the counter (see Figure 24., page 73). With Timer 0 in Mode 3, a uPSD33xx device can look like it has three Timer/ Counters (not including the PCA). When Timer 0 is in Mode 3, Timer 1 can be turned on and off by switching it out of and into its own Mode 3, or can still be used by the serial port as a baud rate generator, or in fact, in any application not requiring an interrupt.uPSD33xx 72/231 Table 40. TMOD: Timer Mode Register (SFR 89h, reset value 00h) Bit 7 Bit 6 Bit 5 Bit 4 Bit 3 Bit 2 Bit 1 Bit 0 GATE C/T M[1:0] GATE C/T M[1:0] Details Bit Symbol R/W Timer Definition (T/C is abbreviation for Timer/Counter) 7 GATE R,W Timer 1 Gate control. When GATE = 1, T/C is enabled only while pin EXTINT1 is '1' and the flag TR1 is '1.' When GATE = 0, T/C is enabled whenever the flag TR1 is '1.' 6 C/T R,W Counter or Timer function select. When C/T = 0, function is timer, clocked by internal clock. C/T = 1, function is counter, clocked by signal sampled on external pin, C1. [5:4] M[1:0] R,W Mode Select. 00b = 13-bit T/C. 8 bits in TH1 with TL1 as 5-bit prescaler. 01b = 16-bit T/C. TH1 and TL1 are cascaded. No prescaler. 10b = 8-bit auto-reload T/C. TH1 holds a constant and loads into TL1 upon overflow. 11b = Timer Counter 1 is stopped. 3 GATE R,W Timer 0 Gate control. When GATE = 1, T/C is enabled only while pin EXTINT0 is '1' and the flag TR0 is '1.' When GATE = 0, T/C is enabled whenever the flag TR0 is '1.' 2 C/T R,W Counter or Timer function select. When C/T = 0, function is timer, clocked by internal clock. C/T = 1, function is counter, clocked by signal sampled on external pin, C0. [1:0] M[1:0] R,W Mode Select. 00b = 13-bit T/C. 8 bits in TH0 with TL0 as 5-bit prescaler. 01b = 16-bit T/C. TH0 and TL0 are cascaded. No prescaler. 10b = 8-bit auto-reload T/C. TH0 holds a constant and loads into TL0 upon overflow. 11b = TL0 is 8-bit T/C controlled by standard Timer 0 control bits. TH0 is a separate 8-bit timer that uses Timer 1 control bits.73/231 uPSD33xx Figure 22. Timer/Counter Mode 0: 13-bit Counter Figure 23. Timer/Counter Mode 2: 8-bit Auto-reload Figure 24. Timer/Counter Mode 3: Two 8-bit Counters AI06622 f OSC TF1 Interrupt Gate TR1 EXTINT1 pin C1 pin Control TL1 (5 bits) TH1 (8 bits) C/T = 0 C/T = 1 ÷ 12 AI06623 f OSC TF1 Interrupt Gate TR1 EXTINT1 pin C1 pin Control TL1 (8 bits) TH1 (8 bits) C/T = 0 C/T = 1 ÷ 12 AI06624 f OSC TF0 Interrupt Gate TR0 EXTINT0 pin C0 pin Control TL0 (8 bits) C/T = 0 C/T = 1 ÷ 12 f OSC TF1 Interrupt Control TH0 (8 bits) ÷ 12 TR1uPSD33xx 74/231 Timer 2 Timer 2 can operate as either an event timer or as an event counter. This is selected by the bit C/T2 in the SFR named, T2CON (Table 41., page 75). Timer 2 has three operating modes selected by bits in T2CON, according to Table 42., page 76. The three modes are: ■ Capture mode ■ Auto re-load mode ■ Baud rate generator mode Capture Mode. In Capture Mode there are two options which are selected by the bit EXEN2 in T2CON. Figure 25., page 79 illustrates Capture mode. If EXEN2 = 0, then Timer 2 is a 16-bit timer if C/T2 = 0, or it’s a 16-bit counter if C/T2 = 1, either of which sets the interrupt flag bit TF2 upon overflow. If EXEN2 = 1, then Timer 2 still does the above, but with the added feature that a 1-to-0 transition at external input pin T2X causes the current value in the Timer 2 registers, TL2 and TH2, to be captured into Registers RCAP2L and RCAP2H, respectively. In addition, the transition at T2X causes interrupt flag bit EXF2 in T2CON to be set. Either flag TF2 or EXF2 will generate an interrupt and the MCU must read both flags to determine the cause. Flags TF2 and EXF2 are not automatically cleared by hardware, so the firmware servicing the interrupt must clear the flag(s) upon exit of the interrupt service routine. Auto-reload Mode. In the Auto-reload Mode, there are again two options, which are selected by the bit EXEN2 in T2CON. Figure 26., page 79 shows Auto-reload mode. If EXEN2 = 0, then when Timer 2 counts up and rolls over from FFFFh it not only sets the interrupt flag TF2, but also causes the Timer 2 registers to be reloaded with the 16-bit value contained in Registers RCAP2L and RCAP2H, which are preset with firmware. If EXEN2 = 1, then Timer 2 still does the above, but with the added feature that a 1-to-0 transition at external input T2X will also trigger the 16-bit reload and set the interrupt flag EXF2. Again, firmware servicing the interrupt must read both TF2 and EXF2 to determine the cause, and clear the flag(s) upon exit. Note: The uPSD33xx does not support selectable up/down counting in Auto-reload mode (this feature was an extension to the original 8032 architecture).75/231 uPSD33xx Table 41. T2CON: Timer 2 Control Register (SFR C8h, reset value 00h) Note: 1. The RCLK1 and TCLK1 Bits in the SFR named PCON control UART1, and have the exact same function as RCLK and TCLK. Bit 7 Bit 6 Bit 5 Bit 4 Bit 3 Bit 2 Bit 1 Bit 0 TF2 EXF2 RCLK TCLK EXEN2 TR2 C/T2 CP/RL2 Details Bit Symbol R/W Definition 7 TF2 R,W Timer 2 flag, causes interrupt if enabled. TF2 is set by hardware upon overflow. Must be cleared by firmware. TF2 will not be set when either RCLK or TCLK =1. 6 EXF2 R,W Timer 2 flag, causes interrupt if enabled. EXF2 is set when a capture or reload is caused by a negative transition on T2X pin and EXEN2 = 1. EXF2 must be cleared by firmware. 5 RCLK(1) R,W UART0 Receive Clock control. When RCLK = 1, UART0 uses Timer 2 overflow pulses for its receive clock in Modes 1 and 3. RCLK=0, Timer 1 overflow is used for its receive clock 4 TCLK(1) R,W UART0 Transmit Clock control. When TCLK = 1, UART0 uses Timer 2 overflow pulses for its transmit clock in Modes 1 and 3. TCLK=0, Timer 1 overflow is used for transmit clock 3 EXEN2 R,W Timer 2 External Enable. When EXEN2 = 1, capture or reload results when negative edge on pin T2X occurs. EXEN2 = 0 causes Timer 2 to ignore events at pin T2X. 2 TR2 R,W Timer 2 run control. 1 = Timer/Counter 2 is on, 0 = Timer Counter 2 is off. 1 C/T2 R,W Counter or Timer function select. When C/T2 = 0, function is timer, clocked by internal clock. When C/T2 = 1, function is counter, clocked by signal sampled on external pin, T2. 0 CP/RL2 R,W Capture/Reload. When CP/RL2 = 1, capture occurs on negative transition at pin T2X if EXEN2 = 1. When CP/RL2 = 0, auto-reload occurs when Timer 2 overflows, or on negative transition at pin T2X when EXEN2=1. When RCLK = 1 or TCLK = 1, CP/RL2 is ignored, and Timer 2 is forced to autoreload upon Timer 2 overflowuPSD33xx 76/231 Table 42. Timer/Counter 2 Operating Modes Note: ↓ = falling edge Mode Bits in T2CON SFR Pin T2X Remarks Input Clock RCLK or TCLK CP/ RL2 TR2 EXEN2 Timer, Internal Counter, External (Pin T2, P1.0) 16-bit Autoreload 001 0 x reload [RCAP2H, RCAP2L] to [TH2, TL2] upon overflow (up counting) fOSC/12 MAX fOSC/24 001 1 ↓ reload [RCAP2H, RCAP2L] to [TH2, TL2] at falling edge on pin T2X 16-bit Capture 0 1 1 0 x 16-bit Timer/Counter (up counting) fOSC/12 MAX fOSC/24 011 1 ↓ Capture [TH2, TL2] and store to [RCAP2H, RCAP2L] at falling edge on pin T2X Baud Rate Generator 1 x 1 0 x No overflow interrupt request (TF2) fOSC/2 – 1x1 1 ↓ Extra Interrupt on pin T2X, sets TF2 Off x x 0 x x Timer 2 stops – –77/231 uPSD33xx Baud Rate Generator Mode. The RCLK and/or TCLK Bits in the SFR T2CON allow the transmit and receive baud rates on serial port UART0 to be derived from either Timer 1 or Timer 2. Figure 27., page 80 illustrates Baud Rate Generator Mode. When TCLK = 0, Timer 1 is used as UART0’s transmit baud generator. When TCLK = 1, Timer 2 will be the transmit baud generator. RCLK has the same effect for UART0’s receive baud rate. With these two bits, UART0 can have different receive and transmit baud rates - one generated by Timer 1, the other by Timer 2. Note: Bits RCLK1 and TCLK1 in the SFR named PCON (see PCON: Power Control Register (SFR 87h, reset value 00h), page 50) have identical functions as RCLK and TCLK but they apply to UART1 instead. For simplicity in the following discussions about baud rate generation, no suffix will be used when referring to SFR registers and bits related to UART0 or UART1, since each UART interface has identical operation. Example, TCLK or TCLK1 will be referred to as just TCLK. The Baud Rate Generator Mode is similar to the Auto-reload Mode, in that a roll over in TH2 causes the Timer 2 registers, TH2 and TL2, to be reloaded with the 16-bit value in Registers RCAP2H and RCAP2L, which are preset with firmware. The baud rates in UART Modes 1 and 3 are determined by Timer 2’s overflow rate as follows: UART Mode 1,3 Baud Rate = Timer 2 Overflow Rate / 16 The timer can be configured for either “timer” or “counter” operation. In the most typical applications, it is configured for “timer” operation (C/T2 = 0). “Timer” operation is a little different for Timer 2 when it's being used as a baud rate generator. In this case, the baud rate is given by the formula: UART Mode 1,3 Baud Rate = fOSC/(32 x [65536 – [RCAP2H, RCAP2L])) where [RCAP2H, RCAP2L] is the content of the SFRs RCAP2H and RCAP2L taken as a 16-bit unsigned integer. A roll-over in TH2 does not set TF2, and will not generate an interrupt. Therefore, the Timer Interrupt does not have to be disabled when Timer 2 is in the Baud Rate Generator Mode. If EXEN2 is set, a 1-to-0 transition on pin T2X will set the Timer 2 interrupt flag EXF2, but will not cause a reload from RCAP2H and RCAP2L to TH2 and TL2. Thus when Timer 2 is in use as a baud rate generator, the pin T2X can be used as an extra external interrupt, if desired. When Timer 2 is running (TR2 = 1) in a “timer” function in the Baud Rate Generator Mode, firmware should not read or write TH2 or TL2. Under these conditions the results of a read or write may not be accurate. However, SFRs RCAP2H and RCAP2L may be read, but should not be written, because a write might overlap a reload and cause write and/or reload errors. Timer 2 should be turned off (clear TR2) before accessing Timer 2 or Registers RCAP2H and RCAP2L, in this case. Table 43., page 78 shows commonly used baud rates and how they can be obtained from Timer 2, with T2CON = 34h.uPSD33xx 78/231 Table 43. Commonly Used Baud Rates Generated from Timer2 (T2CON = 34h) fOSC MHz Desired Baud Rate Timer 2 SFRs Resulting Baud Rate Baud Rate Deviation RCAP2H (hex) RCAP2L(hex) 40.0 115200 FF F5 113636 -1.36% 40.0 57600 FF EA 56818 -1.36% 40.0 28800 FF D5 29070 0.94% 40.0 19200 FF BF 19231 0.16% 40.0 9600 FF 7E 9615 0.16% 36.864 115200 FF F6 115200 0 36.864 57600 FF EC 57600 0 36.864 28800 FF D8 28800 0 36.864 19200 FF C4 19200 0 36.864 9600 FF 88 9600 0 36.0 28800 FF D9 28846 0.16% 36.0 19200 FF C5 19067 -0.69% 36.0 9600 FF 8B 9615 0.16% 24.0 57600 FF F3 57692 0.16% 24.0 28800 FF E6 28846 0.16% 24.0 19200 FF D9 19231 0.16% 24.0 9600 FF B2 9615 0.16% 12.0 28800 FF F3 28846 0.16% 12.0 9600 FF D9 9615 0.16% 11.0592 115200 FF FD 115200 0 11.0592 57600 FF FA 57600 0 11.0592 28800 FF F4 28800 0 11.0592 19200 FF EE 19200 0 11.0592 9600 FF DC 9600 0 3.6864 115200 FF FF 115200 0 3.6864 57600 FF FE 57600 0 3.6864 28800 FF FC 28800 0 3.6864 19200 FF FA 19200 0 3.6864 9600 FF F4 9600 0 1.8432 19200 FF FD 19200 0 1.8432 9600 FF FA 9600 079/231 uPSD33xx Figure 25. Timer 2 in Capture Mode Figure 26. Timer 2 in Auto-Reload Mode AI06625 f OSC TF2 Capture TR2 T2 pin Control TL2 (8 bits) TH2 (8 bits) C/T2 = 0 C/T2 = 1 ÷ 12 EXP2 Control EXEN2 RCAP2L RCAP2H T2X pin Timer 2 Interrupt Transition Detector AI06626 f OSC TF2 Reload TR2 T2 pin Control TL2 (8 bits) TH2 (8 bits) C/T2 = 0 C/T2 = 1 ÷ 12 EXP2 Control EXEN2 RCAP2L RCAP2H T2X pin Timer 2 Interrupt Transition DetectoruPSD33xx 80/231 Figure 27. Timer 2 in Baud Rate Generator Mode AI09605 f OSC Reload TR2 T2 pin Control Note: Oscillator frequency is divided by 2, not 12 like in other timer modes. Note: Availability of additional external interrupt. TL2 (8 bits) TH2 (8 bits) C/T2 = 0 C/T2 = 1 ÷ 12 ÷ 2 ÷ 16 ÷ 16 EXF2 Control EXEN2 RCAP2L RCAP2H T2X pin Timer 2 Interrupt TX CLK RX CLK Timer 1 Overflow SMOD RCLK '1' '0' '0' '1' '1' '0' TCLK Transition Detector81/231 uPSD33xx SERIAL UART INTERFACES uPSD33xx devices provide two standard 8032 UART serial ports. – The first port, UART0, is connected to pins RxD0 (P3.0) and TxD0 (P3.1) – The second port, UART1 is connected to pins RxD1 (P1.2) and TxD1 (P1.3). UART1 can optionally be routed to pins P4.2 and P4.3 as described in Alternate Functions, page 59. The operation of the two serial ports are the same and are controlled by two SFRs: ■ SCON0 (Table 45., page 82) for UART0 ■ SCON1 (Table 46., page 83) for UART1 Each UART has its own data buffer accessed through an SFR listed below: ■ SBUF0 for UART0, address 99h ■ SBUF1 for UART1, address D9h When writing SBU0 or SBUF1, the data automatically loads into the associated UART transmit data register. When reading this SFR, data comes from a different physical register, which is the receive register of the associated UART. Note: For simplicity in the remaining UART discussions, the suffix “0” or “1” will be dropped when referring to SFR registers and bits related to UART0 or UART1, since each UART interface has identical operation. Example, SBUF0 and SBUF1 will be referred to as just SBUF. Each UART serial port can be full-duplex, meaning it can transmit and receive simultaneously. Each UART is also receive-buffered, meaning it can commence reception of a second byte before a previously received byte has been read from the SBUF Register. However, if the first byte still has not been read by the time reception of the second byte is complete, one of the bytes will be lost. UART Operation Modes Each UART can operate in one of four modes, one mode is synchronous, and the others are asynchronous as shown in Table 44. Mode 0. Mode 0 provides asynchronous, half-duplex operation. Serial data is both transmitted, and received on the RxD pin. The TxD pin outputs a shift clock for both transmit and receive directions, thus the MCU must be the master. Eight bits are transmitted/received LSB first. The baud rate is fixed at 1/12 of fOSC. Mode 1. Mode 1 provides standard asynchronous, full-duplex communication using a total of 10 bits per data byte. Data is transmitted through TxD and received through RxD with: a Start Bit (logic '0'), eight data bits (LSB first), and a Stop Bit (logic '1'). Upon receive, the eight data bits go into the SFR SBUF, and the Stop Bit goes into bit RB8 of the SFR SCON. The baud rate is variable and derived from overflows of Timer 1 or Timer 2. Mode 2. Mode 2 provides asynchronous, full-duplex communication using a total of 11 bits per data byte. Data is transmitted through TxD and received through RxD with: a Start Bit (logic '0'); eight data bits (LSB first); a programmable 9th data bit; and a Stop Bit (logic '1'). Upon Transmit, the 9th data bit (from bit TB8 in SCON) can be assigned the value of '0' or '1.' Or, for example, the Parity Bit (P, in the PSW) could be moved into TB8. Upon receive, the 9th data bit goes into RB8 in SCON, while the Stop Bit is ignored. The baud rate is programmable to either 1/32 or 1/64 of fOSC. Mode 3. Mode 3 is the same as Mode 2 in all respects except the baud rate is variable like it is in Mode 1. In all four modes, transmission is initiated by any instruction that uses SBUF as a destination register. Reception is initiated in Mode 0 by the condition RI = 0 and REN = 1. Reception is initiated in the other modes by the incoming Start Bit if REN = 1. Table 44. UART Operating Modes Mode Synchronization Bits of SFR, SCON Baud Clock Data Bits Start/Stop Bits See Figure SM0 SM1 0 Synchronous 0 0 fOSC/12 8 None Figure 28., page 86 1 Asynchronous 0 1 Timer 1 or Timer 2 Overflow 8 1 Start, 1 Stop Figure 30., page 88 2 Asynchronous 1 0 fOSC/32 or fOSC/64 9 1 Start, 1 Stop Figure 32., page 90 3 Asynchronous 1 1 Timer 1 or Timer 2 Overflow 9 1 Start, 1 Stop Figure 34., page 91uPSD33xx 82/231 Multiprocessor Communications. Modes 2 and 3 have a special provision for multiprocessor communications. In these modes, 9 data bits are received. The 9th one goes into bit RB8, then comes a stop bit. The port can be programmed such that when the stop bit is received, the UART interrupt will be activated only if bit RB8 = 1. This feature is enabled by setting bit SM2 in SCON. A way to use this feature in multi-processor systems is as follows: When the master processor wants to transmit a block of data to one of several slaves, it first sends out an address byte which identifies the target slave. An address byte differs from a data byte in that the 9th bit is 1 in an address byte and 0 in a data byte. With SM2 = 1, no slave will be interrupted by a data byte. An address byte, however, will interrupt all slaves, so that each slave can examine the received byte and see if it is being addressed. The addressed slave will clear its SM2 bit and prepare to receive the data bytes that will be coming. The slaves that were not being addressed leave their SM2 bits set and go on about their business, ignoring the coming data bytes. SM2 has no effect in Mode 0, and in Mode 1, SM2 can be used to check the validity of the stop bit. In a Mode 1 reception, if SM2 = 1, the receive interrupt will not be activated unless a valid stop bit is received. Serial Port Control Registers The SFR SCON0 controls UART0, and SCON1 controls UART1, shown in Table 45 and Table 46. These registers contain not only the mode selection bits, but also the 9th data bit for transmit and receive (bits TB8 and RB8), and the UART Interrupt flags, TI and RI. Table 45. SCON0: Serial Port UART0 Control Register (SFR 98h, reset value 00h) Bit 7 Bit 6 Bit 5 Bit 4 Bit 3 Bit 2 Bit 1 Bit 0 SM0 SM1 SM2 REN TB8 RB8 TI RI Details Bit Symbol R/W Definition 7 SM0 R,W Serial Mode Select, See Table 44., page 81. Important, notice bit order of SM0 and SM1. [SM0:SM1] = 00b, Mode 0 [SM0:SM1] = 01b, Mode 1 [SM0:SM1] = 10b, Mode 2 [SM0:SM1] = 11b, Mode 3 6 SM1 R,W 5 SM2 R,W Serial Multiprocessor Communication Enable. Mode 0: SM2 has no effect but should remain 0. Mode 1: If SM2 = 0 then stop bit ignored. SM2 =1 then RI active if stop bit = 1. Mode 2 and 3: Multiprocessor Comm Enable. If SM2=0, 9th bit is ignored. If SM2=1, RI active when 9th bit = 1. 4 REN R,W Receive Enable. If REN=0, UART reception disabled. If REN=1, reception is enabled 3 TB8 R,W TB8 is assigned to the 9th transmission bit in Mode 2 and 3. Not used in Mode 0 and 1. 2 RB8 R,W Mode 0: RB8 is not used. Mode 1: If SM2 = 0, the RB8 is the level of the received stop bit. Mode 2 and 3: RB8 is the 9th data bit that was received in Mode 2 and 3. 1 TI R,W Transmit Interrupt flag. Causes interrupt at end of 8th bit time when transmitting in Mode 0, or at beginning of stop bit transmission in other modes. Must clear flag with firmware. 0 RI R,W Receive Interrupt flag. Causes interrupt at end of 8th bit time when receiving in Mode 0, or halfway through stop bit reception in other modes (see SM2 for exception). Must clear this flag with firmware.83/231 uPSD33xx Table 46. SCON1: Serial Port UART1 Control Register (SFR D8h, reset value 00h) Bit 7 Bit 6 Bit 5 Bit 4 Bit 3 Bit 2 Bit 1 Bit 0 SM0 SM1 SM2 REN TB8 RB8 TI RI Details Bit Symbol R/W Definition 7 SM0 R,W Serial Mode Select, See Table 44., page 81. Important, notice bit order of SM0 and SM1. [SM0:SM1] = 00b, Mode 0 [SM0:SM1] = 01b, Mode 1 [SM0:SM1] = 10b, Mode 2 [SM0:SM1] = 11b, Mode 3 6 SM1 R,W 5 SM2 R,W Serial Multiprocessor Communication Enable. Mode 0: SM2 has no effect but should remain 0. Mode 1: If SM2 = 0 then stop bit ignored. SM2 =1 then RI active if stop bit = 1. Mode 2 and 3: Multiprocessor Comm Enable. If SM2=0, 9th bit is ignored. If SM2=1, RI active when 9th bit = 1. 4 REN R,W Receive Enable. If REN=0, UART reception disabled. If REN=1, reception is enabled 3 TB8 R,W TB8 is assigned to the 9th transmission bit in Mode 2 and 3. Not used in Mode 0 and 1. 2 RB8 R,W Mode 0: RB8 is not used. Mode 1: If SM2 = 0, the RB8 is the level of the received stop bit. Mode 2 and 3: RB8 is the 9th data bit that was received in Mode 2 and 3. 1 TI R,W Transmit Interrupt flag. Causes interrupt at end of 8th bit time when transmitting in Mode 0, or at beginning of stop bit transmission in other modes. Must clear flag with firmware. 0 RI R,W Receive Interrupt flag. Causes interrupt at end of 8th bit time when receiving in Mode 0, or halfway through stop bit reception in other modes (see SM2 for exception). Must clear this flag with firmware.uPSD33xx 84/231 UART Baud Rates The baud rate in Mode 0 is fixed: Mode 0 Baud Rate = fOSC / 12 The baud rate in Mode 2 depends on the value of the bit SMOD in the SFR named PCON. If SMOD = 0 (default value), the baud rate is 1/64 the oscillator frequency, fOSC. If SMOD = 1, the baud rate is 1/32 the oscillator frequency. Mode 2 Baud Rate = (2SMOD / 64) x fOSC Baud rates in Modes 1 and 3 are determined by the Timer 1 or Timer 2 overflow rate. Using Timer 1 to Generate Baud Rates. When Timer 1 is used as the baud rate generator (bits RCLK = 0, TCLK = 0), the baud rates in Modes 1 and 3 are determined by the Timer 1 overflow rate and the value of SMOD as follows: Mode 1,3 Baud Rate = (2SMOD / 32) x (Timer 1 overflow rate) The Timer 1 Interrupt should be disabled in this application. The Timer itself can be configured for either “timer” or “counter” operation, and in any of its 3 running modes. In the most typical applications, it is configured for “timer” operation, in the Auto-reload Mode (high nibble of the SFR TMOD = 0010B). In that case the baud rate is given by the formula: Mode 1,3 Baud Rate = (2SMOD / 32) x (fOSC / (12 x [256 – (TH1)])) Table 47 lists various commonly used baud rates and how they can be obtained from Timer 1. Using Timer/Counter 2 to Generate Baud Rates. See Baud Rate Generator Mode, page 77. Table 47. Commonly Used Baud Rates Generated from Timer 1 UART Mode fOSC MHz Desired Baud Rate Resultant Baud Rate Baud Rate Deviation SMOD bit in PCON Timer 1 C/T Bit in TMOD Timer Mode in TMOD TH1 Reload value (hex) Mode 0 Max 40.0 3.33MHz 3.33MHz 0 X X X X Mode 2 Max 40.0 1250 k 1250 k 0 1 X X X Mode 2 Max 40.0 625 k 625 k 0 0 X X X Modes 1 or 3 40.0 19200 18939 -1.36% 1 0 2 F5 Modes 1 or 3 40.0 9600 9470 -1.36% 1 0 2 EA Modes 1 or 3 36.0 19200 18570 -2.34% 1 0 2 F6 Modes 1 or 3 33.333 57600 57870 0.47% 1 0 2 FD Modes 1 or 3 33.333 28800 28934 0.47% 1 0 2 FA Modes 1 or 3 33.333 19200 19290 0.47% 1 0 2 F7 Modes 1 or 3 33.333 9600 9645 0.47% 1 0 2 EE Modes 1 or 3 24.0 9600 9615 0.16% 1 0 2 F3 Modes 1 or 3 12.0 4800 4808 0.16% 1 0 2 F3 Modes 1 or 3 11.0592 57600 57600 0 1 0 2 FF Modes 1 or 3 11.0592 28800 28800 0 1 0 2 FE Modes 1 or 3 11.0592 19200 19200 0 1 0 2 FD Modes 1 or 3 11.0592 9600 9600 0 1 0 2 FA Modes 1 or 3 3.6864 19200 19200 0 1 0 2 FF Modes 1 or 3 3.6864 9600 9600 0 1 0 2 FE Modes 1 or 3 1.8432 9600 9600 0 1 0 2 FF Modes 1 or 3 1.8432 4800 4800 0 1 0 2 FE85/231 uPSD33xx More About UART Mode 0 Refer to the block diagram in Figure 28., page 86, and timing diagram in Figure 29., page 86. Transmission is initiated by any instruction which writes to the SFR named SBUF. At the end of a write operation to SBUF, a 1 is loaded into the 9th position of the transmit shift register and tells the TX Control unit to begin a transmission. Transmission begins on the following MCU machine cycle, when the “SEND” signal is active in Figure 29. SEND enables the output of the shift register to the alternate function on the port containing pin RxD, and also enables the SHIFT CLOCK signal to the alternate function on the port containing the pin, TxD. At the end of each SHIFT CLOCK in which SEND is active, the contents of the transmit shift register are shifted to the right one position. As data bits shift out to the right, zeros come in from the left. When the MSB of the data byte is at the output position of the shift register, then the '1' that was initially loaded into the 9th position, is just to the left of the MSB, and all positions to the left of that contain zeros. This condition flags the TX Control unit to do one last shift, then deactivate SEND, and then set the interrupt flag TI. Both of these actions occur at S1P1. Reception is initiated by the condition REN = 1 and RI = 0. At the end of the next MCU machine cycle, the RX Control unit writes the bits 11111110 to the receive shift register, and in the next clock phase activates RECEIVE. RECEIVE enables the SHIFT CLOCK signal to the alternate function on the port containing the pin, TxD. Each pulse of SHIFT CLOCK moves the contents of the receive shift register one position to the left while RECEIVE is active. The value that comes in from the right is the value that was sampled at the RxD pin. As data bits come in from the right, 1s shift out to the left. When the 0 that was initially loaded into the rightmost position arrives at the left-most position in the shift register, it flags the RX Control unit to do one last shift, and then it loads SBUF. After this, RECEIVE is cleared, and the receive interrupt flag RI is set.uPSD33xx 86/231 Figure 28. UART Mode 0, Block Diagram Figure 29. UART Mode 0, Timing Diagram AI06824 Zero Detector Internal Bus Tx Control Rx Control Internal Bus SBUF Write to SBUF Read SBUF Load SBUF SBUF Input Shift Register Shift Shift Clock Serial Port Interrupt f OSC/12 REN R1 Rx Clock Start Tx Clock Start Shift Shift Send Receive T R CL D S Q 7 6 5 4 3 2 1 0 RxD P3.0 Alt Input Function RxD Pin TxD Pin AI06825 Write to SBUF Send Shift RxD (Data Out) TxD (Shift Clock) TI Write to SCON RI Receive Shift RxD (Data In) TxD (Shift Clock) Clear RI Receive Transmit D0 D1 D2 D3 D4 D5 D6 D7 D0 D1 D2 D3 D4 D5 D6 D787/231 uPSD33xx More About UART Mode 1 Refer to the block diagram in Figure 30., page 88, and timing diagram in Figure 31., page 88. Transmission is initiated by any instruction which writes to SBUF. At the end of a write operation to SBUF, a '1' is loaded into the 9th position of the transmit shift register and flags the TX Control unit that a transmission is requested. Transmission actually starts at the end of the MCU the machine cycle following the next rollover in the divide-by-16 counter. Thus, the bit times are synchronized to the divide-by-16 counter, not to the writing of SBUF. Transmission begins with activation of SEND which puts the start bit at pin TxD. One bit time later, DATA is activated, which enables the output bit of the transmit shift register to pin TxD. The first shift pulse occurs one bit time after that. As data bits shift out to the right, zeros are clocked in from the left. When the MSB of the data byte is at the output position of the shift register, then the 1 that was initially loaded into the 9th position is just to the left of the MSB, and all positions to the left of that contain zeros. This condition flags the TX Control unit to do one last shift and then deactivates SEND, and sets the interrupt flag, TI. This occurs at the 10th divide-by-16 rollover after a write to SBUF. Reception is initiated by a detected 1-to-0 transition at the pin RxD. For this purpose RxD is sampled at a rate of 16 times whatever baud rate has been established. When a transition is detected, the divide-by-16 counter is immediately reset, and 1FFH is written into the input shift register. Resetting the divide-by-16 counter aligns its rollovers with the boundaries of the incoming bit times. The 16 states of the counter divide each bit time into 16ths. At the 7th, 8th, and 9th counter states of each bit time, the bit detector samples the value of RxD. The value accepted is the value that was seen in at least 2 of the 3 samples. This is done for noise rejection. If the value accepted during the first bit time is not '0,' the receive circuits are reset and the unit goes back to looking for another '1'-to- '0' transition. This is to provide rejection of false start bits. If the start bit proves valid, it is shifted into the input shift register, and reception of the reset of the rest of the frame will proceed. As data bits come in from the right, '1s' shift out to the left. When the start bit arrives at the left-most position in the shift register (which in mode 1 is a 9-bit register), it flags the RX Control unit to do one last shift, load SBUF and RB8, and set the receive interrupt flag RI. The signal to load SBUF and RB8, and to set RI, will be generated if, and only if, the following conditions are met at the time the final shift pulse is generated: 1. RI = 0, and 2. Either SM2 = 0, or the received stop bit = 1. If either of these two conditions are not met, the received frame is irretrievably lost. If both conditions are met, the stop bit goes into RB8, the 8 data bits go into SBUF, and RI is activated. At this time, whether the above conditions are met or not, the unit goes back to looking for a '1'-to-'0' transition on pin RxD.uPSD33xx 88/231 Figure 30. UART Mode 1, Block Diagram Figure 31. UART Mode 1, Timing Diagram AI06826 Zero Detector Internal Bus Tx Control Rx Control Internal Bus SBUF Write to SBUF Read SBUF Load SBUF SBUF Input Shift Register Shift Serial Port Interrupt Rx Clock Start Tx Clock Start Shift Shift Send Load SBUF TI RI CL D S Q 1FFh TxD Pin Data Rx Detector RxD Pin 1-to-0 Transition Detector ÷16 Sample ÷16 ÷2 TB8 Timer1 Overflow Timer2 Overflow 0 0 1 1 0 1 TCLK RCLK SMOD AI06843 Write to SBUF Data Shift TxD TI Rx Clock RxD Bit Detector Sample Times Shift RI Receive Transmit D0 D1 D2 D3 D4 D5 D6 D7 Send Tx Clock Start Bit Stop Bit D0 D1 D2 D3 D4 D5 D6 D7 Start Bit Stop Bit89/231 uPSD33xx More About UART Modes 2 and 3 For Mode 2, refer to the block diagram in Figure 32., page 90, and timing diagram in Figure 33., page 90. For Mode 3, refer to the block diagram in Figure 34., page 91, and timing diagram in Figure 35., page 91. Keep in mind that the baud rate is programmable to either 1/32 or 1/64 of fOSC in Mode 2, but Mode 3 uses a variable baud rate generated from Timer 1 or Timer 2 rollovers. The receive portion is exactly the same as in Mode 1. The transmit portion differs from Mode 1 only in the 9th bit of the transmit shift register. Transmission is initiated by any instruction which writes to SBUF. At the end of a write operation to SBUF, the TB8 Bit is loaded into the 9th position of the transmit shift register and flags the TX Control unit that a transmission is requested. Transmission actually starts at the end of the MCU the machine cycle following the next rollover in the divideby-16 counter. Thus, the bit times are synchronized to the divide-by-16 counter, not to the writing of SBUF. Transmission begins with activation of SEND which puts the start bit at pin TxD. One bit time later, DATA is activated, which enables the output bit of the transmit shift register to pin TxD. The first shift pulse occurs one bit time after that. The first shift clocks a '1' (the stop bit) into the 9th bit position of the shift register. There-after, only zeros are clocked in. Thus, as data bits shift out to the right, zeros are clocked in from the left. When bit TB8 is at the output position of the shift register, then the stop bit is just to the left of TB8, and all positions to the left of that contain zeros. This condition flags the TX Control unit to do one last shift and then deactivate SEND, and set the interrupt flag, TI. This occurs at the 11th divide-by 16 rollover after writing to SBUF. Reception is initiated by a detected 1-to-0 transition at pin RxD. For this purpose RxD is sampled at a rate of 16 times whatever baud rate has been established. When a transition is detected, the divide-by-16 counter is immediately reset, and 1FFH is written to the input shift register. At the 7th, 8th, and 9th counter states of each bit time, the bit detector samples the value of RxD. The value accepted is the value that was seen in at least 2 of the 3 samples. If the value accepted during the first bit time is not '0,' the receive circuits are reset and the unit goes back to looking for another '1'-to- '0' transition. If the start bit proves valid, it is shifted into the input shift register, and reception of the rest of the frame will proceed. As data bits come in from the right, '1s' shift out to the left. When the start bit arrives at the left-most position in the shift register (which in Modes 2 and 3 is a 9-bit register), it flags the RX Control unit to do one last shift, load SBUF and RB8, and set the interrupt flag RI. The signal to load SBUF and RB8, and to set RI, will be generated if, and only if, the following conditions are met at the time the final shift pulse is generated: 1. RI = 0, and 2. Either SM2 = 0, or the received 9th data bit = 1. If either of these conditions is not met, the received frame is irretrievably lost, and RI is not set. If both conditions are met, the received 9th data bit goes into RB8, and the first 8 data bits go into SBUF. One bit time later, whether the above conditions were met or not, the unit goes back to looking for a '1'-to-'0' transition on pin RxD.uPSD33xx 90/231 Figure 32. UART Mode 2, Block Diagram Figure 33. UART Mode 2, Timing Diagram AI06844 Zero Detector Internal Bus Tx Control Rx Control Internal Bus SBUF Write to SBUF Read SBUF Load SBUF SBUF Input Shift Register Shift Serial Port Interrupt Rx Clock Start Tx Clock Start Shift Shift Send Load SBUF TI RI CL D S Q 1FFh TxD Pin Data Rx Detector RxD Pin 1-to-0 Transition Detector ÷16 Sample ÷16 ÷2 TB8 f OSC/32 0 1 SMOD AI06845 Write to SBUF Data Shift TxD TI Rx Clock RxD Bit Detector Sample Times Shift RI Receive Transmit D0 D1 D2 D3 D4 D5 D6 D7 Send Tx Clock Start Bit TB8 Stop Bit D0 D1 D2 D3 D4 D5 D6 D7 Start Bit RB8 Stop Bit Stop Bit Generator91/231 uPSD33xx Figure 34. UART Mode 3, Block Diagram Figure 35. UART Mode 3, Timing Diagram AI06846 Zero Detector Internal Bus Tx Control Rx Control Internal Bus SBUF Write to SBUF Read SBUF Load SBUF SBUF Input Shift Register Shift Serial Port Interrupt Rx Clock Start Tx Clock Start Shift Shift Send Load SBUF TI RI CL D S Q 1FFh TxD Pin Data Rx Detector RxD Pin 1-to-0 Transition Detector ÷16 Sample ÷16 ÷2 TB8 Timer1 Overflow Timer2 Overflow 0 0 1 1 0 1 TCLK RCLK SMOD AI06847 Write to SBUF Data Shift TxD TI Rx Clock RxD Bit Detector Sample Times Shift RI Receive Transmit D0 D1 D2 D3 D4 D5 D6 D7 Send Tx Clock Start Bit TB8 Stop Bit D0 D1 D2 D3 D4 D5 D6 D7 Start Bit RB8 Stop Bit Stop Bit GeneratoruPSD33xx 92/231 IrDA INTERFACE uPSD33xx devices provide an internal IrDA interface that will allow the connection of the UART1 serial interface directly to an external infrared transceiver device. The IrDA interface does this by automatically shortening the pulses transmitted on UART1’s TxD1 pin, and stretching the incoming pulses received on the RxD1 pin. Reference Figures 36 and 37. When the IrDA interface is enabled, the output signal from UART1’s transmitter logic on pin TxD1 is compliant with the IrDA Physical Layer Link Specification v1.4 (www.irda.org) operating from 1.2k bps up to 115.2k bps. The pulses received on the RxD1 pin are stretched by the IrDA interface to be recognized by UART1’s receiver logic, also adhering to the IrDA specification up to 115.2k bps. Note: In Figure 37 a logic '0' in the serial data stream of a UART Frame corresponds to a logic high pulse in an IR Frame. A logic '1' in a UART Frame corresponds to no pulse in an IR Frame. Figure 36. IrDA Interface Figure 37. Pulse Shaping by the IrDA Interface UART1 IrDA Interface TxD RxD uPSD33XX IrDA Transceiver TxD1-IrDA RxD1-IrDA SIRClk AI07851 Start Bit 0101 11 1 00 0 Stop Bit UART Frame Data Bits Bit Time Pulse Width = 3/16 Bit Time Start Bit 0101 11 1 00 0 Stop Bit UART Frame IR Frame IR Frame Data Bits AI0962493/231 uPSD33xx The UART1 serial channel can operate in one of four different modes as shown in Table 44., page 81 in the section, SERIAL UART INTERFACES, page 81. However, when UART1 is used for IrDA communication, UART1 must operate in Mode 1 only, to be compatible with IrDA protocol up to 115.2k bps. The IrDA interface will support baud rates generated from Timer 1 or Timer 2, just like standard UART serial communication, but with one restriction. The transmit baud rate and receive baud rate must be the same (cannot be different rates as is allowed by standard UART communications). The IrDA Interface is disabled after a reset and is enabled by setting the IRDAEN Bit in the SFR named IRDACON (Table 48., page 93). When IrDA is disabled, the UART1's RxD and TxD signals will bypass the internal IrDA logic and instead they are routed directly to the pins RxD1 and TxD1 respectively. When IrDA is enabled, the IrDA pulse shaping logic is active and resides between UART1 and the pins RxD1 and TxD1 as shown in Figure 36., page 92. Table 48. IRDACON Register Bit Definition (SFR CEh, Reset Value 0Fh) Bit 7 Bit 6 Bit 5 Bit 4 Bit 3 Bit 2 Bit 1 Bit 0 – IRDAEN PULSE CDIV4 CDIV3 CDIV2 CDIV1 CDIV0 Details Bit Symbol R/W Definition 7 – – Reserved 6 IRDAEN RW IrDA Enable 0 = IrDA Interface is disabled 1 = IrDA is enabled, UART1 outputs are disconnected from Port 1 (or Port 4) 5 PULSE RW IrDA Pulse Modulation Select 0 = 1.627µs 1 = 3/16 bit time pulses 4-0 CDIV[4:0] RW Specify Clock Divider (see Table 49., page 94)uPSD33xx 94/231 Pulse Width Selection The IrDA interface has two ways to modulate the standard UART1 serial stream: 1. An IrDA data pulse will have a constant pulse width for any bit time, regardless of the selected baud rate. 2. An IrDA data pulse will have a pulse width that is proportional to the the bit time of the selected baud rate. In this case, an IrDA data pulse width is 3/16 of its bit time, as shown in Figure 37., page 92. The PULSE bit in the SFR named IRDACON determines which method above will be used. According to the IrDA physical layer specification, for all baud rates at 115.2k bps and below, the minimum data pulse width is 1.41µs. For a baud rate of 115.2k bps, the maximum pulse width 2.23µs. If a constant pulse width is to be used for all baud rates (PULSE bit = 0), the ideal general pulse width is 1.63µs, derived from the bit time of the fastest baud rate (8.68µs bit time for 115.2k bps rate), multiplied by the proportion, 3/16. To produce this fixed data pulse width when the PULSE bit = 0, a prescaler is needed to generate an internal reference clock, SIRClk, shown in Figure 36., page 92. SIRClk is derived by dividing the oscillator clock frequency, fOSC, using the five bits CDIV[4:0] in the SFR named IRDACON. A divisor must be chosen to produce a frequency for SIRClk that lies between 1.34 MHz and 2.13 MHz, but it is best to choose a divisor value that produces SIRClk frequency as close to 1.83MHz as possible, because SIRClk at 1.83MHz will produce an fixed IrDA data pulse width of 1.63µs. Table 49 provides recommended values for CDIV[4:0] based on several different values of fOSC. For reference, SIRClk of 2.13MHz will generate a fixed IrDA data pulse width of 1.41µs, and SIRClk of 1.34MHz will generate a fixed data pulse width of 2.23µs. Table 49. Recommended CDIV[4:0] Values to Generate SIRClk (default CDIV[4:0] = 0Fh, 15 decimal) Note: 1. When PULSE bit = 0 (fixed data pulse width), this is minimum recommended fOSC because CDIV[4:0] must be 4 or greater. fOSC (MHz) Value in CDIV[4:0] Resulting fSIRCLK (MHz) 40.00 16h, 22 decimal 1.82 36.864, or 36.00 14h, 20 decimal 1.84, or 1.80 24.00 0Dh, 13 decimal 1.84 11.059, or 12.00 06h, 6 decimal 1.84, or 2.00 7.3728(1) 04h, 4 decimal 1.8495/231 uPSD33xx I 2C INTERFACE uPSD33xx devices support one serial I2C interface. This is a two-wire communication channel, having a bi-directional data signal (SDA, pin P3.6) and a clock signal (SCL, pin P3.7) based on opendrain line drivers, requiring external pull-up resistors, RP, each with a typical value of 4.7kΩ (see Figure 38). I 2C Interface Main Features Byte-wide data is transferred, MSB first, between a Master device and a Slave device on two wires. More than one bus Master is allowed, but only one Master may control the bus at any given time. Data is not lost when another Master requests the use of a busy bus because I2C supports collision detection and arbitration. The bus Master initiates all data movement and generates the clock that permits the transfer. Once a transfer is initiated by the Master, any device addressed is considered a Slave. Automatic clock synchronization allows I2C devices with different bit rates to communicate on the same physical bus. A single device can play the role of Master or Slave, or a single device can be a Slave only. Each Slave device on the bus has a unique address, and a general broadcast address is also available. A Master or Slave device has the ability to suspend data transfers if the device needs more time to transmit or receive data. This I2C interface has the following features: – Serial I/O Engine (SIOE): serial/parallel conversion; bus arbitration; clock generation and synchronization; and handshaking are all performed in hardware – Interrupt or Polled operation – Multi-master capability – 7-bit Addressing – Supports standard speed I2C (SCL up to 100kHz), fast mode I2C (101KHz to 400kHz), and high-speed mode I2C (401KHz to 833kHz) Figure 38. Typical I2C Bus Configuration Note: 1. For 3.3V system, connect RP to 3.3V VCC. For 5.0V system, connect RP to 5.0V VDD. I 2C BUS SDA SCL RP RP VCC or VDD(1) Device with I2C Interface Device with I2C Interface SDA/P3.6 SCL/P3.7 uPSD33XX(V) Device with I2C Interface AI09623uPSD33xx 96/231 Communication Flow I 2C data flow control is based on the fact that all I 2C compatible devices will drive the bus lines with open-drain (or open-collector) line drivers pulled up with external resistors, creating a wired-AND situation. This means that either bus line (SDA or SCL) will be at a logic '1' level only when no I2C device is actively driving the line to logic '0.' The logic for handshaking, arbitration, synchronization, and collision detection is implemented by each I2C device having: 1. The ability to hold a line low against the will of the other devices who are trying to assert the line high. 2. The ability of a device to detect that another device is driving the line low against its will. Assert high means the driver releases the line and external pull-ups passively raise the signal to logic '1.' Holding low means the open-drain driver is actively pulling the signal to ground for a logic '0.' For example, if a Slave device cannot transmit or receive a byte because it is distracted by and interrupt or it has to wait for some process to complete, it can hold the SCL clock line low. Even though the Master device is generating the SCL clock, the Master will sense that the Slave is holding the SCL line low against the will of the Master, indicating that the Master must wait until the Slave releases SCL before proceeding with the transfer. Another example is when two Master devices try to put information on the bus simultaneously, the first one to release the SDA data line looses arbitration while the winner continues to hold SDA low. Two types of data transfers are possible with I2C depending on the R/W bit, see Figure 39., page 97. 1. Data transfer from Master Transmitter to Slave Receiver (R/W = 0). In this case, the Master generates a START condition on the bus and it generates a clock signal on the SCL line. Then the Master transmits the first byte on the SDA line containing the 7-bit Slave address plus the R/W bit. The Slave who owns that address will respond with an acknowledge bit on SDA, and all other Slave devices will not respond. Next, the Master will transmit a data byte (or bytes) that the addressed Slave must receive. The Slave will return an acknowledge bit after each data byte it successfully receives. After the final byte is transmitted by the Master, the Master will generate a STOP condition on the bus, or it will generate a RESTART conditon and begin the next transfer. There is no limit to the number of bytes that can be transmitted during a transfer session. 2. Data transfer from Slave Transmitter to Master Receiver (R/W = 1). In this case, the Master generates a START condition on the bus and it generates a clock signal on the SCL line. Then the Master transmits the first byte on the SDA line containing the 7-bit Slave address plus the R/W bit. The Slave who owns that address will respond with an acknowledge bit on SDA, and all other Slave devices will not respond. Next, the addressed Slave will transmit a data byte (or bytes) to the Master. The Master will return an acknowledge bit after each data byte it successfully receives, unless it is the last byte the Master desires. If so, the Master will not acknowledge the last byte and from this, the Slave knows to stop transmitting data bytes to the Master. The Master will then generate a STOP condition on the bus, or it will generate a RE-START conditon and begin the next transfer. There is no limit to the number of bytes that can be transmitted during a transfer session. A few things to know related to these transfers: – Either the Master or Slave device can hold the SCL clock line low to indicate it needs more time to handle a byte transfer. An indefinite holding period is possible. – A START condition is generated by a Master and recognized by a Slave when SDA has a 1- to-0 transition while SCL is high (Figure 39., page 97). – A STOP condition is generated by a Master and recognized by a Slave when SDA has a 0- to1 transition while SCL is high (Figure 39., page 97). – A RE-START (repeated START) condition generated by a Master can have the same function as a STOP condition when starting another data transfer immediately following the previous data transfer (Figure 39., page 97). – When transferring data, the logic level on the SDA line must remain stable while SCL is high, and SDA can change only while SCL is low. However, when not transferring data, SDA may change state while SCL is high, which creates the START and STOP bus conditions.97/231 uPSD33xx – An Acknowlegde bit is generated from a Master or a Slave by driving SDA low during the “ninth” bit time, just following each 8-bit byte that is transfered on the bus (Figure 39., page 97). A Non-Acknowledge occurs when SDA is asserted high during the ninth bit time. All byte transfers on the I2C bus include a 9th bit time reserved for an Acknowlege (ACK) or Non-Acknowledge (NACK). – An additional Master device that desires to control the bus should wait until the bus is not busy before generating a START condition so that a possible Slave operation is not interrupted. – If two Master devices both try to generate a START condition simultaneously, the Master who looses arbitration will switch immediately to Slave mode so it can recoginize it’s own Slave address should it appear on the bus. Figure 39. Data Transfer on an I2C Bus MSB 7-bit Slave Address READ/WRITE Indicator Acknowledge bits from receiver Start Condition Clock can be held low to stall transfer. Repeated if more data bytes are transferred. Repeated Start Condition Stop Condition 12 789 3-6 1 2 9 3-8 ACK MSB ACK NACK R/W AI09625uPSD33xx 98/231 Operating Modes The I2C interface supports four operating modes: ■ Master-Transmitter ■ Master-Receiver ■ Slave-Transmitter ■ Slave-Receiver The interface may operate as either a Master or a Slave within a given application, controlled by firmware writing to SFRs. By default after a reset, the I2C interface is in Master Receiver mode, and the SDA/P3.6 and SCL/ P3.7 pins default to GPIO input mode, high impedance, so there is no I2C bus interference. Before using the I2C interface, it must be initialized by firmware, and the pins must be configured. This is discussed in I 2C Operating Sequences, page 108. Bus Arbitration A Master device always samples the I2C bus to ensure a bus line is high whenever that Master is asserting a logic 1. If the line is low at that time, the Master recognizes another device is overriding it’s own transmission. A Master may start a transfer only if the I2C bus is not busy. However, it’s possible that two or more Masters may generate a START condition simultaneously. In this case, arbitration takes place on the SDA line each time SCL is high. The Master that first senses that its bus sample does not correspond to what it is driving (SDA line is low while it’s asserting a high) will immediately change from Master-Transmitter to Slave-Receiver mode. The arbitration process can carry on for many bit times if both Masters are addressing the same Slave device, and will continue into the data bits if both Masters are trying to be Master-Transmitter. It is also possible for arbitration to carry on into the acknowledge bits if both Masters are trying to be Master-Receiver. Because address and data information on the bus is determined by the winning Master, no information is lost during the arbitration process. Clock Synchronization Clock synchronization is used to synchronize arbitrating Masters, or used as a handshake by a devices to slow down the data transfer. Clock Sync During Arbitration. During bus arbitration between competing Masters, Master_X, with the longest low period on SCL, will force Master_Y to wait until Master_X finishes its low period before Master_Y proceeds to assert its high period on SCL. At this point, both Masters begin asserting their high period on SCL simultaneously, and the Master with the shortest high period will be the first to drive SCL for the next low period. In this scheme, the Master with the longest low SCL period paces low times, and the Master with the shortest high SCL period paces the high times, making synchronized arbitration possible. Clock Sync During Handshaking. This allows receivers in different devices to handle various transfer rates, either at the byte-level, or bit-level. At the byte-level, a device may pause the transfer between bytes by holding SCL low to have time to store the latest received byte or fetch the next byte to transmit. At the bit-level, a Slave device may extend the low period of SCL by holding it low. Thus the speed of any Master device will adapt to the internal operation of the Slave. General Call Address A General Call (GC) occurs when a Master-Transmitter initiates a transfer containing a Slave address of 0000000b, and the R/W bit is logic 0. All Slave devices capable of responding to this broadcast message will acknowledge the GC simultaneously and then behave as a Slave-Receiver. The next byte transmitted by the Master will be accepted and acknowledged by all Slaves capable of handling the special data bytes. A Slave that cannot handle one of these data bytes must ignore it by not acknowledging it. The I2C specification lists the possible meanings of the special bytes that follow the first GC address byte, and the actions to be taken by the Slave device(s) upon receiving them. A common use of the GC by a Master is to dynamically assign device addresses to Slave devices on the bus capable of a programmable device address. The uPSD33xx can generate a GC as a MasterTransmitter, and it can receive a GC as a Slave. When receiving a GC address (00h), an interrupt will be generated so firmware may respond to the special GC data bytes if desired.99/231 uPSD33xx Serial I/O Engine (SIOE) At the heart of the I2C interface is the hardware SIOE, shown in Figure 40. The SIOE automatically handles low-level I2C bus protocol (data shifting, handshaking, arbitration, clock generation and synchronization) and it is controlled and monitored by five SFRs. The five SFRs shown in Figure 40 are: ■ S1CON - Interface Control (Table 50., page 100) ■ S1STA - Interface Status (Table 52., page 103) ■ S1DAT - Data Shift Register (Table 53., page 104) ■ S1ADR - Device Address (Table 54., page 104) ■ S1SETUP - Sampling Rate (Table 55., page 105) Figure 40. I2C Interface SIOE Block Diagram OpenDrain Output Input OpenDrain Output Input Comparator S1SETUP - Sample Rate Control (START Condition) S1STA - Interface Status S1CON - Interface Control ACK Bit SCL / P3.7 Timing and Control Clock Generation Arbitration and Sync Periph Clock (fOSC) SDA / P3.6 8032 MCU Bus INTR to 8032 S1DAT - Shift Register Serial DATA IN Serial DATA OUT Shift Direction 8 8 8 8 8 7 7 b7 b0 S1ADR - Device Address b7 b0 AI09626uPSD33xx 100/231 I 2C Interface Control Register (S1CON) Table 50. Serial Control Register S1CON (SFR DCh, Reset Value 00h) Bit 7 Bit 6 Bit 5 Bit 4 Bit 3 Bit 2 Bit 1 Bit 0 CR2 ENI1 STA STO ADDR AA CR[1:0] Details Bit Symbol R/W Function 7 CR2 R,W This bit, along with bits CR1 and CR0, determine the SCL clock frequency (fSCL) when SIOE is in Master mode. These bits create a clock divisor for fOSC. See Table 51. 6 ENI1 R,W I 2C Interface Enable 0 = SIOE disabled, 1 = SIOE enabled. When disabled, both SDA and SCL signals are in high impedance state. 5 STA R,W START flag. When set, Master mode is entered and SIOE generates a START condition only if the I2C bus is not busy. When a START condition is detected on the bus, the STA flag is cleared by hardware. When the STA bit is set during an interrupt service, the START condition will be generated after the interrupt service. 4 STO R,W STOP flag When STO is set in Master mode, the SIOE generates a STOP condition. When a STOP condition is detected, the STO flag is cleared by hardware. When the STO bit is set during an interrupt service, the STOP condition will be generated after the interrupt service. 3 ADDR R,W This bit is set when an address byte received in Slave mode matches the device address programmed into the S1ADR register. The ADDR bit must be cleared with firmware. 2 AA R,W Assert Acknowledge enable If AA = 1, an acknowledge signal (low on SDA) is automatically returned during the acknowledge bit-time on the SCL line when any of the following three events occur: 1. SIOE in Slave mode receives an address that matches contents of S1ADR register 2. A data byte has been received while SIOE is in Master Receiver mode 3. A data byte has been received while SIOE is a selected Slave Receiver When AA = 0, no acknowledge is returned (high on SDA during acknowledge bit-time). 1, 0 CR1, CR0 R,W These bits, along with bit CR2, determine the SCL clock frequency (fSCL) when SIOE is in Master mode. These bits create a clock divisor for fOSC. See Table 51 for values.101/231 uPSD33xx Table 51. Selection of the SCL Frequency in Master Mode based on fOSC Examples Note: 1. These values are beyond the bit rate supported by uPSD33xx. CR2 CR1 CR0 fOSC Divided by: Bit Rate (kHz) @ fOSC 12MHz fOSC 24MHz fOSC 36MHz fOSC 40MHz fOSC 0 0 0 32 375 750 X(1) X(1) 0 0 1 48 250 500 750 833 0 1 0 60 200 400 600 666 0 1 1 120 100 200 300 333 1 0 0 240 50 100 150 166 1 0 1 480 25 50 75 83 1 1 0 960 12.5 25 37.5 41 1 1 1 1920 6.25 12.5 18.75 20uPSD33xx 102/231 I 2C Interface Status Register (S1STA) The S1STA register provides status regarding immediate activity and the current state of operation on the I2C bus. All bits in this register are read-only except bit 5, INTR, which is the interrupt flag. Interrupt Conditions. If the I2C interrupt is enabled (EI2C = 1 in SFR named IEA, and EA =1 in SFR named IE), and the SIOE is initialized, then an interrupt is automatically generated when any one of the following five events occur: – When the SIOE receives an address that matches the contents of the SFR, S1ADR. Requirements: SIOE is in Slave Mode, and bit AA = 1 in the SFR S1CON. – When the SIOE receives General Call address. Requirments: SIOE is in Slave Mode, bit AA = 1 in the SFR S1CON – When a complete data byte has been received or transmitted by the SIOE while in Master mode. The interrupt will occur even if the Master looses arbitration. – When a complete data byte has been received or transmitted by the SIOE while in selected Slave mode. – A STOP condition on the bus has been recognized by the SIOE while in selected Slave mode. Selected Slave mode means the device address sent by the Master device at the beginning of the current data transfer matched the address stored in the S1ADR register. If the I2C interrupt is not enabled, the MCU may poll the INTR flag in S1STA.103/231 uPSD33xx Table 52. S1STA: I2C Interface Status Register (SFR DDh, reset value 00h) Bit 7 Bit 6 Bit 5 Bit 4 Bit 3 Bit 2 Bit 1 Bit 0 GC STOP INTR TX_MODE BBUSY BLOST ACK_RESP SLV Details Bit Symbol R/W Function 7 GC R General Call flag GC = 1 if the General Call address of 00h was received when SIOE is in Slave mode, and GC is cleared by a START or STOP condition on the bus. If the SIOE is in Master mode when GC = 1, the Bus Lost condition exists, and BLOST = 1. 6 STOP R STOP flag STOP = 1 while SIOE detects a STOP condition on the bus when in Master or Slave mode. 5 INTR R,W Interrupt flag INTR is set to 1 by any of the five I2C interrupt conditions listed above. INTR must be cleared by firmware. 4 TX_MODE R Transmission Mode flag TX_MODE = 1 whenever the SIOE is in Master-Transmitter or SlaveTransmitter mode. TX_MODE = 0 when SIOE is in any receiver mode. 3 BBUSY R Bus Busy flag BBUSY = 1 when the I2C bus is in use. BBUSY is set by the SIOE when a START condition exists on the bus and BBUSY is cleared by a STOP condition. 2 BLOST R Bus Lost flag BLOST is set when the SIOE is in Master mode and it looses the arbitration process to another Master device on the bus. 1 ACK_RESP R Not Acknowledge Response flag While SIOE is in Transmitter mode: – After SIOE sends a byte, ACK_RESP = 1 whenever the external I2C device receives the byte, but that device does NOT assert an ackowledge signal (external device asserted a high on SDA during the acknowledge bit-time). – After SIOE sends a byte, ACK_RESP = 0 whenever the external I2C device receives the byte, and that device DOES assert an ackowledge signal (external device drove a low on SDA during the acknowledge bit-time) Note: If SIOE is in Master-Transmitter mode, and ACK_RESP = 1 due to a Slave-Transmitter not sending an Acknowledge, a STOP condition will not automatically be generated by the SIOE. The STOP condition must be generated with S1CON.STO = 1. 0 SLV R Slave Mode flag SLV = 1 when the SIOE is in Slave mode. SLV = 0 when the SIOE is in Master mode (default).uPSD33xx 104/231 I 2C Data Shift Register (S1DAT) The S1ADR register (Table 53) holds a byte of serial data to be transmitted or it holds a serial byte that has just been received. The MCU may access S1DAT while the SIOE is not in the process of shifting a byte (the INTR flag indicates shifting is complete). While transmitting, bytes are shifted out MSB first, and when receiving, bytes are shifted in MSB first, through the Acknowledge Bit register as shown in Figure 40., page 99. Bus Wait Condition. After the SIOE finishes receiving a byte in Receive mode, or transmitting a byte in Transmit mode, the INTR flag (in S1STA) is set and automatically a wait condition is imposed on the I2C bus (SCL held low by SIOE). In Transmit mode, this wait condition is released as soon as the MCU writes any byte to S1DAT. In Receive mode, the wait condition is released as soon as the MCU reads the S1DAT register. This method allows the user to handle transmit and receive operations within an interrupt service routine. The SIOE will automatically stall the I2C bus at the appropriate time, giving the MCU time to get the next byte ready to transmit or time to read the byte that was just received. Table 53. S1DAT: I2C Data Shift register (SFR DEh, reset value 00h) I 2C Address Register (S1ADR) The S1ADR register (Table 54) holds the 7-bit device address used when the SIOE is operating as a Slave. When the SIOE receives an address from a Master, it will compare this address to the contents of S1ADR, as shown in Figure 40., page 99. If the 7 bits match, the INTR Interrupt flag (in S1STA) is set, and the ADDR Bit (in S1CON) is set. The SIOE cannot modify the contents S1ADR, and S1ADR is not used during Master mode. Table 54. S1ADR: I2C Address register (SFR DFh, reset value 00h) Bit 7 Bit 6 Bit 5 Bit 4 Bit 3 Bit 2 Bit 1 Bit 0 S1DAT[7:0] Details Bit Symbol R/W Function 7:0 S1DAT[7:0] R/W Holds the data byte to be transmitted in Transmit mode, or it holds the data byte received in Receiver mode. Bit 7 Bit 6 Bit 5 Bit 4 Bit 3 Bit 2 Bit 1 Bit 0 SLA6 SLA5 SLA4 SLA3 SLA2 SLA1 SLA0 – Details Bit Symbol R/W Function 7:1 SLA[6:0] R/W Stores desired 7-bit device address, used when SIOE is in Slave mode. 0 – – Not used105/231 uPSD33xx I 2C START Sample Setting (S1SETUP) The S1SETUP register (Table 55) determines how many times an I2C bus START condition will be sampled before the SIOE validates the START condition, giving the SIOE the ability to reject noise or illegal transmissions. Because the minimum duration of an START condition varies with I2C bus speed (fSCL), and also because the uPSD33xx may be operated with a wide variety of frequencies (fOSC), it is necessary to scale the number of samples per START condition based on fOSC and fSCL. In Slave mode, the SIOE recognizes the beginning of a START condition when it detects a '1'-to-'0' transition on the SDA bus line while the SCL line is high (see Figure 39., page 97). The SIOE must then validate the START condition by sampling the bus lines to ensure SDA remains low and SCL remains high for a minimum amount of hold time, tHLDSTA. Once validated, the SIOE begins receiving the address byte that follows the START condition. If the EN_SS Bit (in the S1SETUP Register) is not set, then the SIOE will sample only once after detecting the '1'-to-'0' transition on SDA. This single sample is taken 1/fOSC seconds after the initial 1- to-0 transition was detected. However, more samples should be taken to ensure there is a valid START condition. To take more samples, the SIOE should be initialized such that the EN_SS Bit is set, and a value is written to the SMPL_SET[6:0] field of the S1SETUP Register to specify how many samples to take. The goal is to take a good number of samples during the minimum START condition hold time, tHLDSTA, but no so many samples that the bus will be sampled after tHLDSTA expires. Table 56., page 106 describes the relationship between the contents of S1SETUP and the resulting number of I2C bus samples that SIOE will take after detecting the 1-to-0 transition on SDA of a START condition. Important: Keep in mind that the time between samples is always 1/fOSC. The minimum START condition hold time, tHLDSTA, is different for the three common I2C speed categories per Table 57., page 106. Table 55. S1SETUP: I2C START Condition Sample Setup register (SFR DBh, reset value 00h) Note: 1. Sampling SCL and SDA lines begins after '1'-to-'0' transition on SDA occurred while SCL is high. Time between samples is 1/fOSC. Bit 7 Bit 6 Bit 5 Bit 4 Bit 3 Bit 2 Bit 1 Bit 0 EN_SS SMPL_SET[6:0] Details Bit Symbol R/W Function 7 EN_SS R/W Enable Sample Setup EN_SS = 1 will force the SIOE to sample(1) a START condition on the bus the number of times specified in SMPL_SET[6:0]. EN_SS = 0 means the SIOE will sample(1) a START condition only one time, regardless of the contents of SMPL_SET[6:0]. 6:0 SMPL_SET [6:0] – Sample Setting Specifies the number of bus samples(1) taken during a START condition. See Table 56 for values.uPSD33xx 106/231 Table 56. Number of I2C Bus Samples Taken after 1-to-0 Transition on SDA (START Condition) Table 57. Start Condition Hold Time Note: 1. 833KHz is maximum for uPSD33xx devices. Contents of S1SETUP Resulting value for S1SETUP Resulting Number of Samples Taken After 1-to-0 on SDA Line SS_EN bit SMPL_SET[6:0] 0 XXXXXXXb 00h (default) 1 1 0000000b 80h 1 1 0000001b 81h 2 1 0000010b 82h 3 ... ... ... ... 1 0001011b 8Bh 12 1 0010111b 97h 24 ... ... ... ... 1 1111111b FFh 128 I 2C Bus Speed Range of I2C Clock Speed (fSCL) Minimum START Condition Hold Time (tHLDSTA) Standard Up to 100KHz 4000ns Fast 101KHz to 400KHz 600ns High 401KHz to 833KHz(1) 160ns107/231 uPSD33xx Table 58 provides recommended settings for S1SETUP based on various combinations of fOSC and fSCL. Note that the “Total Sample Period” times in Table 57., page 106 are typically slightly less than the minimum START condition hold time, tHLDSTA for a given I2C bus speed. Important: The SCL bit rate fSCL must first be determined by bits CR[2:0] in the SFR S1CON before a value is chosen for SMPL_SET[6:0] in the SFR S1SETUP. Table 58. S1SETUP Examples for Various I2C Bus Speeds and Oscillator Frequencies Note: 1. Not compatible with High Speed I2C. I 2C Bus Speed, fSCL Parameter Oscillator Frequency, fOSC 6 MHz 12 MHz 24 MHz 33 MHz 40 MHz Standard Recommended S1SETUP Value 93h A7h CFh EEh FFh Number of Samples 20 40 80 111 128 Time Between Samples 166.6ns 83.3ns 41.6ns 30ns 25ns Total Sampled Period 3332ns 3332ns 3332ns 3333ns 3200ns Fast Recommended S1SETUP Value 82h 85h 8Bh 90h 93h Number of Samples 3 6 12 17 20 Time Between Samples 166.6ns 83.3ns 41.6ns 30ns 25ns Total Sampled Period 500ns 500ns 500ns 510ns 500ns High Recommended S1SETUP Value (Note 1) 80 82 83 84 Number of Samples - 1 3 4 5 Time Between Samples - 83.3ns 41.6ns 30ns 25ns Total Sampled Period - 83.3 125ns 120ns 125nsuPSD33xx 108/231 I 2C Operating Sequences The following pseudo-code explains hardware control for these I2C functions on the uPSD33xx: – Initialize the Interface – Function as Master-Transmitter – Function as Master-Receiver – Function as Slave-Transmitter – Function as Slave-Receiver – Interrupt Service Routine Full C code drivers for the uPSD33xx I2C interface, and other interfaces are available from the web at www.st.com\psm. Initialization after a uPSD33xx reset Ensure pins P3.6 and P3.7 are GPIO inputs – SFR P3.7 = 1 and SFR P3.6 = 1 Configure pins P3.6 and P3.7 as I2C – SFR P3SFS.6 = 1 and P3SFS.7 = 1 Set I2C clock prescaler to determine fSCL – SFR S1CON.CR[2:0] = desired SCL freq. Set bus START condition sampling – SFR S1SETUP[7:0] = number of samples Enable individual I2C interrupt and set priority – SFR IEA.I2C = 1 – SFR IPA.I2C = 1 if high priority is desired Set the Device address for Slave mode – SFR S1ADR = XXh, desired address Enable SIOE (as Slave) to return an ACK signal – SFR S1CON.AA = 1 Master-Transmitter Disable all interrupts – SFR IE.EA = 0 Set pointer to global data xmit buffer, set count – *xmit_buf = *pointer to data – buf_length = number of bytes to xmit Set global variables to indicate Master-Xmitter – I2C_master = 1, I2C_xmitter = 1 Disable Master from returning an ACK – SFR S1CON.AA = 0 Enable I2C SIOE – SFR S1CON.INI1 = 1 Transmit Address and R/W bit = 0 to Slave – Is bus not busy? (SFR S1STA.BBUSY = 0?) – SFR S1DAT[7:0] = Load Slave Address & FEh – SFR S1CON.STA = 1, send START on bus Enable All Interrupts and go do something else – SFR IE.EA = 1 Master-Receiver Disable all interrupts – SFR IE.EA = 0 Set pointer to global data recv buffer, set count – *recv_buf = *pointer to data – buf_length = number of bytes to recv Set global variables to indicate Master-Xmitter – I2C_master = 1, I2C_xmitter = 0 Disable Master from returning an ACK – SFR S1CON.AA = 0 Enable I2C SIOE – SFR S1CON.INI1 = 1 Transmit Address and R/W bit = 1 to Slave – Is bus not busy? (SFR S1STA.BBUSY = 0?) – SFR S1DAT[7:0] = Load Slave Address # 01h – SFR S1CON.STA = 1, send START on bus Enable All Interrupts and go do something else – SFR IE.EA = 1109/231 uPSD33xx Slave-Transmitter Disable all interrupts – SFR IE.EA = 0 Set pointer to global data xmit buffer, set count – *xmit_buf = *pointer to data – buf_length = number of bytes to xmit Set global variables to indicate Master-Xmitter – I2C_master = 0, I2C_xmitter = 1 Enable SIOE – SFR S1CON.INI1 = 1 Prepare to Xmit first data byte – SFR S1DAT[7:0] = xmit_buf[0] Enable All Interrupts and go do something else – SFR IE.EA = 1 Slave-Receiver Disable all interrupts – SFR IE.EA = 0 Set pointer to global data recv buffer, set count – *recv_buf = *pointer to data – buf_length = number of bytes to recv Set global variables to indicate Master-Xmitter – I2C_master = 0, I2C_xmitter = 0 Enable SIOE – SFR S1CON.INI1 = 1 Enable All Interrupts and go do something else – SFR IE.EA = 1 Interrupt Service Routine (ISR). A typical I2C interrupt service routine would handle a interrupt for any of the four combinations of Master/Slave and Transmitter/Receiver. In the example routines above, the firmware sets global variables, I2C_master and I2C_xmitter, before enabling interrupts. These flags tell the ISR which one of the four cases to process. Following is pseudo-code for high-level steps in the I2C ISR: Begin I2C ISR : Clear I2C interrupt flag: – S1STA.INTR = 0 Read status of SIOE, put in to variable, status – status = S1STA Read global variables that determine the mode – mode <= (I2C_master, I2C_slave) If mode is Master-Transmitter Bus Arbitration lost? (status.BLOST=1?) If Yes, Arbitration was lost: – S1DAT = dummy, write to release bus – Exit ISR, SIOE will switch to Slave Recv mode If No, Arbitration was not lost, continue: ACK recvd from Slave? (status.ACK_RESP=0?) If No, an ACK was not received: – S1CON.STO = 1, set STOP bus condition – – S1DAT = dummy, write to release bus – Exit ISR If Yes, ACK was received, then continue: – S1DAT = xmit_buf[buffer_index], transmit byte Was that the last byte of data to transmit? If No, it was not the last byte, then: – Exit ISR, transmit next byte on next interrupt If Yes, it was the last byte, then: – S1CON.STO = 1, set STOP bus condition – S1DAT = dummy, write to release bus – Exit ISRuPSD33xx 110/231 Else If mode is Master-Receiver: Bus Arbitration lost? (status.BLOST=1?) If Yes, Arbitration was lost: – S1DAT = dummy, write to release bus – Exit ISR, SIOE will switch to Slave Recv mode If No, Aribitration was not lost, continue: Is this Interrupt from sending an address to Slave, or is it from receiving a data byte from Slave? If its from sending Slave address, goto A: If its from receiving Slave data, goto B: A: (Interrupt is from Master sending addr to Slave) ACK recvd from Slave? (status.ACK_RESP=0?) If No, an ACK was not received: – S1CON.STO = 1, set STOP condition – dummy = S1DAT, read to release bus – Exit ISR If Yes, ACK was received, then continue: – dummy = S1DAT, read to release bus Does Master want to receive just one data byte? If Yes, do not allow Master to ACK on next interrupt: – Exit ISR, now ready to recv one byte from Slv If No, Master can ACK next byte from Slv – S1CON.AA = 1, allow Master to send ACK – Exit ISR, now ready to recv data from Slave B: (Interrupt is from Master recving data from Slv) – recv_buf[buffer_index] = S1DAT, read byte Is this the last data byte to receive from Slave? If Yes, tell Slave to stop transmitting: – S1CON.STO = 1, set STOP bus condition – Exit ISR, finished receiving data from Slave If No, continue: Is this the next to last byte to receive from Slave? If this is the next to last byte, do not allow Master to ACK on next interrupt. – S1CON.AA = 0, don’t let Master return ACK – Exit ISR, now ready to recv last byte from Slv If this is not next to last byte, let Master send ACK to Slave – Exit ISR, ready to recv more bytes from Slave Else If mode is Slave-Transmitter: Is this Intr from SIOE detecting a STOP on bus? If Yes, a STOP was detected: – S1DAT = dummy, write to release bus – Exit ISR, Master needs no more data bytes If No, a STOP was not detected, continue: ACK recvd from Master? (status.ACK_RESP=0?) If No, an ACK was not received: – S1DAT = dummy, write to release bus – Exit ISR, Master needs no more data bytes If Yes, ACK was received, then continue: – S1DAT = xmit_buf[buffer_index], transmit byte – Exit ISR, transmit next byte on next interrupt111/231 uPSD33xx Else If mode is Slave-Receiver: Is this Intr from SIOE detecting a STOP on bus? If Yes, a STOP was detected: – recv_buf[buffer_index] = S1DAT, get last byte – Exit ISR, Master has sent last byte If No, a STOP was not detected, continue: Determine if this Interrupt is from receiving an address or a data byte from a Master. Is (S1CON.ADDR = 1 and S1CON.AA =1)? If No, intr is from receiving data, goto C: If Yes, intr is from an address, continue: – slave_is_adressed = 1, local variable set true – S1CON.ADDR = 0, clear address match flag Determine if R/W bit indicates transmit or receive. Does status.TX_MODE = 1? If Yes, Master wants transmit mode – Exit ISR, indicate Master wants Slv-Xmit mode If No, Master wants Slave-Recv mode – dummy = S1DAT, read taran se bueuPSD33xx 112/231 SPI (SYNCHRONOUS PERIPHERAL INTERFACE) uPSD33xx devices support one serial SPI interface in Master Mode only. This is a three- or fourwire synchronous communication channel, capable of full-duplex operation on 8-bit serial data transfers. The four SPI bus signals are: ■ SPIRxD Pin P1.5 or P4.5 receives data from the Slave SPI device to the uPSD33xx ■ SPITxD Pin P1.6 or P4.6 transmits data from the uPSD33xx to the Slave SPI device ■ SPICLK Pin P1.4 or P4.4 clock is generated from the uPSD33xx to the SPI Slave device ■ SPISEL Pin P1.7 or P4.7 selects the signal from the uPSD33xx to an individual Slave SPI device This SPI interface supports single-Master/multiple-Slave connections. Multiple-Master connections are not directly supported by the uPSD33xx (no internal logic for collision detection). If more than one Slave device is required, the SPISEL signal may be generated from uPSD33xx GPIO outputs (one for each Slave) or from the PLD outputs of the PSD Module. Figure 41. illustrates three examples of SPI device connections using the uPSD33xx: ■ Single-Master/Single-Slave with SPISEL ■ Single-Master/Single-Slave without SPISEL ■ Single-Master/Multiple-Slave without SPISEL Figure 41. SPI Device Connection Examples SPI Bus SPI Bus SPI Bus SPITxD SPIRxD uPSD33xx SPI Master SPI Slave SPICLK Device SPISEL AI07853b MOSI MISO SCLK Single-Master/Single-Slave, with SPISEL Single-Master/Single-Slave, without SPISEL Single-Master/Multiple-Slave, without SPISEL SS SPI Slave Device MOSI MISO SCLK SS SPI Slave Device MOSI MISO SCLK SS SS SPITxD SPIRxD uPSD33xx SPI Master SPI Slave SPICLK Device SPITxD SPIRxD uPSD33xx SPI Master SPICLK GPIO or PLD GPIO or PLD MOSI MISO SCLK113/231 uPSD33xx SPI Bus Features and Communication Flow The SPICLK signal is a gated clock generated from the uPSD33xx (Master) and regulates the flow of data bits. The Master may transmit at a variety of baud rates, and the SPICLK signal will clock one period for each bit of transmitted data. Data is shifted on one edge of SPICLK and sampled on the opposite edge. The SPITxD signal is generated by the Master and received by the Slave device. The SPIRxD signal is generated by the Slave device and received by the Master. There may be no more than one Slave device transmitting data on SPIRxD at any given time in a multi-Slave configuration. Slave selection is accomplished when a Slave’s “Slave Select” (SS) input is permanently grounded or asserted active-low by a Master device. Slave devices that are not selected do not interfere with SPI activities. Slave devices ignore SPICLK and keep their MISO output pins in high-impedance state when not selected. The SPI specification allows a selection of clock polarity and clock phase with respect to data. The uPSD33xx supports the choice of clock polarity, but it does not support the choice of clock phase (phase is fixed at what is typically known as CPHA = 1). See Figure 43. and Figure 44., page 114 for SPI data and clock relationships. Referring to these figures (43 and 44), when the phase mode is defined as such (fixed at CPHA =1), in a new SPI data frame, the Master device begins driving the first data bit on SPITxD at the very first edge of the first clock period of SPICLK. The Slave device will use this first clock edge as a transmission start indicator, and therefore the Slave’s Slave Select input signal may remain grounded in a single-Master/single-Slave configuration (which means the user does not have to use the SPISEL signal from uPSD33xx in this case). The SPI specification does not specify high-level protocol for data exchange, only low-level bit-serial transfers are defined. Full-Duplex Operation When an SPI transfer occurs, 8 bits of data are shifted out on one pin while a different 8 bits of data are simultaneously shifted in on a second pin. Another way to view this transfer is that an 8-bit shift register in the Master and another 8-bit shift register in the Slave are connected as a circular 16-bit shift register. When a transfer occurs, this distributed shift register is shifted 8 bit positions; thus, the data in the Master and Slave devices are effectively exchanged (see Figure 42.). Bus-Level Activity Figure 43. details an SPI receive operation (with respect to bus Master) and Figure 44. details an SPI transmit operation. Also shown are internal flags available to firmware to manage data flow. These flags are accessed through a number of SFRs. Note: The uPSD33xx SPI interface SFRs allow the choice of transmitting the most significant bit (MSB) of a byte first, or the least significant bit (LSB) first. The same bit-order applies to data reception. Figures 43 and 44 illustrate shifting the LSB first. Figure 42. SPI Full-Duplex Data Exchange SPI Bus Master Device Slave Device AI10485 SS SPITxD SPIRxD Baud Rate Generator 8-Bit Shift Register 8-Bit Shift Register SPICLK MOSI MISO SCLKuPSD33xx 114/231 Figure 43. SPI Receive Operation Example Figure 44. SPI Transmit Operation Example Bit7 SPICLK (SPO=0) SPICLK (SPO=1) SPIRXD Bit0 Bit1 Bit7 Bit0 Bit1 Bit7 1 frame RISF RORIS BUSY SPIINTR SPIRDR Full interrupt requested Interrupt handler read data in SPIRDR SPIRDR Full interrupt requested Transmit End interrupt requested AI07855 Bit0 SPICLK (SPO=0) SPICLK (SPO=1) SPITXD Bit1 Bit7 Bit0 Bit1 Bit7 1 frame TISF TEISF BUSY SPIINTR SPITDR Empty interrupt requested Interrupt handler write data in TDR SPITDR Empty interrupt requested Transmit End interrupt requested SPISEL AI07854115/231 uPSD33xx SPI SFR Registers Six SFR registers control the SPI interface: ■ SPICON0 (Table 59., page 117) for interface control ■ SPICON1 (Table 60., page 118) for interrupt control ■ SPITDR (SFR D4h, Write only) holds byte to transmit ■ SPIRDR (SFR D5h, Read only) holds byte received ■ SPICLKD (Table 61., page 118) for clock divider ■ SPISTAT (Table 62., page 119) holds interface status The SPI interface functional block diagram (Figure 45.) shows these six SFRs. Both the transmit and receive data paths are double-buffered, meaning that continuous transmitting or receiving (back-toback transfer) is possible by reading from SPIRDR or writing data to SPITDR while shifting is taking place. There are a number of flags in the SPISTAT register that indicate when it is full or empty to assist the 8032 MCU in data flow management. When enabled, these status flags will cause an interrupt to the MCU. Figure 45. SPI Interface, Master Mode Only SPITDR - TRANSMIT REGISTER SPITxD / P1.6 or P4.6 TIMING AND CONTROL (fOSC) INTR to 8032 SPIRDR - RECEIVE REGISTER 8-bit SHIFT REGISTER 8 8 8 8 SPIRxD / P1.5 or P4.5 SPICON0, SPICON1 - CONTROL REGISTERS 8 SPISTAT - STATUS REGISTER 8 8032 MCU DATA BUS CLOCK GENERATE SPISEL / P1.7 or P4.7 CLOCK SPICLK / P1.4 or P4.4 DIVIDE ÷1 ÷4 ÷8 ÷16 ÷32 ÷64 ÷128 SPICLKD - DIVIDE SELECT 8 PERIPH_CLK AI10486uPSD33xx 116/231 SPI Configuration The SPI interface is reset by the MCU reset, and firmware needs to initialize the SFRs SPICON0, SPICON1, and SPICLKD to define several operation parameters. The SPO Bit in SPICON0 determines the clock polarity. When SPO is set to '0,' a data bit is transmitted on SPITxD from one rising edge of SPICLK to the next and is guaranteed to be valid during the falling edge of SPICLK. When SPO is set to '1,' a data bit is transmitted on SPITxD from one falling edge of SPICLK to the next and is guaranteed to be valid during the rising edge of SPICLK. The uPSD33xx will sample received data on the appropriate edge of SPICLK as determined by SPO. The effect of the SPO Bit can be seen in Figure 43. and Figure 44., page 114. The FLSB Bit in SPICON0 determines the bit order while transmitting and receiving the 8-bit data. When FLSB is '0,' the 8-bit data is transferred in order from MSB (first) to LSB (last). When FLSB Bit is set to '1,' the data is transferred in order from LSB (first) to MSB (last). The clock signal generated on SPICLK is derived from the internal PERIPH_CLK signal. PERIPH_CLK always operates at the frequency, fOSC, and runs constantly except when stopped in MCU Power Down mode. SPICLK is a result of dividing PERIPH_CLK by a sum of different divisors selected by the value contained in the SPICLKD register. The default value in SPICLKD after a reset divides PERIPH_CLK by a factor of 4. The bits in SPICLKD can be set to provide resulting divisor values in of sums of multiples of 4, such as 4, 8, 12, 16, 20, all the way up to 252. For example, if SPICLKD contains 0x24, SPICLK has the frequency of PERIH_CLK divided by 36 decimal. The SPICLK frequency must be set low enough to allow the MCU time to read received data bytes without loosing data. This is dependent upon many things, including the crystal frequency of the MCU and the efficiency of the SPI firmware. Dynamic Control At runtime, bits in registers SPICON0, SPICON1, and SPISTAT are managed by firmware for dynamic control over the SPI interface. The bits Transmitter Enable (TE) and Receiver Enable (RE) when set will allow transmitting and receiving respectively. If TE is disabled, both transmitting and receiving are disabled because SPICLK is driven to constant output logic ‘0’ (when SPO = 0) or logic '1' (when SPO = 1). When the SSEL Bit is set, the SPISEL pin will drive to logic '0' (active) to select a connected slave device at the appropriate time before the first data bit of a byte is transmitted, and SPISEL will automatically return to logic '1' (inactive) after transmitting the eight bit of data, as shown in Figure 44., page 114. SPISEL will continue to automatically toggle this way for each byte data transmission while the SSEL bit is set by firmware. When the SSEL Bit is cleared, the SPISEL pin will drive to constant logic '1' and stay that way (after a transmission in progress completes). The Interrupt Enable Bits (TEIE, RORIE,TIE, and RIE) when set, will allow an SPI interrupt to be generated to the MCU upon the occurrence of the condition enabled by these bits. Firmware must read the four corresponding flags in the SPISTAT register to determine the specific cause of interrupt. These flags are automatically cleared when firmware reads the SPISTAT register.117/231 uPSD33xx Table 59. SPICON0: Control Register 0 (SFR D6h, Reset Value 00h) Bit 7 Bit 6 Bit 5 Bit 4 Bit 3 Bit 2 Bit 1 Bit 0 – TE RE SPIEN SSEL FLSB SBO – Details Bit Symbol R/W Definition 7 – – Reserved 6 TE RW Transmitter Enable 0 = Transmitter is disabled 1 = Transmitter is enabled 5 RE RW Receiver Enable 0 = Receiver is disabled 1 = Receiver is enabled 4 SPIEN RW SPI Enable 0 = Entire SPI Interface is disabled 1 = Entire SPI Interface is enabled 3 SSEL RW Slave Selection 0 = SPISEL output pin is constant logic '1' (slave device not selected) 1 = SPISEL output pin is logic '0' (slave device is selected) during data transfers 2 FLSB RW First LSB 0 = Transfer the most significant bit (MSB) first 1 = Transfer the least significant bit (LSB) first 1 SPO – Sampling Polarity 0 = Sample transfer data at the falling edge of clock (SPICLK is '0' when idle) 1 = Sample transfer data at the rising edge of clock (SPICLK is '1' when idle) 0 – – ReserveduPSD33xx 118/231 Table 60. SPICON1: SPI Interface Control Register 1 (SFR D7h, Reset Value 00h) Table 61. SPICLKD: SPI Prescaler (Clock Divider) Register (SFR D2h, Reset Value 04h) Bit 7 Bit 6 Bit 5 Bit 4 Bit 3 Bit 2 Bit 1 Bit 0 – – – – TEIE RORIE TIE RIE Details Bit Symbol R/W Definition 7-4 – – Reserved 3 TEIE RW Transmission End Interrupt Enable 0 = Disable Interrupt for Transmission End 1 = Enable Interrupt for Transmission End 2 RORIE RW Receive Overrun Interrupt Enable 0 = Disable Interrupt for Receive Overrun 1 = Enable Interrupt for Receive Overrun 1 TIE RW Transmission Interrupt Enable 0 = Disable Interrupt for SPITDR empty 1 = Enable Interrupt for SPITDR empty 0 RIE RW Reception Interrupt Enable 0 = Disable Interrupt for SPIRDR full 1 = Enable Interrupt for SPIRDR full Bit 7 Bit 6 Bit 5 Bit 4 Bit 3 Bit 2 Bit 1 Bit 0 DIV128 DIV64 DIV32 DIV16 DIV8 DIV4 – – Details Bit Symbol R/W Definition 7 DIV128 RW 0 = No division 1 = Divide fOSC clock by 128 6 DIV64 RW 0 = No division 1 = Divide fOSC clock by 64 5 DIV32 RW 0 = No division 1 = Divide fOSC clock by 32 4 DIV16 RW 0 = No division 1 = Divide fOSC clock by 16 3 DIV8 RW 0 = No division 1 = Divide fOSC clock by 8 2 DIV4 RW 0 = No division 1 = Divide fOSC clock by 4 1-0 Not Used –119/231 uPSD33xx Table 62. SPISTAT: SPI Interface Status Register (SFR D3h, Reset Value 02h) Bit 7 Bit 6 Bit 5 Bit 4 Bit 3 Bit 2 Bit 1 Bit 0 – – – BUSY TEISF RORISF TISF RISF Details Bit Symbol R/W Definition 7-5 – – Reserved 4 BUSY R SPI Busy 0 = Transmit or Receive is completed 1 = Transmit or Receive is in process 3 TEISF R Transmission End Interrupt Source flag 0 = Automatically resets to '0' when firmware reads this register 1 = Automatically sets to '1' when transmission end occurs 2 RORISF R Receive Overrun Interrupt Source flag 0 = Automatically resets to '0' when firmware reads this register 1 = Automatically sets to '1' when receive overrun occurs 1 TISF R Transfer Interrupt Source flag 0 = Automatically resets to '0' when SPITDR is full (just after the SPITDR is written) 1 = Automatically sets to '1' when SPITDR is empty (just after byte loads from SPITDR into SPI shift register) 0 RISF R Receive Interrupt Source flag 0 = Automatically resets to '0' when SPIRDR is empty (after the SPIRDR is read) 1 = Automatically sets to '1' when SPIRDR is fulluPSD33xx 120/231 ANALOG-TO-DIGITAL CONVERTOR (ADC) The ADC unit in the uPSD33xx is a SAR type ADC with an SAR register, an auto-zero comparator and three internal DACs. The unit has 8 input channels with 10-bit resolution. The A/D converter has its own VREF input (80-pin package only), which specifies the voltage reference for the A/D operations. The analog to digital converter (A/D) allows conversion of an analog input to a corresponding 10-bit digital value. The A/D module has eight analog inputs (P1.0 through P1.7) to an 8x1 multiplexor. One ADC channel is selected by the bits in the configuration register. The converter generates a 10-bits result via successive approximation. The analog supply voltage is connected to the VREF input, which powers the resistance ladder in the A/D module. The A/D module has 3 registers, the control register ACON, the A/D result register ADAT0, and the second A/D result register ADAT1. The ADAT0 Register stores Bits 0.. 7 of the converter output, Bits 8.. 9 are stored in Bits 0..1 of the ADAT1 Register. The ACON Register controls the operation of the A/D converter module. Three of the bits in the ACON Register select the analog channel inputs, and the remaining bits control the converter operation. ADC channel pin input is enabled by setting the corresponding bit in the P1SFS0 and P1SFS1 Registers to '1' and the channel select bits in the ACON Register. The ADC reference clock (ADCCLK) is generated from fOSC divided by the divider in the ADCPS Register. The ADC operates within a range of 2 to 16MHz, with typical ADCCLK frequency at 8MHz. The conversion time is 4µs typical at 8MHz. The processing of conversion starts when the Start Bit ADST is set to '1.' After one cycle, it is cleared by hardware. The ADC is monotonic with no missing codes. Measurement is by continuous conversion of the analog input. The ADAT Register contains the results of the A/D conversion. When conversion is complete, the result is loaded into the ADAT. The A/D Conversion Status Bit ADSF is set to '1.' The block diagram of the A/D module is shown in Figure 46. The A/D status bit ADSF is set automatically when A/D conversion is completed and cleared when A/D conversion is in process. In addition, the ADC unit sets the interrupt flag in the ACON Register after a conversion is complete (if AINTEN is set to '1'). The ADC interrupts the CPU when the enable bit AINTEN is set. Port 1 ADC Channel Selects The P1SFS0 and P1SFS1 Registers control the selection of the Port 1 pin functions. When the P1SFS0 Bit is '0,' the pin functions as a GPIO. When bits are set to '1,' the pins are configured as alternate functions. A new P1SFS1 Register selects which of the alternate functions is enabled. The ADC channel is enabled when the bit in P1SFS1 is set to '1.' Note: In the 52-pin package, there is no individual VREF pin because VREF is combined with AVCC pin. Figure 46. 10-Bit ADC ANALOG MUX SELECT ADC OUT - 10 BITS ACON REG ADAT 0 REG CONTROL 10-BIT SAR ADC ADAT1 REG ADC0 ADC1 ADC2 ADC3 ADC4 ADC5 ADC6 ADC7 AVREF P1.0 P1.1 P1.2 P1.3 P1.4 P1.5 P1.6 P1.7 AVREF AI07856121/231 uPSD33xx Table 63. ACON Register (SFR 97h, Reset Value 00h) Bit 7 Bit 6 Bit 5 Bit 4 Bit 3 Bit 2 Bit 1 Bit 0 AINTF AINTEN ADEN ADS2 ADS1 ADS0 ADST ADSF Details Bit Symbol Function 7 AINTF ADC Interrupt flag. This bit must be cleared with software. 0 = No interrupt request 1 = The AINTF flag is set when ADSF goes from '0' to '1.' Interrupts CPU when both AINTF and AINTEN are set to '1.' 6 AINTEN ADC Interrupt Enable 0 = ADC interrupt is disabled 1 = ADC interrupt is enabled 5 ADEN ADC Enable Bit 0 = ADC shut off and consumes no operating current 1 = Enable ADC. After ADC is enabled, 16ms of calibration is needed before ADST Bit is set. 4.. 2 ADS2.. 0 Analog channel Select 000 Select channel 0 (P1.0) 001 Select channel 0 (P1.1) 010 Select channel 0 (P1.2) 011 Select channel 0 (P1.3) 101 Select channel 0 (P1.5) 110 Select channel 0 (P1.6) 111 Select channel 0 (P1.7) 1 ADST ADC Start Bit 0 = Force to zero 1 = Start ADC, then after one cycle, the bit is cleared to '0.' 0 ADSF ADC Status Bit 0 = ADC conversion is not completed 1 = ADC conversion is completed. The bit can also be cleared with software.uPSD33xx 122/231 Table 64. ADCPS Register Details (SFR 94h, Reset Value 00h) Table 65. ADAT0 Register (SFR 95H, Reset Value 00h) Table 66. ADAT1 Register (SFR 96h, Reset Value 00h) Bit Symbol Function 7:4 – Reserved 3 ADCCE ADC Conversion Reference Clock Enable 0 = ADC reference clock is disabled (default) 1 = ADC reference clock is enabled 2:0 ADCPS[2:0] ADC Reference Clock PreScaler Only three Prescaler values are allowed: ADCPS[2:0] = 0, for fOSC frequency 16MHz or less. Resulting ADC clock is fOSC. ADCPS[2:0] = 1, for fOSC frequency 32MHz or less. Resulting ADC clock is fOSC/2. ADCPS[2:0] = 2, for fOSC frequency 32MHz > 40MHz. Resulting ADC clock is fOSC/4. Bit Symbol Function 7:0 – Store ADC output, Bit 7 - 0 Bit Symbol Function 7:2 – Reserved 1.. 0 – Store ADC output, Bit 9, 8123/231 uPSD33xx PROGRAMMABLE COUNTER ARRAY (PCA) WITH PWM There are two Programmable Counter Array blocks (PCA0 and PCA1) in the uPSD33xx. A PCA block consists of a 16-bit up-counter, which is shared by three TCM (Timer Counter Module). A TCM can be programmed to perform one of the following four functions: 1. Capture Mode: capture counter values by external input signals 2. Timer Mode 3. Toggle Output Mode 4. PWM Mode: fixed frequency (8-bit or 16-bit), programmable frequency (8-bit only) PCA Block The 16-bit Up-Counter in the PCA block is a freerunning counter (except in PWM Mode with programmable frequency). The Counter has a choice of clock input: from an external pin, Timer 0 Overflow, or PCA Clock. A PCA block has 3 Timer Counter Modules (TCM) which share the 16-bit Counter output. The TCM can be configured to capture or compare counter value, generate a toggling output, or PWM functions. Except for the PWM function, the other TCM functions can generate an interrupt when an event occurs. Every TCM is connected to a port pin in Port 4; the TCM pin can be configured as an event input, a PWMs, a Toggle Output, or as External Clock Input. The pins are general I/O pins when not assigned to the TCM. The TCM operation is configured by Control registers and Capture/Compare registers. Table 67., page 124 lists the SFR registers in the PCA blocks. Figure 47. PCA0 Block Diagram TIMER0 OVERFLOW P4.3/ECI PCACH0 8-bit PCACL0 8-bit CLKSEL1 IDLE MODE (From CPU) OVF0 INT EOVFI TCM0 TCM1 TCM2 PWM FREQ COMPARE P4.0/CEX0 P4.1/CEX1 P4.2/CEX2 16-bit up Timer/Counter CLKSEL0 PCAIDLE PCA0CLK CLEAR COUNTER EN_PCA EN_ALL AI07857uPSD33xx 124/231 Table 67. PCA0 and PCA1 Registers SFR Address Register Name RW Register Function PCA0 PCA1 PCA0 PCA1 A2 BA PCACL0 PCACL1 RW The low 8 bits of PCA 16-bit counter. A3 BB PCACH0 PCACH1 RW The high 8 bits of PCA 16-bit counter. A4 BC PCACON0 PCACON1 RW Control Register – Enable PCA, Timer Overflow flag , PCA Idle Mode, and Select clock source. A5 A5 PCASTA N/A RW Status Register, Interrupt Status flags – Common for both PCA Block 0 and 1. A9, AA, AB BD, BE, BF TCMMODE0 TCMMODE1 TCMMODE2 TCMMODE3 TCMMODE4 TCMMODE5 RW TCM Mode – Capture, Compare, and Toggle Enable Interrupts – PWM Mode Select. AC AD C1 C2 CAPCOML0 CAPCOMH0 CAPCOML3 CAPCOMH3 RW Capture/Compare registers of TCM0 AF B1 C3 C4 CAPCOML1 CAPCOMH1 CAPCOML4 CAPCOMH4 RW Capture/Compare registers of TCM1 B2 B3 C5 C6 CAPCOML2 CAPCOMH2 CAPCOML5 CAPCOMH5 RW Capture/Compare registers of TCM2 B4 C7 PWMF0 PWMF1 RW The 8-bit register to program the PWM frequency. This register is used for programmable, 8-bit PWM Mode only. FB FC CCON2 CCON3 RW Specify the pre-scaler value of PCA0 or PCA1 clock input125/231 uPSD33xx PCA Clock Selection The clock input to the 16-bit up counter in the PCA block is user-programmable. The three clock sources are: – PCA Prescaler Clock (PCA0CLK, PCA1CLK) – Timer 0 Overflow – External Clock, Pin P4.3 or P4.7 The clock source is selected in the configuration register PCACON. The Prescaler output clock PCACLK is the fOSC divided by the divisor which is specified in the CCON2 or CCON3 Register. When External Clock is selected, the maximum clock frequency should not exceed fOSC/4. Table 68. CCON2 Register Bit Definition (SFR 0FBh, Reset Value 10h) Table 69. CCON3 Register Bit Definition (SFR 0FCh, Reset Value 10h) Bit 7 Bit 6 Bit 5 Bit 4 Bit 3 Bit 2 Bit 1 Bit 0 – – – PCA0CE PCA0PS3 PCA0PS2 PCA0PS1 PCA0PS0 Details Bit Symbol R/W Definition 4 PCA0CE R/W PCA0 Clock Enable 0 = PCA0CLK is disabled 1 = PCA0CLK is enabled (default) 3:0 PCA0PS [3:0] R/W PCA0 Prescaler fPCA0CLK = fOSC / (2 ^ PCA0PS[3:0]) Divisor range: 1, 2, 4, 8, 16... 16384, 32768 Bit 7 Bit 6 Bit 5 Bit 4 Bit 3 Bit 2 Bit 1 Bit 0 – – – PCA1CE PCA1PS3 PCA1PS2 PCA1PS1 PCA1PS0 Details Bit Symbol R/W Definition 4 PCA1CE R/W PCA1 Clock Enable 0 = PCA1CLK is disabled 1 = PCA1CLK is enabled (default) 3:0 PCA1PS [3:0] R/W PCA1 Prescaler fPCA1CLK = fOSC / (2 ^ PCA1PS[3:0]) Divisor range: 1, 2, 4, 8, 16... 16384, 32768uPSD33xx 126/231 Operation of TCM Modes Each of the TCM in a PCA block supports four modes of operation. However, an exception is when the TCM is configured in PWM Mode with programmable frequency. In this mode, all TCM in a PCA block must be configured in the same mode or left to be not used. Capture Mode The CAPCOM registers in the TCM are loaded with the counter values when an external pin input changes state. The user can configure the counter value to be loaded by positive edge, negative edge or any transition of the input signal. At loading, the TCM can generate an interrupt if it is enabled. Timer Mode The TCM modules can be configured as software timers by enable the comparator. The user writes a value to the CAPCOM registers, which is then compared with the 16-bit counter. If there is a match, an interrupt can be generated to CPU. Toggle Mode In this mode, the user writes a value to the TCM's CAPCOM registers and enables the comparator. When there is a match with the Counter output, the output of the TCM pin toggles. This mode is a simple extension of the Timer Mode. PWM Mode - (X8), Fixed Frequency In this mode, one or all the TCM's can be configured to have a fixed frequency PWM output on the port pins. The PWM frequency depends on when the low byte of the Counter overflows (modulo 256). The duty cycle of each TCM module can be specified in the CAPCOMHn Register. When the PCA_Counter_L value is equal to or greater than the value in CAPCOMHn, the PWM output is switched to a high state. When the PCA_Counter_L Register overflows, the content in CAPCOMHn is loaded to CAPCOMLn and a new PWM pulse starts. Figure 48. Timer Mode Note: m = 0: n = 0, 1, or 2 m = 1: n = 3, 4, or 5 MATCH_TIMER INTR 0 0 0 TCMMODEn ENABLE 8 8 MATCH PCASTA CAPCOMLn PCACHm PCACLm 16-bit COMPARATOR CAPCOMHn INTFn 0 0 16-bit up Timer/Counter 8 8 EINTF E_COMP CAP_PE CAP_NE MATCH TOGGLE PWM1 PWM0 RESET WRITE to CAPCOMHn WRITE to CAPCOMLn 1 0 EN_FLAG C D AI07858127/231 uPSD33xx Figure 49. PWM Mode - (X8), Fixed Frequency Note: m = 0: n = 0, 1, or 2 m = 1: n = 3, 4, or 5 CAPCOMHn OVERFLOW ENABLE 8 PCACLm 8 CAPCOMLn 8-bit COMPARATORn CEXn MATCH S R Q Q SET CLR 0 0 TCMMODEn 0 0 0 EINTF E_COMP CAP_PE CAP_NE MATCH TOGGLE PWM1 PWM0 AI07859uPSD33xx 128/231 PWM Mode - (X8), Programmable Frequency In this mode, the PWM frequency is not determined by the overflow of the low byte of the Counter. Instead, the frequency is determined by the PWMFm Register. The user can load a value in the PWMFm Register, which is then compared to the low byte of the Counter. If there is a match, the Counter is cleared and the Load registers (PWMFm, CAPCOMHn) are re-loaded for the next PWM pulse. There is only one PWMFm Register which serves all 3 TCM in a PCA block. If one of the TCM modules is operating in this mode, the other modules in the PCA must be configured to the same mode or left not to be used. The duty cycle of the PWM can be specified in the CAPCOMHn Register as in the PWM with fixed frequency mode. Different TCM modules can have their own duty cycle. Note: The value in the Frequency Register (PWMFm) must be larger than the duty cycle register (CAPCOM). Figure 50. PWM Mode - (X8) Programmable Frequency Note: m = 0: n = 0, 1, or 2 m = 1: n = 3, 4, or 5 CLR PCACHm PWM FREQ COMPARE PWMFm = PCACLm PCACLm CAPCOMHn ENABLE ENABLE CEXn 8 8 PWMFm 8-bit COMPARATORm 8-bit COMPARATORn CAPCOMLn MATCH S R Q Q SET CLR 8 0 0 TCMMODEn 0 0 0 EINTF E_COMP CAP_PE CAP_NE MATCH TOGGLE PWM1 PWM0 AI07860129/231 uPSD33xx PWM Mode - Fixed Frequency, 16-bit The operation of the 16-bit PWM is the same as the 8-bit PWM with fixed frequency. In this mode, one or all the TCM can be configured to have a fixed frequency PWM output on the port pins. The PWM frequency is depending on the clock input frequency to the 16-bit Counter. The duty cycle of each TCM module can be specified in the CAPCOMHn and CAPCOMLn Registers. When the 16- bit PCA_Counter is equal or greater than the values in registers CAPCOMHn and CAPCOMLn, the PWM output is switched to a high state. When the PCA_Counter overflows, CEXn is asserted low. PWM Mode - Fixed Frequency, 10-bit The 10-bit PWM logic requires that all 3 TCMs in PCA0 or PCA1 operate in the same 10-bit PWM mode. The 10-bit PWM operates in a similar manner as the 16-bit PWM, except the PCACHm and PCACLm counters are reconfigured as 10-bit counters. The CAPCOMHn and CAPCOMLn Registers become 10-bit registers. PWM duty cycle of each TCM module can be specified in the 10-bit CAPCOMHn and CAPCOMLn Registers. When the 10-bit PCA counter is equal or greater than the values in the 10-bit registers CAPCOMHn and CAPCOMLn, the PWM output switches to a high state. When the 10-bit PCA counter overflows, the PWM pin is switched to a logic low and starts the next PWM pulse. The most-significant 6 bits in the PCACHm counter and CAPCOMH Register are “Don’t cares” and have no effect on the PWM generation. Writing to Capture/Compare Registers When writing a 16-bit value to the PCA Capture/ Compare registers, the low byte should always be written first. Writing to CAPCOMLn clears the E_COMP Bit to '0'; writing to CAPCOMHn sets E_COMP to '1' the largest duty cycle is 100% (CAPCOMHn CAPCOMLn = 0x0000), and the smallest duty cycle is 0.0015% (CAPCOMHn CAPCOMLn = 0xFFFF). A 0% duty cycle may be generated by clearing the E_COMP Bit to ‘0’. Control Register Bit Definition Each PCA has its own PCA_CONFIGn, and each module within the PCA block has its own TCM_Mode Register which defines the operation of that module (see Table 70., page 129 through Table 71., page 130). There is one PCA_STATUS Register that covers both PCA0 and PCA1 (see Table 72., page 131). Table 70. PCA0 Control Register PCACON0 (SFR 0A4h, Reset Value 00h) Bit 7 Bit 6 Bit 5 Bit 4 Bit 3 Bit 2 Bit 1 Bit 0 EN-ALL EN_PCA EOVFI PCAIDLE – – CLK_SEL[1:0] Details Bit Symbol Function 7 EN-ALL 0 = No impact on TCM modules 1 = Enable both PCA counters simultaneously (override the EN_PCA Bits) This bit is to start the two 16-bit counters in the PCA. For customers who want 5 PWM, for example, this bit can start all of the PWM outputs. 6 EN_PCA 0 = PCA counter is disabled 1 = PCA counter is enabled EN_PCA Counter Run Control Bit. Set with software to turn the PCA counter on. Must be cleared with software to turn the PCA counter off. 5 EOVFI 1 = Enable Counter Overflow Interrupt if overflow flag (OVF) is set 4 PCAIDLE 0 = PCA operates when CPU is in Idle Mode 1 = PCA stops running when CPU is in Idle Mode 3 – Reserved 2 10B_PWM 0 = Select 16-bit PWM 1 = Select 10-bit PWM 1-0 CLK_SEL [1:0] 00 Select Prescaler clock as Counter clock 01 Select Timer 0 Overflow 10 Select External Clock pin (P4.3 for PCA0) (MAX clock rate = fOSC/4)uPSD33xx 130/231 Table 71. PCA1 Control Register PCACON1 (SFR 0BCh, Reset Value 00h) Bit 7 Bit 6 Bit 5 Bit 4 Bit 3 Bit 2 Bit 1 Bit 0 – EN_PCA EOVFI PCAIDLE – – CLK_SEL[1:0] Details Bit Symbol Function 6 EN_PCA 0 = PCA counter is disabled 1 = PCA counter is enabled EN_PCA Counter Run Control Bit. Set with software to turn the PCA counter on. Must be cleared with software to turn the PCA counter off. 5 EOVFI 1 = Enable Counter Overflow Interrupt if overflow flag (OVF) is set 4 PCAIDLE 0 = PCA operates when CPU is in Idle Mode 1 = PCA stops running when CPU is in Idle Mode 3 – Reserved 2 10B_PWM 0 = Select 16-bit PWM 1 = Select 10-bit PWM 1-0 CLK_SEL [1:0] 00 Select Prescaler clock as Counter clock 01 Select Timer 0 Overflow 10 Select External Clock pin (P4.7 for PCA1) (MAX clock rate = fOSC/4)131/231 uPSD33xx Table 72. PCA Status Register PCASTA (SFR 0A5h, Reset Value 00h)uPSD33xx 132/231 TCM Interrupts There are 8 TCM interrupts: 6 match or capture interrupts and two counter overflow interrupts. The 8 interrupts are “ORed” as one PCA interrupt to the CPU. By the nature of PCA application, it is unlikely that many of the interrupts occur simultaneously. If they do, the CPU has to read the interrupt flags and determine which one to serve. The software has to clear the interrupt flag in the Status Register after serving the interrupt. Table 73. TCMMODE0 - TCMMODE5 (6 Registers, Reset Value 00h) Table 74. TCMMODE Register Configurations Note: 1. 10-bit PWM mode requires the 10B_PWM Bit in the PCACON Register set to '1.' Bit 7 Bit 6 Bit 5 Bit 4 Bit 3 Bit 2 Bit 1 Bit 0 EINTF E_COMP CAP_PE CAP_NE MATCH TOGGLE PWM[1:0] Details Bit Symbol Function 7 EINTF 1 - Enable the interrupt flags (INTF) in the Status Register to generate an interrupt. 6 E_COMP 1 - Enable the comparator when set 5 CAP_PE 1 - Enable Capture Mode, a positive edge on the CEXn pin. 4 CAP_NE 1 - Enable Capture Mode, a negative edge on the CEXn pin. 3 MATCH 1 - A match from the comparator sets the INTF bits in the Status Register. 2 TOGGLE 1 - A match on the comparator results in a toggling output on CEXn pin. 1-0 PWM[1:0] 01 Enable PWM Mode (x8), fixed frequency. Enable the CEXn pin as a PWM output. 10 Enable PWM Mode (x8) with programmable frequency. Enable the CEXn pin as a PWM output. 11 Enable PWM Mode (x10 or x16), fixed frequency. Enable the CEXn pin as a PWM output. EINTF E_COMP CAP_PE CAP_NE MATCH TOGGLE PWM1 PWM0 TCM FUNCTION 0 0 0 0 0 0 0 0 No operation (reset value) 0 1 0 0 0 0 0 1 8-bit PWM, fixed frequency 0 1 0 0 0 0 10 8-bit PWM, programmable frequency 0 1 0 0 0 0 11 10-bit or 16-bit PMW, fixed frequency(1) X 1 0 0 1 1 0 0 16-bit toggle X 1 0 0 1 0 0 0 16-bit Software Timer X X 0 1 0 0 0 0 16-bit capture, negative trigger X X 1 0 0 0 0 0 16-bit capture, positive trigger X X 1 1 0 0 0 0 16-bit capture, transition trigger133/231 uPSD33xx PSD MODULE The PSD Module is stacked with the MCU Module to form the uPSD33xx, see uPSD33xx HARDWARE DESCRIPTION, page 13. Details of the PSD Module are shown in Figure 51. The two separate modules interface with each other at the 8032 Address, Data, and Control interface blocks in Figure 51. Figure 51. PSD Module Block Diagram PD1 PD2 PORT D PA0 PA1 PA2 PA3 PA4 PA5 PA6 PA7 PORT B PB0 PB1 PB2 PB3 PB4 PB5 PB6 PB7 GENERAL PLD 20 INPUT MACROCELLS A B 16 OUTPUT MACROCELLS A B A B A B A B A B A B A B B C B C B C B C B C B C B C B C SECURITY LOCK PLD INPUT BUS PIN FEEDBACK NODE FEEDBACK PSD Module: uPSD33XX DECODE PLD AND-OR ARRAY FS0-7 AAAAAAAA BBBBBBBB C C C C TO PLD INPUT BUS PORT C PC0 PC1 PC2 PC3 PC4 PC5 PC6 PC7 JTAG-ISP TO ALL AREAS OF PSD MODULE ADDR, DATA, CONTROL BUS LINKED TO 8032 MCU RUNTIME CONTROL, 256 REGs GPIO, VM, PAGE POWER MNGMT CSIOP PLD CSBOOT0-3 EXTERNAL CHIPSELECTS MAIN FLASH MEMORY Up to 8 SEGMENTS FS0 Up to 256 KBytes TOTAL FS7 2nd FLASH MEMORY Up to 4 SEGMENTS Up to 32 KBytes TOTAL CSBOOT0 CSBOOT3 DATA ADDRESS LATCH LOW ADDR HIGH ADDR 8032 MUX ADDR/DATA AD0 AD1 AD2 AD3 AD4 AD5 AD6 AD7 8032 HI ADDR A8 A9 A10 A11 A12 A13 A14 A15 8032 CNTL RD WR PSEN ALE RST 8032 MCU Module PORT A (80-pin only) TO JTAG DEBUG ON MCU GPIO PLD GPIO GPIO GPIO 8 PIN INPUTS MCU READ or WRITE MCU READ PLD OUT PLD OUT PLD OUT PLD OUT PLD OUT JTAG CNTL 8 PIN INPUTS 4 PIN INPUTS MCU READ or WRITE RS0 Up to 32 KBytes SRAM PAGE REG JTAG OMC ALLOCATOR AND-OR ARRAY 69 INPUTS 69 INPUTS AI07872B PLD INPUT BUSuPSD33xx 134/231 PSD Module Functional Description Major functional blocks are shown in Figure 51., page 133. The next sections describe each major block. 8032 Address/Data/Control Interface. These signals attach directly to the MCU Module to implement a typical multiplexed 8051-style bus between the two stacked die. The MCU instruction prefetch and branch cache logic resides on the MCU Module, leaving a standard 8051-style memory interface on the PSD Module. The active-low reset signal originating from the MCU Module goes to the PSD Module reset input (RST). This reset signal can then be routed as an external output from the uPSD33xx to the system PC board, if needed, through any one of the PLD output pins as active-high or active-low logic by specifying logic equations in PSDsoft Express. The 8032 address and data busses are routed throughout the PSD Module as shown in Figure 51 connecting many elements on the PSD Module to the 8032 MCU. The 8032 bus is not only connected to the memories, but also to the General PLD, making it possible for the 8032 to directly read and write individual logic macrocells inside the General PLD. Dual Flash Memories and IAP. uPSD33xx devices contain two independent Flash memory arrays. This means that the 8032 can read instructions from one Flash memory array while erasing or writing the other Flash memory array. Concurrent operation like this enables robust remote updates of firmware, also known as In-Application Programming (IAP). IAP can occur using any uPSD33xx interface (e.g., UART, I2C, SPI). Concurrent memory operation also enables the designer to emulate EEPROM memory within either of the two Flash memory arrays for small data sets that have frequent updates. The 8032 can erase Flash memories by individual sectors or it can erase an entire Flash memory array at one time. Each sector in either Flash memory may be individually write protected, blocking any WRITEs from the 8032 (good for boot and start-up code protection). The Flash memories automatically go to standby between 8032 READ or WRITE accesses to conserve power. Minimum erase cycles is 100K and minimum data retention is 15 years. Flash memory, as well as the entire PSD Module may be programmed with the JTAG In-System Programming (ISP) interface with no 8032 involvement, good for manufacturing and lab development. Main Flash Memory. The Main Flash memory is divided into equal sized sectors that are individually selectable by the Decode PLD output signals, named FSx, one signal for each Main Flash memory sector. Each Flash sector can be located at any address within 8032 program address space (accessed with PSEN) or data address space, also known as 8032 XDATA space (accessed with RD or WR), as defined with the software development tool, PSDsoft Express. The user only has to specify an address range for each segment and specify if Main Flash memory will reside in 8032 data or program address space, and then PSEN, RD, or WR are automatically activated for the specified range. 8032 firmware is easily programmed into Main Flash memory using PSDsoft Express or other software tools. See Table 75., page 135 for Main Flash sector sizes on the various uPSD33xx devices. Secondary Flash Memory. The smaller Secondary Flash memory is also divided into equal sized sectors that are individually selectable by the Decode PLD signals, named CSBOOTx, one signal for each Secondary Flash memory sector. Each sector can be located at any address within 8032 program address space (accessed with PSEN) or XDATA space (accessed with RD or WR) as defined with PSDsoft Express. The user only has to specify an address range for each segment, and specify if Secondary Flash memory will reside in 8032 data or program address space, and then PSEN, RD, or WR are automatically activated for the specified range. 8032 firmware is easily programmed into Secondary Flash memory using PSDsoft Express and others. See Table 75., page 135 for Secondary Flash sector sizes. SRAM. The SRAM is selected by a single signal, named RS0, from the Decode PLD. SRAM may be located at any address within 8032 XDATA space (accessed with RD or WR), or optionally within 8032 program address space (accessed with PSEN) to execute code from SRAM. The default setting places SRAM in XDATA space only. These choices are specified using PSDSoft Express, where the user specifies an SRAM address range. The user would also specify (at run-time) if SRAM will additionally reside in 8032 program address space, and then PSEN, RD, or WR are automatically activated for the specified range. See Table 75., page 135 for SRAM sizes. The SRAM may optionally be backed up by an external battery (or other DC source) to make its contents non-volatile (see SRAM Standby Mode (battery backup), page 193).135/231 uPSD33xx Table 75. uPSD33xx Memory Configuration Runtime Control Registers, CSIOP. A block of 256 bytes is decoded inside the PSD Module for module control and status (see Table 79., page 145). The base address of these 256 locations is referred to in this data sheet as csiop (Chip Select I/O Port), and is selected by the Decode PLD output signal, CSIOP. The csiop registers are always viewed by the 8032 as XDATA, and are accessed with RD and WR signals. The address range of CSIOP is specified using PSDsoft Express where the user only has to specify an address range of 256 bytes, and then the RD or WR signals are automatically activated for the specified range. Individual registers within this block are accessed with an offset from the specified csiop base address. 39 registers are used out of the 256 locations to control the output state of I/ O pins, to read I/O pins, to set the memory page, to control 8032 program and data address space, to control power management, to READ/WRITE macrocells inside the General PLD, and other functions during runtime. Unused locations within csiop are reserved and should not be accessed. Memory Page Register. 8032 MCU architecture has an inherent size limit of 64K bytes in either program address space or XDATA space. Some uPSD33xx devices have much more memory that 64K, so special logic such as this page register is needed to access the extra memory. This 8-bit page register (Figure 52) can be loaded and read by the 8032 at runtime as one of the csiop registers. Page register outputs feed directly into both PLDs creating extended address signals used to “page” memory beyond the 64K byte limit (program space or XDATA). Most 8051 compilers directly support memory paging, also known as memory banking. If memory paging is not needed, or if not all eight page register bits are needed for memory paging, the remaining bits may be used in the General PLD for general logic. Page Register outputs are cleared to logic ’0’ at reset and powerup. Programmable Logic (PLDs) . The uPSD33xx contains two PLDs (Figure 63., page 157) that may optionally run in Turbo or Non-Turbo mode. PLDs operate faster (less propagation delay) while in Turbo mode but consume more power than in Non-Turbo mode. Non-Turbo mode allows the PLDs to go to standby automatically when no PLD inputs are changing to conserve power. The logic configuration (from equations) of both PLDs is stored with non-volatile Flash technology and the logic is active upon power-up. PLDs may NOT be programmed by the 8032, PLD programming only occurs through the JTAG interface. Figure 52. Memory Page Register Device Main Flash Memory Secondary Flash Memory SRAM Total Flash Size (bytes) Individual Sector Size (bytes) Number of Sectors (Sector Select Signal) Total Flash Size (bytes) Individual Sector Size (bytes) Number of Sectors (Sector Select Signal) SRAM Size (bytes) uPSD3312 64K 16K 4 (FS0-3) 16K 8K 2 (CSBOOT0-1) 2K uPSD3333 128K 16K 8 (FS0-7) 32K 8K 4 (CSBOOT0-3) 8K uPSD3334 256K 32K 8 (FS0-7) 32K 8K 4 (CSBOOT0-3) 8K uPSD3354 256K 32K 8 (FS0-7) 32K 8K 4 (CSBOOT0-3) 32K 8032 Data Bus Load or Read via csiop + offset E0h D0 D7 D6 D5 D4 D3 D2 D1 Q0 Q7 Q6 Q5 Q4 Q3 Q2 Q1 DPLD and GPLD Page Register ChipSelects and General Logic RST (PSD Module Reset) RST PGR0-7 AI09172uPSD33xx 136/231 PLD #1, Decode PLD (DPLD). This programmable logic implements memory mapping and is used to select one of the individual Main Flash memory segments, one of individual Secondary Flash memory segments, the SRAM, or the group of csiop registers when the 8032 presents an address to DPLD inputs (see Figure 64., page 159). The DPLD can also optionally drive external chip select signals on Port D pins. The DPLD also optionally produces two select signals (PSEL0 and PSEL1) used to enable a special data bus repeater function on Port A, referred to as Peripheral I/O Mode. There are 69 DPLD input signals which include: 8032 address and control signals, Page Register outputs, PSD Module Port pin inputs, and GPLD logic feedback. PLD #2, General PLD (GPLD). This programmable logic is used to create both combinatorial and sequential general purpose logic (see Figure 65., page 161). The GPLD contains 16 Output Macrocells (OMCs) and 20 Input Macrocells (IMCs). Output Macrocell registers are unique in that they have direct connection to the 8032 data bus allowing them to be loaded and read directly by the 8032 at runtime through OMC registers in csiop. This direct access is good for making small peripheral devices (shifters, counters, state machines, etc.) that are accessed directly by the 8032 with little overhead. There are 69 GPLD inputs which include: 8032 address and control signals, Page Register outputs, PSD Module Port pin inputs, and GPLD feedback. OMCs. There are two banks of eight OMCs inside the GPLD, MCELLAB, and MCELLBC, totalling 16 OMCs all together. Each individual OMC is a base logic element consisting of a flip-flop and some AND-OR logic (Figure 66., page 162). The general structure of the GPLD with OMCs is similar in nature to a 22V10 PLD device with the familiar sum-of-products (AND-OR) construct. True and compliment versions of 69 input signals are available to the inputs of a large AND-OR array. ANDOR array outputs feed into an OR gate within each OMC, creating up to 10 product-terms for each OMC. Logic output of the OR gate can be passed on as combinatorial logic or combined with a flipflop within in each OMC to realize sequential logic. OMC outputs can be used as a buried nodes driving internal feedback to the AND-OR array, or OMC outputs can be routed to external pins on Ports A, B, or C through the OMC Allocator. OMC Allocator. The OMC allocator (Figure 67., page 163) will route eight of the OMCs from MCELLAB to pins on either Port A or Port B, and will route eight of the OMCs from MCELLBC to pins on either Port B or Port C, based on what is specified in PSDsoft Express. IMCs. Inputs from pins on Ports A, B, and C are routed to IMCs for conditioning (clocking or latching) as they enter the chip, which is good for sampling and debouncing inputs. Alternatively, IMCs can pass port input signals directly to PLD inputs without clocking or latching (Figure 68., page 167). The 8032 may read the IMCs asynchronously at any time through IMC registers in csiop. Note: The JTAG signals TDO, TDI, TCK, and TMS on Port C do not route through IMCs, but go directly to JTAG logic. I/O Ports. For 80-pin uPSD33xx devices, the PSD Module has 22 individually configurable I/O pins distributed over four ports (these I/O are in addition to I/O on MCU Module). For 52-pin uPSD33xx devices, the PSD Module has 13 individually configurable I/O pins distributed over three ports. See Figure 74., page 181 for I/O port pin availability on these two packages. I/O port pins on the PSD Module (Ports A, B, C, and D) are completely separate from the port pins on the MCU Module (Ports 1, 3, and 4). They even have different electrical characteristics. I/O port pins on the PSD Module are accessed by csiop registers, or they are controlled by PLD equations. Conversely, I/O Port pins on the MCU Module are controlled by the 8032 SFR registers. Table 76. General I/O pins on PSD Module Note: Four pins on Port C are dedicated to JTAG, leaving four pins for general I/O. Pkg Port A Port B Port D Port D Total 52-pin 0 8 4 1 13 80-pin 8 8 4 2 22137/231 uPSD33xx Each I/O pin on the PSD Module can be individually configured for different functions on a pin-bypin basis (Figure 69., page 169). Following are the available functions on PSD Module I/O pins. – MCU I/O: 8032 controls the output state of each port pin or it reads input state of each port pin, by accessing csiop registers at runtime. The direction (in or out) of each pin is also controlled by csiop registers at run-time. – PLD I/O: PSDsoft Express logic equations and pin configuration selections determine if pins are connected to OMC outputs or IMC inputs. This is a static and non-volatile configuration. Port pins connected to PLD outputs can no longer be driven by the 8032 using MCU I/O output mode. – Latched MCU Address Output: Port A or Port B can output de-multiplexed 8032 address signals A0 - A7 on a pin-by-pin basis as specified in csiop registers at run-time. In addition, Port B can also be configured to output de-multiplexed A8-A15 in PSDsoft Express. – Data Bus Repeater: Port A can bidirectionally buffer the 8032 data bus (demultiplexed) for a specified address range in PSDsoft Express. This is referred to as Peripheral I/O Mode in this document. – Open Drain Outputs: Some port pins can function as open-drain as specified in csiop registers at run-time. – Pins on Port D can be used for external chipselect outputs originating from the DPLD, without consuming OMC resources within the GPLD. JTAG Port. In-System Programming (ISP) can be performed through the JTAG signals on Port C. This serial interface allows programming of the entire PSD Module device or subsections of the PSD Module (for example, only Flash memory but not the PLDs) without the participation of the 8032. A blank uPSD33xx device soldered to a circuit board can be completely programmed in 10 to 25 seconds. The four basic JTAG signals on Port C; TMS, TCK, TDI, and TDO form the IEEE-1149.1 interface. The PSD Module does not implement the IEEE-1149.1 Boundary Scan functions, but uses the JTAG interface for ISP an 8032 debug. The PSD Module can reside in a standard JTAG chain with other JTAG devices and it will remain in BYPASS mode when other devices perform JTAG functions. ISP programming time can be reduced as much as 30% by using two optional JTAG signals on Port C, TSTAT and TERR, in addition to TMS, TCK, TDI and TDO, and this is referred to as “6-pin JTAG”. The FlashLINK JTAG programming cable is available from STMicroelectronics and PSDsoft Express software is available at no charge from www.st.com/psm. More JTAG ISP information maybe found in the section titled “JTAG ISP and Debug” on page 137. The MCU module is also included in the JTAG chain within the uPSD33xx device for 8032 debugging and emulation. While debugging, the PSD Module is in BYPASS mode. Conversely, during ISP, the MCU Module is in BYPASS mode. Power Management. The PSD Module has bits in csiop registers that are configured at run-time by the 8032 to reduce power consumption of the GPLD. The Turbo Bit in the PMMR0 Register can be set to logic ’1’ and both PLDs will go to NonTurbo mode, meaning it will latch its outputs and go to sleep until the next transition on its inputs. There is a slight penalty in PLD performance (longer propagation delay), but significant power savings are realized. Going to Non-Turbo mode may require an additional wait state in the 8032 SFR, BUSCON, because memory decode signals are also delayed. The default state of the Turbo Bit is logic '0,' meaning by default, the GPLD is in fast Turbo mode until the Turbo mode is turned off. Additionally, bits in csiop registers PMMR0 and PMMR2 can be set by the 8032 to selectively block signals from entering both PLDs which further reduces power consumption. There is also an Automatic Power Down counter that detects lack of 8032 activity and reduces power consumption on the PSD Module to its lowest level (see Power Management, page 137).uPSD33xx 138/231 Security and NVM Sector Protection. A programmable security bit in the PSD Module protects its contents from unauthorized viewing and copying. The security bit is specified in PSDsoft Express and programmed into the uPSD33xx with JTAG. Once set, the security bit will block access of JTAG programming equipment to the PSD Module Flash memory and PLD configuration, and also blocks JTAG debugging access to the MCU Module. The only way to defeat the security bit is to erase the entire PSD Module using JTAG (the erase command is the only JTAG command allowed after the security bit has been set), after which the device is blank and may be used again. Additionally and independently, the contents of each individual Flash memory sector can be write protected (sector protection) by configuration with PSDsoft Express. This is typically used to protect 8032 boot code from being corrupted by inadvertent WRITEs to Flash memory from the 8032. Status of sector protection bits may be read (but not written) using two registers in csiop space. Memory Mapping There many different ways to place (or map) the address range of PSD Module memory and I/O depending on system requirements. The DPLD provides complete mapping flexibility. Figure 53 shows one possible system memory map. In this example, 128K bytes of Main Flash memory for a uPSD3333 device is in 8032 program address space, and 32K bytes of Secondary Flash memory, the SRAM, and csiop registers are all in 8032 XDATA space. In Figure 53, the nomenclature fs0..fs7 are designators for the individual sectors of Main Flash memory, 16K bytes each. CSBOOT0..CSBOOT3 are designators for the individual Secondary Flash memory segments, 8K bytes each. rs0 is the designator for SRAM, and csiop designates the PSD Module control register set. The designer may easily specify memory mapping in a point-and-click software environment using PSDsoft Express, creating a non-volatile configuration when the DPLD is programmed using JTAG. 8032 Program Address Space. In the example of Figure 53, six sectors of Main Flash memory (fs2.. fs7) are paged across three memory pages in the upper half of program address space, and the remaining two sectors of Main Flash memory (fs0, fs1) reside in the lower half of program address space, and these two sectors are independent of paging (they reside in “common” program address space). This paged memory example is quite common and supported by many 8051 software compilers. 8032 Data Address Space (XDATA). Four sectors of Secondary Flash memory reside in the upper half of 8032 XDATA space in the example of Figure 53. SRAM and csiop registers are in the lower half of XDATA space. The 8032 SFR registers and local SRAM inside the 8032 MCU Module do not reside in XDATA space, so it is OK to place PSD Module SRAM or csiop registers at an address that overlaps the address of internal 8032 MCU Module SRAM and registers. Figure 53. Typical System Memory Map 0000h 8000h A000h C000h E000h FFFFh 8032 XDATA SPACE (RD and WR) 8032 PROGRAM SPACE (PSEN) csboot0 8KB csboot1 8KB csboot2 8KB csboot3 8KB Page X fs0, 16KB Common Memory to All Pages fs7 16KB fs5 16KB fs3 16KB rs0, 8KB Page 0 Page 2 Page 1 2000h 0000h 8000h FFFFh System I/O fs6 16KB fs4 16KB fs2 16KB fs1, 16KB Common Memory to All Pages C000h 4000h csiop 256B AI09173139/231 uPSD33xx Specifying the Memory Map with PSDsoft Express. The memory map example shown in FieuPSD33xx 140/231 EEPROM Emulation. EEPROM emulation is needed if it is desired to repeatedly change only a small number of bytes of data in Flash memory. In this case EEPROM emulation is needed because although Flash memory can be written byte-bybyte, it must be erased sector-by-sector, it is not erasable byte-by-byte (unlike EEPROM which is written AND erased byte-by-byte). So changing one or two bytes in Flash memory typically requires erasing an entire sector each time only one byte is changed within that sector. However, two of the 8K byte sectors of Secondary Flash memory may be used to emulate EEPROM by using a linked-list software technique to create a small data set that is maintained by alternating between the two flash sectors. For example, a data set of 128 bytes is written and maintained by software in a distributed fashion across one 8K byte sector of Secondary Flash memory until it becomes full. Then the writing continues on the other 8K byte sector while erasing the first 8K byte sector. This process repeats continuously, bouncing back and forth between the two 8K byte sectors. This creates a wear-leveling effect, which increases the effective number of erase cycles for a data set of 128 bytes to many times more than the base 100K erase cycles of the Flash memory. EEPROM emulation in Flash memory is typically faster than writing to actual EEPROM memory, and more reliable because the last known value in a data set is maintained even if a WRITE cycle is corrupted by a power outage. The EEPROM emulation function can be called by the firmware, making it appear that the user is writing a single byte, or data record, thus hiding all of the data management that occurs within the two 8K byte flash sectors. EEPROM emulation firmware for the uPSD33xx is available from www.st.com/psm. Alternative Mapping Schemes. Here are more possible memory maps for the uPSD3333. Note: Mapping examples would be slightly different for uPSD3312, uPSD3334, and uPSD3354 because of the different sizes of individual Flash memory sectors and SRAM as defined in Table 82., page 155. – Figure 55. Place the larger Main Flash Memory into program space, but split the Secondary Flash in half, placing two of it’s sectors into XDATA space and remaining two sectors into program space. This method allows the designer to put IAP code (or boot code) into two sectors of Secondary Flash in program space, and use the other two Secondary Flash sectors for data storage, such as EEPROM emulation in XDATA space. – Figure 56. Place both the Main and Secondary Flash memories into program space for maximum code storage, with no Flash memory in XDATA space. Figure 55. Mapping: Split Second Flash in Half Figure 56. Mapping: All Flash in Code Space 0000h 8000h 4000h 6000h FFFFh 8032 XDATA SPACE (RD and WR) 8032 PROGRAM SPACE (PSEN) csboot1, 8KB Common Memory to All Pages csboot0, 8KB Common Memory to All Pages csboot2 8KB csboot3 8KB Page X rs0, 8KB csiop, 256B fs7 16KB fs3 16KB fs1 16KB Page 0 Page 1 Page 2 Page 3 2000h 0000h 8000h FFFFh Nothing Mapped fs6 16KB fs5 16KB fs4 16KB fs2 16KB fs0 16KB System I/O System I/O C000h 2100h 4000h 2000h AI09174 0000h 8000h 4000h 6000h FFFFh 8032 XDATA SPACE (RD and WR) 8032 PROGRAM SPACE (PSEN) csboot1, 8KB Common Memory to All Pages csboot0, 8KB Common Memory to All Pages csboot2, 8KB Common Memory to All Pages csboot3, 8KB Common Memory to All Pages Page X rs0, 8KB csiop, 256B fs7 16KB fs3 16KB fs1 16KB Page 0 Page 1 Page 2 Page 3 2000h 0000h FFFFh fs6 16KB fs5 16KB fs4 16KB fs2 16KB fs0 16KB System I/O C000h 2100h 2000h AI09175141/231 uPSD33xx – Figure 57. Place the larger Main Flash Memory into XDATA space and the smaller Secondary Flash into program space for systems that need a large amount of Flash for data recording or large look-up tables, and not so much Flash for 8032 firmware. Figure 57. Mapping: Small Code / Big Data It is also possible to “reclassify” the Flash memories during runtime, moving the memories between XDATA memory space and program memory space on-the-fly. This essentially means that the user can override the initial setting during run-time by writing to a csiop register (the VM Register). This is useful for IAP, because standard 8051 architecture does not allow writing to program space. For example, if the user wants to update firmware in Main Flash memory that is residing in program space, the user can temporarily “reclassify” the Main Flash memory into XDATA space to erase and rewrite it while executing IAP code from the Secondary Flash memory in program space. After the writing is complete, the Main Flash can be “reclassified” back to program space, then execution can continue from the new code in Main Flash memory. The mapping example of Figure 57 will accommodate this operation. Memory Sector Select Rules. When defining sector select signals (FSx, CSBOOTx, RS0, CSIOP, PSELx) in PSDsoft Express, keep these rules in mind: – Main Flash and Secondary Flash memory sector select signals may not be larger than their physical sector size as defined in Table 75., page 135. – Any Main Flash memory sector select may not be mapped in the same address range as another Main Flash sector select (cannot overlap segments of Main Flash on top of each other). – Any Secondary Flash memory sector select may not be mapped in the same address range as another Secondary Flash sector select (cannot overlap segments of Secondary Flash on top of each other). – A Secondary Flash memory sector may overlap a Main Flash memory sector. In the case of overlap, priority is given to the Secondary Flash memory sector. – SRAM, CSIOP, or PSELx may overlap any Flash memory sector. In the case of overlap, priority is given to SRAM, CSIOP, or PSELx. Note: PSELx is for optional Peripheral I/O Mode on Port A. – The address range for sector selects for SRAM, PSELx, and CSIOP must not overlap each other as they have the same priority, causing contention if overlapped. 0000h 8000h 4000h 6000h FFFFh 8032 XDATA SPACE (RD and WR) 8032 PROGRAM SPACE (PSEN) csboot0 8KB csboot1 8KB csboot2 8KB csboot3 8KB Page X rs0, 8KB Common Memory to All Pages csiop, 256 bytes, Common to All Pages fs7 16KB fs3 16KB fs1 16KB Page 0 Page 1 Page 2 Page 3 2000h 0000h 8000h FFFFh Nothing Mapped fs6 16KB fs5 16KB fs4 16KB fs2 16KB fs0 16KB System I/O C000h 2100h 2000h AI09176uPSD33xx 142/231 Figure 58 illustrates the priority scheme of the memory elements of the PSD Module. Priority refers to which memory will ultimately produce a byte of data or code to the 8032 MCU for a given bus cycle. Any memory on a higher level can overlap and has priority over any memory on a lower level. Memories on the same level must not overlap. Example: FS0 is valid when the 8032 produces an address in the range of 8000h to BFFFh. CSBOOT0 is valid from 8000h to 9FFFh. RS0 is valid from 8000h to 87FFh. Any address from the 8032 in the range of RS0 always accesses the SRAM. Any address in the range of CSBOOT0 greater than 87FFh (and less than 9FFFh) automatically addresses Secondary Flash memory. Any address greater than 9FFFh accesses Main Flash memory. One-half of the Main Flash memory segment, and one-fourth of the Secondary Flash memory segment cannot be accessed by the 8032 in this example. Figure 58. PSD Module Memory Priority The VM Register. One of the csiop registers (the VM Register) controls whether or not the 8032 bus control signals RD, WR, and PSEN are routed to the Main Flash memory, the Secondary Flash memory, or the SRAM. Routing of these signals to these PSM Module memories determines if memories reside in 8032 program address space, 8032 XDATA space, or both. The initial setting of the VM Register is determined by a choice in PSDsoft Express and programmed into the uPSD33xx in a non-volatile fashion using JTAG. This initial setting is loaded into the VM Register upon power-up and also loaded upon any reset event. However, the 8032 may override the initial VM Register setting at run-time by writing to the VM Register, which is useful for IAP. Table 78., page 143 defines bit functions within the VM Register. Note: Bit 7, PIO_EN, is not related to the memory manipulation functions of Bits 0, 1, 2, 3, and 4. Also note that SRAM must at least always be in 8032 XDATA space (default condition). Bit 0 allows the user to optionally place SRAM into 8032 program space in addition to XDATA space. CSIOP registers are always in XDATA space and cannot reside in program space. Figure 59., page 144 illustrates how the VM Register affects the routing of RD, WR, and PSEN to the memories on the PSD Module. As an example, if we apply the value 0Ch to the VM Register to implement the memory map example shown in Figure 53., page 138, then the routing of RD, WR, and PSEN would look like that shown in Figure 60., page 145. In this example, the configuration is specified in PSDsoft Express and programmed into the uPSD33xx using JTAG. Upon power-on or any reset condition, the non-volatile value 0Ch is loaded into the VM Register. At runtime, the value 0Ch in the VM Register may be changed (overridden) by the 8032 if desired to implement IAP or other functions. Level 1 SRAM, CSIOP, and Peripheral I/O Mode Highest Priority Level 2 Secondary Flash Memory Level 3 Main Flash Memory Lowest Priority AI02867E143/231 uPSD33xx Table 78. VM Register (address = csiop + offset E2h) Note: 1. Default value of Bits 0, 1, 2, 3, and 4 is loaded from Non-Volatile setting as specified from PSDsoft Express upon any reset or powerup condition. The default value of these bits can be overridden by 8032 at run-time. 2. Default value of Bit 7 is zero upon any reset condition. Bit 7 PIO_EN Bit 6 Bit 5 Bit 4 Main Flash XDATA Space Bit 3 Secondary Flash XDATA Space Bit 2 Main Flash Program Space Bit 1 Secondary Flash Program Space Bit 0 SRAM Program Space 0 = disable Peripheral I/O Mode on Port A not used not used 0 = RD or WR cannot access Main Flash 0 = RD or WR cannot access Secondary Flash 0 = PSEN cannot access Main Flash 0 = PSEN cannot access Secondary Flash 0 = PSEN cannot access SRAM 1 = enable Peripheral I/O Mode on Port A not used not used 1 = RD or WR can access Main Flash 1 = RD or WR can access Secondary Flash 1 = PSEN can access Main Flash 1 = PSEN can access Secondary Flash 1 = PSEN can access SRAMuPSD33xx 144/231 Figure 59. VM Register Control of Memories DPLD Main Flash Memory Secondary Flash Memory SRAM CS CS CS FS0 - FS7 CSBOOT0 - CSBOOT3 RS0 WR VM REG BIT 4 VM REG BIT 3145/231 uPSD33xx Figure 60. VM Register Example Corresponding to Memory Map Example of Figure 33 Runtime Control Register Definitions (csiop) The 39 csiop registers are defined in Table 79. The 8032 can access each register by the address offset (specified in Table 79) added to the csiop base address that was specified in PSDsoft Express. Do not write to unused locations within the csiop block of 256 registers, they should remain logic zero. Table 79. CSIOP Registers and their Offsets (in hexadecimal) DPLD Main Flash Memory Secondary Flash Memory SRAM CS CS CS FS0 - FS7 CSBOOT0 - CSBOOT3 RS0 WR OE WR OE WR OE 8032 Address 53 Other PLD Inputs WR PSEN RD VM Register = 0Ch AI02869D Register Name Port A (80-pin) Port B Port C Port D Other Description Link Data In 00h 01h 10h 11h MCU I/O input mode. Read to obtain current logic level of pins on Ports A, B, C, or D. No WRITEs. Table 95., page 172 Control 02h 03h Selects MCUI/O or Latched Address Out mode. Logic 0 = MCU I/O, 1 = 8032 Addr Out. Write to select mode. Read for status. Table 107., page 177 Data Out 04h 05h 12h 13h MCU I/O output mode. Write to set logic level on pins of Ports A, B, C, or D. Read to check status. This register has no effect if a port pin is driven by an OMC output from PLD. Table 99., page 172 Direction 06h 07h 14h 15h MCU I/O mode. Configures port pin as input or output. Write to set direction of port pins. Logic 1 = out, Logic 0 = in. Read to check status. Table 103., page 173 Drive Select 08h 09h 16h 17h Write to configure port pins as either CMOS push-pull or Open Drain on some pins, while selecting high slew rate on other pins. Read to check status. Default output type is CMOS push-pull. Table 109., page 179uPSD33xx 146/231 Input Macrocells 0Ah 0Bh 18h Read to obtain logic state of IMCs. No WRITEs. Table 90., page 167 Enable Out OCh 0Dh 1Ah 1Bh Read state of output enable logic on each I/O port driver. 1 = driver output is enabled, 0 = driver is off, and it is in high impedance state. No WRITEs. Table 113., page 180 Output Macrocells AB (MCELLAB) 20h Read logic state of MCELLAB outputs (bank of eight OMCs). Write to load MCELLAB flip-flops. Table 86., page 165 Output Macrocells BC (MCELLBC) 21h Read logic state of MCELLBC outputs (bank of eight OMCs). Write to load MCELLBC flip-flops. Table 87., page 165 Mask Macrocells AB 22h Write to set mask for MCELLAB. Logic '1' blocks READs/WRITEs of OMC. Logic '0' will pass OMC value. Read to check status. Table 88., page 166 Mask Macrocells BC 23h Write to set mask for MCELLBC. Logic '1' blocks READs/WRITEs of OMC. Logic '0' will pass OMC value. Read to check status. Table 89., page 166 Main Flash Sector Protection C0h Read to determine Main Flash Sector Protection Setting (non-volatile) that was specified in PSDsoft Express. No WRITEs. Table 82., page 155 Security Bit and Secondary Flash Sector Protection C2h Read to determine if PSD Module device Security Bit is active (nonvolatile) Logic 1 = device secured. Also read to determine Secondary Flash Protection Setting (non-volatile) that was specified in PSDsoft. No WRITEs. Table 83., page 155 PMMR0 B0h Power Management Register 0. WRITE and READ. Table 117., page 188 PMMR2 B4h Power Management Register 2. WRITE and READ. Table 118., page 188 PMMR3 C7h Power Management Register 3. WRITE and READ. However, Bit 1 can be cleared only by a reset condition. Table 119., page 188 Page E0h Memory Page Register. WRITE and READ. Figure 52., page 135 VM (Virtual Memory) E2h Places PSD Module memories into 8032 Program Address Space and/or 8032 XDATA Address Space. (VM overrides initial non-volatile setting that was specified in PSDsoft Express. Reset restores initial setting) Table 78., page 143 Register Name Port A (80-pin) Port B Port C Port D Other Description Link147/231 uPSD33xx PSD Module Detailed Operation Specific details are given here for the following key functional areas on the PSD Module: ■ Flash Memories ■ PLDs (DPLD and GPLD) ■ I/O Ports ■ Power Management ■ JTAG ISP and Debug Interface Flash Memory Operation. The Flash memories are accessed through the 8032 Address, Data, and Control Bus interfaces. Flash memories (and SRAM) cannot be accessed by any other bus master other than the 8032 MCU (these are not dual-port memories). The 8032 cannot write to Flash memory as it would an SRAM (supply address, supply data, supply WR strobe, assume the data was correctly written to memory). Flash memory must first be “unlocked” with a special instruction sequence of byte WRITE operations to invoke an internal algorithm inside either Flash memory array, then a single data byte is written (programmed) to the Flash memory array, then programming status is checked by a byte READ operation or by checking the Ready/Busy pin (PC3). Table 80., page 148 lists all of the special instruction sequences to program a byte to either of the Flash memory arrays, erase the arrays, and check for different types of status from the arrays. This unlocking sequence is typical for many Flash memories to prevent accidental WRITEs by errant code. However, it is possible to bypass this unlocking sequence to save time while intentionally programming Flash memory. IMPORTANT: The 8032 may not read and execute code from the same Flash memory array for which it is directing an instruction sequence. Or more simply stated, the 8032 may not read code from the same Flash array that is writing or erasing. Instead, the 8032 must execute code from an alternate memory (like SRAM or a different Flash array) while sending instruction sequences to a given Flash array. Since the two Flash memory arrays inside the PSD Module device are completely independent, the 8032 may read code from one array while sending instructions to the other. It is possible, however, to suspend a sector erase operation in one particular Flash array in order to access a different sector within that same Flash array, then resume the erase later. After a Flash memory array is programmed or erased it will go to “Read Array” mode, then the 8032 can read from Flash memory just as it would read from any 8-bit ROM or SRAM device. Flash Memory Instruction Sequences. An instruction sequence consists of a sequence of specific byte WRITE and byte READ operations. Each byte written to either Flash memory array on the PSD Module is received by a state machine inside the Flash array and sequentially decoded to execute an embedded algorithm. The algorithm is executed when the correct number of bytes are properly received and the time between two consecutive bytes is shorter than the time-out period of 80µs. Some instruction sequences are structured to include READ operations after the initial WRITE operations. An instruction sequence must be followed exactly. Any invalid combination of instruction bytes or time-out between two consecutive bytes while addressing Flash memory resets the PSD Module Flash logic into Read Array mode (where Flash memory is read like a ROM device). The Flash memories support instruction sequences summarized in Table 80., page 148. ■ Program a Byte ■ Unlock Sequence Bypass ■ Erase memory by array or by sector ■ Suspend or resume a sector erase ■ Reset to Read Array mode The first two bytes of an instruction sequence are 8032 bus WRITE operations to “unlock” the Flash array, followed by writing a command byte. The bus operations consist of writing the data AAh to address X555h during the first bus cycle and data 55h to address XAAAh during the second bus cycle. 8032 address signals A12-A15 are “Don’t care” during the instruction sequence during WRITE cycles. However, the appropriate sector select signal (FSx or CSBOOTx) from the DPLD must be active during the entire instruction sequence to complete the entire 8032 address (this includes the page number when memory paging is used). Ignoring A12-A15 means the user has more flexibility in memory mapping. For example, in many traditional Flash memories, instruction sequences must be written to addresses AAAAh and 5555h, not XAAAh and X555h like supported on the PSD Module. When AAAAh and 5555h must be written to, the memory mapping options are limited. The Main Flash and Secondary Flash memories each have the same instruction set shown in Table 80., page 148, but the sector select signals determine which memory array will receive and execute the instructions.uPSD33xx 148/231 Table 80. Flash Memory Instruction Sequences(1,2) Instr. Sequence Bus Cycle 1 Bus Cycle 2 Bus Cycle 3 Bus Cycle 4 Bus Cycle 5 Bus Cycle 6 Bus Cycle 7 Link Read Memory Contents (Read Array mode) Read byte from any valid Flash memory addr Read Memory Contents., p age 149 Program (write) a Byte to Flash Memory Write AAh to X555h (unlock) Write 55h to XAAAh (unlock) Write A0h to X555h (command ) Write data byte to address Programmin g Flash Memory., pa ge 150 Bypass Unlock Write AAh to X555h (unlock) Write 55h to XAAAh (unlock) Write 20h to X555h (command ) Bypassed Unlock Sequence, p age 153 Program a Byte to Flash Memory with Bypassed Unlock Write A0h to XXXXh (command) Write data byte to address Bypassed Unlock Sequence, p age 153 Reset Bypass Unlock Write 90h to XXXXh (command) Write 00h to XXXXh (command ) Bypassed Unlock Sequence, p age 153 Flash Bulk Erase(3) Write AAh to X555h (unlock) Write 55h to XAAAh (unlock) Write 80h to X555h (command ) Write AAh to X555h (unlock) Write 55h to XAAAh (unlock) Write 10h to X555h (command) Flash Bulk Erase., page 153 Flash Sector Erase Write AAh to X555h (unlock) Write 55h to XAAAh (unlock) Write 80h to X555h (command ) Write AAh to X555h (unlock) Write 55h to XAAAh (unlock) Write 30h to desired Sector (command) Write 30h to another Sector (command) Flash Sector Erase., page 154 Suspend Sector Erase Write B0h to address that activates FSx or CSBOOTx where erase is in progress (command) Suspend Sector Erase., page 154 Resume Sector Erase Write 30h to address that activates FSx or CSBOOTx where desired to resume erase (command) Resume Sector Erase., page 154149/231 uPSD33xx Note: 1. All values are in hexadecimal, X = Don’t care 2. 8032 addresses A12 through A15 are “Don’t care” during the instruction sequence decoding. Only address bits A0-A11 are used during decoding of Flash memory instruction sequences. The individual sector select signal (FS0 - FS7 or CSBOOT0-CSBOOT3) which is active during the instruction sequence determines the complete address. 3. Directing this command to any individual sector within a Flash memory array will invoke the bulk erase of all Flash memory sectors within that array. Reading Flash Memory. Under typical conditions, the 8032 may read the Flash memory using READ operations (READ bus cycles) just as it would a ROM or RAM device. Alternately, the 8032 may use READ operations to obtain status information about a Program or Erase operation that is currently in progress. The following sections describe the kinds of READ operations. Read Memory Contents. Flash memory is placed in the Read Array mode after Power-up, after a PSD Module reset event, or after receiving a Reset Flash memory instruction sequence from the 8032. The 8032 can read Flash memory contents using standard READ bus cycles anytime the Flash array is in Read Array mode. Flash memories will always be in Read Array mode when the array is not actively engaged in a program or erase operation. Reading the Erase/Program Status Bits. The Flash arrays provide several status bits to be used by the 8032 to confirm the completion of an erase or program operation on Flash memory, shown in Table 81., page 150. The status bits can be read as many times as needed until an operation is complete. The 8032 performs a READ operation to obtain these status bits while an erase or program operation is being executed by the state machine inside each Flash memory array. Data Polling Flag (DQ7). While programming either Flash memory, the 8032 may read the Data Polling Flag Bit (DQ7), which outputs the com1.24Is0.6(2(i)8.4(3(n)]TJl)8.1(e21.5(n)-23.8(0.9(m3.5o)-23.8(f.9(m3.5)-7.23659 16.9(p)D72(g)-0)]TJ 8as)-77.236 of77.236 0.9(m3.h)-23.8(e16.9(6.5(-77.236e21.5([(at).8(r)2-23.8(g21.5([i)-16.2(l)8)17.4(o)-36e21.5(d)24.4(o)]TJ -1-9.097623.8(r)21.5(-77.236o21.5([-1.08TD 0.00)-23.56-6.8(h )236e21.5(8(h )236o21.5(r.9(6.5(..9(m3.5Onc9(6.5(e21.5([)-7.23659 i)-16.2(l)8)17 as)-6.5(e))-23.8(ro9(o)0.1p)-24.3(o)-24.2(f)14.9(08)]TJ 0 b)-8op)-23.6( on )2p.3(as3(eded124.4(F)t)9.5(ee)-23.6(m)9.5(e)D1(i)c)177(o)0.8(0.8(m)- equaat)-8. Tw [(or8.3(as D72ofw [(or t)9.5(eh)-23.6(e16.9(6.4)t)9.5(ee)3(as j(eded12u)3(ass9(6.4)t)9.5(e i)-n eras)-6.5(e or programi)7.5(n131-12.07316.2(l)8)317.7(l)4(F)-1(ray))15.4(h)2 TD 0.0n(F)-1t)9.536o21.4([-17.6(i)-16.5(de eac)-6.8(h )24.4(F)-17.7(l)7.9(as)-6.8(h m)-15.,5(e)8. i16.5(ndi16.5(c 0.009a(F)-1t)(e)8.i16.5(ngray))15.4(h)t)(e)8.59 i)-4.4(o)-7.2(m)-2(1.24Is123.5(i)8489812.0731-15.5r)497 Tc15.58(h8)15.4(h)cycl)9.5(t)715.5 h715.5Tc15.5s(F)(e ]TJ15.58(16.4)p.5(o)0.l)9.5(t)715.5t)h)-4Tw [(c5.5d715.5 s5.4(.9(715.5cc)715.5ssf(715.5l)9.5(tl)9.5(ty(F)(e.15.4(h)Tg)-0)7.5( )24.424.4(o)]TJ 1 Dat)-8.10017.6(s)]TJ 0(s)-rrrayTD 0.000(s)-cc)-t 81.(or s.000(s)-l2( bei)17.6(2(c 0.4(h)t)(25(e)0.8.4(h)2 T9)-8.5(.6(2(n000(s)-a5(.6(2(l 0.0585 Tw.4(us)-32.8(ll3)24.S8(s)7(x.8.4(h)5o)-.6(2(rrayTD 0 C(i)c)9.S8(20.1pBO)-32.8(O.8(g)-8Tll3)24.x5 Tw.4(usmll)-24u000(s)-st 81.(or b)-.6(2( )24.4(o)-24.23.)]TJ /F1n)]TJ 0Tc 0.0 )-24.46.9(t)v 0.0 )e Fl)- dur6.9(t)n)6.3(o)g15.4(h)t)(e)4.59 ent)(e)4.6.9(t)r8(s))8.2pol.9(t)l.9(t)2 TD 06i)-15.4(h)p)6.3(o))-6.82)7.9(a(o)b)-24.1582 Tw [dure-7.3(p)-16(l902t)-8.8(he m)-15( 2611]TJ 0 -1.76 TD -9.0022 Tc 5.0169 T(us)-32.8m)-23.2)-31.65h mus2(o31.65h 22 Tc 5.d169 T(ui(t)14..7(ed by7e)-23.2(t)7.5(s(us)-32.8w)-14.7(h7.5(s(u582.65h2 Tc 5.[-31.65h6(o)-23.5( obt)15.6(a)-23.5(i)81063(n)]TJ15.4(s)-6.5()8.8( o)24.4(sp5( RE)14h)2 TD 02ro9(h.4(s)-6.()8.8( c(s)-6.o TD 02(l)8.p TD 0.7(i)8.)24.4(sRE)14h)e TD 0d)24.4(s.E)14h) Dur6.(i)8)-1(t)15.4(s)-6.5(o)-2-32.878 44.63413.8( ei)8.1(-)]TJ5 or )]TJas)-6.5(8(t)2 .9(eonm)9.6(e)D1(i)c77(o)0.at)-9(u3)-16.9(p)'0..9(m)-'9(rm( )-21551 Tw.5(8(t))7.1(lr)0.9(m)-14a)-23.5se, ou3u3laslel.5(8(t))7o obta -uPSD33xx 150/231 If all the Flash memory sectors selected for erasure are protected, DQ6 toggles to ’0’ for about 100µs, then returns value of D6 of the previously addressed byte. Error Flag (DQ5). During a normal program or erase operation, the Error Flag Bit (DQ5) is to ’0’. This bit is set to ’1’ when there is a failure during Flash memory byte program, sector erase, or bulk erase operations. In the case of Flash memory programming, DQ5 Bit indicates an attempt to program a Flash memory bit from the programmed state of 0, to the erased state of 1, which is not valid. DQ5 may also indicate a particular Flash cell is damaged and cannot be programmed. In case of an error in a Flash memory sector erase or byte program operation, the Flash memory sector in which the error occurred or to which the programmed byte belongs must no longer be used. Other Flash memory sectors may still be used. DQ5 is reset after a Reset Flash instruction sequence. Erase Time-out Flag (DQ3). The Erase Timeout Flag Bit (DQ3) reflects the time-out period allowed between two consecutive sector erase instruction sequence bytes. If multiple sector erase commands are desired, the additional sector erase commands (30h) must be sent by the 8032 within 80us after the previous sector erase command. DQ3 is 0 before this time period has expired, indicating it is OK to issue additional sector erase commands. DQ3 will go to logic ’1’ if the time has been longer than 80µs since the previous sector erase command (time has expired), indication that is not OK to send another sector erase command. In this case, the 8032 must start a new sector erase instruction sequence (unlock and command) beginning again after the current sector erase operation has completed. Programming Flash Memory. When a byte of Flash memory is programmed, individual bits are programmed to logic '0.' The user cannot program a bit in Flash memory to a logic ’1’ once it has been programmed to a logic '0.' A bit must be erased to logic ’1’, and programmed to logic '0.' That means Flash memory must be erased prior to being programmed. A byte of Flash memory is erased to all 1s (FFh). The 8032 may erase the entire Flash memory array all at once, or erase individual sector-by-sector, but not erase byte-by-byte. However, even though the Flash memories cannot be erased byte-by-byte, the 8032 may program Flash memory byte-by-byte. This means the 8032 does not need to program group of bytes (64, 128, etc.) at one time, like some Flash memories. Each Flash memory requires the 8032 to send an instruction sequence to program a byte or to erase sectors (see Table 80., page 148). If the byte to be programmed is in a protected Flash memory sector, the instruction sequence is ignored. IMPORTANT: It is mandatory that a chip-select signal is active for the Flash sector where a programming instruction sequence is targeted. Make sure that the correct chip-select equation, FSx, or CSBOOTx specified in PSDsoft Express matches the address range that the 8032 firmware is accessing, otherwise the instruction sequence will not be recognized by the Flash array. If memory paging is used, be sure that the 8032 firmware sets the page register to the correct page number before issuing an instruction sequence to the Flash memory segment on a particular memory page, otherwise the correct sector select signal will not become active. Once the 8032 issues a Flash memory program or erase instruction sequence, it must check the status bits for completion. The embedded algorithms that are invoked inside a Flash memory array provide several ways to give status to the 8032. Status may be checked using any of three methods: Data Polling, Data Toggle, or Ready/Busy (pin PC3). Table 81. Flash Memory Status Bit Definition Note: 1. X = Not guaranteed value, can be read either '1' or '0.' 2. DQ7-DQ0 represent the 8032 Data Bus Bits, D7-D0. Functional Block FSx, or CSBOOTx DQ7 DQ6 DQ5 DQ4 DQ3 DQ2 DQ1 DQ0 Flash Memory Active (the desired segment is selected) Data Polling Toggle Flag Error Flag X Erase Timeout XXX151/231 uPSD33xx Data Polling. Polling on the Data Polling Flag Bit (DQ7) is a method of checking whether a program or erase operation is in progress or has completed. Figure 61 shows the Data Polling algorithm. When the 8032 issues a program instruction sequence, the embedded algorithm within the Flash memory array begins. The 8032 then reads the location of the byte to be programmed in Flash memory to check status. The Data Polling Flag Bit (DQ7) of this location becomes the compliment of Bit D7 of the original data byte to be programmed. The 8032 continues to poll this location, comparing the Data Polling Flag Bit (DQ7) and monitoring the Error Flag Bit (DQ5). When the Data Polling Flag Bit (DQ7) matches Bit D7 of the original data, then the embedded algorithm is complete. If the Error Flag Bit (DQ5) is '1,' the 8032 should test the Data Polling Flag Bit (DQ7) again since the Data Polling Flag Bit (DQ7) may have changed simultaneously with the Error Flag Bit (DQ5) (see Figure 61). The Error Flag Bit (DQ5) is set if either an internal time-out occurred while the embedded algorithm attempted to program the byte (indicating a bad Flash cell) or if the 8032 attempted to program bit to logic ’1’ when that bit was already programmed to logic ’0’ (must erase to achieve logic ’1’). It is suggested (as with all Flash memories) to read the location again after the embedded programming algorithm has completed, to compare the byte that was written to the Flash memory with the byte that was intended to be written. When using the Data Polling method during an erase operation, Figure 61 still applies. However, the Data Polling Flag Bit (DQ7) is '0' until the erase operation is complete. A ’1’ on the Error Flag Bit (DQ5) indicates a time-out condition on the Erase cycle, a ’0’ indicates no error. The 8032 can read any location within the sector being erased to get the Data Polling Flag Bit (DQ7) and the Error Flag Bit (DQ5). PSDsoft Express generates ANSI C code functions for implementation of these Data Polling algorithms. Figure 61. Data Polling Flowchart READ DQ5 & DQ7 at VALID ADDRESS START READ DQ7 FAIL PASS AI01369B DQ7 = DATA YES NO YES NO DQ5 = 1 DQ7 = DATA YES NOuPSD33xx 152/231 Data Toggle. Checking the Toggle Flag Bit (DQ6) is another method of determining whether a program or erase operation is in progress or has completed. Figure 62 shows the Data Toggle algorithm. When the 8032 issues a program instruction sequence, the embedded algorithm within the Flash memory array begins. The 8032 then reads the location of the byte to be programmed in Flash memory to check status. The Toggle Flag Bit (DQ6) of this location toggles each time the 8032 reads this location until the embedded algorithm is complete. The 8032 continues to read this location, checking the Toggle Flag Bit (DQ6) and monitoring the Error Flag Bit (DQ5). When the Toggle Flag Bit (DQ6) stops toggling (two consecutive reads yield the same value), then the embedded algorithm is complete. If the Error Flag Bit (DQ5) is '1,' the 8032 should test the Toggle Flag Bit (DQ6) again, since the Toggle Flag Bit (DQ6) may have changed simultaneously with the Error Flag Bit (DQ5) (see Figure 62). The Error Flag Bit (DQ5) is set if either an internal time-out occurred while the embedded algorithm attempted to program the byte, or if the 8032 attempted to program bit to logic ’1’ when that bit was already programmed to logic ’0’ (must erase to achieve logic ’1’). It is suggested (as with all Flash memories) to read the location again after the embedded programming algorithm has completed, to compare the byte that was written to Flash memory with the byte that was intended to be written. When using the Data Toggle method during an erase operation, Figure 62 still applies. the Toggle Flag Bit (DQ6) toggles until the erase operation is complete. A ’1’ on the Error Flag Bit (DQ5) indicates a time-out condition on the Erase cycle, a ’0’ indicates no error. The 8032 can read any location within the sector being erased to get the Toggle Flag Bit (DQ6) and the Error Flag Bit (DQ5). PSDsoft Express generates ANSI C code functions for implementation of these Data Toggling algorithms. Figure 62. Data Toggle Flowchart READ DQ5 & DQ6 START READ DQ6 FAIL PASS AI01370B DQ6 = TOGGLE NO NO YES YES DQ5 = 1 NO YES DQ6 = TOGGLE153/231 uPSD33xx Ready/Busy (PC3). This signal can be used to output the Ready/Busy status of a program or erase operation on either Flash memory. The output on the Ready/Busy pin is a ’0’ (Busy) when either Flash memory array is being written, or when either Flash memory array is being erased. The output is a ’1’ (Ready) when no program or erase operation is in progress. To activate this function on this pin, the user must select the “Ready/Busy” selection in PSDsoft Express when configuring pin PC3. This pin may be polled by the 8032 or used as a 8032 interrupt to indicate when an erase or program operation is complete (requires routing the signal on PC board from PC3 back into a pin on the MCU Module). This signal is also available internally on the PSD Module as an input to both PLDs (without routing a signal externally on PC board) and it’s signal name is “rd_bsy”. The Ready/Busy output can be probed during lab development to check the timing of Flash memory programming in the system at run-time. Bypassed Unlock Sequence. The Bypass Unlock mode allows the 8032 to program bytes in the Flash memories faster than using the standard Flash program instruction sequences because the typical AAh, 55h unlock bus cycles are bypassed for each byte that is programmed. Bypassing the unlock sequence is typically used when the 8032 is intentionally programming a large number of bytes (such as during IAP). After intentional programming is complete, typically the Bypass mode would be disabled, and full protection is back in place to prevent unwanted WRITEs to Flash memory. The Bypass Unlock mode is entered by first initiating two Unlock bus cycles. This is followed by a third WRITE operation containing the Bypass Unlock command, 20h (as shown in Table 80., page 148). The Flash memory array that received that sequence then enters the Bypass Unlock mode. After this, a two bus cycle program operation is all that is required to program a byte in this mode. The first bus cycle in this shortened program instruction sequence contains the Bypassed Unlocked Program command, A0h, to any valid address within the unlocked Flash array. The second bus cycle contains the address and data of the byte to be programmed. Programming status is checked using toggle, polling, or Ready/Busy just as before. Additional data bytes are programmed the same way until this Bypass Unlock mode is exited. To exit Bypass Unlock mode, the system must issue the Reset Bypass Unlock instruction sequence. The first bus cycle of this instruction must write 90h to any valid address within the unlocked Flash Array; the second bus cycle must write 00h to any valid address within the unlocked Flash Array. After this sequence the Flash returns to Read Array mode. During Bypass Unlock Mode, only the Bypassed Unlock Program instruction, or the Reset Bypass Unlock instruction is valid, other instruction will be ignored. Erasing Flash Memory. Flash memory may be erased sector-by-sector, or an entire Flash memory array may be erased with one command (bulk). Flash Bulk Erase. The Flash Bulk Erase instruction sequence uses six WRITE operations followed by a READ operation of the status register, as described in Table 80., page 148. If any byte of the Bulk Erase instruction sequence is wrong, the Bulk Erase instruction sequence aborts and the device is reset to the Read Array mode. The address provided by the 8032 during the Flash Bulk Erase command sequence may select any one of the eight Flash memory sector select signals FSx or one of the four signals CSBOOTx. An erase of the entire Flash memory array will occur in a particular array even though a command was sent to just one of the individual Flash memory sectors within that array. During a Bulk Erase, the memory status may be checked by reading the Error Flag Bit (DQ5), the Toggle Flag Bit (DQ6), and the Data Polling Flag Bit (DQ7). The Error Flag Bit (DQ5) returns a ’1’ if there has been an erase failure. Details of acquiring the status of the Bulk Erase operation are detailed in the section entitled “Programming Flash Memory., page 150. During a Bulk Erase operation, the Flash memory does not accept any other Flash instruction sequences.uPSD33xx 154/231 Flash Sector Erase. The Sector Erase instruction sequence uses six WRITE operations, as described in Table 80., page 148. Additional Flash Sector Erase commands to other sectors within the same Flash array may be issued by the 8032 if the additional commands are sent within a limited amount of time. The Erase Time-out Flag Bit (DQ3) reflects the time-out period allowed between two consecutive sector erase instruction sequence bytes. If multiple sector erase commands are desired, the additional sector erase commands (30h) must be sent by the 8032 to another sector within 80µs after the previous sector erase command. DQ3 is 0 before this time period has expired, indicating it is OK to issue additional sector erase commands. DQ3 will go to logic ’1’ if the time has been longer than 80µs since the previous sector erase command (time has expired), indicating that is not OK to send another sector erase command. In this case, the 8032 must start a new sector erase instruction sequence (unlock and command), beginning again after the current sector erase operation has completed. During a Sector Erase operation, the memory status may be checked by reading the Error Flag Bit (DQ5), the Toggle Flag Bit (DQ6), and the Data Polling Flag Bit (DQ7), as detailed in Reading the Erase/Program Status Bits, page 149. During a Sector Erase operation, a Flash memory accepts only Reset Flash and Suspend Sector Erase instruction sequences. Erasure of one Flash memory sector may be suspended, in order to read data from another Flash memory sector, and then resumed. The address provided with the initial Flash Sector Erase command sequence (Table 80., page 148) must select the first desired sector (FSx or CSBOOTx) to erase. Subsequent sector erase commands that are appended within the time-out period must be addressed to other desired segments within the same Flash memory array. Suspend Sector Erase. When a Sector Erase operation is in progress, the Suspend Sector Erase instruction sequence can be used to suspend the operation by writing B0h to any valid address within the Flash array that currently is undergoing an erase operation. This allows reading of data from a different Flash memory sector within the same array after the Erase operation has been suspended. Suspend Sector Erase is accepted only during an Erase operation. There is up to 15µs delay after the Suspend Sector Erase command is accepted and the array goes to Read Array mode. The 8032 will monitor the Toggle Flag Bit (DQ6) to determine when the erase operation has halted and Read Array mode is active. If a Suspend Sector Erase instruction sequence was executed, the following rules apply: – Attempting to read from a Flash memory sector that was being erased outputs invalid data. – Reading from a Flash memory sector that was not being erased is valid. – The Flash memory cannot be programmed, and only responds to Resume Sector Erase and Reset Flash instruction sequences. – If a Reset Flash instruction sequence is received, data in the Flash memory sector that was being erased is invalid. Resume Sector Erase. If a Suspend Sector Erase instruction sequence was previously executed, the erase cycle may be resumed with this instruction sequence. The Resume Sector Erase instruction sequence consists of writing the command 30h to any valid address within the Flash array that was suspended as shown in Table 80., page 148. Reset Flash. The Reset Flash instruction sequence resets the embedded algorithm running on the state machine in the targeted Flash memory (Main or Secondary) and the memory goes into Read Array mode. The Reset Flash instruction consists of one bus WRITE cycle as shown in Table 80., page 148, and it must be executed after any error condition that has occurred during a Flash memory Program or Erase operation. It may take the Flash memory up to 25µs to complete the Reset cycle. The Reset Flash instruction sequence is ignored when it is issued during a Program or Bulk Erase operation. The Reset Flash instruction sequence aborts any on-going Sector Erase operation and returns the Flash memory to Read Array mode within 25µs. Reset Signal Applied to Flash Memory. Whenever the PSD Module receives a reset signal from the MCU Module, any operation that is occurring in either Flash memory array will be aborted and the array(s) will go to Read Array mode. It may take up to 25µs to abort an operation and achieve Read Array mode. A reset from the MCU Module will result from any of these events: an active signal on the uPSD33xx RESET_IN input pin, a watchdog timer time-out, detection of low VCC, or a JTAG debug channel reset event.155/231 uPSD33xx Flash Memory Sector Protection. Each Flash memory sector can be separately protected against program and erase operations. This mode can be activated (or deactivated) by selecting this feature in PSDsoft Express and then programming through the JTAG Port. Sector protection can be selected for individual sectors, and the 8032 cannot override the protection during run-time. The 8032 can read, but not change, sector protection. Any attempt to program or erase a protected Flash memory sector is ignored. The 8032 may read the contents of a Flash sector even when a sector is protected. Sector protection status is not read using Flash memory instruction sequences, but instead this status is read by the 8032 reading two registers within csiop address space shown in Table 82 and Table 83. Flash Memory Protection During Power-Up. Flash memory WRITE operations are automatically prevented while VDD is ramping up until it rises above VLKO voltage threshold at which time Flash memory WRITE operations are allowed. PSD Module Security Bit. A programmable security bit in the PSD Module protects its contents from unauthorized viewing and copying. The security bit is set using PSDsoft Express and programmed into the PSD Module with JTAG. When set, the security bit will block access of JTAG programming equipment from reading or modifying the PSD Module Flash memory and PLD configuration. The security bit also blocks JTAG access to the MCU Module for debugging. The only way to defeat the security bit is to erase the entire PSD Module using JTAG (erase is the only JTAG operation allowed while security bit is set), after which the device is blank and may be used again. The 8032 MCU will always have access to Flash mem-uPSD33xx 156/231 PLDs. The PSD Module contains two PLDs: the Decode PLD (DPLD), and the General PLD (GPLD), as shown in Figure 63., page 157. Both PLDs are fed by a common PLD input signal bus, and additionally, the GPLD is connected to the 8032 data bus. PLD logic is specified using PSDsoft Express and programmed into the PSD Module using the JTAG ISP channel. PLD logic is non-volatile and available at power-up. PLDs may not be programmed by the 8032. The PLDs have selectable levels of performance and power consumption. The DPLD performs address decoding, and generates select signals for internal and external components, such as memory, registers, and I/O ports. The DPLD can generate External Chip-Select (ECS1-ECS2) signals on Port D. The GPLD can be used for logic functions, such as loadable counters and shift registers, state machines, encoding and decoding logic. These logic functions can be constructed from a combination of 16 Output Macrocells (OMC), 20 Input Macrocells (IMC), and the AND-OR Array. Routing of the 16 OMCs outputs can be divided between pins on three Ports A, B, or C by the OMC Allocator as shown in Figure 67., page 163. Eight of the 16 OMCs that can be routed to pins on Port A or Port B and are named MCELLAB0- MCELLAB7. The other eight OMCs to be routed to pins on Port B or Port C and are named MCELLBC0-MCELLBC7. This routing depends on the pin number assignments that are specified in PSDsoft Express for “PLD Outputs” in the Pin Definition section. OMC outputs can also be routed internally (not to pins) used as buried nodes to create shifters, counters, etc. The AND-OR Array is used to form product terms. These product terms are configured from the logic definitions entered in PSDsoft Express. A PLD Input Bus consisting of 69 signals is connected to both PLDs. Input signals are shown in Table 84, both the true and compliment versions of each of these signals are available at inputs to each PLD. Note: The 8032 data bus, D0 - D7, does not route directly to PLD inputs. Instead, the 8032 data bus has indirect access to the GPLD (not the DPLD) when the 8032 reads and writes the OMC and IMC registers within csiop address space. Turbo Bit and PLDs. The PLDs can minimize power consumption by going to standby after ALL the PLD inputs remain unchanged for an extended time (about 70ns). When the Turbo Bit is set to logic one (Bit 3 of the csiop PMMR0 Register), Turbo mode is turned off and then this automatic standby mode is achieved. Turning off Turbo mode increases propagation delays while reducing power consumption. The default state of the Turbo Bit is logic zero, meaning Turbo mode is on. Additionally, four bits are available in the csiop PMMR0 and PMMR2 Registers to block the 8032 bus control signals (RD, WR, PSEN, ALE) from entering the PLDs. This reduces power consumption and can be used only when these 8032 control signals are not used in PLD logic equations. See Power Management, page 187. Table 84. DPLD and GPLD Inputs Input Source Input Name Number of Signals 8032 Address Bus A0-A15 16 8032 Bus Control Signals PSEN, RD, WR, ALE 4 Reset from MCU Module RESET 1 Power-Down from AutoPower Down Counter PDN 1 PortA Input Macrocells (80-pin devices only) PA0-PA7 8 PortB Input Macrocells PB0-PB7 8 PortC Input Macrocells PC2, PC3, PC4, PC7 4 Port D Inputs (52-pin devices have only PD1) PD1, PD2 2 Page Register PGR0-PGR7 8 Macrocell OMC bank AB Feedback MCELLAB FB0-7 8 Macrocell OMC bank BC Feedback MCELLBC FB0-7 8 Flash memory Status Bit Ready/Busy 1157/231 uPSD33xx Figure 63. DPLD and GPLD GPLD 20 INPUT MACROCELLS PLD INPUT BUS PIN FEEDBACK, PORTS A, B, C NODE FEEDBACK DPLD Main Flash Memory Selects (FSx) AAAAAAAA BBBBBBBB C C C C 69 INPUTS OMC ALLOCATOR 4 or 8 2 or 4 Secondary Flash Memory Selects (CSBOOTx) 1 SRAM Select (RS0) 1 I/O PORT Select (CSIOP) 2 Periperal I/O Mode Range Selects (PSELx) 1 or 2 External Device Chip-Selects (ECSx) 8 8 4 8 8 4 AND-OR ARRAY AND-OR ARRAY 8032 ADDRESS 8032 BUS CONTROL PAGE REGISTER OTHER SIGNALS 16 OUTPUT MACROCELLS PORT A (80-pin only) PORT C PORT B 8032 DATA BUS PIN FEEDBACK, PORT D PORT D 8032 DATA BUS 8 PLD OUT A B A B A B A B A B A B A B A B B C B C B C B C B C B C B C B C 8 PLD OUT 69 INPUTS AI06600AuPSD33xx 158/231 Decode PLD (DPLD). The DPLD (Figure 64., page 159) generates the following memory decode signals: ■ Eight Main Flash memory sector select signals (FS0-FS7) with three product terms each ■ Four Secondary Flash memory sector select signals (CSBOOT0-CSBOOT3) with three product terms each ■ One SRAM select signal (RS0) with two product terms ■ One select signal for the base address of 256 PSD Module device control and status registers (CSIOP) with one product term ■ Two external chip-select output signals for Port D pins, each with one product term (52- pin devices only have one pin on Port D) ■ Two chip-select signals (PSEL0, PSEL1) used to enable the 8032 data bus repeater function (Peripheral I/O mode) for Port A on 80-pin devices. Each has one product term. A product term indicates the logical OR of two or more inputs. For example, three product terms in a DPLD output means the final output signal is capable of representing the logical OR of three different input signals, each input signal representing the logical AND of a combination of the 69 PLD inputs. Using the signal FS0 for example, the user may create a 3-product term chip select signal that is logic true when any one of three different address ranges are true... FS0 = address range 1 OR address range 2 OR address range 3. The phrase “one product term” is a bit misleading, but commonly used in this context. One product term is the logical AND of two or more inputs, with no OR logic involved at all, such as the CSIOP signal in Figure 64., page 159.159/231 uPSD33xx Figure 64. DPLD Logic Array FS0 FS1 FS7 FS6 FS5 FS4 FS3 FS2 MAIN FLASH MEMORY SECTOR SELECTS CSBOOT0 CSBOOT3 CSBOOT2 CSBOOT1 SECONDARY FLASH MEMORY SECTOR SELECTS RS0 SRAM SELECT CSIOP I/O & CONTROL REGISTERS SELECT ECS0 ECS1 EXTERNAL CHIPSELECTS (PORT D) PSEL0 PSEL1 PERIPHERAL I/O MODE RANGE SELECTS 8032 ADDRESS (A0 - A15) 16 4 1 POWER-DOWN INDICATOR (PDN) 1 PIN INPUT PORTS A, B, C (IMCs) 20 PIN INPUT PORT D 2 OMC FEEDBACK (MCELLAB.FB0-7) 8 PAGE REGISTER (PGR0 - PGR7) 8 8 1 OMC FEEDBACK (MCELLBC.FB0-7) PLD INPUT BUS 3 3 3 3 3 3 3 3 3 3 3 3 2 1 1 1 1 1 NUMBER OF PRODUCT TERMS AI06601A PSM MODULE RESET (RST) FLASH MEM PROG STATUS (RDYBSY) 8032 CNTL (RD, WR, PSEN, ALE)uPSD33xx 160/231 General PLD (GPLD). The GPLD is used to create general system logic. Figure 63., page 157 shows the architecture of the entire GPLD, and Figure 65., page 161 shows the relationship between one OMC, one IMC, and one I/O port pin, which is representative of pins on Ports A, B, and C. It is important to understand how these elements work together. A more detailed description will follow for the three major blocks (OMC, IMC, I/ O Port) shown in Figure 65. Figure 65 also shows which csiop registers to access for various PLD and I/O functions. The GPLD contains: ■ 16 Output Macrocells (OMC) ■ 20 Input Macrocells (IMC) ■ OMC Allocator ■ Product Term Allocator inside each OMC ■ AND-OR Array capable of generating up to 137 product terms ■ Three I/O Ports, A, B, and C161/231 uPSD33xx Figure 65. GPLD: One OMC, One IMC, and One I/O Port (typical pin, Port A, B, or C) OUTPUT MACROCELL (OMC) INPUT MACROCELL (IMC) FLIP-FLOP CLOCK GLOBAL CLOCK FLIP-FLOP CLEAR NODE FEEDBACK NATIVE PRODUCT TERMS PRODUCT TERM ALLOCATOR PRODUCT TERMS FROM OTHER OMCs I/O PORT LOGIC PERIPHERAL I/O MODE BIT OUTPUT ENABLE LATCHED 8032 ADDR BIT PSD MODULE PORT PIN 8032 DATA BIT 8032 DATA BIT OUTPUT ENABLE PIN FEEDBACK CLOCK or GATE SIGNAL PLD INPUT BUS OMC OUT ALE TO OTHER I/O PORT LOGIC OMC ALLOCATOR RESET PSD MODULE RESET FROM OTHER MACROCELL ALLOCATOR GLOBAL CLOCK AND-OR ARRAY CLOCK or GATE RESET FLIP-FLOP AND OTHER LOGIC BORROWED PRODUCT TERMS PIN INPUT LATCH OR PASS INPUT SIGNAL 8032 DATA BITS 8032 DATA BITS CSIOP REGISTERS (DATA OUT, DIRECTION CONTROL, DRIVE) M U X OMC OUTPUT FEED BACK DIRECTION CONTROL DATA OUT CSIOP REGISTERS (DATA IN, DATA OUT, DIRECTION, CONTROL, DRIVE, ENABLE) CSIOP REGISTERS (MCELLAB, MCELLBC) READ OMC LOAD OMC CSIOP REGISTERS (IMCA, IMCB, IMCC) READ IMC FLIP-FLOP PRESET PIN INPUT DATA IN 69 INPUTS 8032 RD 8032 RD 8032 RD 8032 WR 8032 WR 8032 ADDRESS, DATA, CONTROL BUS AI06602AuPSD33xx 162/231 Output Macrocell. The GPLD has 16 OMCs. Architecture of one individual OMC is shown in Figure 66. OMCs can be used for internal node feedback (buried registers to build shift registers, etc.), or their outputs may be routed to external port pins. The user can choose any mixture of OMCs used for buried functions and OMCs used to drive port pins. Referring to Figure 66, for each OMC there are native product terms available from the AND-OR Array to form logic, and also borrowed product terms are available (if unused) from other OMCs. The polarity of the final product term output is controlled by the XOR gate. Each OMC can implement sequential logic using the flip-flop element, or combinatorial logic when bypassing the flip-flop as selected by the output multiplexer. An OMC output can drive a port pin through the OMC Allocator, it can also drive the 8032 data bus, and also it can drive a feedback path to the AND-OR Array inputs, all at the same time. The flip-flop in each OMC can be synthesized as a D, T, JK, or SR type in PSDsoft Express. OMC flipflops are specified using PSDsoft Express in the “User Defined Nodes” section of the Design Assistant. Each flip-flop’s clock, preset, and clear inputs may be driven individually from a product term of the AND-OR Array, defined by equations in PSDsoft Express for signals *. c, *.pr, and *.re respectively. The preset and clear inputs on the flip-flops are level activated, active-high logic signals. The clock inputs on the flip-flops are rising-edge logic signals. Optionally, the signal CLKIN (pin PD1) can be used for a common clock source to all OMC flipflops. Each flip-flop is clocked on the rising edge. A common clock is specified in PSDsoft Express by assigning the function “Common Clock Input” for pin PD1 in the Pin Definition section, and then choosing the signal CLKIN when specifying the clock input (*.c) for individual flip-flops in the “User Defined Nodes” section. Figure 66. Detail of a Single OMC D CLR PRE Q MUX MUX M U X M U X PSDsoft PSDsoft OUTPUT MACROCELL (OMC) PT PRESET (.PR) FROM AND-OR ARRAY BORROWED PTs PT CLEAR (.RE) NODE FEEDBACK (.FB) POLARITY SELECT, PSDsoft PT ALLOCATOR, DRAWS FROM LOCAL AND GLOBAL UNUSED PRODUCT TERMS. PSDsoft DICTATES. LENDED PTs DATA BIT FROM 8032 DATA BIT TO 8032 INDICATES MCU WRITE TO PARTICULAR CSIO OMC REGISTER MCU OVERRIDES PT PRESET AND CLR DURING MCU WRITE MCU READ OF PARTICULAR CSIOP OMC REGISTER OMC OUTPUT FROM AND-OR ARRAY TO PLD INPUT BUS FROM AND-OR ARRAY NATIVE PTs ALLOCATED PTs PT CLOCK (.C) FROM AND-OR ARRAY GLOBAL CLOCK (CLKIN) FROM PLD INPUT BUS 8032 ADDRESS, DATA, CONTROL BUS OMC ALLOCATOR O U T PRODUCT TERMS FROM OTHER OMCs AI06617A163/231 uPSD33xx OMC Allocator. Outputs of the 16 OMCs can be routed to a combination of pins on Port A (80-pin devices only), Port B, or Port C as shown in Figure 67. OMCs are routed to port pins automatically after specifying pin numbers in PSDsoft Express. Routing can occur on a bit-by-bit basis, spitting OMC assignment between the ports. However, one OMC can be routed to one only port pin, not both ports. Product Term Allocator. Each OMC has a Product Term Allocator as shown in Figure 66., page 162. PSDsoft Express uses PT Allocators to give and take product terms to and from other OMCs to fit a logic design into the available silicon resources. This happens automatically in PSDsoft Express, but understanding how PT allocation works will help the user if the logic design does not “fit,” in which case the user may try selecting a different pin or different OMC for the logic where more product terms may be available. The following list summarizes how product terms are allocated to each OMC, as shown in Table 85., page 164. – MCELLAB0-MCELLAB7 each have three native product terms and may borrow up to six more – MCELLBC0-MCELLBC3 each have four native product terms and may borrow up to five more – MCELLBC4-MCELLBC7 each have four native product terms and may borrow up to six more. Native product terms come from the AND-OR Array. Each OMC may borrow product terms only from certain other OMCs, if they are not in use. Product term allocation does not add any propagation delay to the logic. The fitter report generated by PSDsoft Express will show any PT allocation that has occurred. If an equation requires more product terms than are available to it through PT allocation, then “external” product terms are required, which consumes other OMCs. This is called product term expansion and also happens automatically in PSDsoft Express as needed. PT expansion causes additional propagation delay because an additional OMC is consumed by the expansion process and it’s output is rerouted (or fed back) into the AND-OR array. The user can examine the fitter report generated by PSDsoft Express to see resulting PT allocation and PT expansion (expansion will have signal names, such as ‘*.fb_0’ or ‘*.fb_1’). PSDsoft Express will always try to fit the logic design first by using PT allocation, and if that is not sufficient then PSDsoft Express will use PT expansion. Product term expansion may occur in the DPLD for complex chip select equations for Flash memory sectors and for SRAM, but this is a rare occurence. If PSDsoft Express does use PT expansion in the DPLD, it results in an approximate 15ns additional propagation delay for that chip select signal, which gives 15ns less time for the memory to respond. Be aware of this and consider adding a wait state to the 8032 bus access (using the SFR named, BUSCON), or lower the 8032 clock frequency to avoid problems with memory access time. Figure 67. OMC Allocator PORT B PINS PORT C PINS PORT A PINS (80-pin pkg only) OMC Bank AB (MCELLAB0-7) OMC Bank BC (MCELLBC0-7) 7 6 5 4 3 2 1 0 7 6 5 4 3 2 1 0 7 4 3 2 7 6 5 4 3 2 1 0 7 6 5 4 3 2 1 0 ** ** * = Used for JTAG, Pin Not Available to GPLD AI09177uPSD33xx 164/231 Table 85. OMC Port and Data Bit Assignments Note: 1. MCELLAB0-MCELLAB7 can be output to Port A pins only on 80-pin devices. Port A is not available on 52-pin devices 2. Port pins PC0, PC1, PC5, and PC6 are dedicated JTAG pins and are not available as outputs for MCELLBC 0, 1, 5, or 6 OMC Port Assignment(1,2) Native Product Terms from AND-OR Array Maximum Borrowed Product Terms Data Bit on 8032 Data Bus for Loading or Reading OMC MCELLAB0 Port A0 or B0 3 6 D0 MCELLAB1 Port A1 or B1 3 6 D1 MCELLAB2 Port A2 or B2 3 6 D2 MCELLAB3 Port A3 or B3 3 6 D3 MCELLAB4 Port A4 or B4 3 6 D4 MCELLAB5 Port A5 or B5 3 6 D5 MCELLAB6 Port A6 or B6 3 6 D6 MCELLAB7 Port A7 or B7 3 6 D7 MCELLBC0 Port B0 4 5 D0 MCELLBC1 Port B1 4 5 D1 MCELLBC2 Port B or C2 4 5 D2 MCELLBC3 Port B3 or C3 4 5 D3 MCELLBC4 Port B4 or C4 4 6 D4 MCELLBC5 Port B5 4 6 D5 MCELLBC6 Port B6 4 6 D6 MCELLBC7 Port B7 orC7 4 6 D7165/231 uPSD33xx Loading and Reading OMCs. Each of the two OMC groups (eight OMCs each) occupies a byte in csiop space, named MCELLAB and MCELLBC (see Table 86 and Table 87). When the 8032 writes or reads these two OMC registers in csiop it is accessing each of the OMCs through it’s 8-bit data bus, with the bit assignment shown in Table 85., page 164. Sometimes it is important to know the bit assignment when the user builds GPLD logic that is accessed by the 8032. For example, the user may create a 4-bit counter that must be loaded and read by the 8032, so the user must know which nibble in the corresponding csiop OMC register the firmware must access. The fitter report generated by PSDsoft Express will indicate how it assigned the OMCs and data bus bits to the logic. The user can optionally force PSDsoft Express to assign logic to specific OMCs and data bus bits if desired by using the ‘PROPERTY’ statement in PSDsoft Express. Please see the PSDsoft Express User’s Manual for more information on OMC assignments. Loading the OMC flip-flops with data from the 8032 takes priority over the PLD logic functions. As such, the preset, clear, and clock inputs to the flip-flop can be asynchronously overridden when the 8032 writes to the csiop registers to load the individual OMCs. Table 86. Output Macrocell MCELLAB (address = csiop + offset 20h) Note: All bits clear to logic ’0’ at power-on reset, but do not clear after warm reset conditions (non-power-on reset) Table 87. Output Macrocell MCELLBC (address = csiop + offset 21h) Note: All bits clear to logic ’0’ at power-on reset, but do not clear after warm reset conditions (non-power-on reset) Bit 7 Bit 6 Bit 5 Bit 4 Bit 3 Bit 2 Bit 1 Bit 0 MCELLAB7 MCELLAB6 MCELLAB5 MCELLAB4 MCELLAB3 MCELLAB2 MCELLAB1 MCELLAB0 Bit 7 Bit 6 Bit 5 Bit 4 Bit 3 Bit 2 Bit 1 Bit 0 MCELLBC7 MCELLBC6 MCELLBC5 MCELLBC4 MCELLBC3 MCELLBC2 MCELLBC1 MCELLBC0uPSD33xx 166/231 OMC Mask Registers. There is one OMC Mask Register for each of the two groups of eight OMCs shown in Table 88 and Table 89. The OMC mask registers are used to block loading of data to individual OMCs. The default value for the mask registers is 00h, which allows loading of all OMCs. When a given bit in a mask register is set to a '1,' the 8032 is blocked from writing to the associated OMC flip-flop. For example, suppose that only four of eight OMCs (MCELLAB0-3) are being used for a state machine. The user may not want the 8032 write to all the OMCs in MCELLAB because it would overwrite the state machine registers. Therefore, the user would want to load the mask register for MCELLAB with the value 0Fh before writing OMCs. Table 88. Output Macrocell MCELLAB Mask Register (address = csiop + offset 22h) Note: 1. Default is 00h after any reset condition 2. 1 = block writing to individual macrocell, 0 = allow writing to individual macrocell Table 89. Output Macrocell MCELLBC Mask Register (address = csiop + offset 23h) Note: 1. Default is 00h after any reset condition 2. 1 = block writing to individual macrocell, 0 = allow writing to individual macrocell Input Macrocells. The GPLD has 20 IMCs, one for each pin on Port A (80-pin device only), one for each pin on Port B, and for the four pins on Port C that are not JTAG pins. The architecture of one individual IMC is shown in Figure 68., page 167. IMCs are individually configurable, and they can strobe a signal coming in from a port pin as a latch (gated), or as a register (clocked), or the IMC can pass the signal without strobing, all prior to driving the signal onto the PLD input bus. Strobing is useful for sampling and debouncing inputs (keypad inputs, etc.) before entering the PLD AND-OR arrays. The outputs of IMCs can be read by the 8032 asynchronously when the 8032 reads the csiop registers shown in Table 90, Table 91, and Table 92., page 167. It is possible to read a PSD Module port pin using one of two different methods, one method is by reading IMCs as described here, the other method is using MCU I/O mode described in a later section. The optional IMC clocking or gating signal used to strobe pin inputs is driven by a product term from the AND-OR array. There is one clocking or gating product term available for each group of four IMCs. Port inputs 0-3 are controlled by one product term and 4-7 by another. To specify in PSDsoft Express the method in which a signal will be strobed as it enters an IMC for a given input pin on Port A, B, or C, just specify “PT Clocked Register” to use a rising edge to clock the incoming signal, or specify “PT Clock Latch” to use an active high gate signal to latch the incoming signal. Then define an equation for the IMC clock (.ld) or the IMC gate (.le) signal in the “I/O Equations” section. If the user would like to latch an incoming signal using the gate signal ALE from the 8032, then in PSDsoft Express, for a given input pin on Port A, B, or C, specify “Latched Address” as the pin function. If it is desired to pass an incoming signal through an IMC directly to the AND-OR array inputs without clocking or gating (this is most common), in PSDsoft Express simply specify “Logic or Address” for the input pin function on Port A, B, or C. Bit 7 Bit 6 Bit 5 Bit 4 Bit 3 Bit 2 Bit 1 Bit 0 Mask MCELLAB7 Mask MCELLAB6 Mask MCELLAB5 Mask MCELLAB4 Mask MCELLAB3 Mask MCELLAB2 Mask MCELLAB1 Mask MCELLAB0 Bit 7 Bit 6 Bit 5 Bit 4 Bit 3 Bit 2 Bit 1 Bit 0 Mask MCELLBC7 Mask MCELLBC6 Mask MCELLBC5 Mask MCELLBC4 Mask MCELLBC3 Mask MCELLBC2 Mask MCELLBC1 Mask MCELLBC0167/231 uPSD33xx Figure 68. Detail of a Single IMC Table 90. Input Macrocell Port A(1) (address = csiop + offset 0Ah) Note: 1. Port A not available on 52-pin uPSD33xx devices 2. 1 = current state of IMC is logic '1,' 0 = current state is logic ’0’ Table 91. Input Macrocell Port B (address = csiop + offset 0Bh) Note: 1 = current state of IMC is logic '1,' 0 = current state is logic ’0’ Table 92. Input Macrocell Port C (address = csiop + offset 18h) Note: 1. X = Not guaranteed value, can be read either '1' or '0.' These are JTAG pins. 2. 1 = current state of IMC is logic '1,' 0 = current state is logic ’0’ Bit 7 Bit 6 Bit 5 Bit 4 Bit 3 Bit 2 Bit 1 Bit 0 IMC PA7 IMC PA6 IMC PA5 IMC PA4 IMC PA3 IMC PA2 IMC PA1 IMC PA0 Bit 7 Bit 6 Bit 5 Bit 4 Bit 3 Bit 2 Bit 1 Bit 0 IMC PB7 IMC PB6 IMC PB5 IMC PB4 IMC PB3 IMC PB2 IMC PB1 IMC PB0 Bit 7 Bit 6 Bit 5 Bit 4 Bit 3 Bit 2 Bit 1 Bit 0 IMC PC7 X X IMC PC4 IMC PC3 IMC PC2 X X INPUT MACROCELL (IMC) Q D G Q D M U X M U X PSDsoft 8032 DATA BIT 8032 READ OF PARTICULAR CSIOP IMC REGISTER PT CLOCK OR GATE (.LD OR .LE) PIN INPUT LATCHED INPUT GATED INPUT (.LD) (.LE) ALE PSDsoft ALE 8032 ADDR, DATA, CNTL BUS FROM I/O PORT LOGIC INPUT SIGNAL FROM PIN ON PORT A, B, or C FROM AND-OR ARRAY TO PLD INPUT BUS THIS SIGAL IS GANGED TO 3 OTHER IMCs, GROUPING IMC 0 - 3 or IMC 4 - 7. AI06603AuPSD33xx 168/231 I/O Ports. There are four programmable I/O ports on the PSD Module: Port A (80-pin device only), Port B, Port C, and Port D. Ports A and B are eight bits each, Port C is four bits, and Port D is two bits for 80-pin devices or 1-bit for 52-pin devices. Each port pin is individually configurable, thus allowing multiple functions per port. The ports are configured using PSDsoft Express then programming with JTAG, and also by the 8032 writing to csiop registers at run-time. Topics discussed in this section are: ■ General Port architecture ■ Port Operating Modes ■ Individual Port Structure General Port Architecture. The general architecture for a single I/O Port pin is shown in Figure 69., page 169. Port structures for Ports A, B, C, and D differ slightly and are shown in Figure 74., page 181 though Figure 77., page 186. Figure 69., page 169 shows four csiop registers whose outputs are determined by the value that the 8032 writes to csiop Direction, Drive, Control, and Data Out. The I/O Port logic contains an output mux whose mux select signal is determined by PSDsoft Express and the csiop Control register bits at run-time. Inputs to this output mux include the following: 1. Data from the csiop Data Out register for MCU I/O output mode (All ports) 2. Latched de-multiplexed 8032 Address for Address Output mode (Ports A and B only) 3. Peripheral I/O mode data bit (Port A only) 4. GPLD OMC output (Ports A, B, and C). The Port Data Buffer (PDB) provides feedback to the 8032 and allows only one source at a time to be read when the 8032 reads various csiop registers. There is one PDB for each port pin enabling the 8032 to read the following on a pin-by-pin basis: 1. MCU I/O signal direction setting (csiop Direction reg) 2. Pin drive type setting (csiop Drive Select reg) 3. Latched Addr Out mode setting (csiop Control reg) 4. MCU I/O pin output setting (csiop Data Out reg) 5. Output Enable of pin driver (csiop Enable Out reg) 6. MCU I/O pin input (csiop Data In reg) A port pin’s output enable signal is controlled by a two input OR gate whose inputs come from: a product term of the AND-OR array; the output of the csiop Direction Register. If an output enable from the AND-OR Array is not defined, and the port pin is not defined as an OMC output, and if Peripheral I/O mode is not used, then the csiop Direction Register has sole control of the OE signal. As shown in Figure 69., page 169, a physical port pin is connected to the I/O Port logic and is also separately routed to an IMC, allowing the 8032 to read a port pin by two different methods (MCU I/O input mode or read the IMC). Port Operating Modes. I/O Port logic has several modes of operation. Table 88., page 166 summarizes which modes are available on each port. Each of the port operating modes are described in following sections. Some operating modes can be defined using PSDsoft Express, and some by the 8032 writing to the csiop registers at run-time, and some require both. For example, PLD I/O, Latched Address Out, and Peripheral I/O modes must be defined in PSDsoft Express and programmed into the device using JTAG, but an additional step must happen at run-time to activate Latched Address Out mode and Peripheral I/O mode, but not needed for PLD I/O. In another example, MCU I/O mode is controlled completely by the 8032 at runtime and only a simple pin name declaration is needed in PSDsoft Express for documentation. Table 89., page 166 summarizes what actions are needed in PSDsoft Express and what actions are required by the 8032 at run-time to achieve the various port functions.169/231 uPSD33xx Figure 69. Detail of a Single I/O Port (typical of Ports A, B, C) I/O PORT LOGIC O U T P U T M U X P D B M U X DIRECTION DRIVE SELECT CONTROL DATA OUT (MCUI/O) ENABLE OUT DATA IN (MCUI/O) D BIT, PERIPH I/O MODE, Port A PT OUTPUT ENABLE (.OE) LATCHED ADDR BIT, PORT A or B OE MUX 8032 DATA BIT OUTPUT DRIVER TYPICAL PIN PORT A, B, C PSD MODULE RESET ONE of 6 CSIOP REGISTERS OUTPUT SELECT PERIPHERAL I/O MODE SETS DIRECTION (PORT A ONLY) 8032 ADDRESS, DATA, CONTROL BUS 1 2 3 1 4 2 3 4 5 6 FROM OMC OUTPUT TO IMC FROM PLD INPUT BUS FROM AND-OR ARRAY FROM OMC ALLOCATOR D CLR DIRECTION DRIVE CONTROL (MCUI/O) DATA OUT RESET PSDsoft PSELx PERIPH I/O DATA BIT CSIOP REGISTERS Q Q Q Q 8032 DRIVE TYPE DATA BITS INPUT BUFFER OUTPUT ENABLE WR RD PIO EN 8032 WR 8032 RD AI07873AuPSD33xx 170/231 Table 93. Port Operating Modes Note: 1. MCELLBC outputs available only on pins PC2, PC3, PC4, and PC7. 2. JTAG pins (PC0/TMS, PC1/TCK, PC5/TDI, PC6/TDO) are dedicated to JTAG pin functions (cannot be used for general I/O). Port Operating Mode Port A (80-pin only) Port B Port C Port D Find it MCU I/O Yes Yes Yes Yes MCU I/O Mode., p age 172 PLD I/O OMC MCELLAB Outputs OMC MCELLBC Outputs External Chip-Select Outputs PLD Inputs Yes No No Yes Yes Yes No Yes No Yes(1) No Yes No No Yes Yes PLD I/O Mode., p age 174 Latched Address Output Yes Yes No No Latched Address Output Mode, pa ge 177 Peripheral I/O Mode Yes No No No Peripher al I/O Mode, pa ge 178 JTAG ISP No No Yes(2) No JTAG ISP Mode., p age 179171/231 uPSD33xx Table 94. Port Configuration Setting Requirements Port Operating Mode Required Action in PSDsoft Express to Configure each Pin Value that 8032 writes to csiop Control Register at run-time Value that 8032 writes to csiop Direction Register at run-time Value that 8032 writes to Bit 7 (PIO_EN) of csiop VM Register at run-time MCU I/O Choose the MCU I/O function and declare the pin name Logic '0' (default) Logic 1 = Out of uPSD Logic 0 = Into uPSD N/A PLD I/O Choose the PLD function type, declare pin name, and specify logic equation(s) N/A Direction register has no effect on a pin if pin is driven from OMC output N/A Latched Address Output Choose Latched Address Out function, declare pin name Logic '1' Logic '1' Only N/A Peripheral I/O Choose Peripheral I/O mode function and specify address range in DPLD for PSELx N/A N/A PIO_EN Bit = Logic 1 (default is '0') 4-PIN JTAG ISP No action required in PSDsoft to get 4-pin JTAG. By default TDO, TDI, TCK, TMS are dedicated JTAG functions. N/A N/A N/A 6-PIN JTAG ISP (faster programming) Choose JTAG TSTAT function for pin PC3 and JTAG TERR function for pin PC4. N/A N/A N/AuPSD33xx 172/231 MCU I/O Mode. In MCU I/O mode, the 8032 on the MCU Module expands its own I/O by using the I/O Ports on the PSD Module. The 8032 can read PSD Module I/O pins, set the direction of the I/O pins, and change the output state of I/O pins by accessing the Data In, Direction, and Data Out csiop registers respectively at run-time. To implement MCU I/O mode, each desired pin is specified in PSDsoft Express as MCU I/O function and given a pin name. Then 8032 firmware is written to set the Direction bit for each corresponding pin during initialization routines (0 = In, 1 = Out of the chip), then the 8032 firmware simply reads the corresponding Data In register to determine the state of an I/O pin, or writes to a Data Out register to set the state of a pin. The Direction of each pin may be changed dynamically by the 8032 if desired. A mixture of input and output pins within a single port is allowed. Figure 69., page 169 shows the Data In, Data Out, and Direction signal paths. The Data In registers are defined in Table 95 to Table 98. The Data Out registers are defined in Table 99 to Table 102., page 173. The Direction registers are defined in Table 103 to Table 106., page 173. Table 95. MCU I/O Mode Port A Data In Register(1) (address = csiop + offset 00h) Note: 1. Port A not available on 52-pin uPSD33xx devices 2. For each bit, 1 = current state of input pin is logic '1,' 0 = current state is logic ’0’ Table 96. MCU I/O Mode Port B Data In Register (address = csiop + offset 01h) Note: For each bit, 1 = current state of input pin is logic '1,' 0 = current state is logic ’0’ Table 97. MCU I/O Mode Port C Data In Register (address = csiop + offset 10h) Note: 1. X = Not guaranteed value, can be read either '1' or '0.' 2. For each bit, 1 = current state of input pin is logic '1,' 0 = current state is logic ’0’ Table 98. MCU I/O Mode Port D Data In Register (address = csiop + offset 11h) Note: 1. X = Not guaranteed value, can be read either '1' or '0.' 2. For each bit, 1 = current state of input pin is logic '1,' 0 = current state is logic ’0’ 3. Not available on 52-pin uPSD33xx devices Table 99. MCU I/O Mode Port A Data Out Register(1) (address = csiop + offset 04h) Note: 1. Port A not available on 52-pin uPSD33xx devices 2. For each bit, 1 = drive port pin to logic '1,' 0 = drive port pin to logic ’0’ 3. Default state of register is 00h after reset or power-up Table 100. MCU I/O Mode Port B Data Out Register (address = csiop + offset 05h) Note: 1. For each bit, 1 = drive port pin to logic '1,' 0 = drive port pin to logic ’0’ 2. Default state of register is 00h after reset or power-up Bit 7 Bit 6 Bit 5 Bit 4 Bit 3 Bit 2 Bit 1 Bit 0 PA7 PA6 PA5 PA4 PA3 PA2 PA1 PA0 Bit 7 Bit 6 Bit 5 Bit 4 Bit 3 Bit 2 Bit 1 Bit 0 PB7 PB6 PB5 PB4 PB3 PB2 PB1 PB0 Bit 7 Bit 6 Bit 5 Bit 4 Bit 3 Bit 2 Bit 1 Bit 0 PC7 X X PC4 PC3 PC2 X X Bit 7 Bit 6 Bit 5 Bit 4 Bit 3 Bit 2 Bit 1 Bit 0 XXXXX PD2(3) PD1 X Bit 7 Bit 6 Bit 5 Bit 4 Bit 3 Bit 2 Bit 1 Bit 0 PA7 PA6 PA5 PA4 PA3 PA2 PA1 PA0 Bit 7 Bit 6 Bit 5 Bit 4 Bit 3 Bit 2 Bit 1 Bit 0 PB7 PB6 PB5 PB4 PB3 PB2 PB1 PB0173/231 uPSD33xx Table 101. MCU I/O Mode Port C Data Out Register (address = csiop + offset 12h) Note: 1. For each bit, 1 = drive port pin to logic '1,' 0 = drive port pin to logic ’0’ 2. Default state of register is 00h after reset or power-up Table 102. MCU I/O Mode Port D Data Out Register (address = csiop + offset 13h) Note: 1. For each bit, 1 = drive port pin to logic '1,' 0 = drive port pin to logic ’0’ 2. Default state for register is 00h after reset or power-up 3. Not available on 52-pin uPSD33xx devices Table 103. MCU I/O Mode Port A Direction Register(1) (address = csiop + offset 06h) Note: 1. Port A not available on 52-pin uPSD33xx devices 2. For each bit, 1 = out from uPSD33xx port pin1, 0 = in to PSD33xx port pin 3. Default state for register is 00h after reset or power-up Table 104. MCU I/O Mode Port B Direction In Register (address = csiop + offset 07h) Note: 1. For each bit, 1 = out from uPSD33xx port pin1, 0 = in to PSD33xx port pin 2. Default state for register is 00h after reset or power-up Table 105. MCU I/O Mode Port C Direction Register (address = csiop + offset 14h) Note: 1. For each bit, 1 = out from uPSD33xx port pin1, 0 = in to PSD33xx port pin 2. Default state for register is 00h after reset or power-up Table 106. MCU I/O Mode Port D Direction Register (address = csiop + offset 15h) Note: 1. For each bit, 1 = out from uPSD33xx port pin1, 0 = in to PSD33xx port pin 2. Default state for register is 00h after reset or power-up 3. Not available on 52-pin uPSD33xx devices Bit 7 Bit 6 Bit 5 Bit 4 Bit 3 Bit 2 Bit 1 Bit 0 PC7 N/A N/A PC4 PC3 PC2 N/A N/A Bit 7 Bit 6 Bit 5 Bit 4 Bit 3 Bit 2 Bit 1 Bit 0 N/A N/A N/A N/A N/A PD2(3) PD1 N/A Bit 7 Bit 6 Bit 5 Bit 4 Bit 3 Bit 2 Bit 1 Bit 0 PA7 PA6 PA5 PA4 PA3 PA2 PA1 PA0 Bit 7 Bit 6 Bit 5 Bit 4 Bit 3 Bit 2 Bit 1 Bit 0 PB7 PB6 PB5 PB4 PB3 PB2 PB1 PB0 Bit 7 Bit 6 Bit 5 Bit 4 Bit 3 Bit 2 Bit 1 Bit 0 PC7 N/A N/A PC4 PC3 PC2 N/A N/A Bit 7 Bit 6 Bit 5 Bit 4 Bit 3 Bit 2 Bit 1 Bit 0 N/A N/A N/A N/A N/A PD2(3) PD1 N/AuPSD33xx 174/231 PLD I/O Mode. Pins on Ports A, B, C, and D can serve as inputs to either the DPLD or the GPLD. Inputs to these PLDs from Ports A, B, and C are routed through IMCs before reaching the PLD input bus. Inputs to the PLDs from Port D do not pass through IMCs, but route directly to the PLD input bus. Pins on Ports A, B, and C can serve as outputs from GPLD OMCs, and Port D pins can be outputs from the DPLD (external chip-selects) which do not consume OMCs. Whenever a pin is specified to be a PLD output, it cannot be used for MCU I/O mode, or other pin modes. If a pin is specified to be a PLD input, it is still possible to read the pin using MCU I/O input mode with the csiop register Data In. Also, the csiop Direction register can still affect a pin which is used for a PLD input. The csiop Data Out register has no effect on a PLD output pin. Each pin on Ports A, B, C, and D have a tri-state buffer at the final output stage. The Output Enable signal for this buffer is driven by the logical OR of two signals. One signal is an Output Enable signal generated by the AND-OR array (from an .oe equation specified in PSDsoft), and the other signal is the output of the csiop Direction register. This logic is shown in Figure 69., page 169. At power-on, all port pins default to high-impedance input (Direction registers default to 00h). However, if an equation is written for the Output Enable that is active at power-on, then the pin will behave as an output. PLD I/O equations are specified in PSDsoft Express and programmed into the uPSD using JTAG. Figure 70 shows a very simple combinatorial logic example which is implemented on pins of Port B. To give a general idea how PLD logic is implemented using PSDsoft Express, Figure 71., page 175 illustrates the pin declaration window of PSDsoft Express, showing the PLD output at pin PB0 declared as “Combinatorial” in the “PLD Output” section, and a signal name, “pld_out”, is specified. The other three signals on pins PB1, PB2, and PB3 would be declared as “Logic or Address” in the “PLD Input” section, and given signal names. In the “Design Assistant” window of PSDsoft Express shown in Figure 72., page 176, simply enter the logic equation for the signal “pld_out” as shown. Either type in the logic statements or enter them using a point-and-click method, selecting various signal names and logic operators available in the window. After PSDsoft Express has accepted and realized the logic from the equations, it synthesizes the logic statement: pld_out = ( pld_in_1 # pld_in_2 ) & !pld_in_3; to be programmed into the GPLD. See the PSDsoft User’s Manual for all the steps. Note: If a particular OMC output is specified as an internal node and not specified as a port pin output in PSDsoft Express, then the port pin that is associated with that OMC can be used for other I/O functions. Figure 70. Simple PLD Logic Example PLDIN 1 PLDIN 2 PLDIN 3 PLD OUT PB0 PB3 PB2 PB1 AI09178175/231 uPSD33xx Figure 71. Pin Declarations in PSDsoft Express for Simple PLD ExampleuPSD33xx 176/231 Figure 72. Using the Design Assistant in PSDsoft Express for Simple PLD Example177/231 uPSD33xx Latched Address Output Mode. In the MCU Module, the data bus Bits D0-D15 are multiplexed with the low address Bits A0-A15, and the ALE signal is used to separate them with respect to time. Sometimes it is necessary to send de-multiplexed address signals to external peripherals or memory devices. Latched Address Output mode will drive individual demuxed address signals on pins of Ports A or B. Port pins can be designated for this function on a pin-by-pin basis, meaning that an entire port will not be sacrificed if only a few address signals are needed. To activate this mode, the desired pins on Port A or Port B are designated as “Latched Address Out” in PSDsoft. Then in the 8032 initialization firmware, a logic ’1’ is written to the csiop Control register for Port A or Port B in each bit position that corresponds to the pin of the port driving an address signal. Table 107 and Table 108 define the csiop Control register locations and bit assignments. The latched low address byte A4-A7 is available on both Port A and Port B. The high address byte A8-A15 is available on Port B only. Selection of high or low address byte is specified in PSDsoft Express. Table 107. Latched Address Output, Port A Control Register(1) (address = csiop + offset 02h) Note: 1. Port A not available on 52-pin uPSD33xx devices 2. For each bit, 1 = drive demuxed 8032 address signal on pin, 0 = pin is default mode, MCU I/O 3. Default state for register is 00h after reset or power-up Table 108. Latched Address Output, Port B Control Register (address = csiop + offset 03h) Note: 1. For each bit, 1 = drive demuxed 8032 address signal on pin, 0 = pin is default mode, MCU I/O 2. Default state for register is 00h after reset or power-up Bit 7 Bit 6 Bit 5 Bit 4 Bit 3 Bit 2 Bit 1 Bit 0 PA7 (addr A7) PA6 (addr A6) PA5 (addr A5) PA4 (addr A4) PA3 (addr A3) PA2 (Addr A2) PA1 (addr A1) PA0 (addr A0) Bit 7 Bit 6 Bit 5 Bit 4 Bit 3 Bit 2 Bit 1 Bit 0 PB7 (addr A7 or A15) PB6 (addr A6 or A14) PB5 (addr A5 or A13) PB4 (addr A4 or A12) PB3 (addr A3 or A11) PB2 (Addr A2 or A10) PB1 (addr A1 or A9) PB0 (addr A0 or A8)uPSD33xx 178/231 Peripheral I/O Mode. This mode will provide a data bus repeater function for the 8032 to interface with external parallel peripherals. The mode is only available on Port A (80-pin devices only) and the data bus signals, D0 - D7, are de-multiplexed (no address A0-A7). When active, this mode behaves like a bidirectional buffer, with the direction automatically controlled by the 8032 RD and WR signals for a specified address range. The DPLD signals PSEL0 and PSEL1 determine this address range. Figure 69., page 169 shows the action of Peripheral I/O mode on the Output Enable logic of the tri-state output driver for a single port pin. Figure 73., page 178 illustrates data repeater the operation. To activate this mode, choose the pin function “Peripheral I/O Mode” in PSDsoft Express on any Port A pin (all eight pins of Port A will automatically change to this mode). Next in PSDsoft, specify an address range for the PSELx signals in the “Chip-Select” section of the “Design Assistant.” Specify an address range for either PSEL0 or PSEL1. Always qualify the PSELx equation with “PSEN is logic '1'” to ensure Peripheral I/O mode is only active during 8032 data cycles, not code cycles. Only one equation is needed since PSELx signals are OR’ed together (Figure 73). Then in the 8032 initialization firmware, a logic ’1’ is written to the csiop VM register, Bit 7 (PIO_EN) as shown in Table 73., page 132. After this, Port A will automatically perform this repeater function whenever the 8032 presents an address (and memory page number, if paging is used) that is within the range specified by PSELx. Once Port A is designated as Peripheral I/O mode in PSDsoft Express, it cannot be used for other functions. Note: The user can alternatively connect an external parallel peripheral to the standard 8032 AD0- AD7 pins on an 80-pin uPSD device (not Port A), but these pins have multiplexed address and data signals, with a weaker fanout drive capability. Figure 73. Peripheral I/O Mode PSEL1 PORT A pins PA0 - PA7 PSEL0 VM REGISTER BIT 7 (PIO EN) 8032 RD 8032 WR 8032 DATA BUS D0-D7 (DE-MUXED) 8 8 AI02886A179/231 uPSD33xx JTAG ISP Mode. Four of the pins on Port C are based on the IEEE 1149.1 JTAG specification and are used for In-System Programming (ISP) of the PSD Module and debugging of the 8032 MCU Module. These pins (TDI, TDO, TMS, TCK) are dedicated to JTAG and cannot be used for any other I/O function. There are two optional pins on Port C (TSTAT and TERR) that can be used to reduce programming time during ISP. See JTAG ISP and JTAG Debug, page 195. Other Port Capabilities. It is possible to change the type of output drive on the ports at run-time. It is also possible to read the state of the output enable signal of the output driver at run-time. The following sections provide the details. Port Pin Drive Options. The csiop Drive Select registers allow reconfiguration of the output drive type for certain pins on Ports A, B, C, and D. The 8032 can change the default drive type setting at run-time. The is no action needed in PSDsoft Express to change or define these pin output drive types. Figure 69., page 169 shows the csiop Drive Select register output controlling the pin output driver. The default setting for drive type for all pins on Ports A, B, C, and D is a standard CMOS pushpull output driver. Note: When a pin on Port A, B, C, D is not used as an output and has no external device driving it as an input (floating pin), excess power consumption can be avoided by placing a weak pull-up resistor (100KΩ) to VDD which keeps the CMOS input pin from floating. Drive Select Registers. The csiop Drive Select Registers will configure a pin output driver as Open Drain or CMOS push/pull for some port pins, and controls the slew rate for other port pins. An external pull-up resistor should be used for pins configured as Open Drain, and the resistor should be sized not to exceed the current sink capability of the pin (see DC specifications). Open Drain outputs are diode clamped, thus the maximum voltage on an pin configured as Open Drain is VDD + 0.7V. A pin can be configured as Open Drain if its corresponding bit in the Drive Select Register is set to logic '1.' Note: The slew rate is a measurement of the rise and fall times of an output. A higher slew rate means a faster output response and may create more electrical noise. A pin operates in a high slew rate when the corresponding bit in the Drive Register is set to '1.' The default rate is standard slew rate (see AC specifications). Table 109 through Table 112., page 180 show the csiop Drive Registers for Ports A, B, C, and D. The tables summarize which pins can be configured as Open Drain outputs and which pins the slew rate can be changed. The default output type is CMOS push/pull output with normal slew rate. Enable Out Registers. The state of the output enable signal for the output driver at each pin on Ports A, B, C, and D can be read at any time by the 8032 when it reads the csiop Enable Output registers. Logic '1' means the driver is in output mode, logic ’0’ means the output driver is in high-impedance mode, making the pin suitable for input mode (read by the input buffer shown in Figure 69., page 169). Figure 69 shows the three sources that can control the pin output enable signal: a product term from AND-OR array; the csiop Direction register; or the Peripheral I/O Mode logic (Port A only). The csiop Enable Out registers represent the state of the final output enable signal for each port pin driver, and are defined in Table 113., page 180 through Table 116., page 180. Table 109. Port A Pin Drive Select Register(1) (address = csiop + offset 08h) Note: 1. Port A not available on 52-pin uPSD33xx devices 2. For each bit, 1 = pin drive type is selected, 0 = pin drive type is default mode, CMOS push/pull 3. Default state for register is 00h after reset or power-up Table 110. Port B Pin Drive Select Register (address = csiop + offset 09h) Note: 1. For each bit, 1 = pin drive type is selected, 0 = pin drive type is default mode, CMOS push/pull 2. Default state for register is 00h after reset or power-up Bit 7 Bit 6 Bit 5 Bit 4 Bit 3 Bit 2 Bit 1 Bit 0 PA7 Open Drain PA6 Open Drain PA5 Open Drain PA4 Open Drain PA3 Slew Rate PA2 Slew Rate PA1 Slew Rate PA0 Slew Rate Bit 7 Bit 6 Bit 5 Bit 4 Bit 3 Bit 2 Bit 1 Bit 0 PB7 Open Drain PB6 Open Drain PB5 Open Drain PB4 Open Drain PB3 Slew Rate PB2 Slew Rate PB1 Slew Rate PB0 Slew RateuPSD33xx 180/231 Table 111. Port C Pin Drive Select Register (address = csiop + offset 16h) Note: 1. For each bit, 1 = pin drive type is selected, 0 = pin drive type is default mode, CMOS push/pull 2. Default state for register is 00h after reset or power-up Table 112. Port D Pin Drive Select Register (address = csiop + offset 17h) Note: 1. For each bit, 1 = pin drive type is selected, 0 = pin drive type is default mode, CMOS push/pull 2. Default state for register is 00h after reset or power-up 3. Pin is not available on 52-pin uPSD33xx devices Table 113. Port A Enable Out Register(1) (address = csiop + offset 0Ch) Note: 1. Port A not available on 52-pin uPSD33xx devices 2. For each bit, 1 = pin drive is enabled as an output, 0 = pin drive is off (high-impedance, pin used as input) Table 114. Port B Enable Out Register (address = csiop + offset 0Dh) Note: For each bit, 1 = pin drive is enabled as an output, 0 = pin drive is off (high-impedance, pin used as input) Table 115. Port C Enable Out Register (address = csiop + offset 1Ah) Note: 1. For each bit, 1 = pin drive is enabled as an output, 0 = pin drive is off (high-impedance, pin used as input) Table 116. Port D Enable Out Register (address = csiop + offset 1Bh) Note: 1. For each bit, 1 = pin drive is enabled as an output, 0 = pin drive is off (high-impedance, pin used as input) 2. Pin is not available on 52-pin uPSD33xx devices Bit 7 Bit 6 Bit 5 Bit 4 Bit 3 Bit 2 Bit 1 Bit 0 PC7 Open Drain N/A (JTAG) N/A (JTAG) PC4 Open Drain PC3 Open Drain PC2 Open Drain N/A (JTAG) N/A (JTAG) Bit 7 Bit 6 Bit 5 Bit 4 Bit 3 Bit 2 Bit 1 Bit 0 N/A N/A N/A N/A N/A PD2(3) Slew Rate PD1 Slew Rate N/A Bit 7 Bit 6 Bit 5 Bit 4 Bit 3 Bit 2 Bit 1 Bit 0 PA7 OE PA6 OE PA5 OE PA4 OE PA3 OE PA2 OE PA1 OE PA0 OE Bit 7 Bit 6 Bit 5 Bit 4 Bit 3 Bit 2 Bit 1 Bit 0 PB7 OE PB6 OE PB5 OE PB4 OE PB3 OE PB2 OE PB1 OE PB0 OE Bit 7 Bit 6 Bit 5 Bit 4 Bit 3 Bit 2 Bit 1 Bit 0 PC7 OE N/A (JTAG) N/A (JTAG) PC4 OE PC3 OE PC2 OE N/A (JTAG) N/A (JTAG) Bit 7 Bit 6 Bit 5 Bit 4 Bit 3 Bit 2 Bit 1 Bit 0 N/A N/A N/A N/A N/A PD2 OE(2) PD1 OE N/A181/231 uPSD33xx Individual Port Structures. Ports A, B, C, and D have some differences. The structure of each individual port is described in the next sections. Port A Structure. Port A supports the following operating modes: ■ MCU I/O Mode ■ GPLD Output Mode from Output Macrocells MCELLABx ■ GPLD Input Mode to Input Macrocells IMCAx ■ Latched Address Output Mode ■ Peripheral I/O Mode Port A also supports Open Drain/Slew Rate output drive type options using csiop Drive Select registers. Pins PA0-PA3 can be configured to fast slew rate, pins PA4-PA7 can be configured to Open Drain Mode. See Figure 74 for details. Figure 74. Port A Structure Note: 1. Port pins PA0-PA3 are capable of Fast Slew Rate output drive option. Port pins PA4-PA7 are capable of Open Drain output option. I/O PORT A LOGIC O U T P U T M U P X D B M U X DIRECTION DRIVE SELECT CONTROL DATA OUT (MCUI/O) ENABLE OUT DATA IN (MCUI/O) D BIT, PERIPH I/O MODE PT OUTPUT ENABLE (.OE) LATCHED ADDR BIT OE MUX OUTPUT ENABLE TYPICAL PIN, PORT A PSD MODULE RESET ONE of 6 CSIOP REGISTERS OUTPUT SELECT PERIPHERAL I/O MODE SETS DIRECTION 8032 ADDRESS, DATA, CONTROL BUS 1 2 3 1 4 2 3 4 5 6 FROM OMC OUTPUT (MCELLABx) FROM PLD INPUT BUS FROM ANDOR ARRAY FROM OMC ALLOCATOR D CLR DIRECTION DRIVE CONTROL (MCUI/O) DATA OUT 8032 WR RESET PSDsoft 8032 RD WR RD PSELx PERIPH I/O DATA BIT TO IMCs PIO EN CSIOP REGISTERS Q Q Q Q DRIVE TYPE SELECT(1) 8032 DATA BITS 8032 DATA BIT PIN INPUT CMOS BUFFER NO HYSTERESIS VDD VDD PIN OUTPUT 1 = OPEN DRAIN, PA4 - PA7 1 = FAST SLEW RATE, PA0 - PA3 IMCA0 - IMCA7 AI09179uPSD33xx 182/231 Port B Structure. Port B supports the following operating modes: ■ MCU I/O Mode ■ GPLD Output Mode from Output Macrocells MCELLABx, or MCELLBCx (OMC allocator routes these signals) ■ GPLD Input Mode to Input Macrocells IMCBx ■ Latched Address Output Mode Port B also supports Open Drain/Slew Rate output drive type options using the csiop Drive Select registers. Pins PB0-PB3 can be configured to fast slew rate, pins PB4-PB7 can be configured to Open Drain Mode. See Figure 75 for detail. Figure 75. Port B Structure Note: 1. Port pins PB0-PB3 are capable of Fast Slew Rate output drive option. Port pins PB4-PB7 are capable of Open Drain output option. I/O PORT B LOGIC O U T P U T M U P X D B M U X DIRECTION DRIVE SELECT CONTROL DATA OUT (MCUI/O) ENABLE OUT DATA IN (MCUI/O) PT OUTPUT ENABLE (.OE) LATCHED ADDR BIT OUTPUT ENABLE OUTPUT ENABLE TYPICAL PIN, PORT B PSD MODULE RESET ONE of 6 CSIOP REGISTERS OUTPUT SELECT 8032 ADDRESS, DATA, CONTROL BUS 1 2 3 1 2 3 4 5 6 FROM OMC OUTPUT (MCELLABx or MCELLBCx) FROM PLD INPUT BUS FROM ANDOR ARRAY FROM OMC ALLOCATOR D CLR DIRECTION DRIVE CONTROL (MCUI/O) DATA OUT 8032 WR RESET PSDsoft 8032 RD TO IMCs CSIOP REGISTERS Q Q Q Q DRIVE TYPE SELECT(1) 8032 DATA BITS 8032 DATA BIT PIN INPUT CMOS BUFFER NO HYSTERESIS VDD VDD PIN OUTPUT 1 = OPEN DRAIN, PB4 - PB7 1 = FAST SLEW RATE, PB0 - PB3 IMCB0 - IMCB7 AI09180183/231 uPSD33xx Port C Structure. Port C supports the following operating modes on pins PC2, PC3, PC4, PC7: ■ MCU I/O Mode ■ GPLD Output Mode from Output Macrocells MCELLBC2, MCELLBC3, MCELLBC4, MCELLBC7 ■ GPLD Input Mode to Input Macrocells IMCC2, IMCC3, IMCC4, IMCC7 See Figure 76., page 184 for detail. Port C pins can also be configured in PSDsoft for other dedicated functions: – Pins PC3 and PC4 support TSTAT and TERR status indicators, to reduce the amount of time required for JTAG ISP programming. These two pins must be used together for this function, adding to the four standard JTAG signals. When TSTAT and TERR are used, it is referred to as “6-pin JTAG”. PC3 and PC4 cannot be used for other functions if they are used for 6-pin JTAG. See JTAG ISP and JTAG Debug, page 195 for details. – PC2 can be used as a voltage input (from battery or other DC source) to backup the contents of SRAM when VDD is lost. This function is specified in PSDsoft Express as SRAM Standby Mode (battery backup), page 193. – PC3 can be used as an output to indicate when a Flash memory program or erase operation has completed. This is specified in PSDsoft Express as Ready/Busy (PC3), page 153. – PC4 can be used as an output to indicate when the SRAM has switched to backup voltage (when VDD is less than the battery input voltage on PC2). This is specified in PSDsoft Express as “Standby-On Indicator” (see SRAM Standby Mode (battery backup), page 193). The remaining four pins (TDI, TDO, TCK, TMS) on Port C are dedicated to the JTAG function and cannot be used for any other function. See JTAG ISP and JTAG Debug, page 195. Port C also supports the Open Drain output drive type options on pins PC2, PC3, PC4, and PC7 using the csiop Drive Select registers.uPSD33xx 184/231 Figure 76. Port C Structure Note: 1. Pull-up switches to VBAT when SRAM goes to battery back-up mode. 2. Optional function on a specific Port C pin. I/O PORT C LOGIC O U T P U T M U P X D B M U X DIRECTION DRIVE SELECT DATA OUT (MCUI/O) ENABLE OUT DATA IN (MCUI/O) PT OUTPUT ENABLE, .OE (JTAG STATE MACHINE AUTOMATICALLY CONTROLS OE FOR JTAG SIGNALS) OUTPUT ENABLE TYPICAL PIN, PORT C PSD MODULE RESET ONE of 6 CSIOP REGISTERS 8032 ADDRESS, DATA, CONTROL BUS 1 2 3 4 5 1 2 3 4 5 FROM OMC OUTPUT (MCELLBCx) STANDBY ON(2) FROM SRAM BACK-UP CIRCUIT FROM FLASH MEMORIES TO/FROM JTAG STATE MACHINE FROM PLD INPUT BUS FROM ANDOR ARRAY FROM OMC ALLOCATOR D CLR DIRECTION DRIVE (MCUI/O) DATA OUT 8032 WR RESET PSDsoft 8032 RD TO IMCs CSIOP REGISTERS Q Q Q DRIVE TYPE SELECT(2) 8032 DATA BITS 8032 DATA BIT PIN CMOS INPUT BUFFER NO HYSTERESIS VDD VDD/VBAT (1) VDD/VBAT (1) PIN OUTPUT 50k PULL-UP ONLY ON JTAG TDI, TMS, TCK SIGNALS TO SRAM BATTERY BACK-UP CIRCUIT(2) IMCC2, IMCC3, IMCC4, IMCC7 RDY/BSY(2) TDO, TSTAT(2), TERR(2) TDI, TMS, TCK AI09181185/231 uPSD33xx Port D Structure. Port D has two I/O pins (PD1, PD2) on 80-pin uPSD33xx devices, and just one pin (PD1) on 52-pin devices, supporting the following operating modes: ■ MCU I/O Mode ■ DPLD Output Mode for External Chip Selects, ECS1, ECS2. This does not consume OMCs in the GPLD. ■ PLD Input Mode – direct input to the PLD Input Bus available to DPLD and GPLD. Does not use IMCs See Figure 77., page 186 for detail. Port D pins can also be configured in PSDsoft as pins for other dedicated functions: – PD1 can be used as a common clock input to all 16 OMC Flip-flops (see OMCs, page 136) and also the Automatic Power-Down (APD), page 189. – PD2 can be used as a common chip select signal (CSI) for the Flash and SRAM memories on the PSD Module (see Chip Select Input (CSI), page 191). If driven to logic ’1’ by an external source, CSI will force all memories into standby mode regardless of what other internal memory select signals are doing on the PSD Module. This is specified in PSDsoft as “PSD Chip Select Input, CSI”. Port D also supports the Fast Slew Rate output drive type option using the csiop Drive Select registers.uPSD33xx 186/231 Figure 77. Port D Structure Note: 1. Optional function on a specific Port D pin. I/O PORT D LOGIC O U T P U T M U P X D B M U X DIRECTION DRIVE SELECT DATA OUT (MCUI/O) ENABLE OUT DATA IN (MCUI/O) PT OUTPUT ENABLE (.OE) OUTPUT ENABLE OUTPUT ENABLE TYPICAL PIN, PORT D PSD MODULE RESET ONE of 5 CSIOP REGISTERS 8032 ADDRESS, DATA, CONTROL BUS 1 2 1 2 3 4 5 FROM DPLD EXTERNAL CHIP (ECSx) FROM PLD INPUT BUS FROM ANDOR ARRAY FROM DPLD D CLR DIRECTION DRIVE (MCUI/O) DATA OUT 8032 WR RESET PSDsoft 8032 RD TO POWER MANAGEMENT AND PLD INPUT BUS CSIOP REGISTERS Q Q Q 8032 DRIVE TYPE SELECT DATA BITS 8032 DATA BIT PIN INPUT CMOS BUFFER NO HYSTERESIS VDD VDD PIN OUTPUT 1 = FAST SLEW RATE PD1. PIN, PD2.PIN DIRECTLY TO PLD INPUT BUS, NO IMC CSI(1) TO POWER MANAGEMENT CLKIN(1) AI09182187/231 uPSD33xx Power Management. The PSD Module offers configurable power saving options, and also a way to manage power to the SRAM (battery backup). These options may be used individually or in combinations. A top level description for these functions is given here, then more detailed descriptions will follow. – Zero-Power Memory: All memory arrays (Flash and SRAM) in the PSD Module are built with zero-power technology, which puts the memories into standby mode (~ zero DC current) when 8032 address signals are not changing. As soon as a transition occurs on any address input, the affected memory “wakes up”, changes and latches its outputs, then goes back to standby. The designer does not have to do anything special to achieve this memory standby mode when no inputs are changing—it happens automatically. Thus, the slower the 8032 clock, the lower the current consumption. Both PLDs (DPLD and GPLD) are also zeropower, but this is not the default condition. The 8032 must set a bit in one of the csiop PMMR registers at run-time to achieve zero-power. – Automatic Power-Down (APD): The APD feature allows the PSD Module to reach it’s lowest current consumption levels. If enabled, the APD counter will time-out when there is a lack of 8032 bus activity for an extended amount of time (8032 asleep). After time-out occurs, all 8032 address and data buffers on the PSD Module are shut down, preventing the PSD Module memories and potentially the PLDs from waking up from standby, even if address inputs are changing state because of noise or any external components driving the address lines. Since the actual address and data buffers are turned off, current consumption is even further reduced. Note: Non-address signals are still available to PLD inputs and will wake up the PLDs if these signals are changing state, but will not wake up the memories. The APD counter requires a relatively slow external clock input on pin PD1 that does stop when the 8032 goes to sleep mode. – Forced Power-Down (FPD): The MCU can put the PSD Module into Power-Down mode with the same results as using APD described above, but FPD does not rely on the APD counter. Instead, FPD will force the PSD Module into Power-Down mode when the MCU firmware sets a bit in one of the csiop PMMR registers. This is a good alternative to APD because no external clock is needed for the APD counter. – PSD Module Chip Select Input (CSI): This input on pin PD2 (80-pin devices only) can be used to disable the internal memories, placing them in standby mode even if address inputs are changing. This feature does not block any internal signals (the address and data buffers are still on but signals are ignored) and CSI does not disable the PLDs. This is a good alternative to using the APD counter, which requires an external clock on pin PD1. – Non-Turbo Mode: The PLDs can operate in Turbo or non-Turbo modes. Turbo mode has the shortest signal propagation delay, but consumes more current than non-Turbo mode. A csiop register can be written by the 8032 to select modes, the default mode is with Turbo mode enabled. In non-Turbo mode, the PLDs can achieve very low standby current (~ zero DC current) while no PLD inputs are changing, and the PLDs will even use less AC current when inputs do change compared to Turbo mode. When the Turbo mode is enabled, there is a significant DC current component AND the AC current component is higher than non-Turbo mode, as shown in Figure 85., page 202 (5V) and Figure 86., page 202 (3.3V). – Blocking Bits: Significant power savings can be achieved by blocking 8032 bus control signals (RD, WR, PSEN, ALE) from reaching PLD inputs, if these signals are not used in any PLD equations. Blocking is achieved by the 8032 writing to the “blocking bits” in csiop PMMR registers. Current consumption of the PLDs is directly related to the composite frequency of all transitions on PLD inputs, so blocking certain PLD inputs can significantly lower PLD operating frequency and power consumption (resulting in a lower frequency on the graphs of Figure 85., page 202 and Figure 86., page 202). – SRAM Backup Voltage: Pin PC2 can be configured in PSDsoft to accept an alternate DC voltage source (battery) to automatically retain the contents of SRAM when VDD drops below this alternate voltage. Note: It is recommended to prevent unused inputs from floating on Ports A, B, C, and D by pulling them up to VDD with a weak external resistor (100KΩ), or by setting the csiop Direction register to “output” at run-time for all unused inputs. This will prevent the CMOS input buffers of unused input pins from drawing excessive current. The csiop PMMR register definitions are shown in 117 through Table 119., page 188.uPSD33xx 188/231 Table 117. Power Management Mode Register PMMR0 (address = csiop + offset B0h) Note: All the bits of this register are cleared to zero following Power-up. Subsequent Reset (RST) pulses do not clear the registers. 1. Blocking bits should be set to logic ’1’ only if the signal is not needed in a DPLD or GPLD logic equation. Table 118. Power Management Mode Register PMMR2 (address = csiop + offset B4h) Note: The bits of this register are cleared to zero following Power-up. Subsequent Reset (RST) pulses do not clear the registers. 1. Blocking bits should be set to logic ’1’ only if the signal is not needed in a DPLD or GPLD logic equation. Table 119. Power Management Mode Register PMMR3 (address = csiop + offset C7h) Note: The bits of this register are cleared to zero following Power-up. Subsequent Reset (RST) pulses do not clear the registers. Bit 0 X 0 Not used, and should be set to zero. Bit 1 APD Enable 0 Automatic Power Down (APD) counter is disabled. 1 APD counter is enabled Bit 2 X 0 Not used, and should be set to zero. Bit 3 PLD Turbo Disable 0 = on PLD Turbo mode is on 1 = off PLD Turbo mode is off, saving power. Bit 4 Blocking Bit, CLKIN to PLDs(1) 0 = on CLKIN (pin PD1) to the PLD Input Bus is not blocked. Every transition of CLKIN powers-up the PLDs. 1 = off CLKIN input to PLD Input Bus is blocked, saving power. But CLKIN still goes to APD counter. Bit 5 Blocking Bit, CLKIN to OMCs Only(1) 0 = on CLKIN input is not blocked from reaching all OMC’s common clock inputs. 1 = off CLKIN input to common clock of all OMCs is blocked, saving power. But CLKIN still goes to APD counter and all PLD logic besides the common clock input on OMCs. Bit 6 X 0 Not used, and should be set to zero. Bit 7 X 0 Not used, and should be set to zero. Bit 0 X 0 Not used, and should be set to zero. Bit 1 X 0 Not used, and should be set to zero. Bit 2 Blocking Bit, WR to PLDs(1) 0 = on 8032 WR input to the PLD Input Bus is not blocked. 1 = off 8032 WR input to PLD Input Bus is blocked, saving power. Bit 3 Blocking Bit, RD to PLDs(1) 0 = on 8032 RD input to the PLD Input Bus is not blocked. 1 = off 8032 RD input to PLD Input Bus is blocked, saving power. Bit 4 Blocking Bit, PSEN to PLDs(1) 0 = on 8032 PSEN input to the PLD Input Bus is not blocked. 1 = off 8032 PSEN input to PLD Input Bus is blocked, saving power. Bit 5 Blocking Bit, ALE to PLDs(1) 0 = on 8032 ALE input to the PLD Input Bus is not blocked. 1 = off 8032 ALE input to PLD Input Bus is blocked, saving power. Bit 5 Blocking Bit, PC7 to PLDs(1) 0 = on Pin PC7 input to the PLD Input Bus is not blocked. 1 = off Pin PC7 input to PLD Input Bus is blocked, saving power. Bit 7 X 0 Not used, and should be set to zero. Bit 0 X 0 Not used, and should be set to zero. Bit 1 FORCE_PD 0 = off APD counter will cause Power-Down Mode if APD is enabled. 1 = on Power-Down mode will be entered immediately regardless of APD activity. Bit 3-7 X 0 Not used, and should be set to zero.189/231 uPSD33xx Automatic Power-Down (APD). The APD unit shown in Figure 63., page 157 puts the PSD Module into power-down mode by monitoring the activity of the 8032 Address Latch Enable (ALE) signal. If the APD unit is enabled by writing a logic ’1’ to Bit 1 of the csiop PMMR0 register, and if ALE signal activity has stopped (8032 in sleep mode), then the four-bit APD counter starts counting up. If the ALE signal remains inactive for 15 clock periods of the CLKIN signal (pin PD1), then the APD counter will reach maximum count and the power down indicator signal (PDN) goes to logic ’1’ forcing the PSD Module into power-down mode. During this time, all buffers on the PSD Module for 8032 address and data signals are disabled in silicon, preventing the PSD Module memories from waking up from stand-by mode, even if noise or other devices are driving the address lines. The PLDs will also stay in standby mode if the PLDs are in non-Turbo mode and if all other PLD inputs (non-address signals) are static. However, if the ALE signal has a transition before the APD counter reaches max count, the APD counter is cleared to zero and the PDN signal will not go active, preventing power-down mode. To prevent unwanted APD time-outs during normal 8032 operation (not sleeping), it is important to choose a clock frequency for CLKIN that will NOT produce 15 or more pulses within the longest period between ALE transitions. A 32768 Hz clock signal is quite often an ideal frequency for CLKIN and APD, and this frequency is often available on external supervisor or real-time clock devices. The “PDN” power-down indicator signal is available to the PLD input bus to use in any PLD equations if desired. The user may want to send this signal as a PLD output to an external device to indicate the PSD Module is in power-down mode. PSDsoft Express automatically includes the “PDN” signal in the DPLD chip select equations for FSx, CSBOOTx, RS0, and CSIOP. The following should be kept in mind when the PSD Module is in power-down mode: – 8032 address and data bus signals are blocked from all memories and both PLDs. – The PSD Module comes out of power-down mode when: ALE starts pulsing again, or the CSI input on pin PD2 transitions from logic ’1’ to logic '0,' or the PSD Module reset signal, RST, transitions from logic ’0’ to logic '1.' – Various signals can be blocked (prior to power-down mode) from entering the PLDs by using “blocking bits” in csiop PMMR registers. – All memories enter standby mode, and the state of the PLDs and I/O Ports are unchanged (if no PLD inputs change). Table 121., page 194 shows the effects of powerdown mode on I/O pins while in various operating modes. – The 8032 Ports 1,3, and 4 on the MCU Module are not affected at all by power-down mode in the PSD Module. – Power-down standby current given in the AC specifications for PSD Module assume there are no transitions on any unblocked PLD input, and there are no output pins driving any loads. The APD counter will count whenever Bit 1 of csiop PMMR0 register is set to logic '1,' and when the ALE signal is steady at either logic ’1’ or logic ’0’ (not transitioning). Figure 79., page 191 shows the flow leading up to power-down mode. The only action required in PSDsoft Express to enable APD mode is to select the pin function “Common Clock Input, CLKIN” before programming with JTAG.uPSD33xx 190/231 Forced Power Down (FDP). An alternative to APD is FPD. The resulting power-savings is the same, but the PDN signal in Figure 78., page 191 is set and Power-Down mode is entered immediately when firmware sets the FORCE_PD Bit to logic '1' in the csiop Register PMMR3 (Bit 1). FPD will override APD counter activity when FORCE_PD is set. No external clock source for the APD counter is needed. The FORCE_PD Bit is cleared only by a reset condition. Caution must be used when implementing FPD because code memory goes off-line as soon as PSD Module Power-Down mode is entered, leaving the MCU with no instruction stream to execute. The MCU Module must put itself into Power-Down mode after it puts the PSD Module into PowerDown Mode. How can it do this if code memory goes off-line? The answer is the Pre-Fetch Queue (PFQ) in the MCU Module. By using the instruction scheme shown in the 8051 assembly code example in Table 120, the PFQ will be loaded with the final instructions to command the MCU Module to Power Down mode after the PDS Module goes to Power-Down mode. In this case, even though the code memory goes off-line in the PSD Module, the last few MCU instruction are sourced from the PFQ. Table 120. Forced Power-Down Example PDOWN: ANL A8h, #7Fh ; disable all interrupts ORL 9Dh, #C0h ; ensure PFQ and BC are enabled MOV DPTR, #xxC7 ; load XDATA pointer to select PMMR3 register (xx = base ; address of csiop registers) CLR A ; clear A JMP LOOP ; first loop - fill PFQ/BQ with Power Down instructions NOP ; second loop - fetch code from PFQ/BC and set Power- ; Down bits for PSD Module and then MCU Module LOOP: MOVX @DPTR, A ; set FORCE_PD Bit in PMMR3 in PSD Module in second ; loop MOV 87h, A ; set PD Bit in PCON Register in MCU Module in second ; loop MOV A, #02h ; set power-down bit in the A Register, but not in PMMR3 or ; PCON yet in first loop JMP LOOP ; uPSD enters into Power-Down mode in second loop191/231 uPSD33xx Figure 78. Automatic Power Down (APD) Unit Figure 79. Power-Down Mode Flow Chart Chip Select Input (CSI). Pin PD2 of Port D can optionally be configured in PSDsoft Express as the PSD Module Chip Select Input, CSI, which is an active-low logic input. By default, pin PD2 does not have the CSI function. When the CSI function is specified in PSDsoft Express, the CSI signal is automatically included in DPLD chip select equations for FSx, CSBOOTx, RS0, and CSIOP. When the CSI pin is driven to logic ’0’ from an external device, all of these memories will be available for READ and WRITE operations. When CSI is driven to logic '1,' none of these memories are available for selection, regardless of the address activity from the 8032, reducing power consumption. The state of the PLD and port I/O pins are not changed when CSI goes to logic ’1’ (disabled). PMMR0, BIT 1 (APD EN) 8032 ALE PSD MODULE RST_ CSI (pin PD2) CLKIN (pin PD1) PDN OMC OUTPUTS FSx CSBOOTx RS0 CSIOP 8032 DATA FROM MCU MODULE 8032 ADDR FROM MCU MODULE PDN PDN CSI PMMR3, BIT 1 (FORCE_PD) ENABLE 1 = FOUND TRANSITION 1 = FOUND EDGE CLEAR FULL COUNT DPLD CHIP SELECT EQUATIONS GPLD TRANSITION DETECTION EDGE DETECTION 4-BIT APD UP-COUNTER ENABLE CLK 1 = POWER DOWN MODE ENABLE PSD MODULE LINE BUFFERS 8032 DATA 8032 ADDR WHEN CSI FUNCTION IS SPECIFIED IN PSDSOFT EXPRESS, CSI IS PART OF EQUATIONS FOR FSx, CSBOOTx, RS0, and CSIOP AI06608B Enable APD. Set PMMR0, Bit 1 = 1 RESET OPTIONAL. Disable desired inputs to PLDs by setting PMMR0 bits 4 and 5, and PMMR2 bits 2 through 6 ALE idle for 15 CLKIN clocks? PDN = 1, PSD Module in PowerDown Mode YES NO AI09183uPSD33xx 192/231 PLD Non-Turbo Mode. The power consumption and speed of the PLDs are controlled by the Turbo Bit (Bit 3) in the csiop PMMR0 register. By setting this bit to logic '1,' the Turbo mode is turned off and both PLDs consume only stand-by current when ALL PLD inputs have no transitions for an extended time (65ns for 5V devices, 100ns for 3.3 V devices), significantly reducing current consumption. The PLDs will latch their outputs and go to standby, drawing very little current. When Turbo mode is off, PLD propagation delay time is increased as shown in the AC specifications for the PSD Module. Since this additional propagation delay also effects the DPLD, the response time of the memories on the PSD Module is also lengthened by that same amount of time. If Turbo mode is off, the user should add an additional wait state to the 8032 BUSCON SFR register if the 8032 clock frequency is higher that a particular value. Please refer to Table 36., page 64 in the MCU Module section. The default state of the Turbo Bit is logic '0,' meaning Turbo mode is on by default (after power-up and reset conditions) until it is turned off by the 8032 writing to PMMR0. PLD Current Consumption. Figure 85., page 202 and Figure 86., page 202 (5V and 3.3V devices respectively) show the relationship between PLD current consumption and the composite frequency of all the transitions on PLD inputs, indicating that a higher input frequency results in higher current consumption. Current consumption of the PLDs have a DC component and an AC component. Both need to be considered when calculating current consumption for a specific PLD design. When Turbo mode is on, there is a linear relationship between current and frequency, and there is a substantial DC current component consumed by the PSD Module when there are no transitions on PLD inputs (composite frequency is zero). The magnitude of this DC current component is directly proportional to how many product terms are used in the equations of both PLDs. PSDsoft Express generates a “fitter” report that specifies how many product terms were used in a design out of a total of 186 available product terms. Figure 85., page 202 and Figure 86., page 202 both give two examples, one with 100% of the 186 product terms used, and another with 25% of the 186 product terms used. Turbo Mode Current Consumption. To determine the AC current component of the specific PLD design with Turbo mode on, the user will have to interpolate from the graph, given the number of product terms specified in the fitter report, and the estimated composite frequency of PLD input signal transitions. For the DC component (y-axis crossing), the user can calculate the number by multiplying the number of product terms used (from fitter report) times the DC current per product term specified in the DC specifications for the PSD Module. The total PLD current usage is the sum of its AC and DC components. Non-Turbo Mode Current Consumption. Notice in Figure 85., page 202 and Figure 86., page 202 that when Turbo mode is off, the DC current consumption is “zero” (just standby current) when the composite frequency of PLD input transitions is zero (no input transitions). Now moving up the frequency axis to consider the AC current component, current consumption remains considerably less than Turbo mode until PLD input transitions happen so rapidly that the PLDs do not have time to latch their outputs and go to standby between the transitions anymore. This is where the lines converge on the graphs, and current consumption becomes the same for PLD input transitions at this frequency and higher regardless if Turbo mode is on or off. To determine the current consumption of the PLDs with Turbo mode off, extrapolate the AC component from the graph based on number of product terms and input frequency. The only DC component in non-Turbo mode is the PSD Module standby current. The key to reducing PLD current consumption is to reduce the composite frequency of transitions on the PLD input bus, moving down the frequency scale on the graphs. One way to do this is to carefully select which signals are entering PLD inputs, not selecting high frequency signals if they are not used in PLD equations. Another way is to use PLD “Blocking Bits” to block certain signals from entering the PLD input bus.193/231 uPSD33xx PLD Blocking Bits. Blocking specific signals from entering the PLDs using bits of the csiop PMMR registers can further reduce PLD AC current consumption by lowering the effective composite frequency of inputs to the PLDs. Blocking 8032 Bus Control Signals. When the 8032 is active on the MCU Module, four bus control signals (RD, WR, PSEN, and ALE) are constantly transitioning to manage 8032 bus traffic. Each time one of these signals has a transition from logic ’1’ to '0,' or 0 to '1,' it will wake up the PLDs if operating in non-Turbo mode, or when in Turbo mode it will cause the affected PLD gates to draw current. If equations in the DPLD or GPLD do not use the signals RD, WR, PSEN, or ALE then these signals can be blocked which will reduce the AC current component substantially. These bus control signals are rarely used in DPLD equations because they are routed in silicon directly to the memory arrays of the PSD Module, bypassing the PLDs. For example, it is NOT necessary to qualify a memory chip select signal with an MCU write strobe, such as “fs0 = address range & !WR_”. Only “fs0 = address range” is needed. Each of the 8032 bus control signals may be blocked individually by writing to Bits 2, 3, 4, and 5 of the PMMR2 register shown in Table 118., page 188. Blocking any of these four bus control signals only prevents them from reaching the PLDs, but they will always go to the memories directly. However, sometimes it is necessary to use these 8032 bus control signals in the GPLD when creating interface signals to external I/O peripherals. But it is still possible to save power by dynamically unblocking the bus signals before reading/writing the external device, then blocking the signals after the communication is complete. The user can also block an input signal coming from pin PC7 to the PLD input bus if desired by writing to Bit 6 of PMMR2. Blocking Common Clock, CLKIN. The input CLKIN (from pin PD1) can be blocked to reduce current consumption. CLKIN is used as a common clock input to all OMC flip-flips, it is a general input to the PLD input bus, and it is used to clock the APD counter. In PSDsoft Express, the function of pin PD1 must be specified as “Common Clock Input, CLKIN” before programming the device with JTAG to get the CLKIN function. Bit 4 of PMMR0 can be set to logic ’1’ to block CLKIN from reaching the PLD input bus, but CLKIN will still reach the APD counter. Bit 5 of PMMR0 can be set to logic ’1’ to block CLKIN from reaching the OMC flip-flops only, but CLKIN is still available to the PLD input bus and the APD counter. See Table 117., page 188 for details. SRAM Standby Mode (battery backup). The SRAM on the PSD Module may optionally be backed up by an external battery (or other DC source) to make its contents non-volatile. This is achieved by connecting a battery to pin PC2 on Port C and selecting the “SRAM Standby” function for pin PC2 within PSDsoft Express. Automatic voltage supply cross-over circuitry is built into the PSD Module to switch SRAM supply to battery as soon as VDD drops below the voltage level of the battery. SRAM contents are protected while battery voltage is greater than 2.0V. Pin PC4 on Port C can be used as an output to indicate that a battery switch-over has occurred. This is configured in PSDsoft Express by selecting the “Standby On Indicator” option for pin PC4. PSD Module Reset Conditions The PSD Module receives a reset signal from the MCU Module. This reset signal is referred to as the “RST” input in PSD Module documentation, and it is active-low when asserted. The character of the RST signal generated from the MCU Module is described in SUPERVISORY FUNCTIONS, page 65. Upon power-up, and while RST is asserted, the PSD Module immediately loads its configuration from non-volatile bits to configure the PLDs and other items. PLD logic is operational and ready for use well before RST is de-asserted. The state of PLD outputs are determined by equations specified in PSDsoft Express. The Flash memories are reset to Read Array mode after any assertion of RST (even if a program or erase operation is occurring). Flash memory WRITE operations are automatically prevented while VDD is ramping up until it rises above the VLKO voltage threshold at which time Flash memory WRITE operations are allowed. Once the uPSD33xx is up and running, any subsequent reset operation is referred to as a warm reset, until power is turned off again. Some PSD Module functions are reset in different ways depending if the reset condition was caused from a power-up reset or a warm reset. Table 121., page 194 summarizes how PSD Module functions are affected by power-up and warm resets, as well as the affect of PSD Module powerdown mode (from APD). The I/O pins of PSD Module Ports A, B, C, and D do not have weak internal pull-ups.uPSD33xx 194/231 In MCU I/O mode, Latched Address Out mode, and Peripheral I/O mode, the pins of Ports A, B, C, and D become standard CMOS inputs during a reset condition. If no external devices are driving these pins during reset, then these inputs may float and draw excessive current. If low power consumption is critical during reset, then these floating inputs should be pulled up externally to VDD with a weak (100KΩ minimum) resistor. In PLD I/O mode, pins of Ports A, B, C, and D may also float during reset if no external device is driving them, and if there is no equation specified for the DPLD or GPLD to make them an output. In this case, a weak external pull-up resistor (100KΩ minimum) should be used on floating pins to avoid excessive current draw. The pins on Ports 1, 3, and 4 of the 8032 MCU module do have weak internal pull-ups and the inputs will not float, so no external pull-ups are needed. Table 121. Function Status During Power-Up Reset, Warm Reset, Power-down Mode Note: 1. VM register Bit 7 (PIO_EN) and Bit 0 (SRAM in 8032 program space) are cleared to zero at power-up and warm reset conditions. Port Configuration Power-Up Reset Warm Reset APD Power-down Mode MCU I/O Pins are in input mode Pins are in input mode Pin logic state is unchanged PLD I/O Pin logic is valid after internal PSD Module configuration bits are loaded. Happens long before RST is de-asserted Pin logic is valid and is determined by PLD logic equations Pin logic depends on inputs to PLD (8032 addresses are blocked from reaching PLD inputs during powerdown mode) Latched Address Out Mode Pins are High Impedance Pins are High Impedance Pins logic state not defined since 8032 address signals are blocked Peripheral I/O Mode Pins are High Impedance Pins are High Impedance Pins are High Impedance JTAG ISP and Debug JTAG channel is active and available JTAG channel is active and available JTAG channel is active and available Register Power-Up Reset Warm Reset APD Power-down Mode PMMR0 and PMMR2 Cleared to 00h Unchanged Unchanged Output of OMC Flip-flops Cleared to ’0’ Depends on .re and .pr equations Depends on .re and .pr equations VM Register(1) Initialized with value that was specified in PSDsoft Initialized with value that was specified in PSDsoft Unchanged All other csiop registers Cleared to 00h Cleared to 00h Unchanged195/231 uPSD33xx JTAG ISP and JTAG Debug. An IEEE 1149.1 serial JTAG interface is used on uPSD33xx devices for ISP (In-System Programming) of the PSD module, and also for debugging firmware on the MCU Module. IEEE 1149.1 Boundary Scan operations are not supported in the uPSD33xx. The main advantage of JTAG ISP is that a blank uPSD33xx device may be soldered to a circuit board and programmed with no involvement of the 8032, meaning that no 8032 firmware needs to be present for ISP. This is good for manufacturing, for field updates, and for easy code development in the lab. JTAG-based programmers and debuggers for uPSD33xx are available from STMicroelectronics and 3rd party vendors. ISP is different than IAP (In-Application Programming). IAP involves the 8032 to program Flash memory over any interface supported by the 8032 (e.g., UART, SPI, I2C), which is good for remote updates over a communication channel. uPSD33xx devices support both ISP and IAP. The entire PSD Module (Flash memory and PLD) may be programmed with JTAG ISP, but only the Flash memories may be programmed using IAP. JTAG Chaining Inside the Package. JTAG protocol allows serial “chaining” of more than one device in a JTAG chain. The uPSD33xx is assembled with a stacked die process combining the PSD Module (one die) and the MCU Module (the other die). These two die are chained together within the uPSD33xx package. The standard JTAG interface has four basic signals: ■ TDI - Serial data into device ■ TDO - Serial data out of device ■ TCK - Common clock ■ TMS - Mode Selection Every device that supports IEEE 1149.1 JTAG communication contains a Test Access Port (TAP) controller, which is a small state machine to manage JTAG protocol and serial streams of commands and data. Both the PSD Module and the MCU Module each contain a TAP controller. Figure 80 illustrates how these die are chained within a package. JTAG programming/test equipment will connect externally to the four IEEE 1149.1 JTAG pins on Port C. The TDI pin on the uPSD33xx package goes directly to the PSD Module first, then exits the PSD Module through TDO. TDO of the PSD Module is connected to TDI of the MCU Module. The serial path is completed when TDO of the MCU Module exits the uPSD33xx package through the TDO pin on Port C. The JTAG signals TCK and TMS are common to both modules as specified in IEEE 1149.1. When JTAG devices are chained, typically one devices is in BYPASS mode while another device is executing a JTAG operation. For the uPSD33xx, the PSD Module is in BYPASS mode while debugging the MCU Module, and the MCU Module is in BYPASS mode while performing ISP on the PSD Module. The RESET_IN input pin on the uPSD33xx package goes to the MCU Module, and this module will generate the RST reset signal for the PSD Module. These reset signals are totally independent of the JTAG TAP controllers, meaning that the JTAG channel is operational when the modules are held in reset. It is required to assert RESET_IN during ISP. STMicroelectronics and 3rd party JTAG ISP tools will automatically assert a reset signal during ISP. However, this reset signal must be connected to RESET_IN as shown in examples in Figure Figure 81., page 196 and Figure 82., page 198. Figure 80. JTAG Chain in uPSD33xx Package JTAG TDI JTAG TMS JTAG TCK JTAG TDO TDI TMS TCK TDO TDO TMS TCK TDI PC3 / TSTAT PC4 / TERR TSTAT TERR OPTIONAL JTAG TAP CONTROLLER JTAG TAP CONTROLLER RESET_IN OPTIONAL DEBUG RESET RST 8032 MCU MCU MODULE PSD MODULE MAIN FLASH MEMORY 2ND FLASH MEMORY PLD uPSD33XX IEEE 1149.1 AI09184uPSD33xx 196/231 In-System Programming. The ISP function can use two different configurations of the JTAG interface: ■ 4-pin JTAG: TDI, TDO, TCK, TMS ■ 6-pin JTAG: Signals above plus TSTAT, TERR At power-up, the four basic JTAG signals are all inputs, waiting for a command to appear on the JTAG bus from programming or test equipment. When the enabling command is received, TDO becomes an output and the JTAG channel is fully functional. The same command that enables the JTAG channel may optionally enable the two additional signals, TSTAT and TERR. 4-pin JTAG ISP (default). The four basic JTAG pins on Port C are enabled for JTAG operation at all times. These pins may not be used for other I/ O functions. There is no action needed in PSDsoft Express to configure a device to use 4-pin JTAG, as this is the default condition. No 8032 firmware is needed to use 4-pin ISP because all ISP functions are controlled from the external JTAG program/test equipment. Figure 81 shows recommended connections on a circuit board to a JTAG program/test tool using 4-pin JTAG. It is required to connect the RST output signal from the JTAG program/test equipment to the RESET_IN input on the uPSD33xx. The RST signal is driven by the equipment with an Open Drain driver, allowing other sources (like a push button) to drive RESET_IN without conflict. Note: The recommended pull-up resistors and decoupling capacitor are illustrated in Figure 81. Figure 81. Recommended 4-pin JTAG Connections Note: 1. For 5V uPSD33xx devices, pull-up resistors and VCC pin on the JTAG connector should be connected to 5V system VDD. 2. For 3.3V uPSD33xx devices, pull-up resistors and VCC pin on the JTAG connector should be connected to 3.3V system VCC. 3. This signal is driven by an Open-Drain output in the JTAG equipment, allowing more than one source to activate RESETIN. TMS - PC0 TCK - PC1 SRAM STBY or I/O - PC2 GENERAL I/O - PC3 GENERAL I/O - PC4 TDI - PC5 TDO - PC6 GENERAL I/O - PC7 JTAG CONN. 100k typical TMS TCK TDI TDO GENERAL I/O SIGNALS GND VCC (1,2) RST(3) uPSD33XX 0.01 µF CIRCUIT BOARD JTAG Programming or Test Equipment Connects Here 10k PUSH BUTTON or ANY OTHER RESET SOURCE DEBUG OPTIONAL TEST POINT 100k RESETIN AI09185197/231 uPSD33xx 6-pin JTAG ISP (optional). The optional signals TSTAT and TERR are programming status flags that can reduce programming time by as much as 30% compared to 4-pin JTAG because this status information does not have to be scanned out of the device serially. TSTAT and TERR must be used as a pair for 6-pin JTAG operation. – TSTAT (pin PC3) indicates when programming of a single Flash location is complete. Logic 1 = Ready, Logic 0 = busy. – TERR (pin PC4) indicates if there was a Flash programming error. Logic 1 = no error, Logic 0 = error. The pin functions for PC3 and PC4 must be selected as “Dedicated JTAG - TSTAT” and “Dedicated JTAG - TERR” in PSDsoft Express to enable 6-pin JTAG ISP. No 8032 firmware is needed to use 6-pin ISP because all ISP functions are controlled from the external JTAG program/test equipment. TSTAT and TERR are functional only when JTAG ISP operations are occurring, which means they are non-functional during JTAG debugging of the 8032 on the MCU Module. Programming times vary depending on the number of locations to be programmed and the JTAG programming equipment, but typical JTAG ISP programming times are 10 to 25 seconds using 6- pin JTAG. The signals TSTAT and TERR are not included in the IEEE 1149.1 specification. Figure 82., page 198 shows recommended connections on a circuit board to a JTAG program/test tool using 6-pin JTAG. It is required to connect the RST output signal from the JTAG program/test equipment to the RESET_IN input on the uPSD33xx. The RST signal is driven by the equipment with an Open Drain driver, allowing other sources (like a push button) to drive RESET_IN without conflict. Note: The recommended pull-up resistors and decoupling capacitor are illustrated in Figure 82.uPSD33xx 198/231 Figure 82. Recommended 6-pin JTAG Connections Note: 1. For 5V uPSD33xx devices, pull-up resistors and VCC pin on the JTAG connector should be connected to 5V system VDD. 2. For 3.3V uPSD33xx devices, pull-up resistors and VCC pin on the JTAG connector should be connected to 3.3V system VCC. 3. This signal is driven by an Open-Drain output in the JTAG equipment, allowing more than one source to activate RESET_IN. TMS - PC0 TCK - PC1 SRAM STBY or I/O - PC2 TSTAT - PC3 TERR - PC4 TDI - PC5 TDO - PC6 GENERAL I/O - PC7 JTAG CONN. 100k typical TMS TCK TDI TERR TSTAT TDO GENERAL I/O SIGNALS GND VCC (1,2) RST(3) uPSD33XX 0.01 µF CIRCUIT BOARD JTAG Programming or Test Equipment Connects Here 10k PUSH BUTTON or ANY OTHER RESET SOURCE DEBUG OPTIONAL TEST POINT 100k RESETIN AI09186199/231 uPSD33xx Recommended JTAG Connector. There is no industry standard JTAG connector. STMicroelectronics recommends a specific JTAG connector and pinout for uPSD3xxx so programming and debug equipment will easily connect to the circuit board. The user does not have to use this connector if there is a different connection scheme. The recommended connector scheme can accept a standard 14-pin ribbon cable connector (2 rows of 7 pins on 0.1” centers, 0.025” square posts, standard keying) as shown in Figure 83. See the STMicroelectronics “FlashLINK, FL-101 User Manual” for more information. Figure 83. Recommended JTAG Connector Chaining uPSD33xx Devices. It is possible to chain a uPSD33xx device with other uPSD33xx devices on a circuit board, and also chain with IEEE 1149.1 compliant devices from other manufacturers. Figure 84., page 200 shows a chaining example. The TDO of one device connects to the TDI of the next device, and so on. Only one device is performing JTAG operations at any given time while the other two devices are in BYPASS mode. Configuration for JTAG chaining can be made in PSDsoft Express by choosing “More than one device” when prompted about chaining devices. Notice in Figure 84., page 200 that the uPSD33xx devices are chained externally, but also be aware that the two die within each uPSD33xx device are chained internally. This internal chaining of die is transparent to the user and is taken care of by PSDsoft Express and 3rd party JTAG tool software. The example in Figure 84., page 200 also shows how to use 6-pin JTAG when chaining devices. The signals TSTAT and TERR are configured as open-drain type signals from PSDsoft Express. This facilitates a wired-OR connection of TSTAT signals from multiple uPSD33xx devices and also a wired-OR connection of TERR signals from those same multiple devices. PSDsoft Express puts TSTAT and TERR signals into open-drain mode by default, requiring external pull-up resistors. Click on 'Properties' in the JTAG-ISP window of PSDsoft Express to change to standard CMOS push-pull outputs if desired, but wired-OR logic is not possible in CMOS output mode. TDO TCK TMS VCC TDI GND JEN TERR GND GND RST TSTAT CNTL TRST 14 12 10 13 11 9 8 7 6 5 4 3 2 1 KEY WAY VIEW: Looking into face of shrouded male connector, with 0.025" posts on 0.1" centers. Connector reference: Molex 70247-1401 This connector accepts a 14-pin ribbon cable such as: • Samtec: HCSD-07-D-06.00-01-S-N • Digikey: M3CCK-14065-ND AI09187uPSD33xx 200/231 Figure 84. Example of Chaining uPSD33xx Devices Device 1 µPSD33XX uPSD33XX TMS TCK TDI TDO IEEE 1149.1 Compliant Device Device 2 Device N System Reset Circuitry TMS TCK TDI TDO TSTAT TERR CIRCUIT BOARD JTAG CONN. VCC TMS TCK TDI TSTAT TERR TDO RST GND 100K 100K 100K 100K 100K 10K 100K JTAG Programming or Test Equipment Connects Here Optional Optional TMS TCK TDI TDO TSTAT TERR AI09188201/231 uPSD33xx Debugging the 8032 MCU Module. The 8032 on the MCU module may be debugged in-circuit using the same four basic JTAG signals as used for JTAG ISP (TDI, TDO, TCK, TMS). The signals TSTAT and TERR are not needed for debugging, and they will not create a problem if they exist on the circuit board while debugging. The same connector specified in Figure 83., page 199 can be used for ISP or for 8032 debugging. There are 3rd party suppliers of uPSD33xx JTAG debugging equipment (check www.st.com/psm). These are small pods which connect to a PC (or notebook computer) using a USB interface, and they are driven by an 8032 Integrated Development Environment (IDE) running on the PC. Standard debugging features are provided through this JTAG interface such as single-step, breakpoints, trace, memory dump and fill, and others. There is also a dedicated Debug pin (shown in Figure 80., page 195) which can be configured as an output to trigger external devices upon a programmable internal event (e.g., breakpoint match), or the pin can be configured as an input so an external device can initiate an internal debug event (e.g., break execution). The Debug pin function is configured by the 8032 IDE debug software tool. See DEBUG UNIT, page 39 for more details. The Debug signal should always be pulled up externally with a weak pull-up (100K minimum) to VCC even if nothing is connected to it, as shown in Figure 81., page 196 and Figure 82., page 198. JTAG Security Setting. A programmable security bit in the PSD Module protects its contents from unauthorized viewing and copying. The security bit is set by clicking on the “Additional PSD Settings” box in the main flow diagram of PSDsoft Express, then choosing to set the security bit. Once a file with this setting is programmed into a uPSD33xx using JTAG ISP, any further attempts to communicate with the uPSD33xx using JTAG will be limited. Once secured, the only JTAG operation allowed is a full-chip erase. No reading or modifying Flash memory or PLD logic is allowed. Debugging operations to the MCU Module are also not allowed. The only way to defeat the security bit is to perform a JTAG ISP full-chip erase operation, after which the device is blank and may be used again. The 8032 on the MCU Module will always have access to PSM Module memory contents through the 8-bit 8032 data bus connecting the two die, even while the security bit is set. Initial Delivery State. When delivered from STMicroelectronics, uPSD33xx devices are erased, meaning all Flash memory and PLD configuration bits are logic '1.' Firmware and PLD logic configuration must be programmed at least the first time using JTAG ISP. Subsequent programming of Flash memory may be performed using JTAG ISP, JTAG debugging, or the 8032 may run firmware to program Flash memory (IAP).uPSD33xx 202/231 AC/DC PARAMETERS These tables describe the AD and DC parameters of the uPSD33xx Devices: ■ DC Electrical Specification ■ AC Timing Specification ■ PLD Timing – Combinatorial Timing – Synchronous Clock Mode – Asynchronous Clock Mode – Input Macrocell Timing ■ MCU Module Timing – READ Timing – WRITE Timing – Power-down and RESET Timing The following are issues concerning the parameters presented: – In the DC specification the supply current is given for different modes of operation. – The AC power component gives the PLD, Flash memory, and SRAM mA/MHz specification. Figure 85 and Figure 86 show the PLD mA/MHz as a function of the number of Product Terms (PT) used. – In the PLD timing parameters, add the required delay when Turbo Bit is '0.' Figure 85. PLD ICC /Frequency Consumption (5V range) Figure 86. PLD ICC /Frequency Consumption (3V range) 0 10 20 30 40 60 70 80 90 100 110 VCC = 5V 50 0 10 15 5 20 25 HIGHEST COMPOSITE FREQUENCY AT PLD INPUTS (MHz) ICC – (mA) TURBO ON (100%) TURBO ON (25%) TURBO OFF TURBO OFF PT 100% PT 25% AI02894 0 10 20 30 40 50 60 VCC = 3V 0 10 15 5 20 25 ICC – (mA) TURBO ON (100%) TURBO ON (25%) TURBO OFF TURBO OFF HIGHEST COMPOSITE FREQUENCY AT PLD INPUTS (MHz) PT 100% PT 25% AI03100203/231 uPSD33xx Table 122. PSD Module Example, Typ. Power Calculation at VCC = 5.0V (Turbo Mode Off) Conditions MCU Clock Frequency = 12MHz Highest Composite PLD input frequency (Freq PLD) = 8MHz MCU ALE frequency (Freq ALE) = 2MHz % Flash memory Access = 80% % SRAM access = 15% % I/O access = 5% (no additional power above base) Operational Modes % Normal = 40% % Power-down Mode = 60% Number of product terms used (from fitter report) = 45 PT % of total product terms = 45/182 = 24.7% Turbo Mode = Off Calculation (using typical values) ICC total = ICC(MCUactive) x %MCUactive + ICC(PSDactive) x %PSDactive + IPD(pwrdown) x %pwrdown ICC(MCUactive) = 20mA IPD(pwrdown) = 250uA ICC(PSDactive) = ICC(ac) + ICC(dc) = %flash x 2.5mA/MHz x Freq ALE + %SRAM x 1.5mA/MHz x Freq ALE + % PLD x (from graph using Freq PLD) = 0.8 x 2.5mA/MHz x 2MHz + 0.15 x 1.5mA/MHz x 2MHz + 24mA = (4 + 0.45 + 24) mA = 28.45mA ICC total = 20mA x 40% + 28.45mA x 40% + 250uA x 60% = 8mA + 11.38mA + 150uA = 19.53mA This is the operating power with no Flash memory Erase or Program cycles in progress. Calculation is based on all I/O pins being disconnected and IOUT = 0mA.uPSD33xx 204/231 MAXIMUM RATING Stressing the device above the rating listed in the Absolute Maximum Ratings” table may cause permanent damage to the device. These are stress ratings only and operation of the device at these or any other conditions above those indicated in the Operating sections of this specification is not implied. Exposure to Absolute Maximum Rating conditions for extended periods may affect device reliability. Refer also to the STMicroelectronics SURE Program and other relevant quality documents. Table 123. Absolute Maximum Ratings Note: 1. IPC/JEDEC J-STD-020A 2. JEDEC Std JESD22-A114A (C1=100pF, R1=1500 Ω, R2=500 Ω) DC AND AC PARAMETERS This section summarizes the operating and measurement conditions, and the DC and AC characteristics of the device. The parameters in the DC and AC Characteristic tables that follow are derived from tests performed under the Measurement Conditions summarized in the relevant tables. Designers should check that the operating conditions in their circuit match the measurement conditions when relying on the quoted parameters. Table 124. Operating Conditions (5V Devices) Table 125. Operating Conditions (3.3V Devices) Symbol Parameter Min. Max. Unit TSTG Storage Temperature –65 125 °C TLEAD Lead Temperature during Soldering (20 seconds max.)(1) 235 °C VIO Input and Output Voltage (Q = VOH or Hi-Z) –0.5 6.5 V VCC Supply Voltage –0.5 6.5 V VPP Device Programmer Supply Voltage –0.5 14.0 V VESD Electrostatic Discharge Voltage (Human Body Model)(2) –2000 2000 V Symbol Parameter Min. Max. Unit VCC Supply Voltage 4.5 5.5 V TA Ambient Operating Temperature (industrial) –40 85 °C Ambient Operating Temperature (commercial) 0 70 °C Symbol Parameter Min. Max. Unit VCC Supply Voltage 3.0 3.6 V TA Ambient Operating Temperature (industrial) –40 85 °C Ambient Operating Temperature (commercial) 0 70 °C205/231 uPSD33xx Table 126. AC Signal Letters for Timing Note: Example: tAVLX = Time from Address Valid to ALE Invalid. Table 127. AC Signal Behavior Symbols for Timing Note: Example: tAVLX = Time from Address Valid to ALE Invalid. Figure 87. Switching Waveforms – Key A Address C Clock D Input Data I Instruction L ALE N RESET Input or Output P PSEN signal Q Output Data R RD signal W WR signal B VSTBY Output M Output Macrocell t Time L Logic Level Low or ALE H Logic Level High V Valid X No Longer a Valid Logic Level Z Float PW Pulse Width WAVEFORMS INPUTS OUTPUTS STEADY INPUT MAY CHANGE FROM HI TO LO MAY CHANGE FROM LO TO HI DON'T CARE OUTPUTS ONLY STEADY OUTPUT WILL BE CHANGING FROM HI TO LO WILL BE CHANGING LO TO HI CHANGING, STATE UNKNOWN CENTER LINE IS TRI-STATE AI03102uPSD33xx 206/231 Table 128. Major Parameters Parameter Test Conditions/Comments 5.0V Value 3.3V Value Unit Operating Voltage – 4.5 to 5.5 (PSD); 3.0 to 3.6 (MCU) 3.0 to 3.6 (PSD and MCU) V Operating Temperature – –40 to 85 –40 to 85 °C MCU Frequency 8MHz (min) for I2C 1 Min, 40 Max 1 Min, 40 Max MHz Active Current, Typical (20% of PLD used; 25°C operation) 40MHz Crystal, Turbo 50 40 mA 40MHz Crystal, Non-Turbo 48 38 mA 8MHz Crystal, Turbo 21 18 mA 8MHz Crystal, Non-Turbo 10 8 mA Idle Current, Typical (20% of PLD used; 25°C operation) 40MHz Crystal divided by 2048 internally. All interfaces are disabled. 16 11 mA Standby Current, Typical Power-down Mode needs reset to exit. 140 120 µA SRAM Backup Current, Typical If external battery is attached. 0.5 0.5 µA I/O Sink/Source Current, Ports A, B, C, and D VOL = 0.45V (max); VOH = 2.4V (min) IOL = 8 (max); IOH = –2 (min) IOL = 4 (max); IOH = –1 (min) mA I/O Sink/Source Current, Port 4 VOL = 0.6V (max); VOH = 2.4V (min) IOL = 10 (max); IOH = –10 (min) IOL = 10 (max); IOH = –10 (min) mA PLD Macrocells For registered or combinatorial logic 16 16 – PLD Inputs Inputs from pins, feedback, or MCU addresses 69 69 – PLD Outputs Output to pins or internal feedback 18 18 – PLD Propagation Delay, Typical, Turbo Mode PLD input to output 15 22 ns207/231 uPSD33xx Table 129. Preliminary MCU Module DC Characteristics Note: 1. Power supply (VCC) is always 3.0 to 3.6V for the MCU Module. VDD for the PSD Module may be 3V or 5V. 2. IPD (Power-down Mode) is measured with: XTAL1 = VSS; XTAL2 = NC; RESET = VCC; Port 0 = VCC; all other pins are disconnected. 3. ICC-CPU (Active Mode) is measured with: XTAL1 driven with tCLCH, tCHCL = 5ns, VIL = VSS + 0.5V, VIH = VCC – 0.5V, XTAL2 = NC; RESET = VSS; Port 0 = VCC; all other pins are disconnected. ICC would be slightly higher if a crystal oscillator is used (approximately 1mA). 4. ICC-CPU (Idle Mode) is measured with: XTAL1 driven with tCLCH, tCHCL = 5ns, VIL = VSS + 0.5V, VIH = VCC – 0.5V, XTAL2 = NC; RESET = VCC; Port 0 = VCC; all other pins are disconnected. ICC would be slightly higher if a crystal oscillator is used (approximately 1mA). All IP clocks are disabled. 5. I/O current = 0mA, all I/O pins are disconnected. Symbol Parameter Test Conditions Min. Typ. Max. Unit VCC Supply Voltage(1) 3.0 3.6 V VIH High Level Input Voltage (Ports 0, 1, 2, 3, 4, XTAL1, RESET) 5V Tolerant - max voltage 5.5V 3.0V < VCC < 3.6V 0.7VCC 5.5 V VIL Low Level Input Voltage (Ports 0, 1, 2, 3, 4, XTAL1, RESET) 3.0V < VCC < 3.6V VSS – 0.5 0.3VCC V VOL1 Output Low Voltage (Port 4) IOL = 10mA 0.6 V V VOL2 Output Low Voltage (Other Ports) IOL =5mA 0.6 V V VOH1 Output High Voltage (Ports 4 push-pull) IOH = –10mA 2.4 V V VOH2 Output High Voltage (Port 0 push-pull) IOH = –5mA 2.4 V V VOH3 Output High Voltage (Other Ports Bi-directional mode) IOH = –20µA 2.4 V V VOP XTAL Open Bias Voltage (XTAL1, XTAL2) IOL = 3.2mA 1.0 2.0 V IRST RESET Pin Pull-up Current (RESET) VIN = VSS –10 –55 uA IFR XTAL Feedback Resistor Current (XTAL1) XTAL1 = VCC; XTAL2 = VSS –20 50 uA IIHL1 Input High Leakage Current (Port 0) VSS < VIN < 5.5V –10 10 uA IIHL2 Input High Leakage Current (Port 1, 2, 3, 4) VIH = 2.3V –10 10 uA IILL Input Low Leakage Current (Port 1, 2, 3, 4) VIL < 0.5V –10 10 uA IPD (Note 2) Power-down Mode VCC = 3.6V 65 95 uA ICC-CPU (Note 3,4,5) Active - 12MHz VCC = 3.6V 14 20 mA Idle - 12MHz 10 12 mA Active - 24MHz VCC = 3.6V 19 30 mA Idle - 24MHz 13 17 mA Active - 40MHz VCC = 3.6V 26 40 mA Idle - 40MHz 17 22 mAuPSD33xx 208/231 Table 130. PSD Module DC Characteristics (with 5V VDD) Note: 1. Internal Power-down mode is active. 2. PLD is in non-Turbo mode, and none of the inputs are switching. 3. Please see Figure 85., page 202 for the PLD current calculation. 4. IOUT = 0mA Symbol Parameter Test Condition (in addition to those in Table 129., page 207) Min. Typ. Max. Unit VIH Input High Voltage 4.5V < VDD < 5.5V 2 VDD +0.5 V VIL Input Low Voltage 4.5V < VDD < 5.5V –0.5 0.8 V VLKO VDD (min) for Flash Erase and Program 2.5 4.2 V VOL Output Low Voltage IOL = 20uA, VDD = 4.5V 0.01 0.1 V IOL = 8mA, VDD = 4.5V 0.25 0.45 V VOH Output High Voltage Except VSTBY On IOH = –20uA, VDD = 4.5V 4.4 4.49 V IOH = –2mA, VDD = 4.5V 2.4 3.9 V VOH1 Output High Voltage VSTBY On IOH1 = 1uA VSTBY – 0.8 V VSTBY SRAM Stand-by Voltage 2.0 VDD V ISTBY SRAM Stand-by Current VDD = 0V 0.5 1 uA IIDLE Idle Current (VSTBY input) VDD > VSTBY –0.1 0.1 uA VDF SRAM Data Retention Voltage Only on VSTBY 2 VDD – 0.2 V ISB Stand-by Supply Current for Power-down Mode CSI > VDD – 0.3V (Notes 1,2) 120 250 uA ILI Input Leakage Current VSS < VIN < VDD –1 ±0.1 1 uA ILO Output Leakage Current 0.45 < VOUT < VDD –10 ±5 10 uA ICC (DC) (Note 4) Operating Supply Current PLD Only PLD_TURBO = Off, f = 0MHz (Note 4) 0 uA/PT PLD_TURBO = On, f = 0MHz 400 700 uA/PT Flash memory During Flash memory WRITE/Erase Only 15 30 mA Read only, f = 0MHz 0 0 mA SRAM f = 0MHz 0 0 mA ICC (AC) (Note 4) PLD AC Adder Note 3 Flash memory AC Adder 1.5 2.5 mA/ MHz SRAM AC Adder 1.5 3.0 mA/ MHz209/231 uPSD33xx Table 131. PSD Module DC Characteristics (with 3.3V VDD) Note: 1. Internal PD is active. 2. PLD is in non-Turbo mode, and none of the inputs are switching. 3. Please see Figure 86., page 202 for the PLD current calculation. 4. IOUT = 0mA Symbol Parameter Test Condition (in addition to those in Table 129., page 207) Min. Typ. Max. Unit VIH High Level Input Voltage 3.0V < VDD < 3.6V 0.7VDD VDD +0.5 V VIL Low Level Input Voltage 3.0V < VDD < 3.6V –0.5 0.8 V VLKO VDD (min) for Flash Erase and Program 1.5 2.2 V VOL Output Low Voltage IOL = 20uA, VDD = 3.0V 0.01 0.1 V IOL = 4mA, VDD = 3.0V 0.15 0.45 V VOH Output High Voltage Except VSTBY On IOH = –20uA, VDD = 3.0V 2.9 2.99 V IOH = –1mA, VDD = 3.0V 2.7 2.8 V VOH1 Output High Voltage VSTBY On IOH1 = 1uA VSTBY – 0.8 V VSTBY SRAM Stand-by Voltage 2.0 VDD V ISTBY SRAM Stand-by Current VDD = 0V 0.5 1 uA IIDLE Idle Current (VSTBY input) VDD > VSTBY –0.1 0.1 uA VDF SRAM Data Retention Voltage Only on VSTBY 2 VDD – 0.2 V ISB Stand-by Supply Current for Power-down Mode CSI > VDD – 0.3V (Notes 1,2) 50 100 uA ILI Input Leakage Current VSS < VIN < VDD –1 ±0.1 1 uA ILO Output Leakage Current 0.45 < VIN < VDD –10 ±5 10 uA ICC (DC) (Note 4) Operating Supply Current PLD Only PLD_TURBO = Off, f = 0MHz (Note 2) 0 uA/PT PLD_TURBO = On, f = 0MHz 200 400 uA/PT Flash memory During Flash memory WRITE/Erase Only 10 25 mA Read only, f = 0MHz 0 0 mA SRAM f = 0MHz 0 0 mA ICC (AC) (Note 4) PLD AC Adder Note 3 Flash memory AC Adder 1.0 1.5 mA/ MHz SRAM AC Adder 0.8 1.5 mA/ MHzuPSD33xx 210/231 Figure 88. External PSEN/READ Cycle (80-pin Device Only) Table 132. External PSEN or READ Cycle AC Characteristics (3V or 5V Device) Note: 1. BUSCON Register is configured for 4 PFQCLK. 2. Refer to Table 133 for “n” and “m” values. Table 133. n, m, and x, y Values Symbol Parameter 40MHz Oscillator(1) Variable Oscillator 1/tCLCL = 8 to 40MHz Unit Min Max Min Max tLHLL ALE pulse width 17 tCLCL – 8 ns tAVLL Address setup to ALE 13 tCLCL – 12 ns tLLAX Address hold after ALE 7.5 0.5tCLCL – 5 ns tLLPL ALE to PSEN or RD 7.5 0.5tCLCL – 5 ns tPLPH PSEN or RD pulse width(2) 40 ntCLCL – 10 ns tPXIX Input instruction/data hold after PSEN or RD 2 2 ns tPHIZ Input instruction/data float after PSEN or RD 10.5 0.5tCLCL – 2 ns tPXAV Address hold after PSEN or RD 7.5 0.5tCLCL – 5 ns tAVIV Address to valid instruction/data in(2) 70 mtCLCL – 5 ns tAZPL Address float to PSEN or RD –2 –2 ns # of PFQCLK in BUSCON Reg. PSEN (code) Cycle READ Cycle WRITE Cycle nmnmx y 3 12- - - - 4 232321 5 343432 6 454543 7 - - 5654 tAVLL tPLPH tPXIZ tAVIV211/231 uPSD33xx Figure 89. External WRITE Cycle (80-pin Device Only) Table 134. External WRITE Cycle AC Characteristics (3V or 5V Device) Note: 1. BUSCON Register is configured for 4 PFQCLK. 2. Refer to Table 135, page 151 for “n” and “m” values. Table 135. External Clock Drive Symbol Parameter 40MHz Oscillator(1) Variable Oscillator 1/tCLCL = 8 to 40MHz Unit Min Max Min Max tLHLL ALE pulse width 17 tCLCL – 8 ns tAVLL Address Setup to ALE 13 tCLCL – 12 ns tLLAX Address hold after ALE 7.5 0.5tCLCL – 5 ns tWLWH WR pulse width(2) 40 xtCLCL – 10 ns tLLWL ALE to WR 7.5 0.5tCLCL – 5 ns tAVWL Address valid to WR 27.5 1.5tCLCL – 10 ns tWHLH WR High to ALE High 6.5 14.5 0.5tCLCL – 6 0.5tCLCL + 2 ns tQVWH Data setup before WR(y) 20 ytCLCL – 5 ns tWHQX Data hold after WR 6.5 14.5 0.5tCLCL – 6 0.5tCLCL + 2 ns Symbol Parameter(1) 40MHz Oscillator Variable Oscillator 1/tCLCL = 8 to 40MHz Unit Min Max Min Max tCLCL Oscillator period 25 125 ns tCHCX High time 10 tCLCL – tCLCX ns tCLCX Low time 10 tCLCL – tCLCX ns tCLCH Rise time 10 ns tCHCL Fall time 10 ns MCU A8 - A11 MCU AD0 - AD7 ALE WR PSEN A8-A11 A8-A11 tLLWL tWLWH tAVLL tLHLL tQVWH A0-A7 DATA OUT A0-A7 INSTR IN tLLAX tAVWL tWHQX tWHLH AI07877uPSD33xx 212/231 Table 136. A/D Analog Specification Note: 1. fIN 2kHz, ACLK = 8MHz, AVREF = VCC = 3.3V 2. AVREF = VCC in 52-pin package. Symbol Parameter Test Conditions(1) Min. Typ. Max. Unit IDD Normal Input = AVREF 4.0 mA Power-down 40 uA AVIN Analog Input Voltage GND AVREF V AVREF(2) Analog Reference Voltage 3.6 V Accuracy Resolution 10 bits INL Integral Nonlinearity Input = 0 to AVREF (V) FOSC ≤ 32MHz ±2 LSB DNL Differential Nonlinearity Input = 0 to AVREF (V) FOSC ≤ 32MHz ±2 LSB SNR Signal to Noise Ratio fSAMPLE = 500ksps 50 54 dB SNDR Signal to Noise Distortion Ratio 48 52 dB ACLK ADC Clock 2 8 16 MHz tC Conversion Time 8MHz 1 4 8 µs tCAL Power-up Time Calibration Time 16 ms fIN Analog Input Frequency 60 kHz THD Total Harmonic Distortion 50 54 dB213/231 uPSD33xx Figure 90. Input to Output Disable / Enable Table 137. CPLD Combinatorial Timing (5V PSD Module) Note: 1. Fast Slew Rate output available on PA3-PA0, PB3-PB0, and PD2-PD1. Decrement times by given amount 2. tPD for MCU address and control signals refers to delay from pins on Port 0, Port 2, RD WR, PSEN and ALE to CPLD combinatorial output (80-pin package only) Table 138. CPLD Combinatorial Timing (3V PSD Module) Note: 1. Fast Slew Rate output available on PA3-PA0, PB3-PB0, and PD2-PD1. Decrement times by given amount 2. tPD for MCU address and control signals refers to delay from pins on Port 0, Port 2, RD WR, PSEN and ALE to CPLD combinatorial output (80-pin package only) Symbol Parameter Conditions Min Max PT Aloc Turbo Off Slew rate(1) Unit tPD(2) CPLD Input Pin/Feedback to CPLD Combinatorial Output 20 + 2 + 10 – 2 ns tEA CPLD Input to CPLD Output Enable 21 + 10 – 2 ns tER CPLD Input to CPLD Output Disable 21 + 10 – 2 ns tARP CPLD Register Clear or Preset Delay 21 + 10 – 2 ns tARPW CPLD Register Clear or Preset Pulse Width 10 + 10 ns tARD CPLD Array Delay Any macrocell 11 + 2 ns Symbol Parameter Conditions Min Max PT Aloc Turbo Off Slew rate(1) Unit tPD(2) CPLD Input Pin/Feedback to CPLD Combinatorial Output 35 + 4 + 20 – 6 ns tEA CPLD Input to CPLD Output Enable 38 + 20 – 6 ns tER CPLD Input to CPLD Output Disable 38 + 20 – 6 ns tARP CPLD Register Clear or Preset Delay 35 + 20 – 6 ns tARPW CPLD Register Clear or Preset Pulse Width 18 + 20 ns tARD CPLD Array Delay Any macrocell 20 + 4 ns tER tEA INPUT INPUT TO OUTPUT ENABLE/DISABLE AI02863uPSD33xx 214/231 Figure 91. Synchronous Clock Mode Timing – PLD Table 139. CPLD Macrocell Synchronous Clock Mode Timing (5V PSD Module) Note: 1. Fast Slew Rate output available on PA3-PA0, PB3-PB0, and PD2-PD1. Decrement times by given amount. 2. CLKIN (PD1) tCLCL = tCH + tCL.105 3. Symbol Parameter Conditions Min Max PT Aloc Turbo Off Slew rate(1) Unit fMAX Maximum Frequency External Feedback 1/(tS+tCO) 40.0 MHz Maximum Frequency Internal Feedback (fCNT) 1/(tS+tCO–10) 66.6 MHz Maximum Frequency Pipelined Data 1/(tCH+tCL) 83.3 MHz tS Input Setup Time 12 + 2 + 10 ns tH Input Hold Time 0 ns tCH Clock High Time Clock Input 6 ns tCL Clock Low Time Clock Input 6 ns tCO Clock to Output Delay Clock Input 13 – 2 ns tARD CPLD Array Delay Any macrocell 11 + 2 ns tMIN Minimum Clock Period(2) tCH+tCL 12 ns tCH tCL tCO tS tH CLKIN INPUT REGISTERED OUTPUT AI02860215/231 uPSD33xx Table 140. CPLD Macrocell Synchronous Clock Mode Timing (3V PSD Module) Note: 1. Fast Slew Rate output available on PA3-PA0, PB3-PB0, and PD2-PD1. Decrement times by given amount. 2. CLKIN (PD1) tCLCL = tCH + tCL. Symbol Parameter Conditions Min Max PT Aloc Turbo Off Slew rate(1) Unit fMAX Maximum Frequency External Feedback 1/(tS+tCO) 23.2 MHz Maximum Frequency Internal Feedback (fCNT) 1/(tS+tCO–10) 30.3 MHz Maximum Frequency Pipelined Data 1/(tCH+tCL) 40.0 MHz tS Input Setup Time 20 + 4 + 15 ns tH Input Hold Time 0 ns tCH Clock High Time Clock Input 15 ns tCL Clock Low Time Clock Input 10 ns tCO Clock to Output Delay Clock Input 23 – 6 ns tARD CPLD Array Delay Any macrocell 20 + 4 ns tMIN Minimum Clock Period(2) tCH+tCL 25 nsuPSD33xx 216/231 Figure 92. Asynchronous RESET / Preset Figure 93. Asynchronous Clock Mode Timing (Product Term Clock) Table 141. CPLD Macrocell Asynchronous Clock Mode Timing (5V PSD Module) Symbol Parameter Conditions Min Max PT Aloc Turbo Off Slew Rate Unit fMAXA Maximum Frequency External Feedback 1/(tSA+tCOA) 38.4 MHz Maximum Frequency Internal Feedback (fCNTA) 1/(tSA+tCOA–10) 62.5 MHz Maximum Frequency Pipelined Data 1/(tCHA+tCLA) 71.4 MHz tSA Input Setup Time 7 + 2 + 10 ns tHA Input Hold Time 8 ns tCHA Clock Input High Time 9 + 10 ns tCLA Clock Input Low Time 9 + 10 ns tCOA Clock to Output Delay 21 + 10 – 2 ns tARDA CPLD Array Delay Any macrocell 11 + 2 ns tMINA Minimum Clock Period 1/fCNTA 16 ns tARP REGISTER OUTPUT tARPW RESET/PRESET INPUT AI02864 tCHA tCLA tCOA tSA tHA CLOCK INPUT REGISTERED OUTPUT AI02859217/231 uPSD33xx Table 142. CPLD Macrocell Asynchronous Clock Mode Timing (3V PSD Module) Symbol Parameter Conditions Min Max PT Aloc Turbo Off Slew Rate Unit fMAXA Maximum Frequency External Feedback 1/(tSA+tCOA) 21.7 MHz Maximum Frequency Internal Feedback (fCNTA) 1/(tSA+tCOA–10) 27.8 MHz Maximum Frequency Pipelined Data 1/(tCHA+tCLA) 33.3 MHz tSA Input Setup Time 10 + 4 + 15 ns tHA Input Hold Time 12 ns tCHA Clock High Time 17 + 15 ns tCLA Clock Low Time 13 + 15 ns tCOA Clock to Output Delay 31 + 15 – 6 ns tARD CPLD Array Delay Any macrocell 20 + 4 ns tMINA Minimum Clock Period 1/fCNTA 36 nsuPSD33xx 218/231 Figure 94. Input Macrocell Timing (Product Term Clock) Table 143. Input Macrocell Timing (5V PSD Module) Note: 1. Inputs from Port A, B, and C relative to register/ latch clock from the PLD. ALE/AS latch timings refer to tAVLX and tLXAX. Table 144. Input Macrocell Timing (3V PSD Module) Note: 1. Inputs from Port A, B, and C relative to register/latch clock from the PLD. ALE latch timings refer to tAVLX and tLXAX. Symbol Parameter Conditions Min Max PT Aloc Turbo Off Unit tIS Input Setup Time (Note 1) 0 ns tIH Input Hold Time (Note 1) 15 + 10 ns tINH NIB Input High Time (Note 1) 9 ns tINL NIB Input Low Time (Note 1) 9 ns tINO NIB Input to Combinatorial Delay (Note 1) 34 + 2 + 10 ns Symbol Parameter Conditions Min Max PT Aloc Turbo Off Unit tIS Input Setup Time (Note 1) 0 ns tIH Input Hold Time (Note 1) 25 + 15 ns tINH NIB Input High Time (Note 1) 12 ns tINL NIB Input Low Time (Note 1) 12 ns tINO NIB Input to Combinatorial Delay (Note 1) 43 + 4 + 15 ns tINH tINL tINO tIH tIS PT CLOCK INPUT OUTPUT AI03101219/231 uPSD33xx Table 145. Program, WRITE and Erase Times (5V, 3V PSD Modules) Note: 1. Programmed to all zero before erase. 2. Typical after 100K program/erase cycle is 5 seconds. 3. The polling status, DQ7, is valid tQ7VQV time units before the data byte, DQ0-DQ7, is valid for reading. Symbol Parameter Min. Typ. Max. Unit Flash Program 8.5 s Flash Bulk Erase(1) (pre-programmed) 3(2) 10 s Flash Bulk Erase (not pre-programmed) 5 s tWHQV3 Sector Erase (pre-programmed) 1 10 s tWHQV2 Sector Erase (not pre-programmed) 2.2 s tWHQV1 Byte Program 14 150 µs Program/Erase Cycles (per Sector) 100,000 cycles PLD Program/Erase Cycles 1000 cycles tWHWLO Sector Erase Time-Out 100 µs tQ7VQV DQ7 Valid to Output (DQ7-DQ0) Valid (Data Polling)(3) 30 nsuPSD33xx 220/231 Figure 95. Peripheral I/O READ Timing Table 146. Port A Peripheral Data Mode READ Timing (5V PSD Module) Note: 1. Any input used to select Port A Data Peripheral Mode. 2. Data is already stable on Port A. Table 147. Port A Peripheral Data Mode READ Timing (3V PSD Module) Note: 1. Any input used to select Port A Data Peripheral Mode. 2. Data is already stable on Port A. Symbol Parameter Conditions Min Max Turbo Off Unit tAVQV–PA Address Valid to Data Valid (Note 1) 37 + 10 ns tSLQV–PA CSI Valid to Data Valid 27 + 10 ns tRLQV–PA RD to Data Valid (Note 2) 32 ns tDVQV–PA Data In to Data Out Valid 22 ns tRHQZ–PA RD to Data High-Z 23 ns Symbol Parameter Conditions Min Max Turbo Off Unit tAVQV–PA Address Valid to Data Valid (Note 1) 50 + 20 ns tSLQV–PA CSI Valid to Data Valid 37 + 20 ns tRLQV–PA RD to Data Valid (Note 2) 45 ns tDVQV–PA Data In to Data Out Valid 38 ns tRHQZ–PA RD to Data High-Z 36 ns tRLQV (PA) tDVQV (PA) tRHQZ (PA) tSLQV (PA) tAVQV (PA) ADDRESS DATA VALID ALE A/D BUS RD DATA ON PORT A CSI AI06610221/231 uPSD33xx Figure 96. Peripheral I/O WRITE Timing Table 148. Port A Peripheral Data Mode WRITE Timing (5V PSD Module) Note: 1. Data stable on Port 0 pins to data on Port A. Table 149. Port A Peripheral Data Mode WRITE Timing (3V PSD Module) Note: 1. Data stable on Port 0 pins to data on Port A. Table 150. Supervisor Reset and LVD Note: 1. 25µs minimum to abort a Flash memory program or erase cycle in progress. 2. As FOSC decreases, tRST_ACTV increases. Example: tRST_ACTV = 50ms when FOSC = 8MHz. Symbol Parameter Conditions Min Max Unit tWLQV–PA WR to Data Propagation Delay 25 ns tDVQV–PA Data to Port A Data Propagation Delay (Note 1) 22 ns tWHQZ–PA WR Invalid to Port A Tri-state 20 ns Symbol Parameter Conditions Min Max Unit tWLQV–PA WR to Data Propagation Delay 42 ns tDVQV–PA Data to Port A Data Propagation Delay (Note 1) 38 ns tWHQZ–PA WR Invalid to Port A Tri-state 33 ns Symbol Parameter Conditions Min Typ Max Unit tRST_LO_IN Reset Input Duration 1(1) µs tRST_ACTV Generated Reset Duration fOSC = 40MHz 10(2) ms tRST_FIL Reset Input Spike Filter 1 µs VRST_HYS Reset Input Hysteresis VCC = 3.3V 0.1 V VRST_THRESH LVD Trip Threshold VCC = 3.3V 2.4 2.6 2.8 V tDVQV (PA) tWLQV (PA) tWHQZ (PA) A/D BUS ADDRESS DATA OUT WR PORT A DATA OUT ALE AI06611uPSD33xx 222/231 Table 151. VSTBYON Definitions Timing (5V, 3V PSD Modules) Note: 1. VSTBYON timing is measured at VCC ramp rate of 2ms. Figure 97. ISC Timing Table 152. ISC Timing (5V PSD Module) Note: 1. For non-PLD Programming, Erase or in ISC By-pass Mode. 2. For Program or Erase PLD only. Symbol Parameter Conditions Min Typ Max Unit tBVBH VSTBY Detection to VSTBYON Output High (Note 1) 20 µs tBXBL VSTBY Off Detection to VSTBYON Output Low (Note 1) 20 µs Symbol Parameter Conditions Min Max Unit tISCCF Clock (TCK, PC1) Frequency (except for PLD) (Note 1) 20 MHz tISCCH Clock (TCK, PC1) High Time (except for PLD) (Note 1) 23 ns tISCCL Clock (TCK, PC1) Low Time (except for PLD) (Note 1) 23 ns tISCCFP Clock (TCK, PC1) Frequency (PLD only) (Note 2) 5 MHz tISCCHP Clock (TCK, PC1) High Time (PLD only) (Note 2) 90 ns tISCCLP Clock (TCK, PC1) Low Time (PLD only) (Note 2) 90 ns tISCPSU ISC Port Set Up Time 7 ns tISCPH ISC Port Hold Up Time 5 ns tISCPCO ISC Port Clock to Output 21 ns tISCPZV ISC Port High-Impedance to Valid Output 21 ns tISCPVZ ISC Port Valid Output to High-Impedance 21 ns ISCCH TCK TDI/TMS ISC OUTPUTS/TDO ISC OUTPUTS/TDO t tISCCL tISCPSU tISCPH tISCPVZ t ISCPZV tISCPCO AI02865223/231 uPSD33xx Table 153. ISC Timing (3V PSD Module) Note: 1. For non-PLD Programming, Erase or in ISC By-pass Mode. 2. For Program or Erase PLD only. Figure 98. MCU Module AC Measurement I/O Waveform Note: AC inputs during testing are driven at VCC–0.5V for a logic '1,' and 0.45V for a logic '0.' Timing measurements are made at VIH(min) for a logic '1,' and VIL(max) for a logic '0' Figure 99. PSD Module AC Float I/O Waveform Note: For timing purposes, a Port pin is considered to be no longer floating when a 100mV change from load voltage occurs, and begins to float when a 100mV change from the loaded VOH or VOL level occurs IOL and IOH ≥ 20mA Symbol Parameter Conditions Min Max Unit tISCCF Clock (TCK, PC1) Frequency (except for PLD) (Note 1) 12 MHz tISCCH Clock (TCK, PC1) High Time (except for PLD) (Note 1) 40 ns tISCCL Clock (TCK, PC1) Low Time (except for PLD) (Note 1) 40 ns tISCCFP Clock (TCK, PC1) Frequency (PLD only) (Note 2) 5 MHz tISCCHP Clock (TCK, PC1) High Time (PLD only) (Note 2) 90 ns tISCCLP Clock (TCK, PC1) Low Time (PLD only) (Note 2) 90 ns tISCPSU ISC Port Set Up Time 12 ns tISCPH ISC Port Hold Up Time 5 ns tISCPCO ISC Port Clock to Output 30 ns tISCPZV ISC Port High-Impedance to Valid Output 30 ns tISCPVZ ISC Port Valid Output to High-Impedance 30 ns AI06650 VCC – 0.5V 0.45V Test Points 0.2 VCC – 0.1V 0.2 VCC + 0.9V AI06651 Test Reference Points VOL + 0.1V VOH – 0.1V VLOAD – 0.1V VLOAD + 0.1V 0.2 VCC – 0.1VuPSD33xx 224/231 Figure 100. External Clock Cycle Figure 101. PSD Module AC Measurement I/O Waveform Figure 102. PSD Module AC Measurement Load Circuit Table 154. I/O Pin Capacitance Note: 1. Sampled only, not 100% tested. 2. Typical values are for TA = 25°C and nominal supply voltages. 3. Maximum for MCU Address and Data lines is 20pF each. 3.0V 0V Test Point 1.5V AI03103b Device Under Test 2.01 V 195 Ω CL = 30 pF (Including Scope and Jig Capacitance) AI03104b Symbol Parameter(1) Test Condition Typ.2 Max. Unit CIN Input Capacitance (for input pins) VIN = 0V 4 6 pF COUT Output Capacitance (for input/ output pins)(3) VOUT = 0V 8 12 pF225/231 uPSD33xx PACKAGE MECHANICAL INFORMATION Figure 103. TQFP52 – 52-lead Plastic Thin, Quad, Flat Package Outline Note: Drawing is not to scale. QFP-A Nd E1 CP b e A2 A N A1 α L D1 D 1 Ne E c D2 E2 L1uPSD33xx 226/231 Table 155. TQFP52 – 52-lead Plastic Thin, Quad, Flat Package Mechanical Data Symb mm inches Typ Min Max Typ Min Max A 1.50 – 1.70 0.059 – 0.067 A1 0.10 0.05 0.20 0.004 0.002 0.008 A2 1.40 1.30 1.50 0.055 0.039 0.059 b – 0.20 0.40 – 0.008 0.016 c – 0.07 0.20 – 0.003 0.008 D 12.00 11.80 12.20 0.472 0.465 0.480 D1 10.00 9.80 10.20 0.394 0.386 0.402 D2 7.80 7.67 7.93 0.307 0.302 0.312 E 12.00 11.80 12.20 0.472 0.465 0.480 E1 10.00 9.80 10.20 0.394 0.386 0.402 E2 7.80 7.67 7.93 0.307 0.302 0.312 e 0.65 – – 0.026 – – L – 0.45 0.75 – 0.018 0.030 L1 1.00 – – 0.039 – – α – 0° 7° – 0° 7° n 52 52 Nd 13 13 Ne 13 13 CP – – 0.10 – – 0.004227/231 uPSD33xx Figure 104. TQFP80 – 80-lead Plastic Thin, Quad, Flat Package Outline Note: Drawing is not to scale. QFP-A Nd E1 CP b e A2 A N A1 α L D1 D 1 Ne E c D2 E2 L1uPSD33xx 228/231 Table 156. TQFP80 – 80-lead Plastic Thin, Quad, Flat Package Mechanical Data Symb mm inches Typ Min Max Typ Min Max A 1.60 0.063 A1 0.05 0.15 0.002 0.006 A2 1.40 1.35 1.45 0.055 0.053 0.057 b 0.17 0.27 0.007 0.011 c 0.09 0.20 0.004 0.008 D 14.00 0.551 D1 12.00 0.472 D2 9.50 0.374 E 14.00 0.551 E1 12.00 0.472 E2 9.50 0.374 e 0.50 0.020 L 0.45 0.75 0.018 0.030 L1 1.00 0.039 α 0° 7° 0° 7° n 80 80 Nd 20 20 Ne 20 20 CP 0.08 0.003229/231 uPSD33xx PART NUMBERING Table 157. Ordering Information Scheme For a list of available options (e.g., Speed, Package) or for further information on any aspect of this device, please contact the ST Sales Office nearest to you. Example: uPSD 33 3 4 D V – 40 U 6 T Device Type uPSD = Microcontroller PSD Family 33 = Turbo core SRAM Size 1 = 2Kbyte 3 = 8Kbyte 5 = 32Kbyte Main Flash Memory Size 2 = 64Kbyte 3 = 128Kbyte 4 = 256Kbyte IP Mix D = IP Mix: I2C, SPI, UART (2), IrDA, ADC, Supervisor, PCA Operating Voltage blank = VCC = 4.5 to 5.5V V = VCC = 3.0 to 3.6V Speed –40 = 40MHz Package T = 52-pin TQFP U = 80-pin TQFP Temperature Range 6 = –40 to 85°C Shipping Option Tape & Reel Packing = TuPSD33xx 230/231 REVISION HISTORY Table 158. Document Revision History Date Version Revision Details July 1, 2003 1.0 First Issue 15-Jul-03 1.1 Update register information, electrical characteristics (Table 17, 46, 132, 133, 134, 135; Figure 68) 03-Sep-03 1.2 Update references for Product Catalog 05-Feb-04 2.0 Reformatted; corrected mechanical dimensions (Table 158) 07-May-04 3.0 Reformatted; update characteristics (Figure 3, 4, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84; Table 42, 64, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, 113, 114, 115, 116, 117, 118, 121, 129, 130, 131, 136) 14-Sep-04 4.0 Reformatted; updated Feature Summary; added table (Table 128); updated graphics, mechanical dimensions (Figure 3, 4, 37, 40, 51, 76, 80; Table 2, 3, 6, 7, 8, 9, 10, 11, 37, 38, 40, 51, 77, 84, 119, 120, 121, 129, 155, 156) 29-Oct-04 5.0 Corrected TQFP80 mechanical dimensions (Table 156) 21-Jan-05 6.0 Updated characteristics, SPI section (Figure 3, 41, 42, 45; Table 59, 60, 61, 62, 128, 138, 140, 142, 144, 145, 152, 153)231/231 uPSD33xx Information furnished is believed to be accurate and reliable. However, STMicroelectronics assumes no responsibility for the consequences of use of such information nor for any infringement of patents or other rights of third parties which may result from its use. No lii96ns0.71(i96 i)-12.1-s granted by implication or otherwise under any patent or patent rights of STMicroelectronics. Specifications mentioned in this publication are subject ESMT M52D32321A Elite Semiconductor Memory Technology Inc. Publication Date : Jul. 2007 Revision : 1.4 1/29 Revision History : Revision 1.0 (Nov. 02, 2006) -Original Revision 1.1 (Mar. 02, 2007) - Delete BGA ball name of packing dimensions Revision 1.2 (May. 03, 2007) - Modify DC Characteristics Revision 1.3 (May. 14, 2007) - Modify tSS (1.5ns => 2.5ns) and tSH(1ns => 1.5ns) Revision 1.4 (Jul. 10, 2007) - Modify type error ESMT M52D32321A Elite Semiconductor Memory Technology Inc. Publication Date : Jul. 2007 Revision : 1.4 2/29 SDRAM 512K x 32Bit x 2Banks Synchronous DRAM FEATURES z 1.8V power supply z LVCMOS compatible with multiplexed address z Dual banks operation z MRS cycle with address key programs - CAS Latency (1, 2 & 3 ) - Burst Length (1, 2, 4, 8 & full page) - Burst Type (Sequential & Interleave) z EMRS cycle with address key programs. z All inputs are sampled at the positive going edge of the system clock z Burst Read Single-bit Write operation z Special Function Support. - PASR (Partial Array Self Refresh ) - TCSR (Temperature compensated Self Refresh) - DS (Driver Strength) z DQM for masking z Auto & self refresh z 64ms refresh period (4K cycle) GENERAL DESCRIPTION The M52D32321A is 33,554,432 bits synchronous high data rate Dynamic RAM organized as 2 x 524,288 words by 32 bits, fabricated with high performance CMOS technology. Synchronous design allows precise cycle control with the use of system clock I/O transactions are possible on every clock cycle. Range of operating frequencies, programmable burst length and programmable latencies allow the same device to be useful for a variety of high bandwidth, high performance memory system applications. ORDERING INFORMATION Part NO. MAX Freq. Package Comments M52D32321A -10BG 100MHz 90 Ball VFBGA Pb-free M52D32321A -7.5BG 133MHz 90 Ball VFBGA Pb-free PIN CONFIGURATION (TOP VIEW) 90 Ball FBGA 1 2 3 4 5 6 7 8 9 A DQ26 DQ24 VSS VDD DQ23 DQ21 B DQ28 VDDQ VSSQ VDDQ VSSQ DQ19 C VSSQ DQ27 DQ25 DQ22 DQ20 VDDQ D VSSQ DQ29 DQ30 DQ17 DQ18 VDDQ E VDDQ DQ31 NC NC DQ16 VSSQ F VSS DQM3 A3 A2 DQM2 VDD G A4 A5 A6 A10 A0 A1 H A7 A8 NC NC NC NC J CLK CKE A9 BA CS RAS K DQM1 NC NC CAS WE DQM0 L VDDQ DQ8 VSS VDD DQ7 VSSQ M VSSQ DQ10 DQ9 DQ6 DQ5 VDDQ N VSSQ DQ12 DQ14 DQ1 DQ3 VDDQ P DQ11 VDDQ VSSQ VDDQ VSSQ DQ4 R DQ13 DQ15 VSS VDD DQ0 DQ2ESMT M52D32321A Elite Semiconductor Memory Technology Inc. Publication Date : Jul. 2007 Revision : 1.4 3/29 FUNCTIONAL BLOCK DIAGRAM Bank Select Data Input Register Column Decoder Latency & Burst Length Programming Register 512K x 32 512K x 32 Timing Register CLK CKE CS RAS CAS WE L(U)DQM LDQM LWCBR DQi LDQM LWE LRAS LCBR LWE LCAS CLK ADD LCKE PIN FUNCTION DESCRIPTION Pin Name Input Function CLK System Clock Active on the positive going edge to sample all inputs. CS Chip Select Disables or enables device operation by masking or enabling all inputs except CLK, CKE and L(U)DQM. CKE Clock Enable Masks system clock to freeze operation from the next clock cycle. CKE should be enabled at least one cycle prior to new command. Disable input buffers for power down in standby. A0 ~ A10 Address Row / column addresses are multiplexed on the same pins. Row address : RA0 ~ RA10, column address : CA0 ~ CA7 BA Bank Select Address Selects bank to be activated during row address latch time. Selects bank for read/write during column address latch time. RAS Row Address Strobe Latches row addresses on the positive going edge of the CLK with RAS low. Enables row access & precharge. CAS Column Address Strobe Latches column addresses on the positive going edge of the CLK with CAS low. Enables column access. WE Write Enable Enables write operation and row precharge. Latches data in starting from CAS , WE active. L(U)DQM Data Input / Output Mask Makes data output Hi-Z, tSHZ after the clock and masks the output. Blocks data input when L(U)DQM active. ESMT M52D32321A Elite Semiconductor Memory Technology Inc. Publication Date : Jul. 2007 Revision : 1.4 4/29 DQ0 ~ 31 Data Input / Output Data inputs/outputs are multiplexed on the same pins. VDD/VSS Power Supply/Ground Power and ground for the input buffers and the core logic. VDDQ/VSSQ Data Output Power/Ground Isolated power supply and ground for the output buffers to provide improved noise immunity. N.C/RFU No Connection/ Reserved for Future Use This pin is recommended to be left No Connection on the device. ABSOLUTE MAXIMUM RATINGS Parameter Symbol Value Unit Voltage on any pin relative to VSS VIN,VOUT -1.0 ~ 4.6 V Voltage on VDD supply relative to VSS VDD,VDDQ -1.0 ~ 4.6 V Storage temperature TSTG -55 ~ + 150 °C Power dissipation PD 0.7 W Short circuit current IOS 50 MA Note: Permanent device damage may occur if ABSOLUTE MAXIMUM RATINGS are exceeded. Functional operation should be restricted to recommended operating condition. Exposure to higher than recommended voltage for extended periods of time could affect device reliability. DC OPERATING CONDITIONS Recommended operating conditions (Voltage referenced to VSS = 0V, TA= 0 °C ~ 70 °C ) Parameter Symbol Min Typ Max Unit Note Supply voltage VDD,VDDQ 1.7 1.8 1.9 V Input logic high voltage VIH 0.8 x VDDQ 1.8 VDDQ+0.3 V 1 Input logic low voltage VIL -0.3 0 0.3 V 2 Output logic high voltage VOH VDDQ – 0.2 - - V IOH =-0.1mA Output logic low voltage VOL - - 0.2 V IOL = 0.1mA Input leakage current IIL -10 - 10 uA 3 Output leakage current IOL -10 - 10 uA 4 Note : 1.VIH (max) = 2.2V AC for pulse width ≤ 3ns acceptable. 2.VIL (min) = -1.0V AC for pulse width ≤ 3ns acceptable. 3.Any input 0V ≤ VIN ≤ VDDQ, all other pins are not under test = 0V. 4.Dout is disabled, 0V ≤ VOUT ≤ VDDQ. CAPACITANCE (VDD = 1.8V, TA = 25 °C , f = 1MHz) Pin Symbol Min Max Unit CLOCK CCLK 2.0 4.0 pF RAS , CAS , WE , CS , CKE, LDQM, UDQM CIN 2.0 4.0 pF ADDRESS CADD 2.0 4.0 pF DQ0 ~DQ15 COUT 3.5 6.0 pF ESMT M52D32321A Elite Semiconductor Memory Technology Inc. Publication Date : Jul. 2007 Revision : 1.4 5/29 DC CHARACTERISTICS (Recommended operating condition unless otherwise noted, TA = 0 °C ~ 70 °C ) Version Parameter Symbol Test Condition CAS Latency -7.5 -10 Unit Note Operating Current (One Bank Active) ICC1 Burst Length = 1 tRC ≥ tRC (min), tCC ≥ tCC (min), IOL= 0mA 55 35 mA 1 Precharge Standby ICC2P CKE ≤ VIL(max), tCC =15ns 0.3 mA Current in power-down mode ICC2PS CKE ≤ VIL(max), CLK ≤ VIL(max), tCC = ∞ 0.2 mA ICC2N CKE ≥ VIH(min), CS ≥ VIH(min), tCC =15ns Input signals are changed one time during 30ns 3 mA Precharge Standby Current in non power-down mode ICC2NS CKE ≥ VIH(min), CLK ≤ VIL(max), tCC = ∞ Input signals are stable 1 mA ICC3P CKE ≤ VIL(max), tCC =15ns 1.5 Active Standby Current in power-down mode ICC3PS CKE ≤ VIL(max), CLK ≤ VIL(max), tCC = ∞ 1 mA ICC3N CKE ≥ VIH(min), CS ≥ VIH(min), tCC=15ns Input signals are changed one time during 30ns Active Standby Current 10 mA in non power-down mode (One Bank Active) ICC3NS CKE ≥ VIH (min), CLK ≤ VIL(max), tCC= ∞ Input signals are stable 2.5 mA Operating Current (Burst Mode) ICC4 IOL= 0Ma, Page Burst All Band Activated, tCCD = tCCD (min) 70 60 mA 1 Refresh Current ICC5 tRC ≥ tRC(min) 40 40 mA 2 TCSR range 45 70 °C Self Refresh Current ICC6 CKE ≤ 0.2V 2 Banks 180 200 1 Bank 160 180 uA Deep Power Down Current ICC7 CKE ≤ 0.2V 10 uA Note: 1.Measured with outputs open. Addresses are changed only one time during tCC(min). 2.Refresh period is 64ms. Addresses are changed only one time during tCC(min). ESMT M52D32321A Elite Semiconductor Memory Technology Inc. Publication Date : Jul. 2007 Revision : 1.4 6/29 AC OPERATING TEST CONDITIONS (VDD=1.8V ± 0.1V,TA= 0 C° ~ 70 C° ) Parameter Value Unit Input levels (Vih/Vil) 0.9 x VDDQ / 0.2 V Input timing measurement reference level 0.5 x VDDQ V Input rise and fall time tr / tf = 1 / 1 ns Output timing measurement reference level 0.5 x VDDQ V Output load condition See Fig.2 OPERATING AC PARAMETER (AC operating conditions unless otherwise noted) Version Parameter Symbol -7.5 -10 Unit Note Row active to row active delay tRRD(min) 15 20 ns 1 RAS to CAS delay tRCD(min) 22.5 30 ns 1 Row precharge time tRP(min) 22.5 30 ns 1 tRAS(min) 45 50 ns 1 Row active time tRAS(max) 100 us Row cycle time tRC(min) 67.5 90 ns 1 Last data in to new col. Address delay tCDL(min) 1 CLK 2 Last data in to row precharge tRDL(min) 2 CLK 2 Last data in to burst stop tBDL(min) 1 CLK 2 Col. Address to col. Address delay tCCD(min) 1 CLK 3 CAS latency=3 2 Number of valid output data CAS latency=2 1 ea 4 Note: 1. The minimum number of clock cycles is determined by dividing the minimum time required with clock cycle time and then rounding off to the next higher integer. 2. Minimum delay is required to complete write. 3. All parts allow every cycle column address change. 4. In case of row precharge interrupt, auto precharge and read burst stop. The earliest a precharge command can be issued after a Read command without the loss of data is CL+BL-2 clocks. Z0=50 1.8V Output (Fig.2) AC Output Load Circuit 20 pF Vtt =0.5x VDDQ VOH(DC) = VDDQ-0.2V, IOH = -0.1mA VOL(DC) = 0.2V, IOL = 0.1mA 20 pF Output (Fig.1) DC Output Load circuit 10.6K 13.9K 50ESMT M52D32321A Elite Semiconductor Memory Technology Inc. Publication Date : Jul. 2007 Revision : 1.4 7/29 AC CHARACTERISTICS (AC operating conditions unless otherwise noted) -7.5 -10 Parameter Symbol Min Max Min Max Unit Note CAS Latency =3 7.5 9 CLK cycle time CAS Latency =2 tCC 12 1000 15 1000 ns 1 CLK to valid CAS Latency =3 - 7 - 8 output delay CAS Latency =2 tSAC - 10 - 10 ns 1 Output data hold time tOH 2.0 - 2.0 - ns 2 CLK high pulse width tCH 2.5 - 2.5 - ns 3 CLK low pulse width tCL 2.5 - 2.5 - ns 3 Input setup time tSS 2.5 - 2.5 - ns 3 Input hold time tSH 1.5 - 1.5 - ns 3 CLK to output in Low-Z tSLZ 1 - 1 - ns 2 CAS Latency =3 - 6 - 7 CLK to output in Hi-Z CAS Latency =2 tSHZ - 9 - 10 ns - *All AC parameters are measured from half to half. Note: 1.Parameters depend on programmed CAS latency. 2.If clock rising time is longer than 1ns,(tr/2-0.5)ns should be added to the parameter. 3.Assumed input rise and fall time (tr & tf)=1ns. If tr & tf is longer than 1ns, transient time compensation should be considered, i.e., [(tr+ tf)/2-1]ns should be added to the parameter. ESMT M52D32321A Elite Semiconductor Memory Technology Inc. Publication Date : Jul. 2007 Revision : 1.4 8/29 MODE REGISTER FIELD TABLE TO PROGRAM MODES Register Programmed with MRS Address BA A10/AP A9 A8 A7 A6 A5 A4 A3 A2 A1 A0 Function 0 RFU W.B.L TM CAS Latency BT Burst Length Test Mode CAS Latency Burst Type Burst Length A8 A7 Type A6 A5 A4 Latency A3 Type A2 A1 A0 BT = 0 BT = 1 0 0 Mode Register Set 0 0 0 Reserved 0 Sequential 0 0 0 1 1 0 1 Reserved 0 0 1 1 1 Interleave 0 0 1 2 2 1 0 Reserved 0 1 0 2 0 1 0 4 4 1 1 Reserved 0 1 1 3 0 1 1 8 8 1 0 0 Reserved 1 0 0 Reserved Reserved 1 0 1 Reserved 1 0 1 Reserved Reserved 1 1 0 Reserved 1 1 0 Reserved Reserved 1 1 1 Reserved 1 1 1 Full Page Reserved Full Page Length : 256 ESMT M52D32321A Elite Semiconductor Memory Technology Inc. Publication Date : Jul. 2007 Revision : 1.4 9/29 Extended Mode Register BA A10 A9 A8 A7 A6 A5 A4 A3 A2 A1 A0 Address bus 1 0 ATCSR 0 0 DS TCSR PASR Extended Mode Register A2-0 Self Refresh Coverage 000 Full Array 001 1/2 of Full Array 010 1/4 of Full Array 011 RFU 100 RFU 101 RFU 110 RFU PASR 111 RFU A6-A5 Driver Strength 00 Full Strength 01 1/2 Strength 10 1/4 Strength DS 11 RFU A9 ATCSR ATCSR 0 Enable 1 R TRUTH TABLE (Deep Power Down Mode) COMMAND CKEn-1 CKEn CS RAS CAS WE DQM BA A10/AP A9~A0 Entry H L L H H L X Deep Power Down Mode Exit L H X X X X X X (V= Valid, X= Don’t Care, H= Logic High , L = Logic Low) A4-A3 Maximum Case Temperature 11 85oC 00 70oC 01 45oC TCSR 10 15oC ESMT M52D32321A Elite Semiconductor Memory Technology Inc. Publication Date : Jul. 2007 Revision : 1.4 10/29 Burst Length and Sequence (Burst of Two) Starting Address (column address A0 binary) Sequential Addressing Sequence (decimal) Interleave Addressing Sequence (decimal) 0 0,1 0,1 1 1,0 1,0 (Burst of Four) Starting Address (column address A1-A0, binary) Sequential Addressing Sequence (decimal) Interleave Addressing Sequence (decimal) 00 0,1,2,3 0,1,2,3 01 1,2,3,0 1,0,3,2 10 2,3,0,1 2,3,0,1 11 3,0,1,2 3,2,1,0 (Burst of Eight) Starting Address (column address A2-A0, binary) Sequential Addressing Sequence (decimal) Interleave Addressing Sequence (decimal) 000 0,1,2,3,4,5,6,7 0,1,2,3,4,5,6,7 001 1,2,3,4,5,6,7,0 1,0,3,2,5,4,7,6 010 2,3,4,5,6,7,0,1 2,3,0,1,6,7,4,5 011 3,4,5,6,7,0,1,2 3,2,1,0,7,6,5,4 100 4,5,6,7,0,1,2,3 4,5,6,7,0,1,2,3 101 5,6,7,0,1,2,3,4 5,4,7,6,1,0,3,2 110 6,7,0,1,2,3,4,5 6,7,4,5,2,3,0,1 111 7,0,1,2,3,4,5,6 7,6,5,4,3,2,1,0 Full page burst is an extension of the above tables of Sequential Addressing, with the length being 256 for 1Mx32 divice. POWER UP SEQUENCE 1.Apply power and start clock, attempt to maintain CKE= “H”, L(U)DQM = “H” and the other pin are NOP condition at the inputs. 2.Maintain stable power, stable clock and NOP input condition for a minimum of 200us. 3.Issue precharge commands for all banks of the devices. 4.Issue 2 or more auto-refresh commands. 5.Issue mode register set command to initialize the mode register. Cf.)Sequence of 4 & 5 is regardless of the order.ESMT M52D32321A Elite Semiconductor Memory Technology Inc. Publication Date : Jul. 2007 Revision : 1.4 11/29 SIMPLIFIED TRUTH TABLE COMMAND CKEn-1 CKEn CS RAS CAS WE DQM BA A10/AP A9~A0 Note Mode Register Set H X L L L L X OP CODE 1,2 Register Extended Mode Register Set H X L L L L X OP CODE 1,2 Auto Refresh H 3 Entry H L L L L H X X 3 L H H H 3 Refresh Self Refresh Exit L H H X X X X X 3 Bank Active & Row Addr. H X L L H H X V Row Address Auto Precharge Disable L 4 Read & Column Address Auto Precharge Enable H X L H L H X V H Column Address (A0~A7) 4,5 Write & Column Auto Precharge Disable L 4 Address Auto Precharge Enable H X L H L L X V H Column Address (A0~A7) 4,5 Burst Stop H X L H H L X X 6 Bank Selection V L 4 Precharge Both Banks H X L L H L X X H X 4 H X X X Entry H L L V V V Clock Suspend or X Active Power Down Exit L H X X X X X X H X X X Entry H L L H H H X H X X X Precharge Power Down Mode Exit L H L V V V X X DQM H X V X 7 H H X X X No Operation Command H X L H H H X X Deep Power Down Mode Entry H L L H H L X Exit L H X X X X X X (V= Valid, X= Don’t Care, H= Logic High , L = Logic Low) Note: 1. OP Code: Operation Code A0~A10/AP, BA: Program keys.(@MRS). BA=0 for MRS and BA=1 for EMRS. 2. MRS/EMRS can be issued only at both banks precharge state. A new command can be issued after 2 clock cycle of MRS. 3. Auto refresh functions are as same as CBR refresh of DRAM. The automatical precharge without row precharge command is meant by “Auto”. Auto / self refresh can be issued only at both banks precharge state. 4. BA: Bank select address. If “Low”: at read, write, row active and precharge, bank A is selected. If “High”: at read, write, row active and precharge, bank B is selected. If A10/AP is “High” at row precharge, BA ignored and both banks are selected. 5. During burst read or write with auto precharge, new read/write command can not be issued. Another bank read /write command can be issued after the end of burst. New row active of the associated bank can be issued at tRP after the end of burst. 6. Burst stop command is valid at every burst length. 7. DQM sampled at positive going edge of a CLK masks the data-in at the very CLK (Write DQM latency is 0), but makes Hi-Z state the data-out of 2 CLK cycles after. (Read DQM latency is 2) ESMT M52D32321A Elite Semiconductor Memory Technology Inc. Publication Date : Jul. 2007 Revision : 1.4 12/29 Single Bit Read-Write-Read Cycle (Same Page) @CAS Latency=3, Burst Length=1 : D o n ' t C a r e 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 CLOCK CKE C S RAS CAS ADDR W E D Q DQM A10/AP t C H t C L t C C Row Active BA *Note1 HIGH t RCD t S S t S S t S H t S H t S S t S H t S S t S S t S H t S S t S S t S H R a C a C b C c R b BS BS BS BS BS BS R a Qa D b Q c R b Read Write Read Precharge Row Active t R C t RAS t R P t CCD t RAC *Note2 *Note2,3 *Note2,3 *Note4 *Note2 *Note 3 *Note 3 *Note2,3 t S H t SLZ t SAC t O H t S H t S S t S H *Note 3 *Note4ESMT M52D32321A Elite Semiconductor Memory Technology Inc. Publication Date : Jul. 2007 Revision : 1.4 13/29 *Note: 1. All inputs expect CKE & DQM can be don’t care when CS is high at the CLK high going edge. 2. Bank active & read/write are controlled by BA. BA Active & Read/Write 0 Bank A 1 Bank B 3.Enable and disable auto precharge function are controlled by A10/AP in read/write command. A10/AP BA Operation 0 0 Disable auto precharge, leave bank A active at end of burst. 1 Disable auto precharge, leave bank B active at end of burst. 1 0 Enable auto precharge, precharge bank A at end of burst. 1 Enable auto precharge, precharge bank B at end of burst. 4.A10/AP and BA control bank precharge when precharge command is asserted. A10/AP BA precharge 0 0 Bank A 0 1 Bank B 1 X Both Banks ESMT M52D32321A Elite Semiconductor Memory Technology Inc. Publication Date : Jul. 2007 Revision : 1.4 14/29 Power Up Sequence 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 CLOCK CKE ADDR D Q DQM A10/AP t R P Key RAa RAa Precharge All Banks Auto Refresh Auto Refresh Mode Register Set (A-Bank) Row Active : Don't care t R C t R C High level is necessary High level is necessary BA High-Z CS RAS CAS WE Key KeyESMT M52D32321A Elite Semiconductor Memory Technology Inc. Publication Date : Jul. 2007 Revision : 1.4 15/29 Read & Write Cycle at Same Bank @Burst Length = 4 *Note: 1.Minimum row cycle times is required to complete internal DRAM operation. 2.Row precharge can interrupt burst on any cycle. [CAS Latency-1] number of valid output data is available after Row precharge. Last valid output will be Hi-Z(tSHZ) after the clock. 3.Access time from Row active command. tcc*(tRCD +CAS latency-1)+tSAC 4.Ouput will be Hi-Z after the end of burst.(1,2,4,8 bit burst) Burst can’t end in Full Page Mode. tRCD tRC 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 CLOCK CKE CS RAS CAS ADDR DQM BA CL=2 CL=3 Ra Rb Cb0 tOH tSAC tSHZ tSHZ tRDL Row Active Read Precharge (A-Bank) (A-Bank) (A-Bank) Precharge (A-Bank) Write (A-Bank) Row Active (A-Bank) *Note3 *Note3 *Note4 *Note4 : Don't care *Note1 Qa0 Qa1 Qa2 Qa3 Db0 Db1 Db2 Db3 Qa0 Qa1 Qa2 Qa3 Db0 Db1 Db2 Db3 tRAC tRAC tRDL Ca0 A10/AP Ra Rb HIGH *Note2 WE tO H QC tSACESMT M52D32321A Elite Semiconductor Memory Technology Inc. Publication Date : Jul. 2007 Revision : 1.4 16/29 Page Read & Write Cycle at Same Bank @ Burst Length=4 *Note :1.To write data before burst read ends, DQM should be asserted three cycle prior to write command to avoid bus contention. 2.Row precharge will interrupt writing. Last data input, tRDL before Row precharge, will be written. 3.DQM should mask invalid input data on precharge command cycle when asserting precharge before end of burst. Input data after Row precharge cycle will be masked internally. CLOCK CKE CS RAS CAS BA ADDR A10/AP CL=2 CL=3 WE DQM HIGH tRCD *Note2 Ra Ca0 Cb0 Cc0 Cd0 Ra Qa0 Qa1 Qb0 Qb1 Qb2 Dc0 Dc1 Dd0 Dd1 Qa0 Qa1 Qb0 Qb1 Dc0 Dc1 Dd0 Dd2 tCDL *Note1 Row Active (A-Bank) Read (A-Bank) Read (A-Bank) Write (A-Bank) Write (A-Bank) Precharge (A-Bank) : Don't care DQ 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 tRDL *Note3ESMT M52D32321A Elite Semiconductor Memory Technology Inc. Publication Date : Jul. 2007 Revision : 1.4 17/29 Page Read Cycle at Different Bank @ Burst Length=4 *Note: 1. CS can be don’t cared when RAS , CAS and WE are high at the clock high going dege. 2.To interrupt a burst read by row precharge, both the read and the precharge banks must be the same. CLOCK CKE CS RAS CAS BA ADDR A10/AP CL=2 CL=3 WE DQM HIGH *Note2 RAa CAa RBb RAa Read (A-Bank) Row Active Row Active (B-Bank) (A-Bank) Read (A-Bank) Read (B-Bank) Read (A-Bank) Read (B-Bank) Precharge (A-Bank) : Don't care DQ CBb CAc CBd CAe QAa0 *Note1 RBb 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 QAa1 QAa2 QAa3 QBb0 QBb1 QBb2 QBb3 QAc0 QAc1 QBd0 QBd1 QAe0 QAe1 QAa0 QAa1 QAa2 QAa3 QBb0 QBb1 QBb2 QBb3 QAc0 QAc1 QBd0 QBd1 QAe0 QAe1 ESMT M52D32321A Elite Semiconductor Memory Technology Inc. Publication Date : Jul. 2007 Revision : 1.4 18/29 Page Write Cycle at Different Bank @Burst Length = 4 *Note: 1.To interrupt burst write by Row precharge, DQM should be asserted to mask invalid input data. 2.To interrupt burst write by row precharge, both the write and the precharge banks must be the same. CLOCK CKE CS RAS CAS BA ADDR A10/AP WE DQM HIGH Row Active (A-Bank) Row Active (B-Bank) Write (A-Bank) Precharge (Both Banks) : Don't care DQ Write (A-Bank) Write (B-Bank) Write (B-Bank) DAa0 DAa1 DAa2 DAa3 DBb0 DBb1 DBb2 DBb3 DAc0 DAc1 DBd0 DBd1 RAa RBb RAa CAa RBb CBb CAc CBd *Note2 tCDL tRDL *Note1 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 ESMT M52D32321A Elite Semiconductor Memory Technology Inc. Publication Date : Jul. 2007 Revision : 1.4 19/29 Read & Write Cycle at Different Bank @ Burst Length = 4 *Note: 1.tCDL should be met to complete write.ESMT M52D32321A Elite Semiconductor Memory Technology Inc. Publication Date : Jul. 2007 Revision : 1.4 20/29 Read & Write Cycle with auto Precharge @ Burst Length =4 *Note: 1.tCDL Should be controlled to meet minimum tRAS before internal precharge start (In the case of Burst Length=1 & 2 and BRSW mode) 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 CLOCK CKE CAS ADDR W E D Q DQM A10/AP BA CL=2 CL=3 Row Active ( A - Bank ) Row Active ( B - Bank ) Read with Auto Precharge ( A - Bank ) Auto Precharge Start Point (B-Bank) : D o n ' t C a r e Qa0 Qa1 Qa2 Qa3 Db0 Db1 Db2 Db3 R a Ra Ca R b C b R b Qa0 Qa1 Qa2 Qa3 Db0 Db1 Db2 Db3 Write with Auto Precharge (B-Bank) HIGH Auto Precharge Start Point ( A - Bank) C S RASESMT M52D32321A Elite Semiconductor Memory Technology Inc. Publication Date : Jul. 2007 Revision : 1.4 21/29 Clock Suspension & DQM Operation Cycle @CAS Latency=2, Burst Length=4 *Note:1.DQM is needed to prevent bus contention. CLOCK CKE ADDR D Q DQM A10/AP R a C a C b C c R a Qa0 Qa1 Qa2 Qa3 t SHZ Qb0 Qb1 t SHZ Dc0 Dc2 *Note1 Row Active Read Clock Suspension Read Read DQM Write Write DQM Clock Suspension Write DQM :Don't Care BA C S RAS CAS W E 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19ESMT M52D32321A Elite Semiconductor Memory Technology Inc. Publication Date : Jul. 2007 Revision : 1.4 22/29 Read Interrupted by Precharge Command & Read Burst Stop Cycle @Burst Length =Full page *Note: 1.Burst can’t end in full page mode, so auto precharge can’t issue. 2.About the valid DQs after burst stop, it is same as the case of RAS interrupt. Both cases are illustrated above timing diagram. See the label 1,2 on them. But at burst write, burst stop and RAS interrupt should be compared carefully. Refer the timing diagram of “Full page write burst stop cycle”. 3.Burst stop is valid at every burst length. CLOCK CKE ADDR D Q DQM A10/AP BA RAa CAa CAb RAa QAa0 QAa1 QAb0 QAb1 QAb2 *Note1 Row Active (A-Bank) Read (A-Bank) Burst Stop Read (A-Bank) :Don't Care HIGH CL=2 CL=3 QAa2 QAa3 QAa4 QAb3 QAb4 QAb5 QAa0 QAa1 QAa2 QAa3 QAa4 QAb0 QAb1 QAb2 QAb3 QAb4 QAb5 1 1 2 2 Precharge (A-Bank) 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 CS RAS CAS WE *Note2ESMT M52D32321A Elite Semiconductor Memory Technology Inc. Publication Date : Jul. 2007 Revision : 1.4 23/29 Write Interrupted by Precharge Command & Write Burst stop Cycle @ Burst Length =Full page *Note: 1. Burst can’t end in full page mode, so auto precharge can’t issue. 2.Data-in at the cycle of interrupted by precharge can not be written into the corresponding memory cell. It is defined by AC parameter of tRDL. DQM at write interrupted by precharge command is needed to prevent invalid write. Input data after Row precharge cycle will be masked internally. 3.Burst stop is valid at every burst length. CLOCK CKE ADDR D Q DQM A10/AP RAa CAa CAb RAa DAa0 DAa1 DAb0 DAb1 DAb2 Row Active (A-Bank) Write (A-Bank) Burst Stop Write (A-Bank) :Don't Care HIGH DAa2 DAa3 DAa4 DAb3 DAb4 DAb5 Precharge (A-Bank) t BDL t RDL *Note2 C S RAS CAS W E BA 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19ESMT M52D32321A Elite Semiconductor Memory Technology Inc. Publication Date : Jul. 2007 Revision : 1.4 24/29 Burst Read Single bit Write Cycle @Burst Length=2 *Note:1.BRSW modes is enabled by setting A9 “High” at MRS(Mode Register Set). At the BRSW Mode, the burst length at write is fixed to “1” regardless of programmed burst length. 2.When BRSW write command with auto precharge is executed, keep it in mind that tRAS should not be violated. Auto precharge is executed at the next cycle of burst-end, so in the case of BRSW write command, the precharge command will be issued after two clock cycles. CLOCK CKE ADDR CL=2 DQM A10/AP BA RAa RAc RAa QAb0 Row Active (A-Bank) Write (A-Bank) :Don't Care HIGH QAb1 Precharge (A-Bank) CAa RBb CAb CBc CAd RAc DBc0 D Q CL=3 DAa0 QAb0 QAb1 DBc0 Row Active (B-Bank) Row Active (A-Bank) Write with Auto Precharge (B-Bank) Read (A-Bank) DAa0 QAd0 QAd1 QAd0 QAd1 *Note1 C S RAS CAS W E RBb *Note2 Read with Auto Precharge (A-Bank) ESMT M52D32321A Elite Semiconductor Memory Technology Inc. Publication Date : Jul. 2007 Revision : 1.4 25/29 Active/Precharge Power Down Mode @CAS Latency=2, Burst Length=4 *Note :1.Both banks should be in idle state prior to entering precharge power down mode. 2.CKE should be set high at least 1CLK+tss prior to Row active command. 3.Can not violate minimum refresh specification. (64ms) CLOCK CKE ADDR D Q DQM A10/AP Active Power-down Exit Precharge : Don't care *Note3 *Note2 *Note1 t S S R a R a Qa0 Qa1 Qa2 t SHZ Precharge Power-Down Entry Precharge Power-Down Exit Row Active Active Power-down Entry Read 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 C a B A RAS CAS C S W E tS S tS SESMT M52D32321A Elite Semiconductor Memory Technology Inc. Publication Date : Jul. 2007 Revision : 1.4 26/29 Self Refresh Entry & Exit Cycle *Note: TO ENTER SELF REFRESH MODE 1. CS , RAS & CAS with CKE should be low at the same clock cycle. 2. After 1 clock cycle, all the inputs including the system clock can be don’t care except for CKE. 3. The device remains in self refresh mode as long as CKE stays “Low”. cf.) Once the device enters self refresh mode, minimum tRAS is required before exit from self refresh. TO EXIT SELF REFRESH MODE 4. System clock restart and be stable before returning CKE high. 5. CS Starts from high. 6. Minimum tRC is required after CKE going high to complete self refresh exit. 7. 4K cycle of burst auto refresh is required before self refresh entry and after self refresh exit if the system uses burst refresh. CLOCK CKE ADDR D Q DQM A10/AP Self Refresh Entry Auto Refresh : Don't care Self Refresh Exit Hi-Z Hi-Z W E BA CAS RAS C S *Note2 *Note1 *Note4 t RCmin *Note6 *Note5 *Note7 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 t S S *Note3ESMT M52D32321A Elite Semiconductor Memory Technology Inc. Publication Date : Jul. 2007 Revision : 1.4 27/29 Mode Register Set Cycle Auto Refresh Cycle *Both banks precharge should be completed before Mode Register Set cycle and auto refresh cycle. MODE REGISTER SET CYCLE *Note: 1. CS ,RAS , CAS & WE activation at the same clock cycle with address key will set internal mode register. 2.Minimum 2 clock cycles should be met before new RAS activation. 3.Please refer to Mode Register Set table. CLOCK CKE ADDR Key :Don't Care HIGH C S RAS CAS HIGH *Note3 R a *Note1 D Q Hi-Z DQM 1 2 3 4 5 6 0 1 2 3 4 5 6 7 8 9 10 Hi-Z *Note2 t R C MRS New Command Auto Refresh New Command W E 0ESMT M52D32321A Elite Semiconductor Memory Technology Inc. Publication Date : Jul. 2007 Revision : 1.4 28/29 PACKING DIMENSIONS 90-BALL SDRAM ( 8x13 mm ) Symbol Dimension in mm Dimension in inch Min Norm Max Min Norm Max A 1.00 0.039 A1 0.30 0.35 0.40 0.012 0.014 0.016 A2 0.586 0.023 øb 0.40 0.45 0.50 0.016 0.018 0.020 D 7.90 8.00 8.10 0.311 0.315 0.319 E 12.90 13.00 13.10 0.508 0.512 0.516 D1 6.40 0.252 E1 11.20 0.441 e 0.80 0.031 Controlling dimension : Millimeter.ESMT M52D32321A Elite Semiconductor Memory Technology Inc. Publication Date : Jul. 2007 Revision : 1.4 29/29 Important Notice All rights reserved. No part of this document may be reproduced or duplicated in any form or by any means without the prior permission of ESMT. The contents contained in this document are believed to be accurate at the time of publication. ESMT assumes no responsibility for any error in this document, and reserves the right to change the products or specification in this document without notice. The information contained herein is presented only as a guide or examples for the application of our products. No responsibility is assumed by ESMT for any infringement of patents, copyrights, or other intellectual property rights of third parties which may result from its use. No license, either express , implied or otherwise, is granted under any patents, copyrights or other intellectual property rights of ESMT or others. Any semiconductor devices may have inherently a certain rate of failure. To minimize risks associated with customer's application, adequate design and operating safeguards against injury, damage, or loss from such failure, should be provided by the customer when making application designs. ESMT's products are not authorized for use in critical applications such as, but not limited to, life support devices or system, where failure or abnormal operation may directly affect human lives or cause physical injury or property damage. If products described here are to be used for such kinds of application, purchaser must do its own quality assurance testing appropriate to such applications. CRUCIAL PART NUMBER MODULE TYPE DENSITY SPEED RANK VOLTAGE COMP CONFIG CAS LATENCY MICRON PART NUMBER CT4G4RFS8213 RDIMM 288-pin 4GB 2133MT/s Single 1.2V 512M x 8 CL15 MTA9ASF51272PZ-2G1A2 CT8G4RFS4213 RDIMM 288-pin 8GB 2133MT/s Single 1.2V 1024M x 4 CL15 MTA18ASF1G72PZ-2G1A2 CT16G4RFD4213 RDIMM 288-pin 16GB 2133MT/s Dual 1.2V 1024M x 4 CL15 MTA36ASF2G72PZ-2G1A2 CT4G4DFS8213 UDIMM 288-pin 4GB 2133MT/s Single 1.2V 512M x 8 CL15 MTA8ATF51264AZ-2G1A1 CT8G4DFD8213 UDIMM 288-pin 8GB 2133MT/s Dual 1.2V 512M x 8 CL15 MTA16ATF1G64AZ-2G1A1 1 Product performance and efficiency improvements are noted as comparisons between DDR3 and DDR4 memory technologies at their introduction. When it was introduced, DDR3-1066 operated at 1.5V and had an estimated component density of 8Gb, compared to DDR4-2133, which will operate at 1.2V and have an estimated component density of 16Gb. When voltage reductions and all other energy-saving DDR4 features are factored in, DDR4 modules are projected to consume up to 40% less power. 2Limited lifetime warranty valid everywhere except Germany and France, where warranty is valid for ten years from date of purchase. 3Program benefits may vary and are subject to change without notice. Customer admittance and continued inclusion to the program is up to the sole discretion of Micron Technology, Inc. REVISION: 04/18/2014 ©2014 Micron Technology, Inc. All rights reserved. Information is subject to change without notice. Crucial and the Crucial logo are trademarks or registered trademarks of Micron Technology, Inc. All other trademarks and service marks are property of their respective owners. Products and specifications are subject to change without notice. Neither Crucial nor Micron Technology is responsible for omissions or errors in typography or photography. NOW SAMPLING: Crucial® DDR4 Server Memory Get early access to Crucial DDR4 modules! Introducing the Crucial DDR4 Technology Enablement Program (TEP) HOW IT WORKS Enroll in the Crucial DDR4 TEP program and get early access to DDR4 modules and information. Start the enrollment process today by visiting www.crucial.com/usa/en/memory-ddr4-info. ELIGIBILITY Channel partners who are currently developing or evaluating DDR4-capable platforms BENEFITS3 • Early access to select Crucial DDR4 modules • Notification of new DDR4 modules as they become available • Access to technical resources to aid in product development and evaluation Now Sampling The following modules are now included as part of the Crucial DDR4 TEP program. Qualified participants are encouraged to inquire about pricing and availability. Additional module types, densities, and speeds will be available later this year. Stay tuned! DDR4 Server Memory: Product Highlights1 • Increase data throughput – up to 50% more memory bandwidth • Enable up to twice the installed server memory capacity • Reduce power consumption – up to 40% more energy efficient • Easier system cooling – less heat generated per module • Optimized for future Intel® Xeon® processor E5-2600 v3 product family • Compatible with OEM servers and warranties • Backed by the Reliance Program • Limited lifetime warranty2 Overcome one of the greatest server limitations: memory. From cloud computing and virtualization to HPC, Big Data and more, memory-dependent server applications require increasingly higher densities of memory and higher levels of performance than are attainable on current DDR3 technology. Enter Crucial DDR4 server memory. More speed. More bandwidth. More efficient. Next generation DDR4 memory is here. © 2007 Microchip Technology Inc. DS39605F PIC18F1220/1320 Data Sheet 18/20/28-Pin High-Performance, Enhanced Flash Microcontrollers with 10-Bit A/D and nanoWatt TechnologyDS39605F-page ii © 2007 Microchip Technology Inc. Information contained in this publication regarding device applications and the like is provided only for your convenience and may be superseded by updates. It is your responsibility to ensure that your application meets with your specifications. MICROCHIP MAKES NO REPRESENTATIONS OR WARRANTIES OF ANY KIND WHETHER EXPRESS OR IMPLIED, WRITTEN OR ORAL, STATUTORY OR OTHERWISE, RELATED TO THE INFORMATION, INCLUDING BUT NOT LIMITED TO ITS CONDITION, QUALITY, PERFORMANCE, MERCHANTABILITY OR FITNESS FOR PURPOSE. Microchip disclaims all liability arising from this information and its use. Use of Microchip devices in life support and/or safety applications is entirely at the buyer’s risk, and the buyer agrees to defend, indemnify and hold harmless Microchip from any and all damages, claims, suits, or expenses resulting from such use. No licenses are conveyed, implicitly or otherwise, under any Microchip intellectual property rights. Trademarks The Microchip name and logo, the Microchip logo, Accuron, dsPIC, KEELOQ, microID, MPLAB, PIC, PICmicro, PICSTART, PRO MATE, PowerSmart, rfPIC and SmartShunt are registered trademarks of Microchip Technology Incorporated in the U.S.A. and other countries. AmpLab, FilterLab, Migratable Memory, MXDEV, MXLAB, SEEVAL, SmartSensor and The Embedded Control Solutions Company are registered trademarks of Microchip Technology Incorporated in the U.S.A. Analog-for-the-Digital Age, Application Maestro, CodeGuard, dsPICDEM, dsPICDEM.net, dsPICworks, ECAN, ECONOMONITOR, FanSense, FlexROM, fuzzyLAB, In-Circuit Serial Programming, ICSP, ICEPIC, Linear Active Thermistor, Mindi, MiWi, MPASM, MPLIB, MPLINK, PICkit, PICDEM, PICDEM.net, PICLAB, PICtail, PowerCal, PowerInfo, PowerMate, PowerTool, REAL ICE, rfLAB, rfPICDEM, Select Mode, Smart Serial, SmartTel, Total Endurance, UNI/O, WiperLock and ZENA are trademarks of Microchip Technology Incorporated in the U.S.A. and other countries. SQTP is a service mark of Microchip Technology Incorporated in the U.S.A. All other trademarks mentioned herein are property of their respective companies. © 2007, Microchip Technology Incorporated, Printed in the U.S.A., All Rights Reserved. Printed on recycled paper. Note the following details of the code protection feature on Microchip devices: • Microchip products meet the specification contained in their particular Microchip Data Sheet. • Microchip believes that its family of products is one of the most secure families of its kind on the market today, when used in the intended manner and under normal conditions. • There are dishonest and possibly illegal methods used to breach the code protection feature. All of these methods, to our knowledge, require using the Microchip products in a manner outside the operating specifications contained in Microchip’s Data Sheets. Most likely, the person doing so is engaged in theft of intellectual property. • Microchip is willing to work with the customer who is concerned about the integrity of their code. • Neither Microchip nor any other semiconductor manufacturer can guarantee the security of their code. Code protection does not mean that we are guaranteeing the product as “unbreakable.” Code protection is constantly evolving. We at Microchip are committed to continuously improving the code protection features of our products. Attempts to break Microchip’s code protection feature may be a violation of the Digital Millennium Copyright Act. If such acts allow unauthorized access to your software or other copyrighted work, you may have a right to sue for relief under that Act. Microchip received ISO/TS-16949:2002 certification for its worldwide headquarters, design and wafer fabrication facilities in Chandler and Tempe, Arizona, Gresham, Oregon and Mountain View, California. The Company’s quality system processes and procedures are for its PIC® MCUs and dsPIC DSCs, KEELOQ® code hopping devices, Serial EEPROMs, microperipherals, nonvolatile memory and analog products. In addition, Microchip’s quality system for the design and manufacture of development systems is ISO 9001:2000 certified.© 2007 Microchip Technology Inc. DS39605F-page 1 Low-Power Features: • Power Managed modes: - Run: CPU on, peripherals on - Idle: CPU off, peripherals on - Sleep: CPU off, peripherals off • Power Consumption modes: - PRI_RUN: 150 μA, 1 MHz, 2V - PRI_IDLE: 37 μA, 1 MHz, 2V - SEC_RUN: 14 μA, 32 kHz, 2V - SEC_IDLE: 5.8 μA, 32 kHz, 2V - RC_RUN: 110 μA, 1 MHz, 2V - RC_IDLE: 52 μA, 1 MHz, 2V - Sleep: 0.1 μA, 1 MHz, 2V • Timer1 Oscillator: 1.1 μA, 32 kHz, 2V • Watchdog Timer: 2.1 μA • Two-Speed Oscillator Start-up Oscillators: • Four Crystal modes: - LP, XT, HS: up to 25 MHz - HSPLL: 4-10 MHz (16-40 MHz internal) • Two External RC modes, up to 4 MHz • Two External Clock modes, up to 40 MHz • Internal oscillator block: - 8 user-selectable frequencies: 31 kHz, 125 kHz, 250 kHz, 500 kHz, 1 MHz, 2 MHz, 4 MHz, 8 MHz - 125 kHz to 8 MHz calibrated to 1% - Two modes select one or two I/O pins - OSCTUNE – Allows user to shift frequency • Secondary oscillator using Timer1 @ 32 kHz • Fail-Safe Clock Monitor - Allows for safe shutdown if peripheral clock stops Peripheral Highlights: • High current sink/source 25 mA/25 mA • Three external interrupts • Enhanced Capture/Compare/PWM (ECCP) module: - One, two or four PWM outputs - Selectable polarity - Programmable dead time - Auto-Shutdown and Auto-Restart - Capture is 16-bit, max resolution 6.25 ns (TCY/16) - Compare is 16-bit, max resolution 100 ns (TCY) • Compatible 10-bit, up to 13-channel Analog-toDigital Converter module (A/D) with programmable acquisition time • Enhanced USART module: - Supports RS-485, RS-232 and LIN 1.2 - Auto-Wake-up on Start bit - Auto-Baud Detect Special Microcontroller Features: • 100,000 erase/write cycle Enhanced Flash program memory typical • 1,000,000 erase/write cycle Data EEPROM memory typical • Flash/Data EEPROM Retention: > 40 years • Self-programmable under software control • Priority levels for interrupts • 8 x 8 Single-Cycle Hardware Multiplier • Extended Watchdog Timer (WDT): - Programmable period from 41 ms to 131s - 2% stability over VDD and Temperature • Single-supply 5V In-Circuit Serial Programming™ (ICSP™) via two pins • In-Circuit Debug (ICD) via two pins • Wide operating voltage range: 2.0V to 5.5V Device Program Memory Data Memory I/O 10-bit A/D (ch) ECCP (PWM) EUSART Timers Flash 8/16-bit (bytes) # Single-Word Instructions SRAM (bytes) EEPROM (bytes) PIC18F1220 4K 2048 256 256 16 7 1 Y 1/3 PIC18F1320 8K 4096 256 256 16 7 1 Y 1/3 18/20/28-Pin High-Performance, Enhanced Flash MCUs with 10-bit A/D and nanoWatt Technology PIC18F1220/1320PIC18F1220/1320 DS39605F-page 2 © 2007 Microchip Technology Inc. Pin Diagrams RB3/CCP1/P1A RB2/P1B/INT2 OSC1/CLKI/RA7 OSC2/CLKO/RA6 VDD/AVDD RB7/PGD/T1OSI/ RB6/PGC/T1OSO/ RB5/PGM/KBI1 RB4/AN6/RX/ RA0/AN0 RA1/AN1/LVDIN RA4/T0CKI MCLR/VPP/RA5 VSS/AVSS RA2/AN2/VREFRA3/AN3/VREF+ RB0/AN4/INT0 RB1/AN5/TX/ 1 2 3 4 5 6 7 8 9 18 17 16 15 14 13 12 11 10 PIC18F1X20 18-Pin PDIP, SOIC RB3/CCP1/P1A RB2/P1B/INT2 OSC1/CLKI/RA7 OSC2/CLKO/RA6 VDD RB7/PGD/T1OSI/ RB6/PGC/T1OSO/ RB5/PGM/KBI1 RB4/AN6/RX/ RA0/AN0 RA1/AN1/LVDIN RA4/T0CKI MCLR/VPP/RA5 VSS RA2/AN2/VREFRA3/AN3/VREF+ RB0/AN4/INT0 RB1/AN5/TX/ 1 2 3 4 5 7 8 9 10 20 19 18 17 16 14 13 12 11 PIC18F1X20 AVSS 6 15 AVDD 20-Pin SSOP 28-Pin QFN 16 2 RA4/T0CKI RA0/AN0 NC MCLR/VPP/RA5 NC AVSS NC RA2/AN2/VREFRA3/AN3/VREF+ RA1/AN1/LVDIN OSC1/CLKI/RA7 OSC2/CLKO/RA6 VDD NC AVDD RB7/PGD/T1OSI/P1D/KBI3 RB6/PGC/T1OSO/T13CKI/P1C/KBI2 NC RB5/PGM/KBI1 7 PIC18F1X20 1 3 6 5 4 15 21 19 20 17 18 28 27 26 25 24 23 22 8 9 10 11 12 13 14 VSS NC NC RB2/P1B/INT2 RB0/AN4/INT0 RB1/AN5/TX/CK/INT1 NC RB4/AN6/RX/DT/KBI0 RB3/CCP1/P1A T13CKI/P1C/KBI2 P1D/KBI3 CK/INT1 DT/KBI0 P1D/KBI3 T13CKI/P1C/KBI2 CK/INT1 DT/KBI0© 2007 Microchip Technology Inc. DS39605F-page 3 PIC18F1220/1320 Table of Contents 1.0 Device Overview .......................................................................................................................................................................... 5 2.0 Oscillator Configurations ............................................................................................................................................................ 11 3.0 Power Managed Modes ............................................................................................................................................................. 19 4.0 Reset.......................................................................................................................................................................................... 33 5.0 Memory Organization................................................................................................................................................................. 41 6.0 Flash Program Memory.............................................................................................................................................................. 57 7.0 Data EEPROM Memory ............................................................................................................................................................. 67 8.0 8 x 8 Hardware Multiplier............................................................................................................................................................ 71 9.0 Interrupts .................................................................................................................................................................................... 73 10.0 I/O Ports ..................................................................................................................................................................................... 87 11.0 Timer0 Module ........................................................................................................................................................................... 99 12.0 Timer1 Module ......................................................................................................................................................................... 103 13.0 Timer2 Module ......................................................................................................................................................................... 109 14.0 Timer3 Module ......................................................................................................................................................................... 111 15.0 Enhanced Capture/Compare/PWM (ECCP) Module................................................................................................................ 115 16.0 Enhanced Addressable Universal Synchronous Asynchronous Receiver Transmitter (EUSART) .......................................... 131 17.0 10-Bit Analog-to-Digital Converter (A/D) Module ..................................................................................................................... 155 18.0 Low-Voltage Detect.................................................................................................................................................................. 165 19.0 Special Features of the CPU.................................................................................................................................................... 171 20.0 Instruction Set Summary.......................................................................................................................................................... 191 21.0 Development Support............................................................................................................................................................... 233 22.0 Electrical Characteristics.......................................................................................................................................................... 237 23.0 DC and AC Characteristics Graphs and Tables....................................................................................................................... 267 24.0 Packaging Information.............................................................................................................................................................. 285 Appendix A: Revision History............................................................................................................................................................. 291 Appendix B: Device Differences ........................................................................................................................................................ 291 Appendix C: Conversion Considerations ........................................................................................................................................... 292 Appendix D: Migration from Baseline to Enhanced Devices.............................................................................................................. 292 Appendix E: Migration from Mid-Range to Enhanced Devices .......................................................................................................... 293 Appendix F: Migration from High-End to Enhanced Devices............................................................................................................. 293 Index .................................................................................................................................................................................................. 295 The Microchip Web Site..................................................................................................................................................................... 303 Customer Change Notification Service .............................................................................................................................................. 303 Customer Support.............................................................................................................................................................................. 303 Reader Response .............................................................................................................................................................................. 304 PIC18F1220/1320 Product Identification System .............................................................................................................................. 305PIC18F1220/1320 DS39605F-page 4 © 2007 Microchip Technology Inc. TO OUR VALUED CUSTOMERS It is our intention to provide our valued customers with the best documentation possible to ensure successful use of your Microchip products. To this end, we will continue to improve our publications to better suit your needs. Our publications will be refined and enhanced as new volumes and updates are introduced. If you have any questions or comments regarding this publication, please contact the Marketing Communications Department via E-mail at docerrors@microchip.com or fax the Reader Response Form in the back of this data sheet to (480) 792-4150. We welcome your feedback. Most Current Data Sheet To obtain the most up-to-date version of this data sheet, please register at our Worldwide Web site at: http://www.microchip.com You can determine the version of a data sheet by examining its literature number found on the bottom outside corner of any page. The last character of the literature number is the version number, (e.g., DS30000A is version A of document DS30000). Errata An errata sheet, describing minor operational differences from the data sheet and recommended workarounds, may exist for current devices. As device/documentation issues become known to us, we will publish an errata sheet. The errata will specify the revision of silicon and revision of document to which it applies. To determine if an errata sheet exists for a particular device, please check with one of the following: • Microchip’s Worldwide Web site; http://www.microchip.com • Your local Microchip sales office (see last page) When contacting a sales office, please specify which device, revision of silicon and data sheet (include literature number) you are using. Customer Notification System Register on our web site at www.microchip.com to receive the most current information on all of our products.© 2007 Microchip Technology Inc. DS39605F-page 5 PIC18F1220/1320 1.0 DEVICE OVERVIEW This document contains device specific information for the following devices: This family offers the advantages of all PIC18 microcontrollers – namely, high computational performance at an economical price – with the addition of high endurance Enhanced Flash program memory. On top of these features, the PIC18F1220/1320 family introduces design enhancements that make these microcontrollers a logical choice for many high-performance, power sensitive applications. 1.1 New Core Features 1.1.1 nanoWatt TECHNOLOGY All of the devices in the PIC18F1220/1320 family incorporate a range of features that can significantly reduce power consumption during operation. Key items include: • Alternate Run Modes: By clocking the controller from the Timer1 source or the internal oscillator block, power consumption during code execution can be reduced by as much as 90%. • Multiple Idle Modes: The controller can also run with its CPU core disabled, but the peripherals are still active. In these states, power consumption can be reduced even further, to as little as 4% of normal operation requirements. • On-the-fly Mode Switching: The power managed modes are invoked by user code during operation, allowing the user to incorporate power-saving ideas into their application’s software design. • Lower Consumption in Key Modules: The power requirements for both Timer1 and the Watchdog Timer have been reduced by up to 80%, with typical values of 1.1 and 2.1 μA, respectively. 1.1.2 MULTIPLE OSCILLATOR OPTIONS AND FEATURES All of the devices in the PIC18F1220/1320 family offer nine different oscillator options, allowing users a wide range of choices in developing application hardware. These include: • Four Crystal modes, using crystals or ceramic resonators. • Two External Clock modes, offering the option of using two pins (oscillator input and a divide-by-4 clock output), or one pin (oscillator input, with the second pin reassigned as general I/O). • Two External RC Oscillator modes, with the same pin options as the External Clock modes. • An internal oscillator block, which provides an 8 MHz clock (±2% accuracy) and an INTRC source (approximately 31 kHz, stable over temperature and VDD), as well as a range of 6 user-selectable clock frequencies (from 125 kHz to 4 MHz) for a total of 8 clock frequencies. Besides its availability as a clock source, the internal oscillator block provides a stable reference source that gives the family additional features for robust operation: • Fail-Safe Clock Monitor: This option constantly monitors the main clock source against a reference signal provided by the internal oscillator. If a clock failure occurs, the controller is switched to the internal oscillator block, allowing for continued low-speed operation, or a safe application shutdown. • Two-Speed Start-up: This option allows the internal oscillator to serve as the clock source from Poweron Reset, or wake-up from Sleep mode, until the primary clock source is available. This allows for code execution during what would otherwise be the clock start-up interval and can even allow an application to perform routine background activities and return to Sleep without returning to full power operation. 1.2 Other Special Features • Memory Endurance: The Enhanced Flash cells for both program memory and data EEPROM are rated to last for many thousands of erase/write cycles – up to 100,000 for program memory and 1,000,000 for EEPROM. Data retention without refresh is conservatively estimated to be greater than 40 years. • Self-programmability: These devices can write to their own program memory spaces under internal software control. By using a bootloader routine located in the protected Boot Block at the top of program memory, it becomes possible to create an application that can update itself in the field. • Enhanced CCP module: In PWM mode, this module provides 1, 2 or 4 modulated outputs for controlling half-bridge and full-bridge drivers. Other features include auto-shutdown, for disabling PWM outputs on interrupt or other select conditions and auto-restart, to reactivate outputs once the condition has cleared. • Enhanced USART: This serial communication module features automatic wake-up on Start bit and automatic baud rate detection and supports RS-232, RS-485 and LIN 1.2 protocols, making it ideally suited for use in Local Interconnect Network (LIN) bus applications. • 10-bit A/D Converter: This module incorporates programmable acquisition time, allowing for a channel to be selected and a conversion to be initiated without waiting for a sampling period and thus, reduce code overhead. • Extended Watchdog Timer (WDT): This enhanced version incorporates a 16-bit prescaler, allowing a time-out range from 4 ms to over 2 minutes that is stable across operating voltage and temperature. • PIC18F1220 • PIC18F1320PIC18F1220/1320 DS39605F-page 6 © 2007 Microchip Technology Inc. 1.3 Details on Individual Family Members Devices in the PIC18F1220/1320 family are available in 18-pin, 20-pin and 28-pin packages. A block diagram for this device family is shown in Figure 1-1. The devices are differentiated from each other only in the amount of on-chip Flash program memory (4 Kbytes for the PIC18F1220 device, 8 Kbytes for the PIC18F1320 device). These and other features are summarized in Table 1-1. A block diagram of the PIC18F1220/1320 device architecture is provided in Figure 1-1. The pinouts for this device family are listed in Table 1-2. TABLE 1-1: DEVICE FEATURES Features PIC18F1220 PIC18F1320 Operating Frequency DC – 40 MHz DC – 40 MHz Program Memory (Bytes) 4096 8192 Program Memory (Instructions) 2048 4096 Data Memory (Bytes) 256 256 Data EEPROM Memory (Bytes) 256 256 Interrupt Sources 15 15 I/O Ports Ports A, B Ports A, B Timers 4 4 Enhanced Capture/Compare/PWM Modules 1 1 Serial Communications Enhanced USART Enhanced USART 10-bit Analog-to-Digital Module 7 input channels 7 input channels Resets (and Delays) POR, BOR, RESET Instruction, Stack Full, Stack Underflow (PWRT, OST), MCLR (optional), WDT POR, BOR, RESET Instruction, Stack Full, Stack Underflow (PWRT, OST), MCLR (optional), WDT Programmable Low-Voltage Detect Yes Yes Programmable Brown-out Reset Yes Yes Instruction Set 75 Instructions 75 Instructions Packages 18-pin SDIP 18-pin SOIC 20-pin SSOP 28-pin QFN 18-pin SDIP 18-pin SOIC 20-pin SSOP 28-pin QFN© 2007 Microchip Technology Inc. DS39605F-page 7 PIC18F1220/1320 FIGURE 1-1: PIC18F1220/1320 BLOCK DIAGRAM Instruction Decode & Control PORTA PORTB RA4/T0CKI MCLR/VPP/RA5(1) Enhanced Timer0 Timer1 Timer2 RA3/AN3/VREF+ RA2/AN2/VREFRA1/AN1/LVDIN RA0/AN0 Data Latch Data RAM Address Latch Address<12> 12(2) BSR FSR0 FSR1 FSR2 4 12 4 PCH PCL PCLATH 8 31 Level Stack Program Counter PRODH PRODL 8 x 8 Multiply WREG 8 BIT OP 8 8 ALU<8> 8 Address Latch (8 Kbytes) Data Latch 20 21 21 16 8 8 8 inc/dec logic 21 8 Data Bus<8> 8 Instruction 12 3 ROM Latch Timer3 Bank0, F PCLATU PCU OSC2/CLKO/RA6(2) USART 8 Register Table Latch Table Pointer <2> inc/dec logic RB0/AN4/INT0 RB4/AN6/RX/DT/KBI0 RB1/AN5/TX/CK/INT1 RB2/P1B/INT2 RB3/CCP1/P1A RB5/PGM/KBI1 RB6/PGC/T1OSO/ RB7/PGD/T1OSI/ OSC2/CLKI/RA7 Decode (2) Power-up Timer Power-on Reset Watchdog Timer VDD, VSS Brown-out Reset Precision Reference Voltage Low-Voltage Programming In-Circuit Debugger Oscillator Start-up Timer Timing Generation OSC1(2) OSC2(2) T1OSI T1OSO INTRC Oscillator Fail-Safe Clock Monitor Note 1: RA5 is available only when the MCLR Reset is disabled. 2: OSC1, OSC2, CLKI and CLKO are only available in select oscillator modes and when these pins are not being used as digital I/O. Refer to Section 2.0 “Oscillator Configurations” for additional information. 8 CCP Enhanced T13CKI/P1C/KBI2 Program Memory (4 Kbytes) PIC18F1220 PIC18F1320 A/D Converter Data EEPROM P1D/KBI3 MCLR(1)PIC18F1220/1320 DS39605F-page 8 © 2007 Microchip Technology Inc. TABLE 1-2: PIC18F1220/1320 PINOUT I/O DESCRIPTIONS Pin Name Pin Number Pin Type Buffer Type Description PDIP/ SOIC SSOP QFN MCLR/VPP/RA5 MCLR VPP RA5 441 I P I ST — ST Master Clear (input) or programming voltage (input). Master Clear (Reset) input. This pin is an active-low Reset to the device. Programming voltage input. Digital input. OSC1/CLKI/RA7 OSC1 CLKI RA7 16 18 21 I I I/O ST CMOS ST Oscillator crystal or external clock input. Oscillator crystal input or external clock source input. ST buffer when configured in RC mode, CMOS otherwise. External clock source input. Always associated with pin function OSC1. (See related OSC1/CLKI, OSC2/CLKO pins.) General purpose I/O pin. OSC2/CLKO/RA6 OSC2 CLKO RA6 15 17 20 O O I/O — — ST Oscillator crystal or clock output. Oscillator crystal output. Connects to crystal or resonator in Crystal Oscillator mode. In RC, EC and INTRC modes, OSC2 pin outputs CLKO, which has 1/4 the frequency of OSC1 and denotes instruction cycle rate. General purpose I/O pin. PORTA is a bidirectional I/O port. RA0/AN0 RA0 AN0 1 1 26 I/O I ST Analog Digital I/O. Analog input 0. RA1/AN1/LVDIN RA1 AN1 LVDIN 2 2 27 I/O I I ST Analog Analog Digital I/O. Analog input 1. Low-Voltage Detect input. RA2/AN2/VREFRA2 AN2 VREF- 677 I/O I I ST Analog Analog Digital I/O. Analog input 2. A/D reference voltage (low) input. RA3/AN3/VREF+ RA3 AN3 VREF+ 788 I/O I I ST Analog Analog Digital I/O. Analog input 3. A/D reference voltage (high) input. RA4/T0CKI RA4 T0CKI 3 3 28 I/O I ST/OD ST Digital I/O. Open-drain when configured as output. Timer0 external clock input. RA5 See the MCLR/VPP/RA5 pin. RA6 See the OSC2/CLKO/RA6 pin. RA7 See the OSC1/CLKI/RA7 pin. Legend: TTL = TTL compatible input CMOS = CMOS compatible input or output ST = Schmitt Trigger input with CMOS levels I = Input O = Output P = Power OD = Open-drain (no P diode to VDD) © 2007 Microchip Technology Inc. DS39605F-page 9 PIC18F1220/1320 PORTB is a bidirectional I/O port. PORTB can be software programmed for internal weak pull-ups on all inputs. RB0/AN4/INT0 RB0 AN4 INT0 899 I/O I I TTL Analog ST Digital I/O. Analog input 4. External interrupt 0. RB1/AN5/TX/CK/INT1 RB1 AN5 TX CK INT1 9 10 10 I/O I O I/O I TTL Analog — ST ST Digital I/O. Analog input 5. EUSART asynchronous transmit. EUSART synchronous clock (see related RX/DT). External interrupt 1. RB2/P1B/INT2 RB2 P1B INT2 17 19 23 I/O O I TTL — ST Digital I/O. Enhanced CCP1/PWM output. External interrupt 2. RB3/CCP1/P1A RB3 CCP1 P1A 18 20 24 I/O I/O O TTL ST — Digital I/O. Capture 1 input/Compare 1 output/PWM 1 output. Enhanced CCP1/PWM output. RB4/AN6/RX/DT/KBI0 RB4 AN6 RX DT KBI0 10 11 12 I/O I I I/O I TTL Analog ST ST TTL Digital I/O. Analog input 6. EUSART asynchronous receive. EUSART synchronous data (see related TX/CK). Interrupt-on-change pin. RB5/PGM/KBI1 RB5 PGM KBI1 11 12 13 I/O I/O I TTL ST TTL Digital I/O. Low-Voltage ICSP Programming enable pin. Interrupt-on-change pin. RB6/PGC/T1OSO/ T13CKI/P1C/KBI2 RB6 PGC T1OSO T13CKI P1C KBI2 12 13 15 I/O I/O O I O I TTL ST — ST — TTL Digital I/O. In-Circuit Debugger and ICSP programming clock pin. Timer1 oscillator output. Timer1/Timer3 external clock output. Enhanced CCP1/PWM output. Interrupt-on-change pin. RB7/PGD/T1OSI/ P1D/KBI3 RB7 PGD T1OSI P1D KBI3 13 14 16 I/O I/O I O I TTL ST CMOS — TTL Digital I/O. In-Circuit Debugger and ICSP programming data pin. Timer1 oscillator input. Enhanced CCP1/PWM output. Interrupt-on-change pin. VSS 5 5, 6 3, 5 P — Ground reference for logic and I/O pins. VDD 14 15, 16 17, 19 P — Positive supply for logic and I/O pins. NC — — 18 — — No connect. TABLE 1-2: PIC18F1220/1320 PINOUT I/O DESCRIPTIONS (CONTINUED) Pin Name Pin Number Pin Type Buffer Type Description PDIP/ SOIC SSOP QFN Legend: TTL = TTL compatible input CMOS = CMOS compatible input or output ST = Schmitt Trigger input with CMOS levels I = Input O = Output P = Power OD = Open-drain (no P diode to VDD) PIC18F1220/1320 DS39605F-page 10 © 2007 Microchip Technology Inc. NOTES:© 2007 Microchip Technology Inc. DS39605F-page 11 PIC18F1220/1320 2.0 OSCILLATOR CONFIGURATIONS 2.1 Oscillator Types The PIC18F1220 and PIC18F1320 devices can be operated in ten different oscillator modes. The user can program the configuration bits, FOSC3:FOSC0, in Configuration Register 1H to select one of these ten modes: 1. LP Low-Power Crystal 2. XT Crystal/Resonator 3. HS High-Speed Crystal/Resonator 4. HSPLL High-Speed Crystal/Resonator with PLL enabled 5. RC External Resistor/Capacitor with FOSC/4 output on RA6 6. RCIO External Resistor/Capacitor with I/O on RA6 7. INTIO1 Internal Oscillator with FOSC/4 output on RA6 and I/O on RA7 8. INTIO2 Internal Oscillator with I/O on RA6 and RA7 9. EC External Clock with FOSC/4 output 10. ECIO External Clock with I/O on RA6 2.2 Crystal Oscillator/Ceramic Resonators In XT, LP, HS or HSPLL Oscillator modes, a crystal or ceramic resonator is connected to the OSC1 and OSC2 pins to establish oscillation. Figure 2-1 shows the pin connections. The oscillator design requires the use of a parallel cut crystal. FIGURE 2-1: CRYSTAL/CERAMIC RESONATOR OPERATION (XT, LP, HS OR HSPLL CONFIGURATION) TABLE 2-1: CAPACITOR SELECTION FOR CERAMIC RESONATORS Note: Use of a series cut crystal may give a frequency out of the crystal manufacturer’s specifications. Typical Capacitor Values Used: Mode Freq OSC1 OSC2 XT 455 kHz 2.0 MHz 4.0 MHz 56 pF 47 pF 33 pF 56 pF 47 pF 33 pF HS 8.0 MHz 16.0 MHz 27 pF 22 pF 27 pF 22 pF Capacitor values are for design guidance only. These capacitors were tested with the resonators listed below for basic start-up and operation. These values are not optimized. Different capacitor values may be required to produce acceptable oscillator operation. The user should test the performance of the oscillator over the expected VDD and temperature range for the application. See the notes following Table 2-2 for additional information. Resonators Used: 455 kHz 4.0 MHz 2.0 MHz 8.0 MHz 16.0 MHz Note 1: See Table 2-1 and Table 2-2 for initial values of C1 and C2. 2: A series resistor (RS) may be required for AT strip cut crystals. 3: RF varies with the oscillator mode chosen. C1(1) C2(1) XTAL OSC2 OSC1 RF(3) Sleep To Logic PIC18FXXXX RS(2) InternalPIC18F1220/1320 DS39605F-page 12 © 2007 Microchip Technology Inc. TABLE 2-2: CAPACITOR SELECTION FOR CRYSTAL OSCILLATOR An external clock source may also be connected to the OSC1 pin in the HS mode, as shown in Figure 2-2. FIGURE 2-2: EXTERNAL CLOCK INPUT OPERATION (HS OSC CONFIGURATION) 2.3 HSPLL A Phase Locked Loop (PLL) circuit is provided as an option for users who wish to use a lower frequency crystal oscillator circuit, or to clock the device up to its highest rated frequency from a crystal oscillator. This may be useful for customers who are concerned with EMI due to high-frequency crystals. The HSPLL mode makes use of the HS mode oscillator for frequencies up to 10 MHz. A PLL then multiplies the oscillator output frequency by 4 to produce an internal clock frequency up to 40 MHz. The PLL is enabled only when the oscillator configuration bits are programmed for HSPLL mode. If programmed for any other mode, the PLL is not enabled. FIGURE 2-3: PLL BLOCK DIAGRAM Osc Type Crystal Freq Typical Capacitor Values Tested: C1 C2 LP 32 kHz 33 pF 33 pF 200 kHz 15 pF 15 pF XT 1 MHz 33 pF 33 pF 4 MHz 27 pF 27 pF HS 4 MHz 27 pF 27 pF 8 MHz 22 pF 22 pF 20 MHz 15 pF 15 pF Capacitor values are for design guidance only. These capacitors were tested with the crystals listed below for basic start-up and operation. These values are not optimized. Different capacitor values may be required to produce acceptable oscillator operation. The user should test the performance of the oscillator over the expected VDD and temperature range for the application. See the notes following this table for additional information. Crystals Used: 32 kHz 4 MHz 200 kHz 8 MHz 1 MHz 20 MHz Note 1: Higher capacitance increases the stability of oscillator, but also increases the start-up time. 2: When operating below 3V VDD, or when using certain ceramic resonators at any voltage, it may be necessary to use the HS mode or switch to a crystal oscillator. 3: Since each resonator/crystal has its own characteristics, the user should consult the resonator/crystal manufacturer for appropriate values of external components. 4: RS may be required to avoid overdriving crystals with low drive level specification. 5: Always verify oscillator performance over the VDD and temperature range that is expected for the application. OSC1 Open OSC2 Clock from Ext. System PIC18FXXXX (HS Mode) MUX VCO Loop Filter Crystal Osc OSC2 OSC1 PLL Enable FIN FOUT SYSCLK Phase Comparator HS Oscillator Enable ÷4 (from Configuration Register 1H)© 2007 Microchip Technology Inc. DS39605F-page 13 PIC18F1220/1320 2.4 External Clock Input The EC and ECIO Oscillator modes require an external clock source to be connected to the OSC1 pin. There is no oscillator start-up time required after a Power-on Reset, or after an exit from Sleep mode. In the EC Oscillator mode, the oscillator frequency divided by 4 is available on the OSC2 pin. This signal may be used for test purposes, or to synchronize other logic. Figure 2-4 shows the pin connections for the EC Oscillator mode. FIGURE 2-4: EXTERNAL CLOCK INPUT OPERATION (EC CONFIGURATION) The ECIO Oscillator mode functions like the EC mode, except that the OSC2 pin becomes an additional general purpose I/O pin. The I/O pin becomes bit 6 of PORTA (RA6). Figure 2-5 shows the pin connections for the ECIO Oscillator mode. FIGURE 2-5: EXTERNAL CLOCK INPUT OPERATION (ECIO CONFIGURATION) 2.5 RC Oscillator For timing insensitive applications, the “RC” and “RCIO” device options offer additional cost savings. The RC oscillator frequency is a function of the supply voltage, the resistor (REXT) and capacitor (CEXT) values and the operating temperature. In addition to this, the oscillator frequency will vary from unit to unit due to normal manufacturing variation. Furthermore, the difference in lead frame capacitance between package types will also affect the oscillation frequency, especially for low CEXT values. The user also needs to take into account variation, due to tolerance of external R and C components used. Figure 2-6 shows how the R/C combination is connected. In the RC Oscillator mode, the oscillator frequency divided by 4 is available on the OSC2 pin. This signal may be used for test purposes, or to synchronize other logic. FIGURE 2-6: RC OSCILLATOR MODE The RCIO Oscillator mode (Figure 2-7) functions like the RC mode, except that the OSC2 pin becomes an additional general purpose I/O pin. The I/O pin becomes bit 6 of PORTA (RA6). FIGURE 2-7: RCIO OSCILLATOR MODE OSC1/CLKI FOSC/4 OSC2/CLKO Clock from Ext. System PIC18FXXXX OSC1/CLKI RA6 I/O (OSC2) Clock from Ext. System PIC18FXXXX OSC2/CLKO CEXT REXT PIC18FXXXX OSC1 FOSC/4 Internal Clock VDD VSS Recommended values: 3 kΩ ≤ REXT ≤ 100 kΩ CEXT > 20 pF CEXT REXT PIC18FXXXX OSC1 Internal Clock VDD VSS Recommended values: 3 kΩ ≤ REXT ≤ 100 kΩ CEXT > 20 pF RA6 I/O (OSC2)PIC18F1220/1320 DS39605F-page 14 © 2007 Microchip Technology Inc. 2.6 Internal Oscillator Block The PIC18F1220/1320 devices include an internal oscillator block, which generates two different clock signals; either can be used as the system’s clock source. This can eliminate the need for external oscillator circuits on the OSC1 and/or OSC2 pins. The main output (INTOSC) is an 8 MHz clock source, which can be used to directly drive the system clock. It also drives a postscaler, which can provide a range of clock frequencies from 125 kHz to 4 MHz. The INTOSC output is enabled when a system clock frequency from 125 kHz to 8 MHz is selected. The other clock source is the internal RC oscillator (INTRC), which provides a 31 kHz output. The INTRC oscillator is enabled by selecting the internal oscillator block as the system clock source, or when any of the following are enabled: • Power-up Timer • Fail-Safe Clock Monitor • Watchdog Timer • Two-Speed Start-up These features are discussed in greater detail in Section 19.0 “Special Features of the CPU”. The clock source frequency (INTOSC direct, INTRC direct or INTOSC postscaler) is selected by configuring the IRCF bits of the OSCCON register (Register 2-2). 2.6.1 INTIO MODES Using the internal oscillator as the clock source can eliminate the need for up to two external oscillator pins, which can then be used for digital I/O. Two distinct configurations are available: • In INTIO1 mode, the OSC2 pin outputs FOSC/4, while OSC1 functions as RA7 for digital input and output. • In INTIO2 mode, OSC1 functions as RA7 and OSC2 functions as RA6, both for digital input and output. 2.6.2 INTRC OUTPUT FREQUENCY The internal oscillator block is calibrated at the factory to produce an INTOSC output frequency of 8.0 MHz (see Table 22-6). This changes the frequency of the INTRC source from its nominal 31.25 kHz. Peripherals and features that depend on the INTRC source will be affected by this shift in frequency. Once set during factory calibration, the INTRC frequency will remain within ±2% as temperature and VDD change across their full specified operating ranges. 2.6.3 OSCTUNE REGISTER The internal oscillator’s output has been calibrated at the factory, but can be adjusted in the user’s application. This is done by writing to the OSCTUNE register (Register 2-1). The tuning sensitivity is constant throughout the tuning range. When the OSCTUNE register is modified, the INTOSC and INTRC frequencies will begin shifting to the new frequency. The INTRC clock will reach the new frequency within 8 clock cycles (approximately 8 * 32 μs = 256 μs). The INTOSC clock will stabilize within 1 ms. Code execution continues during this shift. There is no indication that the shift has occurred. Operation of features that depend on the INTRC clock source frequency, such as the WDT, Fail-Safe Clock Monitor and peripherals, will also be affected by the change in frequency.© 2007 Microchip Technology Inc. DS39605F-page 15 PIC18F1220/1320 REGISTER 2-1: OSCTUNE: OSCILLATOR TUNING REGISTER 2.7 Clock Sources and Oscillator Switching Like previous PIC18 devices, the PIC18F1220/1320 devices include a feature that allows the system clock source to be switched from the main oscillator to an alternate low-frequency clock source. PIC18F1220/ 1320 devices offer two alternate clock sources. When enabled, these give additional options for switching to the various power managed operating modes. Essentially, there are three clock sources for these devices: • Primary oscillators • Secondary oscillators • Internal oscillator block The primary oscillators include the External Crystal and Resonator modes, the External RC modes, the External Clock modes and the internal oscillator block. The particular mode is defined on POR by the contents of Configuration Register 1H. The details of these modes are covered earlier in this chapter. The secondary oscillators are those external sources not connected to the OSC1 or OSC2 pins. These sources may continue to operate even after the controller is placed in a power managed mode. PIC18F1220/1320 devices offer only the Timer1 oscillator as a secondary oscillator. This oscillator, in all power managed modes, is often the time base for functions such as a real-time clock. Most often, a 32.768 kHz watch crystal is connected between the RB6/T1OSO and RB7/T1OSI pins. Like the LP mode oscillator circuit, loading capacitors are also connected from each pin to ground. These pins are also used during ICSP operations. The Timer1 oscillator is discussed in greater detail in Section 12.2 “Timer1 Oscillator”. In addition to being a primary clock source, the internal oscillator block is available as a power managed mode clock source. The INTRC source is also used as the clock source for several special features, such as the WDT and Fail-Safe Clock Monitor. The clock sources for the PIC18F1220/1320 devices are shown in Figure 2-8. See Section 12.0 “Timer1 Module” for further details of the Timer1 oscillator. See Section 19.1 “Configuration Bits” for configuration register details. U-0 U-0 R/W-0 R/W-0 R/W-0 R/W-0 R/W-0 R/W-0 — — TUN5 TUN4 TUN3 TUN2 TUN1 TUN0 bit 7 bit 0 bit 7-6 Unimplemented: Read as ‘0’ bit 5-0 TUN<5:0>: Frequency Tuning bits 011111 = Maximum frequency • • • • 000001 000000 = Center frequency. Oscillator module is running at the calibrated frequency. 111111 • • • • 100000 = Minimum frequency Legend: R = Readable bit W = Writable bit U = Unimplemented bit, read as ‘0’ -n = Value at POR ‘1’ = Bit is set ‘0’ = Bit is cleared x = Bit is unknownPIC18F1220/1320 DS39605F-page 16 © 2007 Microchip Technology Inc. 2.7.1 OSCILLATOR CONTROL REGISTER The OSCCON register (Register 2-2) controls several aspects of the system clock’s operation, both in full power operation and in power managed modes. The System Clock Select bits, SCS1:SCS0, select the clock source that is used when the device is operating in power managed modes. The available clock sources are the primary clock (defined in Configuration Register 1H), the secondary clock (Timer1 oscillator) and the internal oscillator block. The clock selection has no effect until a SLEEP instruction is executed and the device enters a power managed mode of operation. The SCS bits are cleared on all forms of Reset. The Internal Oscillator Select bits, IRCF2:IRCF0, select the frequency output of the internal oscillator block that is used to drive the system clock. The choices are the INTRC source, the INTOSC source (8 MHz), or one of the six frequencies derived from the INTOSC postscaler (125 kHz to 4 MHz). If the internal oscillator block is supplying the system clock, changing the states of these bits will have an immediate change on the internal oscillator’s output. The OSTS, IOFS and T1RUN bits indicate which clock source is currently providing the system clock. The OSTS indicates that the Oscillator Start-up Timer has timed out and the primary clock is providing the system clock in Primary Clock modes. The IOFS bit indicates when the internal oscillator block has stabilized and is providing the system clock in RC Clock modes or during Two-Speed Start-ups. The T1RUN bit (T1CON<6>) indicates when the Timer1 oscillator is providing the system clock in Secondary Clock modes. In power managed modes, only one of these three bits will be set at any time. If none of these bits are set, the INTRC is providing the system clock, or the internal oscillator block has just started and is not yet stable. The IDLEN bit controls the selective shutdown of the controller’s CPU in power managed modes. The uses of these bits are discussed in more detail in Section 3.0 “Power Managed Modes”. FIGURE 2-8: PIC18F1220/1320 CLOCK DIAGRAM Note 1: The Timer1 oscillator must be enabled to select the secondary clock source. The Timer1 oscillator is enabled by setting the T1OSCEN bit in the Timer1 Control register (T1CON<3>). If the Timer1 oscillator is not enabled, then any attempt to select a secondary clock source when executing a SLEEP instruction will be ignored. 2: It is recommended that the Timer1 oscillator be operating and stable before executing the SLEEP instruction or a very long delay may occur while the Timer1 oscillator starts. PIC18F1220/1320 4 x PLL CONFIG1H <3:0> Secondary Oscillator T1OSCEN Enable Oscillator T1OSO T1OSI Clock Source Option for Other Modules OSC1 OSC2 Sleep Primary Oscillator HSPLL LP, XT, HS, RC, EC T1OSC CPU Peripherals IDLEN Postscaler MUX MUX 8 4 MHz 2 MHz 1 MHz 500 kHz 125 kHz 250 kHz OSCCON<6:4> 111 110 101 100 011 010 001 000 31 kHz INTRC Source Internal Oscillator Block WDT, FSCM 8 MHz Internal Oscillator (INTOSC) OSCCON<6:4> Clock Control OSCCON<1:0>© 2007 Microchip Technology Inc. DS39605F-page 17 PIC18F1220/1320 REGISTER 2-2: OSCCON REGISTER R/W-0 R/W-0 R/W-0 R/W-0 R(1) R-0 R/W-0 R/W-0 IDLEN IRCF2 IRCF1 IRCF0 OSTS IOFS SCS1 SCS0 bit 7 bit 0 bit 7 IDLEN: Idle Enable bits 1 = Idle mode enabled; CPU core is not clocked in power managed modes 0 = Run mode enabled; CPU core is clocked in Run modes, but not Sleep mode bit 6-4 IRCF2:IRCF0: Internal Oscillator Frequency Select bits 111 = 8 MHz (8 MHz source drives clock directly) 110 = 4 MHz 101 = 2 MHz 100 = 1 MHz 011 = 500 kHz 010 = 250 kHz 001 = 125 kHz 000 = 31 kHz (INTRC source drives clock directly) bit 3 OSTS: Oscillator Start-up Time-out Status bit 1 = Oscillator Start-up Timer time-out has expired; primary oscillator is running 0 = Oscillator Start-up Timer time-out is running; primary oscillator is not ready bit 2 IOFS: INTOSC Frequency Stable bit 1 = INTOSC frequency is stable 0 = INTOSC frequency is not stable bit 1-0 SCS1:SCS0: System Clock Select bits 1x = Internal oscillator block (RC modes) 01 = Timer1 oscillator (Secondary modes) 00 = Primary oscillator (Sleep and PRI_IDLE modes) Note 1: Depends on state of the IESO bit in Configuration Register 1H. Legend: R = Readable bit W = Writable bit U = Unimplemented bit, read as ‘0’ -n = Value at POR ‘1’ = Bit is set ‘0’ = Bit is cleared x = Bit is unknownPIC18F1220/1320 DS39605F-page 18 © 2007 Microchip Technology Inc. 2.7.2 OSCILLATOR TRANSITIONS The PIC18F1220/1320 devices contain circuitry to prevent clocking “glitches” when switching between clock sources. A short pause in the system clock occurs during the clock switch. The length of this pause is between 8 and 9 clock periods of the new clock source. This ensures that the new clock source is stable and that its pulse width will not be less than the shortest pulse width of the two clock sources. Clock transitions are discussed in greater detail in Section 3.1.2 “Entering Power Managed Modes”. 2.8 Effects of Power Managed Modes on the Various Clock Sources When the device executes a SLEEP instruction, the system is switched to one of the power managed modes, depending on the state of the IDLEN and SCS1:SCS0 bits of the OSCCON register. See Section 3.0 “Power Managed Modes” for details. When PRI_IDLE mode is selected, the designated primary oscillator continues to run without interruption. For all other power managed modes, the oscillator using the OSC1 pin is disabled. The OSC1 pin (and OSC2 pin, if used by the oscillator) will stop oscillating. In Secondary Clock modes (SEC_RUN and SEC_IDLE), the Timer1 oscillator is operating and providing the system clock. The Timer1 oscillator may also run in all power managed modes if required to clock Timer1 or Timer3. In Internal Oscillator modes (RC_RUN and RC_IDLE), the internal oscillator block provides the system clock source. The INTRC output can be used directly to provide the system clock and may be enabled to support various special features, regardless of the power managed mode (see Section 19.2 “Watchdog Timer (WDT)” through Section 19.4 “Fail-Safe Clock Monitor”). The INTOSC output at 8 MHz may be used directly to clock the system, or may be divided down first. The INTOSC output is disabled if the system clock is provided directly from the INTRC output. If the Sleep mode is selected, all clock sources are stopped. Since all the transistor switching currents have been stopped, Sleep mode achieves the lowest current consumption of the device (only leakage currents). Enabling any on-chip feature that will operate during Sleep will increase the current consumed during Sleep. The INTRC is required to support WDT operation. The Timer1 oscillator may be operating to support a realtime clock. Other features may be operating that do not require a system clock source (i.e., INTn pins, A/D conversions and others). 2.9 Power-up Delays Power-up delays are controlled by two timers, so that no external Reset circuitry is required for most applications. The delays ensure that the device is kept in Reset until the device power supply is stable under normal circumstances and the primary clock is operating and stable. For additional information on power-up delays, see Sections 4.1 through 4.5. The first timer is the Power-up Timer (PWRT), which provides a fixed delay on power-up (parameter 33, Table 22-8) if enabled in Configuration Register 2L. The second timer is the Oscillator Start-up Timer (OST), intended to keep the chip in Reset until the crystal oscillator is stable (LP, XT and HS modes). The OST does this by counting 1024 oscillator cycles before allowing the oscillator to clock the device. When the HSPLL Oscillator mode is selected, the device is kept in Reset for an additional 2 ms following the HS mode OST delay, so the PLL can lock to the incoming clock frequency. There is a delay of 5 to 10 μs following POR while the controller becomes ready to execute instructions. This delay runs concurrently with any other delays. This may be the only delay that occurs when any of the EC, RC or INTIO modes are used as the primary clock source. TABLE 2-3: OSC1 AND OSC2 PIN STATES IN SLEEP MODE Oscillator Mode OSC1 Pin OSC2 Pin RC, INTIO1 Floating, external resistor should pull high At logic low (clock/4 output) RCIO, INTIO2 Floating, external resistor should pull high Configured as PORTA, bit 6 ECIO Floating, pulled by external clock Configured as PORTA, bit 6 EC Floating, pulled by external clock At logic low (clock/4 output) LP, XT and HS Feedback inverter disabled at quiescent voltage level Feedback inverter disabled at quiescent voltage level Note: See Table 4-1 in Section 4.0 “Reset” for time-outs due to Sleep and MCLR Reset.© 2007 Microchip Technology Inc. DS39605F-page 19 PIC18F1220/1320 3.0 POWER MANAGED MODES The PIC18F1220/1320 devices offer a total of six operating modes for more efficient power management (see Table 3-1). These provide a variety of options for selective power conservation in applications where resources may be limited (i.e., battery powered devices). There are three categories of power managed modes: • Sleep mode • Idle modes • Run modes These categories define which portions of the device are clocked and sometimes, what speed. The Run and Idle modes may use any of the three available clock sources (primary, secondary or INTOSC multiplexer); the Sleep mode does not use a clock source. The clock switching feature offered in other PIC18 devices (i.e., using the Timer1 oscillator in place of the primary oscillator) and the Sleep mode offered by all PIC® devices (where all system clocks are stopped) are both offered in the PIC18F1220/1320 devices (SEC_RUN and Sleep modes, respectively). However, additional power managed modes are available that allow the user greater flexibility in determining what portions of the device are operating. The power managed modes are event driven; that is, some specific event must occur for the device to enter or (more particularly) exit these operating modes. For PIC18F1220/1320 devices, the power managed modes are invoked by using the existing SLEEP instruction. All modes exit to PRI_RUN mode when triggered by an interrupt, a Reset or a WDT time-out (PRI_RUN mode is the normal full power execution mode; the CPU and peripherals are clocked by the primary oscillator source). In addition, power managed Run modes may also exit to Sleep mode, or their corresponding Idle mode. 3.1 Selecting Power Managed Modes Selecting a power managed mode requires deciding if the CPU is to be clocked or not and selecting a clock source. The IDLEN bit controls CPU clocking, while the SCS1:SCS0 bits select a clock source. The individual modes, bit settings, clock sources and affected modules are summarized in Table 3-1. 3.1.1 CLOCK SOURCES The clock source is selected by setting the SCS bits of the OSCCON register (Register 2-2). Three clock sources are available for use in power managed Idle modes: the primary clock (as configured in Configuration Register 1H), the secondary clock (Timer1 oscillator) and the internal oscillator block. The secondary and internal oscillator block sources are available for the power managed modes (PRI_RUN mode is the normal full power execution mode; the CPU and peripherals are clocked by the primary oscillator source). TABLE 3-1: POWER MANAGED MODES Mode OSCCON Bits Module Clocking Available Clock and Oscillator Source IDLEN <7> SCS1:SCS0 <1:0> CPU Peripherals Sleep 0 00 Off Off None – All clocks are disabled PRI_RUN 0 00 Clocked Clocked Primary – LP, XT, HS, HSPLL, RC, EC, INTRC(1) This is the normal full power execution mode. SEC_RUN 0 01 Clocked Clocked Secondary – Timer1 Oscillator RC_RUN 0 1x Clocked Clocked Internal Oscillator Block(1) PRI_IDLE 1 00 Off Clocked Primary – LP, XT, HS, HSPLL, RC, EC SEC_IDLE 1 01 Off Clocked Secondary – Timer1 Oscillator RC_IDLE 1 1x Off Clocked Internal Oscillator Block(1) Note 1: Includes INTOSC and INTOSC postscaler, as well as the INTRC source.PIC18F1220/1320 DS39605F-page 20 © 2007 Microchip Technology Inc. 3.1.2 ENTERING POWER MANAGED MODES In general, entry, exit and switching between power managed clock sources requires clock source switching. In each case, the sequence of events is the same. Any change in the power managed mode begins with loading the OSCCON register and executing a SLEEP instruction. The SCS1:SCS0 bits select one of three power managed clock sources; the primary clock (as defined in Configuration Register 1H), the secondary clock (the Timer1 oscillator) and the internal oscillator block (used in RC modes). Modifying the SCS bits will have no effect until a SLEEP instruction is executed. Entry to the power managed mode is triggered by the execution of a SLEEP instruction. Figure 3-5 shows how the system is clocked while switching from the primary clock to the Timer1 oscillator. When the SLEEP instruction is executed, clocks to the device are stopped at the beginning of the next instruction cycle. Eight clock cycles from the new clock source are counted to synchronize with the new clock source. After eight clock pulses from the new clock source are counted, clocks from the new clock source resume clocking the system. The actual length of the pause is between eight and nine clock periods from the new clock source. This ensures that the new clock source is stable and that its pulse width will not be less than the shortest pulse width of the two clock sources. Three bits indicate the current clock source: OSTS and IOFS in the OSCCON register and T1RUN in the T1CON register. Only one of these bits will be set while in a power managed mode. When the OSTS bit is set, the primary clock is providing the system clock. When the IOFS bit is set, the INTOSC output is providing a stable 8 MHz clock source and is providing the system clock. When the T1RUN bit is set, the Timer1 oscillator is providing the system clock. If none of these bits are set, then either the INTRC clock source is clocking the system, or the INTOSC source is not yet stable. If the internal oscillator block is configured as the primary clock source in Configuration Register 1H, then both the OSTS and IOFS bits may be set when in PRI_RUN or PRI_IDLE modes. This indicates that the primary clock (INTOSC output) is generating a stable 8 MHz output. Entering an RC power managed mode (same frequency) would clear the OSTS bit. 3.1.3 MULTIPLE SLEEP COMMANDS The power managed mode that is invoked with the SLEEP instruction is determined by the settings of the IDLEN and SCS bits at the time the instruction is executed. If another SLEEP instruction is executed, the device will enter the power managed mode specified by these same bits at that time. If the bits have changed, the device will enter the new power managed mode specified by the new bit settings. 3.1.4 COMPARISONS BETWEEN RUN AND IDLE MODES Clock source selection for the Run modes is identical to the corresponding Idle modes. When a SLEEP instruction is executed, the SCS bits in the OSCCON register are used to switch to a different clock source. As a result, if there is a change of clock source at the time a SLEEP instruction is executed, a clock switch will occur. In Idle modes, the CPU is not clocked and is not running. In Run modes, the CPU is clocked and executing code. This difference modifies the operation of the WDT when it times out. In Idle modes, a WDT time-out results in a wake from power managed modes. In Run modes, a WDT time-out results in a WDT Reset (see Table 3-2). During a wake-up from an Idle mode, the CPU starts executing code by entering the corresponding Run mode until the primary clock becomes ready. When the primary clock becomes ready, the clock source is automatically switched to the primary clock. The IDLEN and SCS bits are unchanged during and after the wake-up. Figure 3-2 shows how the system is clocked during the clock source switch. The example assumes the device was in SEC_IDLE or SEC_RUN mode when a wake is triggered (the primary clock was configured in HSPLL mode). Note 1: Caution should be used when modifying a single IRCF bit. If VDD is less than 3V, it is possible to select a higher clock speed than is supported by the low VDD. Improper device operation may result if the VDD/FOSC specifications are violated. 2: Executing a SLEEP instruction does not necessarily place the device into Sleep mode; executing a SLEEP instruction is simply a trigger to place the controller into a power managed mode selected by the OSCCON register, one of which is Sleep mode.© 2007 Microchip Technology Inc. DS39605F-page 21 PIC18F1220/1320 3.2 Sleep Mode The power managed Sleep mode in the PIC18F1220/ 1320 devices is identical to that offered in all other PIC microcontrollers. It is entered by clearing the IDLEN and SCS1:SCS0 bits (this is the Reset state) and executing the SLEEP instruction. This shuts down the primary oscillator and the OSTS bit is cleared (see Figure 3-1). When a wake event occurs in Sleep mode (by interrupt, Reset or WDT time-out), the system will not be clocked until the primary clock source becomes ready (see Figure 3-2), or it will be clocked from the internal oscillator block if either the Two-Speed Start-up or the Fail-Safe Clock Monitor are enabled (see Section 19.0 “Special Features of the CPU”). In either case, the OSTS bit is set when the primary clock is providing the system clocks. The IDLEN and SCS bits are not affected by the wake-up. 3.3 Idle Modes The IDLEN bit allows the microcontroller’s CPU to be selectively shut down while the peripherals continue to operate. Clearing IDLEN allows the CPU to be clocked. Setting IDLEN disables clocks to the CPU, effectively stopping program execution (see Register 2-2). The peripherals continue to be clocked regardless of the setting of the IDLEN bit. There is one exception to how the IDLEN bit functions. When all the low-power OSCCON bits are cleared (IDLEN:SCS1:SCS0 = 000), the device enters Sleep mode upon the execution of the SLEEP instruction. This is both the Reset state of the OSCCON register and the setting that selects Sleep mode. This maintains compatibility with other PIC devices that do not offer power managed modes. If the Idle Enable bit, IDLEN (OSCCON<7>), is set to a ‘1’ when a SLEEP instruction is executed, the peripherals will be clocked from the clock source selected using the SCS1:SCS0 bits; however, the CPU will not be clocked. Since the CPU is not executing instructions, the only exits from any of the Idle modes are by interrupt, WDT time-out or a Reset. When a wake event occurs, CPU execution is delayed approximately 10 μs while it becomes ready to execute code. When the CPU begins executing code, it is clocked by the same clock source as was selected in the power managed mode (i.e., when waking from RC_IDLE mode, the internal oscillator block will clock the CPU and peripherals until the primary clock source becomes ready – this is essentially RC_RUN mode). This continues until the primary clock source becomes ready. When the primary clock becomes ready, the OSTS bit is set and the system clock source is switched to the primary clock (see Figure 3-4). The IDLEN and SCS bits are not affected by the wake-up. While in any Idle mode or the Sleep mode, a WDT time-out will result in a WDT wake-up to full power operation. TABLE 3-2: COMPARISON BETWEEN POWER MANAGED MODES Power Managed Mode CPU is Clocked by ... WDT Time-out causes a ... Peripherals are Clocked by ... Clock during Wake-up (while primary becomes ready) Sleep Not clocked (not running) Wake-up Not clocked None or INTOSC multiplexer if Two-Speed Start-up or Fail-Safe Clock Monitor are enabled Any Idle mode Not clocked (not running) Wake-up Primary, Secondary or INTOSC multiplexer Unchanged from Idle mode (CPU operates as in corresponding Run mode) Any Run mode Primary or secondary clocks or INTOSC multiplexer Reset Primary or secondary clocks or INTOSC multiplexer Unchanged from Run modePIC18F1220/1320 DS39605F-page 22 © 2007 Microchip Technology Inc. FIGURE 3-1: TIMING TRANSITION FOR ENTRY TO SLEEP MODE FIGURE 3-2: TRANSITION TIMING FOR WAKE FROM SLEEP (HSPLL) Q2 Q3 Q4 OSC1 Peripheral Sleep Program Q1 Q1 Counter Clock CPU Clock PC PC + 2 Q3 Q4 Q1 Q2 OSC1 Peripheral Program PC PLL Clock Q3 Q4 Output CPU Clock Q1 Q2 Q3 Q4 Q1 Q2 Clock Counter PC + 6 PC + 8 Q1 Q2 Q3 Q4 Wake Event Note 1: TOST = 1024 TOSC; TPLL = 2 ms (approx). These intervals are not shown to scale. TOST(1) TPLL(1) OSTS bit Set PC + 2 PC + 4© 2007 Microchip Technology Inc. DS39605F-page 23 PIC18F1220/1320 3.3.1 PRI_IDLE MODE This mode is unique among the three Low-Power Idle modes, in that it does not disable the primary system clock. For timing sensitive applications, this allows for the fastest resumption of device operation with its more accurate primary clock source, since the clock source does not have to “warm up” or transition from another oscillator. PRI_IDLE mode is entered by setting the IDLEN bit, clearing the SCS bits and executing a SLEEP instruction. Although the CPU is disabled, the peripherals continue to be clocked from the primary clock source specified in Configuration Register 1H. The OSTS bit remains set in PRI_IDLE mode (see Figure 3-3). When a wake event occurs, the CPU is clocked from the primary clock source. A delay of approximately 10 μs is required between the wake event and code execution starts. This is required to allow the CPU to become ready to execute instructions. After the wakeup, the OSTS bit remains set. The IDLEN and SCS bits are not affected by the wake-up (see Figure 3-4). FIGURE 3-3: TRANSITION TIMING TO PRI_IDLE MODE FIGURE 3-4: TRANSITION TIMING FOR WAKE FROM PRI_IDLE MODE Q1 Peripheral Program PC PC + 2 OSC1 Q3 Q4 Q1 CPU Clock Clock Counter Q2 OSC1 Peripheral Program PC CPU Clock PC + 2 Q1 Q3 Q4 Clock Counter Q2 Wake Event CPU Start-up DelayPIC18F1220/1320 DS39605F-page 24 © 2007 Microchip Technology Inc. 3.3.2 SEC_IDLE MODE In SEC_IDLE mode, the CPU is disabled, but the peripherals continue to be clocked from the Timer1 oscillator. This mode is entered by setting the Idle bit, modifying bits, SCS1:SCS0 = 01 and executing a SLEEP instruction. When the clock source is switched (see Figure 3-5) to the Timer1 oscillator, the primary oscillator is shut down, the OSTS bit is cleared and the T1RUN bit is set. When a wake event occurs, the peripherals continue to be clocked from the Timer1 oscillator. After a 10 μs delay following the wake event, the CPU begins executing code, being clocked by the Timer1 oscillator. The microcontroller operates in SEC_RUN mode until the primary clock becomes ready. When the primary clock becomes ready, a clock switchback to the primary clock occurs (see Figure 3-6). When the clock switch is complete, the T1RUN bit is cleared, the OSTS bit is set and the primary clock is providing the system clock. The IDLEN and SCS bits are not affected by the wake-up. The Timer1 oscillator continues to run. FIGURE 3-5: TIMING TRANSITION FOR ENTRY TO SEC_IDLE MODE FIGURE 3-6: TIMING TRANSITION FOR WAKE FROM SEC_RUN MODE (HSPLL) Note: The Timer1 oscillator should already be running prior to entering SEC_IDLE mode. If the T1OSCEN bit is not set when the SLEEP instruction is executed, the SLEEP instruction will be ignored and entry to SEC_IDLE mode will not occur. If the Timer1 oscillator is enabled, but not yet running, peripheral clocks will be delayed until the oscillator has started; in such situations, initial oscillator operation is far from stable and unpredictable operation may result. Q2 Q3 Q4 OSC1 Peripheral Program Q1 T1OSI Q1 Counter Clock CPU Clock PC PC + 2 12345678 Clock Transition Q1 Q3 Q4 OSC1 Peripheral Program PC PC + 2 T1OSI PLL Clock Q1 PC + 6 Q2 Output Q3 Q4 Q1 CPU Clock PC + 4 Clock Counter Q2 Q2 Q3 Note 1: TOST = 1024 TOSC; TPLL = 2 ms (approx). These intervals are not shown to scale. Wake from Interrupt Event TPLL(1) 1 2 3 45678 Clock Transition OSTS bit Set TOST(1)© 2007 Microchip Technology Inc. DS39605F-page 25 PIC18F1220/1320 3.3.3 RC_IDLE MODE In RC_IDLE mode, the CPU is disabled, but the peripherals continue to be clocked from the internal oscillator block using the INTOSC multiplexer. This mode allows for controllable power conservation during Idle periods. This mode is entered by setting the IDLEN bit, setting SCS1 (SCS0 is ignored) and executing a SLEEP instruction. The INTOSC multiplexer may be used to select a higher clock frequency by modifying the IRCF bits before executing the SLEEP instruction. When the clock source is switched to the INTOSC multiplexer (see Figure 3-7), the primary oscillator is shut down and the OSTS bit is cleared. If the IRCF bits are set to a non-zero value (thus, enabling the INTOSC output), the IOFS bit becomes set after the INTOSC output becomes stable, in about 1 ms. Clocks to the peripherals continue while the INTOSC source stabilizes. If the IRCF bits were previously at a non-zero value before the SLEEP instruction was executed and the INTOSC source was already stable, the IOFS bit will remain set. If the IRCF bits are all clear, the INTOSC output is not enabled and the IOFS bit will remain clear; there will be no indication of the current clock source. When a wake event occurs, the peripherals continue to be clocked from the INTOSC multiplexer. After a 10 μs delay following the wake event, the CPU begins executing code, being clocked by the INTOSC multiplexer. The microcontroller operates in RC_RUN mode until the primary clock becomes ready. When the primary clock becomes ready, a clock switchback to the primary clock occurs (see Figure 3-8). When the clock switch is complete, the IOFS bit is cleared, the OSTS bit is set and the primary clock is providing the system clock. The IDLEN and SCS bits are not affected by the wakeup. The INTRC source will continue to run if either the WDT or the Fail-Safe Clock Monitor is enabled. FIGURE 3-7: TIMING TRANSITION TO RC_IDLE MODE FIGURE 3-8: TIMING TRANSITION FOR WAKE FROM RC_RUN MODE (RC_RUN TO PRI_RUN) Q2 Q3 Q4 OSC1 Peripheral Program Q1 INTRC Q1 Counter Clock CPU Clock PC PC + 2 12345678 Clock Transition Q1 Q3 Q4 OSC1 Peripheral Program PC PC + 2 INTOSC PLL Clock Q1 PC + 6 Q2 Output Q3 Q4 Q1 CPU Clock PC + 4 Clock Counter Q2 Q2 Q3 Note 1: TOST = 1024 TOSC; TPLL = 2 ms (approx). These intervals are not shown to scale. Wake from Interrupt Event TOST(1) TPLL(1) 12345678 Clock Transition OSTS bit Set Multiplexer Q4PIC18F1220/1320 DS39605F-page 26 © 2007 Microchip Technology Inc. 3.4 Run Modes If the IDLEN bit is clear when a SLEEP instruction is executed, the CPU and peripherals are both clocked from the source selected using the SCS1:SCS0 bits. While these operating modes may not afford the power conservation of Idle or Sleep modes, they do allow the device to continue executing instructions by using a lower frequency clock source. RC_RUN mode also offers the possibility of executing code at a frequency greater than the primary clock. Wake-up from a power managed Run mode can be triggered by an interrupt, or any Reset, to return to full power operation. As the CPU is executing code in Run modes, several additional exits from Run modes are possible. They include exit to Sleep mode, exit to a corresponding Idle mode and exit by executing a RESET instruction. While the device is in any of the power managed Run modes, a WDT time-out will result in a WDT Reset. 3.4.1 PRI_RUN MODE The PRI_RUN mode is the normal full power execution mode. If the SLEEP instruction is never executed, the microcontroller operates in this mode (a SLEEP instruction is executed to enter all other power managed modes). All other power managed modes exit to PRI_RUN mode when an interrupt or WDT time-out occur. There is no entry to PRI_RUN mode. The OSTS bit is set. The IOFS bit may be set if the internal oscillator block is the primary clock source (see Section 2.7.1 “Oscillator Control Register”). 3.4.2 SEC_RUN MODE The SEC_RUN mode is the compatible mode to the “clock switching” feature offered in other PIC18 devices. In this mode, the CPU and peripherals are clocked from the Timer1 oscillator. This gives users the option of lower power consumption while still using a high accuracy clock source. SEC_RUN mode is entered by clearing the IDLEN bit, setting SCS1:SCS0 = 01 and executing a SLEEP instruction. The system clock source is switched to the Timer1 oscillator (see Figure 3-9), the primary oscillator is shut down, the T1RUN bit (T1CON<6>) is set and the OSTS bit is cleared. When a wake event occurs, the peripherals and CPU continue to be clocked from the Timer1 oscillator while the primary clock is started. When the primary clock becomes ready, a clock switchback to the primary clock occurs (see Figure 3-6). When the clock switch is complete, the T1RUN bit is cleared, the OSTS bit is set and the primary clock is providing the system clock. The IDLEN and SCS bits are not affected by the wake-up. The Timer1 oscillator continues to run. Firmware can force an exit from SEC_RUN mode. By clearing the T1OSCEN bit (T1CON<3>), an exit from SEC_RUN back to normal full power operation is triggered. The Timer1 oscillator will continue to run and provide the system clock, even though the T1OSCEN bit is cleared. The primary clock is started. When the primary clock becomes ready, a clock switchback to the primary clock occurs (see Figure 3-6). When the clock switch is complete, the Timer1 oscillator is disabled, the T1RUN bit is cleared, the OSTS bit is set and the primary clock is providing the system clock. The IDLEN and SCS bits are not affected by the wake-up. FIGURE 3-9: TIMING TRANSITION FOR ENTRY TO SEC_RUN MODE Note: The Timer1 oscillator should already be running prior to entering SEC_RUN mode. If the T1OSCEN bit is not set when the SLEEP instruction is executed, the SLEEP instruction will be ignored and entry to SEC_RUN mode will not occur. If the Timer1 oscillator is enabled, but not yet running, system clocks will be delayed until the oscillator has started; in such situations, initial oscillator operation is far from stable and unpredictable operation may result. Q2 Q3 Q4 OSC1 Peripheral Program Q1 T1OSI Q1 Counter Clock CPU Clock PC PC + 2 12345678 Clock Transition Q2 Q3 Q4 Q1 Q2 Q3 PC + 2© 2007 Microchip Technology Inc. DS39605F-page 27 PIC18F1220/1320 3.4.3 RC_RUN MODE In RC_RUN mode, the CPU and peripherals are clocked from the internal oscillator block using the INTOSC multiplexer and the primary clock is shut down. When using the INTRC source, this mode provides the best power conservation of all the Run modes, while still executing code. It works well for user applications which are not highly timing sensitive, or do not require high-speed clocks at all times. If the primary clock source is the internal oscillator block (either of the INTIO1 or INTIO2 oscillators), there are no distinguishable differences between PRI_RUN and RC_RUN modes during execution. However, a clock switch delay will occur during entry to and exit from RC_RUN mode. Therefore, if the primary clock source is the internal oscillator block, the use of RC_RUN mode is not recommended. This mode is entered by clearing the IDLEN bit, setting SCS1 (SCS0 is ignored) and executing a SLEEP instruction. The IRCF bits may select the clock frequency before the SLEEP instruction is executed. When the clock source is switched to the INTOSC multiplexer (see Figure 3-10), the primary oscillator is shut down and the OSTS bit is cleared. The IRCF bits may be modified at any time to immediately change the system clock speed. Executing a SLEEP instruction is not required to select a new clock frequency from the INTOSC multiplexer. If the IRCF bits are all clear, the INTOSC output is not enabled and the IOFS bit will remain clear; there will be no indication of the current clock source. The INTRC source is providing the system clocks. If the IRCF bits are changed from all clear (thus, enabling the INTOSC output), the IOFS bit becomes set after the INTOSC output becomes stable. Clocks to the system continue while the INTOSC source stabilizes, in approximately 1 ms. If the IRCF bits were previously at a non-zero value before the SLEEP instruction was executed and the INTOSC source was already stable, the IOFS bit will remain set. When a wake event occurs, the system continues to be clocked from the INTOSC multiplexer while the primary clock is started. When the primary clock becomes ready, a clock switch to the primary clock occurs (see Figure 3-8). When the clock switch is complete, the IOFS bit is cleared, the OSTS bit is set and the primary clock is providing the system clock. The IDLEN and SCS bits are not affected by the wake-up. The INTRC source will continue to run if either the WDT or the Fail-Safe Clock Monitor is enabled. FIGURE 3-10: TIMING TRANSITION TO RC_RUN MODE Note: Caution should be used when modifying a single IRCF bit. If VDD is less than 3V, it is possible to select a higher clock speed than is supported by the low VDD. Improper device operation may result if the VDD/FOSC specifications are violated. Q1 Q2 Q3 OSC1 Peripheral Program Q4 INTRC Q4 Counter Clock CPU Clock PC PC + 2 12345678 Clock Transition Q1 Q2 Q3 Q4 Q1 Q2 Q3 PC + 4PIC18F1220/1320 DS39605F-page 28 © 2007 Microchip Technology Inc. 3.4.4 EXIT TO IDLE MODE An exit from a power managed Run mode to its corresponding Idle mode is executed by setting the IDLEN bit and executing a SLEEP instruction. The CPU is halted at the beginning of the instruction following the SLEEP instruction. There are no changes to any of the clock source status bits (OSTS, IOFS or T1RUN). While the CPU is halted, the peripherals continue to be clocked from the previously selected clock source. 3.4.5 EXIT TO SLEEP MODE An exit from a power managed Run mode to Sleep mode is executed by clearing the IDLEN and SCS1:SCS0 bits and executing a SLEEP instruction. The code is no different than the method used to invoke Sleep mode from the normal operating (full power) mode. The primary clock and internal oscillator block are disabled. The INTRC will continue to operate if the WDT is enabled. The Timer1 oscillator will continue to run, if enabled in the T1CON register (Register 12-1). All clock source status bits are cleared (OSTS, IOFS and T1RUN). 3.5 Wake from Power Managed Modes An exit from any of the power managed modes is triggered by an interrupt, a Reset or a WDT time-out. This section discusses the triggers that cause exits from power managed modes. The clocking subsystem actions are discussed in each of the power managed modes (see Sections 3.2 through 3.4). Device behavior during Low-Power mode exits is summarized in Table 3-3. 3.5.1 EXIT BY INTERRUPT Any of the available interrupt sources can cause the device to exit a power managed mode and resume full power operation. To enable this functionality, an interrupt source must be enabled by setting its enable bit in one of the INTCON or PIE registers. The exit sequence is initiated when the corresponding interrupt flag bit is set. On all exits from Low-Power mode by interrupt, code execution branches to the interrupt vector if the GIE/GIEH bit (INTCON<7>) is set. Otherwise, code execution continues or resumes without branching (see Section 9.0 “Interrupts”). Note: If application code is timing sensitive, it should wait for the OSTS bit to become set before continuing. Use the interval during the low-power exit sequence (before OSTS is set) to perform timing insensitive “housekeeping” tasks.© 2007 Microchip Technology Inc. DS39605F-page 29 PIC18F1220/1320 TABLE 3-3: ACTIVITY AND EXIT DELAY ON WAKE FROM SLEEP MODE OR ANY IDLE MODE (BY CLOCK SOURCES) Clock in Power Managed Mode Primary System Clock Power Managed Mode Exit Delay Clock Ready Status Bit (OSCCON) Activity during Wake-up from Power Managed Mode Exit by Interrupt Exit by Reset Primary System Clock (PRI_IDLE mode) LP, XT, HS 5-10 μs(5) OSTS CPU and peripherals clocked by primary clock and executing instructions. Not clocked or Two-Speed Start-up (if enabled)(3). HSPLL EC, RC, INTRC(1) — INTOSC(2) IOFS T1OSC or INTRC(1) LP, XT, HS OST OSTS CPU and peripherals clocked by selected power managed mode clock and executing instructions until primary clock source becomes ready. HSPLL OST + 2 ms EC, RC, INTRC(1) 5-10 μs(5) — INTOSC(2) 1 ms(4) IOFS INTOSC(2) LP, XT, HS OST OSTS HSPLL OST + 2 ms EC, RC, INTRC(1) 5-10 μs(5) — INTOSC(2) None IOFS Sleep mode LP, XT, HS OST OSTS Not clocked or Two-Speed Start-up (if enabled) until primary clock source becomes ready(3). HSPLL OST + 2 ms EC, RC, INTRC(1) 5-10 μs(5) — INTOSC(2) 1 ms(4) IOFS Note 1: In this instance, refers specifically to the INTRC clock source. 2: Includes both the INTOSC 8 MHz source and postscaler derived frequencies. 3: Two-Speed Start-up is covered in greater detail in Section 19.3 “Two-Speed Start-up”. 4: Execution continues during the INTOSC stabilization period. 5: Required delay when waking from Sleep and all Idle modes. This delay runs concurrently with any other required delays (see Section 3.3 “Idle Modes”).PIC18F1220/1320 DS39605F-page 30 © 2007 Microchip Technology Inc. 3.5.2 EXIT BY RESET Normally, the device is held in Reset by the Oscillator Start-up Timer (OST) until the primary clock (defined in Configuration Register 1H) becomes ready. At that time, the OSTS bit is set and the device begins executing code. Code execution can begin before the primary clock becomes ready. If either the Two-Speed Start-up (see Section 19.3 “Two-Speed Start-up”) or Fail-Safe Clock Monitor (see Section 19.4 “Fail-Safe Clock Monitor”) are enabled in Configuration Register 1H, the device may begin execution as soon as the Reset source has cleared. Execution is clocked by the INTOSC multiplexer driven by the internal oscillator block. Since the OSCCON register is cleared following all Resets, the INTRC clock source is selected. A higher speed clock may be selected by modifying the IRCF bits in the OSCCON register. Execution is clocked by the internal oscillator block until either the primary clock becomes ready, or a power managed mode is entered before the primary clock becomes ready; the primary clock is then shut down. 3.5.3 EXIT BY WDT TIME-OUT A WDT time-out will cause different actions, depending on which power managed mode the device is in when the time-out occurs. If the device is not executing code (all Idle modes and Sleep mode), the time-out will result in a wake from the power managed mode (see Sections 3.2 through 3.4). If the device is executing code (all Run modes), the time-out will result in a WDT Reset (see Section 19.2 “Watchdog Timer (WDT)”). The WDT timer and postscaler are cleared by executing a SLEEP or CLRWDT instruction, the loss of a currently selected clock source (if the Fail-Safe Clock Monitor is enabled) and modifying the IRCF bits in the OSCCON register if the internal oscillator block is the system clock source. 3.5.4 EXIT WITHOUT AN OSCILLATOR START-UP DELAY Certain exits from power managed modes do not invoke the OST at all. These are: • PRI_IDLE mode, where the primary clock source is not stopped; or • the primary clock source is not any of LP, XT, HS or HSPLL modes. In these cases, the primary clock source either does not require an oscillator start-up delay, since it is already running (PRI_IDLE), or normally does not require an oscillator start-up delay (RC, EC and INTIO Oscillator modes). However, a fixed delay (approximately 10 μs) following the wake event is required when leaving Sleep and Idle modes. This delay is required for the CPU to prepare for execution. Instruction execution resumes on the first clock cycle following this delay. 3.6 INTOSC Frequency Drift The factory calibrates the internal oscillator block output (INTOSC) for 8 MHz (see Table 22-6). However, this frequency may drift as VDD or temperature changes, which can affect the controller operation in a variety of ways. It is possible to adjust the INTOSC frequency by modifying the value in the OSCTUNE register (Register 2-1). This has the side effect that the INTRC clock source frequency is also affected. However, the features that use the INTRC source often do not require an exact frequency. These features include the Fail-Safe Clock Monitor, the Watchdog Timer and the RC_RUN/ RC_IDLE modes when the INTRC clock source is selected. Being able to adjust the INTOSC requires knowing when an adjustment is required, in which direction it should be made and in some cases, how large a change is needed. Three examples follow but other techniques may be used.© 2007 Microchip Technology Inc. DS39605F-page 31 PIC18F1220/1320 3.6.1 EXAMPLE – EUSART An adjustment may be indicated when the EUSART begins to generate framing errors, or receives data with errors while in Asynchronous mode. Framing errors indicate that the system clock frequency is too high – try decrementing the value in the OSCTUNE register to reduce the system clock frequency. Errors in data may suggest that the system clock speed is too low – increment OSCTUNE. 3.6.2 EXAMPLE – TIMERS This technique compares system clock speed to some reference clock. Two timers may be used; one timer is clocked by the peripheral clock, while the other is clocked by a fixed reference source, such as the Timer1 oscillator. Both timers are cleared, but the timer clocked by the reference generates interrupts. When an interrupt occurs, the internally clocked timer is read and both timers are cleared. If the internally clocked timer value is greater than expected, then the internal oscillator block is running too fast – decrement OSCTUNE. 3.6.3 EXAMPLE – CCP IN CAPTURE MODE A CCP module can use free running Timer1 (or Timer3), clocked by the internal oscillator block and an external event with a known period (i.e., AC power frequency). The time of the first event is captured in the CCPRxH:CCPRxL registers and is recorded for use later. When the second event causes a capture, the time of the first event is subtracted from the time of the second event. Since the period of the external event is known, the time difference between events can be calculated. If the measured time is much greater than the calculated time, the internal oscillator block is running too fast – decrement OSCTUNE. If the measured time is much less than the calculated time, the internal oscillator block is running too slow – increment OSCTUNE.PIC18F1220/1320 DS39605F-page 32 © 2007 Microchip Technology Inc. NOTES:© 2007 Microchip Technology Inc. DS39605F-page 33 PIC18F1220/1320 4.0 RESET The PIC18F1220/1320 devices differentiate between various kinds of Reset: a) Power-on Reset (POR) b) MCLR Reset during normal operation c) MCLR Reset during Sleep d) Watchdog Timer (WDT) Reset (during execution) e) Programmable Brown-out Reset (BOR) f) RESET Instruction g) Stack Full Reset h) Stack Underflow Reset Most registers are unaffected by a Reset. Their status is unknown on POR and unchanged by all other Resets. The other registers are forced to a “Reset state”, depending on the type of Reset that occurred. Most registers are not affected by a WDT wake-up, since this is viewed as the resumption of normal operation. Status bits from the RCON register (Register 4-1), RI, TO, PD, POR and BOR, are set or cleared differently in different Reset situations, as indicated in Table 4-2. These bits are used in software to determine the nature of the Reset. See Table 4-3 for a full description of the Reset states of all registers. A simplified block diagram of the On-Chip Reset Circuit is shown in Figure 4-1. The Enhanced MCU devices have a MCLR noise filter in the MCLR Reset path. The filter will detect and ignore small pulses. The MCLR pin is not driven low by any internal Resets, including the WDT. The MCLR input provided by the MCLR pin can be disabled with the MCLRE bit in Configuration Register 3H (CONFIG3H<7>). FIGURE 4-1: SIMPLIFIED BLOCK DIAGRAM OF ON-CHIP RESET CIRCUIT S R Q External Reset MCLR VDD OSC1 WDT Time-out VDD Rise Detect OST/PWRT INTRC(1) POR Pulse OST 10-bit Ripple Counter PWRT Chip_Reset 11-bit Ripple Counter Enable OST(2) Enable PWRT Note 1: This is a separate oscillator from the RC oscillator of the CLKI pin. 2: See Table 4-1 for time-out situations. Brown-out Reset BOR RESET Instruction Stack Pointer Stack Full/Underflow Reset Sleep ( )_IDLE 1024 Cycles 65.5 ms 32 μs MCLREPIC18F1220/1320 DS39605F-page 34 © 2007 Microchip Technology Inc. 4.1 Power-on Reset (POR) A Power-on Reset pulse is generated on-chip when VDD rise is detected. To take advantage of the POR circuitry, just tie the MCLR pin through a resistor (1k to 10 kΩ) to VDD. This will eliminate external RC components usually needed to create a Power-on Reset delay. A minimum rise rate for VDD is specified (parameter D004). For a slow rise time, see Figure 4-2. When the device starts normal operation (i.e., exits the Reset condition), device operating parameters (voltage, frequency, temperature, etc.) must be met to ensure operation. If these conditions are not met, the device must be held in Reset until the operating conditions are met. FIGURE 4-2: EXTERNAL POWER-ON RESET CIRCUIT (FOR SLOW VDD POWER-UP) 4.2 Power-up Timer (PWRT) The Power-up Timer (PWRT) of the PIC18F1220/1320 is an 11-bit counter, which uses the INTRC source as the clock input. This yields a count of 2048 x 32 μs = 65.6 ms. While the PWRT is counting, the device is held in Reset. The power-up time delay will vary from chip-to-chip due to VDD, temperature and process variation. See DC parameter 33 for details. The PWRT is enabled by clearing configuration bit, PWRTEN. 4.3 Oscillator Start-up Timer (OST) The Oscillator Start-up Timer (OST) provides a 1024 oscillator cycle (from OSC1 input) delay after the PWRT delay is over (parameter 33). This ensures that the crystal oscillator or resonator has started and stabilized. The OST time-out is invoked only for XT, LP, HS and HSPLL modes and only on Power-on Reset, or on exit from most low-power modes. 4.4 PLL Lock Time-out With the PLL enabled in its PLL mode, the time-out sequence following a Power-on Reset is slightly different from other oscillator modes. A portion of the Power-up Timer is used to provide a fixed time-out that is sufficient for the PLL to lock to the main oscillator frequency. This PLL lock time-out (TPLL) is typically 2 ms and follows the Oscillator Start-up Time-out. 4.5 Brown-out Reset (BOR) A configuration bit, BOR, can disable (if clear/ programmed), or enable (if set) the Brown-out Reset circuitry. If VDD falls below VBOR (parameter D005) for greater than TBOR (parameter 35), the brown-out situation will reset the chip. A Reset may not occur if VDD falls below VBOR for less than TBOR. The chip will remain in Brown-out Reset until VDD rises above VBOR. If the Power-up Timer is enabled, it will be invoked after VDD rises above VBOR; it then will keep the chip in Reset for an additional time delay, TPWRT (parameter 33). If VDD drops below VBOR while the Power-up Timer is running, the chip will go back into a Brown-out Reset and the Power-up Timer will be initialized. Once VDD rises above VBOR, the Power-up Timer will execute the additional time delay. Enabling BOR Reset does not automatically enable the PWRT. 4.6 Time-out Sequence On power-up, the time-out sequence is as follows: First, after the POR pulse has cleared, PWRT time-out is invoked (if enabled). Then, the OST is activated. The total time-out will vary based on oscillator configuration and the status of the PWRT. For example, in RC mode with the PWRT disabled, there will be no time-out at all. Figure 4-3, Figure 4-4, Figure 4-5, Figure 4-6 and Figure 4-7 depict time-out sequences on power-up. Since the time-outs occur from the POR pulse, if MCLR is kept low long enough, all time-outs will expire. Bringing MCLR high will begin execution immediately (Figure 4-5). This is useful for testing purposes or to synchronize more than one PIC18FXXXX device operating in parallel. Table 4-2 shows the Reset conditions for some Special Function Registers, while Table 4-3 shows the Reset conditions for all the registers. Note 1: External Power-on Reset circuit is required only if the VDD power-up slope is too slow. The diode D helps discharge the capacitor quickly when VDD powers down. 2: R < 40 kΩ is recommended to make sure that the voltage drop across R does not violate the device’s electrical specification. 3: R1 ≥ 1 kΩ will limit any current flowing into MCLR from external capacitor C, in the event of MCLR/VPP pin breakdown due to Electrostatic Discharge (ESD) or Electrical Overstress (EOS). C R1 D R VDD MCLR PIC18FXXXX VDD© 2007 Microchip Technology Inc. DS39605F-page 35 PIC18F1220/1320 TABLE 4-1: TIME-OUT IN VARIOUS SITUATIONS REGISTER 4-1: RCON REGISTER BITS AND POSITIONS TABLE 4-2: STATUS BITS, THEIR SIGNIFICANCE AND THE INITIALIZATION CONDITION FOR RCON REGISTER Oscillator Configuration Power-up(2) and Brown-out Exit from Low-Power Mode PWRTEN = 0 PWRTEN = 1 HSPLL 66 ms(1) + 1024 TOSC + 2 ms(2) 1024 TOSC + 2 ms(2) 1024 TOSC + 2 ms(2) HS, XT, LP 66 ms(1) + 1024 TOSC 1024 TOSC 1024 TOSC EC, ECIO 66 ms(1) 5-10 μs(3) 5-10 μs(3) RC, RCIO 66 ms(1) 5-10 μs(3) 5-10 μs(3) INTIO1, INTIO2 66 ms(1) 5-10 μs(3) 5-10 μs(3) Note 1: 66 ms (65.5 ms) is the nominal Power-up Timer (PWRT) delay. 2: 2 ms is the nominal time required for the 4x PLL to lock. 3: The program memory bias start-up time is always invoked on POR, wake-up from Sleep, or on any exit from power managed mode that disables the CPU and instruction execution. R/W-0 U-0 U-0 R/W-1 R/W-1 R/W-1 R/W-1 R/W-1 IPEN — — RI TO PD POR BOR bit 7 bit 0 Note: Refer to Section 5.14 “RCON Register” for bit definitions. Condition Program Counter RCON Register RI TO PD POR BOR STKFUL STKUNF Power-on Reset 0000h 0--1 1100 1 1 1 0 0 0 0 RESET Instruction 0000h 0--0 uuuu 0 u u u u u u Brown-out 0000h 0--1 11u- 1 1 1 u 0 u u MCLR during Power Managed Run modes 0000h 0--u 1uuu u 1 u u u u u MCLR during Power Managed Idle modes and Sleep 0000h 0--u 10uu u 1 0 u u u u WDT Time-out during Full Power or Power Managed Run 0000h 0--u 0uuu u 0 u u u u u MCLR during Full Power Execution 0000h 0--u uuuu u u u u u u u Stack Full Reset (STVR = 1) 1 u Stack Underflow Reset (STVR = 1) u 1 Stack Underflow Error (not an actual Reset, STVR = 0) 0000h u--u uuuu u u u u u u 1 WDT Time-out during Power Managed Idle or Sleep PC + 2 u--u 00uu u 0 0 u u u u Interrupt Exit from Power Managed modes PC + 2 u--u u0uu u u 0 u u u u Legend: u = unchanged, x = unknown, – = unimplemented bit, read as ‘0’ Note 1: When the wake-up is due to an interrupt and the GIEH or GIEL bits are set, the PC is loaded with the interrupt vector (0x000008h or 0x000018h).PIC18F1220/1320 DS39605F-page 36 © 2007 Microchip Technology Inc. TABLE 4-3: INITIALIZATION CONDITIONS FOR ALL REGISTERS Register Applicable Devices Power-on Reset, Brown-out Reset MCLR Resets WDT Reset RESET Instruction Stack Resets Wake-up via WDT or Interrupt TOSU 1220 1320 ---0 0000 ---0 0000 ---0 uuuu(3) TOSH 1220 1320 0000 0000 0000 0000 uuuu uuuu(3) TOSL 1220 1320 0000 0000 0000 0000 uuuu uuuu(3) STKPTR 1220 1320 00-0 0000 00-0 0000 uu-u uuuu(3) PCLATU 1220 1320 ---0 0000 ---0 0000 ---u uuuu PCLATH 1220 1320 0000 0000 0000 0000 uuuu uuuu PCL 1220 1320 0000 0000 0000 0000 PC + 2(2) TBLPTRU 1220 1320 --00 0000 --00 0000 --uu uuuu TBLPTRH 1220 1320 0000 0000 0000 0000 uuuu uuuu TBLPTRL 1220 1320 0000 0000 0000 0000 uuuu uuuu TABLAT 1220 1320 0000 0000 0000 0000 uuuu uuuu PRODH 1220 1320 xxxx xxxx uuuu uuuu uuuu uuuu PRODL 1220 1320 xxxx xxxx uuuu uuuu uuuu uuuu INTCON 1220 1320 0000 000x 0000 000u uuuu uuuu(1) INTCON2 1220 1320 1111 -1-1 1111 -1-1 uuuu -u-u(1) INTCON3 1220 1320 11-0 0-00 11-0 0-00 uu-u u-uu(1) INDF0 1220 1320 N/A N/A N/A POSTINC0 1220 1320 N/A N/A N/A POSTDEC0 1220 1320 N/A N/A N/A PREINC0 1220 1320 N/A N/A N/A PLUSW0 1220 1320 N/A N/A N/A FSR0H 1220 1320 ---- 0000 ---- 0000 ---- uuuu FSR0L 1220 1320 xxxx xxxx uuuu uuuu uuuu uuuu WREG 1220 1320 xxxx xxxx uuuu uuuu uuuu uuuu INDF1 1220 1320 N/A N/A N/A POSTINC1 1220 1320 N/A N/A N/A POSTDEC1 1220 1320 N/A N/A N/A PREINC1 1220 1320 N/A N/A N/A PLUSW1 1220 1320 N/A N/A N/A FSR1H 1220 1320 ---- 0000 ---- 0000 ---- uuuu FSR1L 1220 1320 xxxx xxxx uuuu uuuu uuuu uuuu Legend: u = unchanged, x = unknown, - = unimplemented bit, read as ‘0’, q = value depends on condition. Shaded cells indicate conditions do not apply for the designated device. Note 1: One or more bits in the INTCONx or PIRx registers will be affected (to cause wake-up). 2: When the wake-up is due to an interrupt and the GIEL or GIEH bit is set, the PC is loaded with the interrupt vector (0008h or 0018h). 3: When the wake-up is due to an interrupt and the GIEL or GIEH bit is set, the TOSU, TOSH and TOSL are updated with the current value of the PC. The STKPTR is modified to point to the next location in the hardware stack. 4: See Table 4-2 for Reset value for specific condition. 5: Bits 6 and 7 of PORTA, LATA and TRISA are enabled, depending on the Oscillator mode selected. When not enabled as PORTA pins, they are disabled and read ‘0’. 6: Bit 5 of PORTA is enabled if MCLR is disabled.© 2007 Microchip Technology Inc. DS39605F-page 37 PIC18F1220/1320 BSR 1220 1320 ---- 0000 ---- 0000 ---- uuuu INDF2 1220 1320 N/A N/A N/A POSTINC2 1220 1320 N/A N/A N/A POSTDEC2 1220 1320 N/A N/A N/A PREINC2 1220 1320 N/A N/A N/A PLUSW2 1220 1320 N/A N/A N/A FSR2H 1220 1320 ---- 0000 ---- 0000 ---- uuuu FSR2L 1220 1320 xxxx xxxx uuuu uuuu uuuu uuuu STATUS 1220 1320 ---x xxxx ---u uuuu ---u uuuu TMR0H 1220 1320 0000 0000 0000 0000 uuuu uuuu TMR0L 1220 1320 xxxx xxxx uuuu uuuu uuuu uuuu T0CON 1220 1320 1111 1111 1111 1111 uuuu uuuu OSCCON 1220 1320 0000 q000 0000 q000 uuuu qquu LVDCON 1220 1320 --00 0101 --00 0101 --uu uuuu WDTCON 1220 1320 ---- ---0 ---- ---0 ---- ---u RCON(4) 1220 1320 0--1 11q0 0--q qquu u--u qquu TMR1H 1220 1320 xxxx xxxx uuuu uuuu uuuu uuuu TMR1L 1220 1320 xxxx xxxx uuuu uuuu uuuu uuuu T1CON 1220 1320 0000 0000 u0uu uuuu uuuu uuuu TMR2 1220 1320 0000 0000 0000 0000 uuuu uuuu PR2 1220 1320 1111 1111 1111 1111 1111 1111 T2CON 1220 1320 -000 0000 -000 0000 -uuu uuuu ADRESH 1220 1320 xxxx xxxx uuuu uuuu uuuu uuuu ADRESL 1220 1320 xxxx xxxx uuuu uuuu uuuu uuuu ADCON0 1220 1320 00-0 0000 00-0 0000 uu-u uuuu ADCON1 1220 1320 -000 0000 -000 0000 -uuu uuuu ADCON2 1220 1320 0-00 0000 0-00 0000 u-uu uuuu CCPR1H 1220 1320 xxxx xxxx uuuu uuuu uuuu uuuu CCPR1L 1220 1320 xxxx xxxx uuuu uuuu uuuu uuuu CCP1CON 1220 1320 0000 0000 0000 0000 uuuu uuuu PWM1CON 1220 1320 0000 0000 0000 0000 uuuu uuuu ECCPAS 1220 1320 0000 0000 0000 0000 uuuu uuuu TABLE 4-3: INITIALIZATION CONDITIONS FOR ALL REGISTERS (CONTINUED) Register Applicable Devices Power-on Reset, Brown-out Reset MCLR Resets WDT Reset RESET Instruction Stack Resets Wake-up via WDT or Interrupt Legend: u = unchanged, x = unknown, - = unimplemented bit, read as ‘0’, q = value depends on condition. Shaded cells indicate conditions do not apply for the designated device. Note 1: One or more bits in the INTCONx or PIRx registers will be affected (to cause wake-up). 2: When the wake-up is due to an interrupt and the GIEL or GIEH bit is set, the PC is loaded with the interrupt vector (0008h or 0018h). 3: When the wake-up is due to an interrupt and the GIEL or GIEH bit is set, the TOSU, TOSH and TOSL are updated with the current value of the PC. The STKPTR is modified to point to the next location in the hardware stack. 4: See Table 4-2 for Reset value for specific condition. 5: Bits 6 and 7 of PORTA, LATA and TRISA are enabled, depending on the Oscillator mode selected. When not enabled as PORTA pins, they are disabled and read ‘0’. 6: Bit 5 of PORTA is enabled if MCLR is disabled.PIC18F1220/1320 DS39605F-page 38 © 2007 Microchip Technology Inc. TMR3H 1220 1320 xxxx xxxx uuuu uuuu uuuu uuuu TMR3L 1220 1320 xxxx xxxx uuuu uuuu uuuu uuuu T3CON 1220 1320 0-00 0000 u-uu uuuu u-uu uuuu SPBRGH 1220 1320 0000 0000 0000 0000 uuuu uuuu SPBRG 1220 1320 0000 0000 0000 0000 uuuu uuuu RCREG 1220 1320 0000 0000 0000 0000 uuuu uuuu TXREG 1220 1320 0000 0000 0000 0000 uuuu uuuu TXSTA 1220 1320 0000 0010 0000 0010 uuuu uuuu RCSTA 1220 1320 0000 000x 0000 000x uuuu uuuu BAUDCTL 1220 1320 -1-1 0-00 -1-1 0-00 -u-u u-uu EEADR 1220 1320 0000 0000 0000 0000 uuuu uuuu EEDATA 1220 1320 0000 0000 0000 0000 uuuu uuuu EECON2 1220 1320 0000 0000 0000 0000 0000 0000 EECON1 1220 1320 xx-0 x000 uu-0 u000 uu-0 u000 IPR2 1220 1320 1--1 -11- 1--1 -11- u--u -uuPIR2 1220 1320 0--0 -00- 0--0 -00- u--u -uu-(1) PIE2 1220 1320 0--0 -00- 0--0 -00- u--u -uuIPR1 1220 1320 -111 -111 -111 -111 -uuu -uuu PIR1 1220 1320 -000 -000 -000 -000 -uuu -uuu(1) PIE1 1220 1320 -000 -000 -000 -000 -uuu -uuu OSCTUNE 1220 1320 --00 0000 --00 0000 --uu uuuu TRISB 1220 1320 1111 1111 1111 1111 uuuu uuuu TRISA(5) 1220 1320 11-1 1111(5) 11-1 1111(5) uu-u uuuu(5) LATB 1220 1320 xxxx xxxx uuuu uuuu uuuu uuuu LATA(5) 1220 1320 xx-x xxxx(5) uu-u uuuu(5) uu-u uuuu(5) PORTB 1220 1320 xxxx xxxx uuuu uuuu uuuu uuuu PORTA(5,6) 1220 1320 xx0x 0000(5,6) uu0u 0000(5,6) uuuu uuuu(5,6) TABLE 4-3: INITIALIZATION CONDITIONS FOR ALL REGISTERS (CONTINUED) Register Applicable Devices Power-on Reset, Brown-out Reset MCLR Resets WDT Reset RESET Instruction Stack Resets Wake-up via WDT or Interrupt Legend: u = unchanged, x = unknown, - = unimplemented bit, read as ‘0’, q = value depends on condition. Shaded cells indicate conditions do not apply for the designated device. Note 1: One or more bits in the INTCONx or PIRx registers will be affected (to cause wake-up). 2: When the wake-up is due to an interrupt and the GIEL or GIEH bit is set, the PC is loaded with the interrupt vector (0008h or 0018h). 3: When the wake-up is due to an interrupt and the GIEL or GIEH bit is set, the TOSU, TOSH and TOSL are updated with the current value of the PC. The STKPTR is modified to point to the next location in the hardware stack. 4: See Table 4-2 for Reset value for specific condition. 5: Bits 6 and 7 of PORTA, LATA and TRISA are enabled, depending on the Oscillator mode selected. When not enabled as PORTA pins, they are disabled and read ‘0’. 6: Bit 5 of PORTA is enabled if MCLR is disabled.© 2007 Microchip Technology Inc. DS39605F-page 39 PIC18F1220/1320 FIGURE 4-3: TIME-OUT SEQUENCE ON POWER-UP (MCLR TIED TO VDD, VDD RISE < TPWRT) FIGURE 4-4: TIME-OUT SEQUENCE ON POWER-UP (MCLR NOT TIED TO VDD): CASE 1 FIGURE 4-5: TIME-OUT SEQUENCE ON POWER-UP (MCLR NOT TIED TO VDD): CASE 2 TPWRT TOST VDD MCLR INTERNAL POR PWRT TIME-OUT OST TIME-OUT INTERNAL RESET TPWRT TOST VDD MCLR INTERNAL POR PWRT TIME-OUT OST TIME-OUT INTERNAL RESET VDD MCLR INTERNAL POR PWRT TIME-OUT OST TIME-OUT INTERNAL RESET TPWRT TOSTPIC18F1220/1320 DS39605F-page 40 © 2007 Microchip Technology Inc. FIGURE 4-6: SLOW RISE TIME (MCLR TIED TO VDD, VDD RISE > TPWRT) FIGURE 4-7: TIME-OUT SEQUENCE ON POR W/PLL ENABLED (MCLR TIED TO VDD) VDD MCLR INTERNAL POR PWRT TIME-OUT OST TIME-OUT INTERNAL RESET 0V 1V 5V TPWRT TOST TPWRT TOST VDD MCLR INTERNAL POR PWRT TIME-OUT OST TIME-OUT INTERNAL RESET PLL TIME-OUT TPLL Note: TOST = 1024 clock cycles. TPLL ≈ 2 ms max. First three stages of the PWRT timer.© 2007 Microchip Technology Inc. DS39605F-page 41 PIC18F1220/1320 5.0 MEMORY ORGANIZATION There are three memory types in Enhanced MCU devices. These memory types are: • Program Memory • Data RAM • Data EEPROM Data and program memory use separate busses, which allows for concurrent access of these types. Additional detailed information for Flash program memory and data EEPROM is provided in Section 6.0 “Flash Program Memory” and Section 7.0 “Data EEPROM Memory”, respectively. FIGURE 5-1: PROGRAM MEMORY MAP AND STACK FOR PIC18F1220 5.1 Program Memory Organization A 21-bit program counter is capable of addressing the 2-Mbyte program memory space. Accessing a location between the physically implemented memory and the 2-Mbyte address will cause a read of all ‘0’s (a NOP instruction). The PIC18F1220 has 4 Kbytes of Flash memory and can store up to 2,048 single-word instructions. The PIC18F1320 has 8 Kbytes of Flash memory and can store up to 4,096 single-word instructions. The Reset vector address is at 0000h and the interrupt vector addresses are at 0008h and 0018h. The program memory maps for the PIC18F1220 and PIC18F1320 devices are shown in Figure 5-1 and Figure 5-2, respectively. FIGURE 5-2: PROGRAM MEMORY MAP AND STACK FOR PIC18F1320 PC<20:0> Stack Level 1 • Stack Level 31 Reset Vector Low Priority Interrupt Vector • • CALL,RCALL,RETURN RETFIE,RETLW 21 0000h 0018h On-Chip Program Memory High Priority Interrupt Vector 0008h User Memory Space 1FFFFFh 1000h 0FFFh Read ‘0’ 200000h PC<20:0> Stack Level 1 • Stack Level 31 Reset Vector Low Priority Interrupt Vector • • CALL,RCALL,RETURN RETFIE,RETLW 21 0000h 0018h 2000h 1FFFh On-Chip Program Memory High Priority Interrupt Vector 0008h User Memory Space Read ‘0’ 1FFFFFh 200000hPIC18F1220/1320 DS39605F-page 42 © 2007 Microchip Technology Inc. 5.2 Return Address Stack The return address stack allows any combination of up to 31 program calls and interrupts to occur. The PC (Program Counter) is pushed onto the stack when a CALL or RCALL instruction is executed, or an interrupt is Acknowledged. The PC value is pulled off the stack on a RETURN, RETLW or a RETFIE instruction. PCLATU and PCLATH are not affected by any of the RETURN or CALL instructions. The stack operates as a 31-word by 21-bit RAM and a 5-bit stack pointer, with the Stack Pointer initialized to 00000B after all Resets. There is no RAM associated with Stack Pointer, 00000B. This is only a Reset value. During a CALL type instruction, causing a push onto the stack, the Stack Pointer is first incremented and the RAM location pointed to by the Stack Pointer (STKPTR) register is written with the contents of the PC (already pointing to the instruction following the CALL). During a RETURN type instruction, causing a pop from the stack, the contents of the RAM location pointed to by the STKPTR are transferred to the PC and then the Stack Pointer is decremented. The stack space is not part of either program or data space. The Stack Pointer is readable and writable and the address on the top of the stack is readable and writable through the top-of-stack Special File Registers. Data can also be pushed to or popped from the stack using the top-of-stack SFRs. Status bits indicate if the stack is full, has overflowed or underflowed. 5.2.1 TOP-OF-STACK ACCESS The top of the stack is readable and writable. Three register locations, TOSU, TOSH and TOSL, hold the contents of the stack location pointed to by the STKPTR register (Figure 5-3). This allows users to implement a software stack if necessary. After a CALL, RCALL or interrupt, the software can read the pushed value by reading the TOSU, TOSH and TOSL registers. These values can be placed on a user defined software stack. At return time, the software can replace the TOSU, TOSH and TOSL and do a return. The user must disable the global interrupt enable bits while accessing the stack to prevent inadvertent stack corruption. 5.2.2 RETURN STACK POINTER (STKPTR) The STKPTR register (Register 5-1) contains the stack pointer value, the STKFUL (Stack Full) status bit and the STKUNF (Stack Underflow) status bits. The value of the Stack Pointer can be 0 through 31. The Stack Pointer increments before values are pushed onto the stack and decrements after values are popped off the stack. At Reset, the Stack Pointer value will be zero. The user may read and write the Stack Pointer value. This feature can be used by a Real-Time Operating System for return stack maintenance. After the PC is pushed onto the stack 31 times (without popping any values off the stack), the STKFUL bit is set. The STKFUL bit is cleared by software or by a POR. The action that takes place when the stack becomes full depends on the state of the STVR (Stack Overflow Reset Enable) configuration bit. (Refer to Section 19.1 “Configuration Bits” for a description of the device configuration bits.) If STVR is set (default), the 31st push will push the (PC + 2) value onto the stack, set the STKFUL bit and reset the device. The STKFUL bit will remain set and the Stack Pointer will be set to zero. If STVR is cleared, the STKFUL bit will be set on the 31st push and the Stack Pointer will increment to 31. Any additional pushes will not overwrite the 31st push and STKPTR will remain at 31. When the stack has been popped enough times to unload the stack, the next pop will return a value of zero to the PC and sets the STKUNF bit, while the Stack Pointer remains at zero. The STKUNF bit will remain set until cleared by software or a POR occurs. FIGURE 5-3: RETURN ADDRESS STACK AND ASSOCIATED REGISTERS Note: Returning a value of zero to the PC on an underflow has the effect of vectoring the program to the Reset vector, where the stack conditions can be verified and appropriate actions can be taken. This is not the same as a Reset, as the contents of the SFRs are not affected. 00011 001A34h 11111 11110 11101 00010 00001 00000 00010 Return Address Stack Top-of-Stack 000D58h TOSU TOSH TOSL 00h 1Ah 34h STKPTR<4:0>© 2007 Microchip Technology Inc. DS39605F-page 43 PIC18F1220/1320 REGISTER 5-1: STKPTR REGISTER 5.2.3 PUSH AND POP INSTRUCTIONS Since the Top-of-Stack (TOS) is readable and writable, the ability to push values onto the stack and pull values off the stack, without disturbing normal program execution, is a desirable option. To push the current PC value onto the stack, a PUSH instruction can be executed. This will increment the Stack Pointer and load the current PC value onto the stack. TOSU, TOSH and TOSL can then be modified to place data or a return address on the stack. The ability to pull the TOS value off of the stack and replace it with the value that was previously pushed onto the stack, without disturbing normal execution, is achieved by using the POP instruction. The POP instruction discards the current TOS by decrementing the Stack Pointer. The previous value pushed onto the stack then becomes the TOS value. 5.2.4 STACK FULL/UNDERFLOW RESETS These Resets are enabled by programming the STVR bit in Configuration Register 4L. When the STVR bit is cleared, a full or underflow condition will set the appropriate STKFUL or STKUNF bit, but not cause a device Reset. When the STVR bit is set, a full or underflow condition will set the appropriate STKFUL or STKUNF bit and then cause a device Reset. The STKFUL or STKUNF bits are cleared by the user software or a Power-on Reset. R/C-0 R/C-0 U-0 R/W-0 R/W-0 R/W-0 R/W-0 R/W-0 STKFUL STKUNF — SP4 SP3 SP2 SP1 SP0 bit 7 bit 0 bit 7(1) STKFUL: Stack Full Flag bit 1 = Stack became full or overflowed 0 = Stack has not become full or overflowed bit 6(1) STKUNF: Stack Underflow Flag bit 1 = Stack underflow occurred 0 = Stack underflow did not occur bit 5 Unimplemented: Read as ‘0’ bit 4-0 SP4:SP0: Stack Pointer Location bits Note 1: Bit 7 and bit 6 are cleared by user software or by a POR. Legend: R = Readable bit W = Writable bit U = Unimplemented C = Clearable only bit -n = Value at POR ‘1’ = Bit is set ‘0’ = Bit is cleared x = Bit is unknownPIC18F1220/1320 DS39605F-page 44 © 2007 Microchip Technology Inc. 5.3 Fast Register Stack A “fast return” option is available for interrupts. A fast register stack is provided for the Status, WREG and BSR registers and is only one in depth. The stack is not readable or writable and is loaded with the current value of the corresponding register when the processor vectors for an interrupt. The values in the registers are then loaded back into the working registers, if the RETFIE, FAST instruction is used to return from the interrupt. All interrupt sources will push values into the stack registers. If both low and high priority interrupts are enabled, the stack registers cannot be used reliably to return from low priority interrupts. If a high priority interrupt occurs while servicing a low priority interrupt, the stack register values stored by the low priority interrupt will be overwritten. Users must save the key registers in software during a low priority interrupt. If interrupt priority is not used, all interrupts may use the fast register stack for returns from interrupt. If no interrupts are used, the fast register stack can be used to restore the Status, WREG and BSR registers at the end of a subroutine call. To use the fast register stack for a subroutine call, a CALL LABEL, FAST instruction must be executed to save the Status, WREG and BSR registers to the fast register stack. A RETURN, FAST instruction is then executed to restore these registers from the fast register stack. Example 5-1 shows a source code example that uses the fast register stack during a subroutine call and return. EXAMPLE 5-1: FAST REGISTER STACK CODE EXAMPLE 5.4 PCL, PCLATH and PCLATU The Program Counter (PC) specifies the address of the instruction to fetch for execution. The PC is 21-bits wide. The low byte, known as the PCL register, is both readable and writable. The high byte, or PCH register, contains the PC<15:8> bits and is not directly readable or writable. Updates to the PCH register may be performed through the PCLATH register. The upper byte is called PCU. This register contains the PC<20:16> bits and is not directly readable or writable. Updates to the PCU register may be performed through the PCLATU register. The contents of PCLATH and PCLATU will be transferred to the program counter by any operation that writes PCL. Similarly, the upper two bytes of the program counter will be transferred to PCLATH and PCLATU by an operation that reads PCL. This is useful for computed offsets to the PC (see Section 5.8.1 “Computed GOTO”). The PC addresses bytes in the program memory. To prevent the PC from becoming misaligned with word instructions, the LSB of PCL is fixed to a value of ‘0’. The PC increments by 2 to address sequential instructions in the program memory. The CALL, RCALL, GOTO and program branch instructions write to the program counter directly. For these instructions, the contents of PCLATH and PCLATU are not transferred to the program counter. CALL SUB1, FAST ;STATUS, WREG, BSR ;SAVED IN FAST REGISTER ;STACK • • SUB1 • • RETURN, FAST ;RESTORE VALUES SAVED ;IN FAST REGISTER STACK© 2007 Microchip Technology Inc. DS39605F-page 45 PIC18F1220/1320 5.5 Clocking Scheme/Instruction Cycle The clock input (from OSC1) is internally divided by four to generate four non-overlapping quadrature clocks, namely Q1, Q2, Q3 and Q4. Internally, the Program Counter (PC) is incremented every Q1, the instruction is fetched from the program memory and latched into the instruction register in Q4. The instruction is decoded and executed during the following Q1 through Q4. The clocks and instruction execution flow are shown in Figure 5-4. 5.6 Instruction Flow/Pipelining An “Instruction Cycle” consists of four Q cycles (Q1, Q2, Q3 and Q4). The instruction fetch and execute are pipelined such that fetch takes one instruction cycle, while decode and execute takes another instruction cycle. However, due to the pipelining, each instruction effectively executes in one cycle. If an instruction causes the program counter to change (e.g., GOTO), then two cycles are required to complete the instruction (Example 5-2). A fetch cycle begins with the Program Counter (PC) incrementing in Q1. In the execution cycle, the fetched instruction is latched into the “Instruction Register” (IR) in cycle Q1. This instruction is then decoded and executed during the Q2, Q3 and Q4 cycles. Data memory is read during Q2 (operand read) and written during Q4 (destination write). FIGURE 5-4: CLOCK/INSTRUCTION CYCLE EXAMPLE 5-2: INSTRUCTION PIPELINE FLOW Q1 Q2 Q3 Q4 Q1 Q2 Q3 Q4 Q1 Q2 Q3 Q4 OSC1 Q1 Q2 Q3 Q4 PC OSC2/CLKO (RC Mode) PC PC + 2 PC + 4 Fetch INST (PC) Execute INST (PC – 2) Fetch INST (PC + 2) Execute INST (PC) Fetch INST (PC + 4) Execute INST (PC + 2) Internal Phase Clock All instructions are single cycle, except for any program branches. These take two cycles, since the fetch instruction is “flushed” from the pipeline, while the new instruction is being fetched and then executed. TCY0 TCY1 TCY2 TCY3 TCY4 TCY5 1. MOVLW 55h Fetch 1 Execute 1 2. MOVWF PORTB Fetch 2 Execute 2 3. BRA SUB_1 Fetch 3 Execute 3 4. BSF PORTA, BIT3 (Forced NOP) Fetch 4 Flush (NOP) 5. Instruction @ address SUB_1 Fetch SUB_1 Execute SUB_1PIC18F1220/1320 DS39605F-page 46 © 2007 Microchip Technology Inc. 5.7 Instructions in Program Memory The program memory is addressed in bytes. Instructions are stored as two bytes or four bytes in program memory. The Least Significant Byte of an instruction word is always stored in a program memory location with an even address (LSB = 0). Figure 5-5 shows an example of how instruction words are stored in the program memory. To maintain alignment with instruction boundaries, the PC increments in steps of 2 and the LSB will always read ‘0’ (see Section 5.4 “PCL, PCLATH and PCLATU”). The CALL and GOTO instructions have the absolute program memory address embedded into the instruction. Since instructions are always stored on word boundaries, the data contained in the instruction is a word address. The word address is written to PC<20:1>, which accesses the desired byte address in program memory. Instruction #2 in Figure 5-5 shows how the instruction ‘GOTO 000006h’ is encoded in the program memory. Program branch instructions, which encode a relative address offset, operate in the same manner. The offset value stored in a branch instruction represents the number of single-word instructions that the PC will be offset by. Section 20.0 “Instruction Set Summary” provides further details of the instruction set. FIGURE 5-5: INSTRUCTIONS IN PROGRAM MEMORY 5.7.1 TWO-WORD INSTRUCTIONS PIC18F1220/1320 devices have four two-word instructions: MOVFF, CALL, GOTO and LFSR. The second word of these instructions has the 4 MSBs set to ‘1’s and is decoded as a NOP instruction. The lower 12 bits of the second word contain data to be used by the instruction. If the first word of the instruction is executed, the data in the second word is accessed. If the second word of the instruction is executed by itself (first word was skipped), it will execute as a NOP. This action is necessary when the two-word instruction is preceded by a conditional instruction that results in a skip operation. A program example that demonstrates this concept is shown in Example 5-3. Refer to Section 20.0 “Instruction Set Summary” for further details of the instruction set. EXAMPLE 5-3: TWO-WORD INSTRUCTIONS Word Address LSB = 1 LSB = 0 ↓ Program Memory Byte Locations → 000000h 000002h 000004h 000006h Instruction 1: MOVLW 055h 0Fh 55h 000008h Instruction 2: GOTO 000006h EFh 03h 00000Ah F0h 00h 00000Ch Instruction 3: MOVFF 123h, 456h C1h 23h 00000Eh F4h 56h 000010h 000012h 000014h CASE 1: Object Code Source Code 0110 0110 0000 0000 TSTFSZ REG1 ; is RAM location 0? 1100 0001 0010 0011 MOVFF REG1, REG2 ; No, skip this word 1111 0100 0101 0110 ; Execute this word as a NOP 0010 0100 0000 0000 ADDWF REG3 ; continue code CASE 2: Object Code Source Code 0110 0110 0000 0000 TSTFSZ REG1 ; is RAM location 0? 1100 0001 0010 0011 MOVFF REG1, REG2 ; Yes, execute this word 1111 0100 0101 0110 ; 2nd word of instruction 0010 0100 0000 0000 ADDWF REG3 ; continue code© 2007 Microchip Technology Inc. DS39605F-page 47 PIC18F1220/1320 5.8 Look-up Tables Look-up tables are implemented two ways: • Computed GOTO • Table Reads 5.8.1 COMPUTED GOTO A computed GOTO is accomplished by adding an offset to the program counter (see Example 5-4). A look-up table can be formed with an ADDWF PCL instruction and a group of RETLW 0xnn instructions. WREG is loaded with an offset into the table before executing a call to that table. The first instruction of the called routine is the ADDWF PCL instruction. The next instruction executed will be one of the RETLW 0xnn instructions, that returns the value 0xnn to the calling function. The offset value (in WREG) specifies the number of bytes that the program counter should advance and should be multiples of 2 (LSB = 0). In this method, only one data byte may be stored in each instruction location and room on the return address stack is required. EXAMPLE 5-4: COMPUTED GOTO USING AN OFFSET VALUE 5.8.2 TABLE READS/TABLE WRITES A better method of storing data in program memory allows two bytes of data to be stored in each instruction location. Look-up table data may be stored two bytes per program word by using table reads and writes. The Table Pointer (TBLPTR) register specifies the byte address and the Table Latch (TABLAT) register contains the data that is read from or written to program memory. Data is transferred to/from program memory, one byte at a time. The table read/table write operation is discussed further in Section 6.1 “Table Reads and Table Writes”. 5.9 Data Memory Organization The data memory is implemented as static RAM. Each register in the data memory has a 12-bit address, allowing up to 4096 bytes of data memory. Figure 5-6 shows the data memory organization for the PIC18F1220/1320 devices. The data memory map is divided into as many as 16 banks that contain 256 bytes each. The lower 4 bits of the Bank Select Register (BSR<3:0>) select which bank will be accessed. The upper 4 bits for the BSR are not implemented. The data memory contains Special Function Registers (SFR) and General Purpose Registers (GPR). The SFRs are used for control and status of the controller and peripheral functions, while GPRs are used for data storage and scratch pad operations in the user’s application. The SFRs start at the last location of Bank 15 (FFFh) and extend towards F80h. Any remaining space beyond the SFRs in the Bank may be implemented as GPRs. GPRs start at the first location of Bank 0 and grow upwards. Any read of an unimplemented location will read as ‘0’s. The entire data memory may be accessed directly or indirectly. Direct addressing may require the use of the BSR register. Indirect addressing requires the use of a File Select Register (FSRn) and a corresponding Indirect File Operand (INDFn). Each FSR holds a 12-bit address value that can be used to access any location in the Data Memory map without banking. See Section 5.12 “Indirect Addressing, INDF and FSR Registers” for indirect addressing details. The instruction set and architecture allow operations across all banks. This may be accomplished by indirect addressing or by the use of the MOVFF instruction. The MOVFF instruction is a two-word/two-cycle instruction that moves a value from one register to another. To ensure that commonly used registers (SFRs and select GPRs) can be accessed in a single cycle, regardless of the current BSR values, an Access Bank is implemented. A segment of Bank 0 and a segment of Bank 15 comprise the Access RAM. Section 5.10 “Access Bank” provides a detailed description of the Access RAM. 5.9.1 GENERAL PURPOSE REGISTER FILE Enhanced MCU devices may have banked memory in the GPR area. GPRs are not initialized by a Power-on Reset and are unchanged on all other Resets. Data RAM is available for use as GPR registers by all instructions. The second half of Bank 15 (F80h to FFFh) contains SFRs. All other banks of data memory contain GPRs, starting with Bank 0. MOVFW OFFSET CALL TABLE ORG 0xnn00 TABLE ADDWF PCL RETLW 0xnn RETLW 0xnn RETLW 0xnn . . .PIC18F1220/1320 DS39605F-page 48 © 2007 Microchip Technology Inc. FIGURE 5-6: DATA MEMORY MAP FOR PIC18F1220/1320 DEVICES Bank 0 Bank 14 Bank 15 BSR<3:0> Data Memory Map = 0000 = 1111 080h 07Fh F80h FFFh 00h 7Fh 80h FFh Access Bank When a = 0, The BSR is ignored and the Access Bank is used. The first 128 bytes are General Purpose RAM (from Bank 0). The second 128 bytes are Special Function Registers (from Bank 15). When a = 1, The BSR specifies the Bank used by the instruction. F7Fh F00h EFFh 0FFh 000h Access RAM FFh 00h FFh 00h GPR SFR Unused Access RAM High Access RAM Low Bank 1 to Unused = 1110 Read ‘00h’ = 0001 (SFRs)© 2007 Microchip Technology Inc. DS39605F-page 49 PIC18F1220/1320 5.9.2 SPECIAL FUNCTION REGISTERS The Special Function Registers (SFRs) are registers used by the CPU and peripheral modules for controlling the desired operation of the device. These registers are implemented as static RAM. A list of these registers is given in Table 5-1 and Table 5-2. The SFRs can be classified into two sets: those associated with the “core” function and those related to the peripheral functions. Those registers related to the “core” are described in this section, while those related to the operation of the peripheral features are described in the section of that peripheral feature. The SFRs are typically distributed among the peripherals whose functions they control. The unused SFR locations will be unimplemented and read as ‘0’s. TABLE 5-1: SPECIAL FUNCTION REGISTER MAP FOR PIC18F1220/1320 DEVICES Address Name Address Name Address Name Address Name FFFh TOSU FDFh INDF2(2) FBFh CCPR1H F9Fh IPR1 FFEh TOSH FDEh POSTINC2(2) FBEh CCPR1L F9Eh PIR1 FFDh TOSL FDDh POSTDEC2(2) FBDh CCP1CON F9Dh PIE1 FFCh STKPTR FDCh PREINC2(2) FBCh — F9Ch — FFBh PCLATU FDBh PLUSW2(2) FBBh — F9Bh OSCTUNE FFAh PCLATH FDAh FSR2H FBAh — F9Ah — FF9h PCL FD9h FSR2L FB9h — F99h — FF8h TBLPTRU FD8h STATUS FB8h — F98h — FF7h TBLPTRH FD7h TMR0H FB7h PWM1CON F97h — FF6h TBLPTRL FD6h TMR0L FB6h ECCPAS F96h — FF5h TABLAT FD5h T0CON FB5h — F95h — FF4h PRODH FD4h — FB4h — F94h — FF3h PRODL FD3h OSCCON FB3h TMR3H F93h TRISB FF2h INTCON FD2h LVDCON FB2h TMR3L F92h TRISA FF1h INTCON2 FD1h WDTCON FB1h T3CON F91h — FF0h INTCON3 FD0h RCON FB0h SPBRGH F90h — FEFh INDF0(2) FCFh TMR1H FAFh SPBRG F8Fh — FEEh POSTINC0(2) FCEh TMR1L FAEh RCREG F8Eh — FEDh POSTDEC0(2) FCDh T1CON FADh TXREG F8Dh — FECh PREINC0(2) FCCh TMR2 FACh TXSTA F8Ch — FEBh PLUSW0(2) FCBh PR2 FABh RCSTA F8Bh — FEAh FSR0H FCAh T2CON FAAh BAUDCTL F8Ah LATB FE9h FSR0L FC9h — FA9h EEADR F89h LATA FE8h WREG FC8h — FA8h EEDATA F88h — FE7h INDF1(2) FC7h — FA7h EECON2 F87h — FE6h POSTINC1(2) FC6h — FA6h EECON1 F86h — FE5h POSTDEC1(2) FC5h — FA5h — F85h — FE4h PREINC1(2) FC4h ADRESH FA4h — F84h — FE3h PLUSW1(2) FC3h ADRESL FA3h — F83h — FE2h FSR1H FC2h ADCON0 FA2h IPR2 F82h — FE1h FSR1L FC1h ADCON1 FA1h PIR2 F81h PORTB FE0h BSR FC0h ADCON2 FA0h PIE2 F80h PORTA Note 1: Unimplemented registers are read as ‘0’. 2: This is not a physical register.PIC18F1220/1320 DS39605F-page 50 © 2007 Microchip Technology Inc. TABLE 5-2: REGISTER FILE SUMMARY (PIC18F1220/1320) File Name Bit 7 Bit 6 Bit 5 Bit 4 Bit 3 Bit 2 Bit 1 Bit 0 Value on POR, BOR Details on page: TOSU — — — Top-of-Stack Upper Byte (TOS<20:16>) ---0 0000 36, 42 TOSH Top-of-Stack High Byte (TOS<15:8>) 0000 0000 36, 42 TOSL Top-of-Stack Low Byte (TOS<7:0>) 0000 0000 36, 42 STKPTR STKFUL STKUNF — Return Stack Pointer 00-0 0000 36, 43 PCLATU — — bit 21(3) Holding Register for PC<20:16> ---0 0000 36, 44 PCLATH Holding Register for PC<15:8> 0000 0000 36, 44 PCL PC Low Byte (PC<7:0>) 0000 0000 36, 44 TBLPTRU — — bit 21 Program Memory Table Pointer Upper Byte (TBLPTR<20:16>) --00 0000 36, 60 TBLPTRH Program Memory Table Pointer High Byte (TBLPTR<15:8>) 0000 0000 36, 60 TBLPTRL Program Memory Table Pointer Low Byte (TBLPTR<7:0>) 0000 0000 36, 60 TABLAT Program Memory Table Latch 0000 0000 36, 60 PRODH Product Register High Byte xxxx xxxx 36, 71 PRODL Product Register Low Byte xxxx xxxx 36, 71 INTCON GIE/GIEH PEIE/GIEL TMR0IE INT0IE RBIE TMR0IF INT0IF RBIF 0000 000x 36, 75 INTCON2 RBPU INTEDG0 INTEDG1 INTEDG2 — TMR0IP — RBIP 1111 -1-1 36, 76 INTCON3 INT2IP INT1IP — INT2IE INT1IE — INT2IF INT1IF 11-0 0-00 36, 77 INDF0 Uses contents of FSR0 to address data memory – value of FSR0 not changed (not a physical register) N/A 36, 53 POSTINC0 Uses contents of FSR0 to address data memory – value of FSR0 post-incremented (not a physical register) N/A 36, 53 POSTDEC0 Uses contents of FSR0 to address data memory– value of FSR0 post-decremented (not a physical register) N/A 36, 53 PREINC0 Uses contents of FSR0 to address data memory – value of FSR0 pre-incremented (not a physical register) N/A 36, 53 PLUSW0 Uses contents of FSR0 to address data memory – value of FSR0 offset by W (not a physical register) N/A 36, 53 FSR0H — — — — Indirect Data Memory Address Pointer 0 High ---- 0000 36, 53 FSR0L Indirect Data Memory Address Pointer 0 Low Byte xxxx xxxx 36, 53 WREG Working Register xxxx xxxx 36 INDF1 Uses contents of FSR1 to address data memory – value of FSR1 not changed (not a physical register) N/A 36, 53 POSTINC1 Uses contents of FSR1 to address data memory – value of FSR1 post-incremented (not a physical register) N/A 36, 53 POSTDEC1 Uses contents of FSR1 to address data memory – value of FSR1 post-decremented (not a physical register) N/A 36, 53 PREINC1 Uses contents of FSR1 to address data memory – value of FSR1 pre-incremented (not a physical register) N/A 36, 53 PLUSW1 Uses contents of FSR1 to address data memory – value of FSR1 offset by W (not a physical register) N/A 36, 53 FSR1H — — — — Indirect Data Memory Address Pointer 1 High ---- 0000 36, 53 FSR1L Indirect Data Memory Address Pointer 1 Low Byte xxxx xxxx 36, 53 BSR — — — — Bank Select Register ---- 0000 37, 52 INDF2 Uses contents of FSR2 to address data memory – value of FSR2 not changed (not a physical register) N/A 37, 53 POSTINC2 Uses contents of FSR2 to address data memory – value of FSR2 post-incremented (not a physical register) N/A 37, 53 POSTDEC2 Uses contents of FSR2 to address data memory – value of FSR2 post-decremented (not a physical register) N/A 37, 53 PREINC2 Uses contents of FSR2 to address data memory – value of FSR2 pre-incremented (not a physical register) N/A 37, 53 PLUSW2 Uses contents of FSR2 to address data memory – value of FSR2 offset by W (not a physical register) N/A 37, 53 FSR2H — — — — Indirect Data Memory Address Pointer 2 High ---- 0000 37, 53 FSR2L Indirect Data Memory Address Pointer 2 Low Byte xxxx xxxx 37, 53 STATUS — — — N OV Z DC C ---x xxxx 37, 55 TMR0H Timer0 Register High Byte 0000 0000 37, 101 TMR0L Timer0 Register Low Byte xxxx xxxx 37, 101 T0CON TMR0ON T08BIT T0CS T0SE PSA T0PS2 T0PS1 T0PS0 1111 1111 37, 99 OSCCON IDLEN IRCF2 IRCF1 IRCF0 OSTS IOFS SCS1 SCS0 0000 q000 37, 17 LVDCON — — IVRST LVDEN LVDL3 LVDL2 LVDL1 LVDL0 --00 0101 37, 167 WDTCON — — — — — — — SWDTEN --- ---0 37, 180 RCON IPEN — — RI TO PD POR BOR 0--1 11q0 35, 56, 84 Legend: x = unknown, u = unchanged, – = unimplemented, q = value depends on condition Note 1: RA6 and associated bits are configured as port pins in RCIO, ECIO and INTIO2 (with port function on RA6) Oscillator mode only and read ‘0’ in all other oscillator modes. 2: RA7 and associated bits are configured as port pins in INTIO2 Oscillator mode only and read ‘0’ in all other modes. 3: Bit 21 of the PC is only available in Test mode and Serial Programming modes. 4: The RA5 port bit is only available when MCLRE fuse (CONFIG3H<7>) is programmed to ‘0’. Otherwise, RA5 reads ‘0’. This bit is read-only.© 2007 Microchip Technology Inc. DS39605F-page 51 PIC18F1220/1320 TMR1H Timer1 Register High Byte xxxx xxxx 37, 108 TMR1L Timer1 Register Low Byte xxxx xxxx 37, 108 T1CON RD16 T1RUN T1CKPS1 T1CKPS0 T1OSCEN T1SYNC TMR1CS TMR1ON 0000 0000 37, 103 TMR2 Timer2 Register 0000 0000 37, 109 PR2 Timer2 Period Register 1111 1111 37, 109 T2CON — TOUTPS3 TOUTPS2 TOUTPS1 TOUTPS0 TMR2ON T2CKPS1 T2CKPS0 -000 0000 37, 109 ADRESH A/D Result Register High Byte xxxx xxxx 37, 164 ADRESL A/D Result Register Low Byte xxxx xxxx 37, 164 ADCON0 VCFG1 VCFG0 — CHS2 CHS1 CHS0 GO/DONE ADON 00-0 0000 37, 155 ADCON1 — PCFG6 PCFG5 PCFG4 PCFG3 PCFG2 PCFG1 PCFG0 -000 0000 37, 156 ADCON2 ADFM — ACQT2 ACQT1 ACQT0 ADCS2 ADCS1 ADCS0 0-00 0000 37, 157 CCPR1H Capture/Compare/PWM Register 1 High Byte xxxx xxxx 37. 116 CCPR1L Capture/Compare/PWM Register 1 Low Byte xxxx xxxx 37, 116 CCP1CON P1M1 P1M0 DC1B1 DC1B0 CCP1M3 CCP1M2 CCP1M1 CCP1M0 0000 0000 37, 115 PWM1CON PRSEN PDC6 PDC5 PDC4 PDC3 PDC2 PDC1 PDC0 0000 0000 37, 126 ECCPAS ECCPASE ECCPAS2 ECCPAS1 ECCPAS0 PSSAC1 PSSAC0 PSSBD1 PSSBD0 0000 0000 37, 127 TMR3H Timer3 Register High Byte xxxx xxxx 38, 113 TMR3L Timer3 Register Low Byte xxxx xxxx 38, 113 T3CON RD16 — T3CKPS1 T3CKPS0 T3CCP1 T3SYNC TMR3CS TMR3ON 0-00 0000 38, 111 SPBRGH EUSART Baud Rate Generator High Byte 0000 0000 38 SPBRG EUSART Baud Rate Generator Low Byte 0000 0000 38, 135 RCREG EUSART Receive Register 0000 0000 38, 143, 142 TXREG EUSART Transmit Register 0000 0000 38, 140, 142 TXSTA CSRC TX9 TXEN SYNC SENDB BRGH TRMT TX9D 0000 0010 38, 132 RCSTA SPEN RX9 SREN CREN ADDEN FERR OERR RX9D 0000 000x 38, 133 BAUDCTL — RCIDL — SCKP BRG16 — WUE ABDEN -1-1 0-00 38 EEADR EEPROM Address Register 0000 0000 38, 67 EEDATA EEPROM Data Register 0000 0000 38, 70 EECON2 EEPROM Control Register 2 (not a physical register) 0000 0000 38, 58, 67 EECON1 EEPGD CFGS — FREE WRERR WREN WR RD xx-0 x000 38, 59, 68 IPR2 OSCFIP — — EEIP — LVDIP TMR3IP — 1--1 -11- 38, 83 PIR2 OSCFIF — — EEIF — LVDIF TMR3IF — 0--0 -00- 38, 79 PIE2 OSCFIE — — EEIE — LVDIE TMR3IE — 0--0 -00- 38, 81 IPR1 — ADIP RCIP TXIP — CCP1IP TMR2IP TMR1IP -111 -111 38, 82 PIR1 — ADIF RCIF TXIF — CCP1IF TMR2IF TMR1IF -000 -000 38, 78 PIE1 — ADIE RCIE TXIE — CCP1IE TMR2IE TMR1IE -000 -000 38, 80 OSCTUNE — — TUN5 TUN4 TUN3 TUN2 TUN1 TUN0 --00 0000 38, 15 TRISB Data Direction Control Register for PORTB 1111 1111 38, 98 TRISA TRISA7(2) TRISA6(1) — Data Direction Control Register for PORTA 11-1 1111 38, 89 LATB Read/Write PORTB Data Latch xxxx xxxx 38, 98 LATA LATA<7>(2) LATA<6>(1) — Read/Write PORTA Data Latch xx-x xxxx 38, 89 PORTB Read PORTB pins, Write PORTB Data Latch xxxx xxxx 38, 98 PORTA RA7(2) RA6(1) RA5(4) Read PORTA pins, Write PORTA Data Latch xx0x 0000 38, 89 TABLE 5-2: REGISTER FILE SUMMARY (PIC18F1220/1320) (CONTINUED) File Name Bit 7 Bit 6 Bit 5 Bit 4 Bit 3 Bit 2 Bit 1 Bit 0 Value on POR, BOR Details on page: Legend: x = unknown, u = unchanged, – = unimplemented, q = value depends on condition Note 1: RA6 and associated bits are configured as port pins in RCIO, ECIO and INTIO2 (with port function on RA6) Oscillator mode only and read ‘0’ in all other oscillator modes. 2: RA7 and associated bits are configured as port pins in INTIO2 Oscillator mode only and read ‘0’ in all other modes. 3: Bit 21 of the PC is only available in Test mode and Serial Programming modes. 4: The RA5 port bit is only available when MCLRE fuse (CONFIG3H<7>) is programmed to ‘0’. Otherwise, RA5 reads ‘0’. This bit is read-only.PIC18F1220/1320 DS39605F-page 52 © 2007 Microchip Technology Inc. 5.10 Access Bank The Access Bank is an architectural enhancement which is very useful for C compiler code optimization. The techniques used by the C compiler may also be useful for programs written in assembly. This data memory region can be used for: • Intermediate computational values • Local variables of subroutines • Faster context saving/switching of variables • Common variables • Faster evaluation/control of SFRs (no banking) The Access Bank is comprised of the last 128 bytes in Bank 15 (SFRs) and the first 128 bytes in Bank 0. These two sections will be referred to as Access RAM High and Access RAM Low, respectively. Figure 5-6 indicates the Access RAM areas. A bit in the instruction word specifies if the operation is to occur in the bank specified by the BSR register or in the Access Bank. This bit is denoted as the ‘a’ bit (for access bit). When forced in the Access Bank (a = 0), the last address in Access RAM Low is followed by the first address in Access RAM High. Access RAM High maps the Special Function Registers, so these registers can be accessed without any software overhead. This is useful for testing status flags and modifying control bits. 5.11 Bank Select Register (BSR) The need for a large general purpose memory space dictates a RAM banking scheme. The data memory is partitioned into as many as sixteen banks. When using direct addressing, the BSR should be configured for the desired bank. BSR<3:0> holds the upper 4 bits of the 12-bit RAM address. The BSR<7:4> bits will always read ‘0’s and writes will have no effect (see Figure 5-7). A MOVLB instruction has been provided in the instruction set to assist in selecting banks. If the currently selected bank is not implemented, any read will return all ‘0’s and all writes are ignored. The Status register bits will be set/cleared as appropriate for the instruction performed. Each Bank extends up to FFh (256 bytes). All data memory is implemented as static RAM. A MOVFF instruction ignores the BSR, since the 12-bit addresses are embedded into the instruction word. Section 5.12 “Indirect Addressing, INDF and FSR Registers” provides a description of indirect addressing, which allows linear addressing of the entire RAM space. FIGURE 5-7: DIRECT ADDRESSING Note 1: For register file map detail, see Table 5-1. 2: The access bit of the instruction can be used to force an override of the selected bank (BSR<3:0>) to the registers of the Access Bank. 3: The MOVFF instruction embeds the entire 12-bit address in the instruction. Data Memory(1) Direct Addressing Bank Select(2) Location Select(3) BSR<3:0> 7 From Opcode 0 (3) 00h 01h 0Eh 0Fh Bank 0 Bank 1 Bank 14 Bank 15 1FFh 100h 0FFh 000h EFFh E00h FFFh F00h BSR<7:4> 000 0© 2007 Microchip Technology Inc. DS39605F-page 53 PIC18F1220/1320 5.12 Indirect Addressing, INDF and FSR Registers Indirect addressing is a mode of addressing data memory, where the data memory address in the instruction is not fixed. An FSR register is used as a pointer to the data memory location that is to be read or written. Since this pointer is in RAM, the contents can be modified by the program. This can be useful for data tables in the data memory and for software stacks. Figure 5-8 shows how the fetched instruction is modified prior to being executed. Indirect addressing is possible by using one of the INDF registers. Any instruction, using the INDF register, actually accesses the register pointed to by the File Select Register, FSR. Reading the INDF register itself, indirectly (FSR = 0), will read 00h. Writing to the INDF register indirectly, results in a no operation (NOP). The FSR register contains a 12-bit address, which is shown in Figure 5-9. The INDFn register is not a physical register. Addressing INDFn actually addresses the register whose address is contained in the FSRn register (FSRn is a pointer). This is indirect addressing. Example 5-5 shows a simple use of indirect addressing to clear the RAM in Bank 1 (locations 100h-1FFh) in a minimum number of instructions. EXAMPLE 5-5: HOW TO CLEAR RAM (BANK 1) USING INDIRECT ADDRESSING There are three indirect addressing registers. To address the entire data memory space (4096 bytes), these registers are 12-bit wide. To store the 12 bits of addressing information, two 8-bit registers are required: 1. FSR0: composed of FSR0H:FSR0L 2. FSR1: composed of FSR1H:FSR1L 3. FSR2: composed of FSR2H:FSR2L In addition, there are registers INDF0, INDF1 and INDF2, which are not physically implemented. Reading or writing to these registers activates indirect addressing, with the value in the corresponding FSR register being the address of the data. If an instruction writes a value to INDF0, the value will be written to the address pointed to by FSR0H:FSR0L. A read from INDF1 reads the data from the address pointed to by FSR1H:FSR1L. INDFn can be used in code anywhere an operand can be used. If INDF0, INDF1 or INDF2 are read indirectly via an FSR, all ‘0’s are read (zero bit is set). Similarly, if INDF0, INDF1 or INDF2 are written to indirectly, the operation will be equivalent to a NOP instruction and the Status bits are not affected. 5.12.1 INDIRECT ADDRESSING OPERATION Each FSR register has an INDF register associated with it, plus four additional register addresses. Performing an operation using one of these five registers determines how the FSR will be modified during indirect addressing. When data access is performed using one of the five INDFn locations, the address selected will configure the FSRn register to: • Do nothing to FSRn after an indirect access (no change) – INDFn • Auto-decrement FSRn after an indirect access (post-decrement) – POSTDECn • Auto-increment FSRn after an indirect access (post-increment) – POSTINCn • Auto-increment FSRn before an indirect access (pre-increment) – PREINCn • Use the value in the WREG register as an offset to FSRn. Do not modify the value of the WREG or the FSRn register after an indirect access (no change) – PLUSWn When using the auto-increment or auto-decrement features, the effect on the FSR is not reflected in the Status register. For example, if the indirect address causes the FSR to equal ‘0’, the Z bit will not be set. Auto-incrementing or auto-decrementing an FSR affects all 12 bits. That is, when FSRnL overflows from an increment, FSRnH will be incremented automatically. Adding these features allows the FSRn to be used as a stack pointer, in addition to its uses for table operations in data memory. Each FSR has an address associated with it that performs an indexed indirect access. When a data access to this INDFn location (PLUSWn) occurs, the FSRn is configured to add the signed value in the WREG register and the value in FSR to form the address before an indirect access. The FSR value is not changed. The WREG offset range is -128 to +127. If an FSR register contains a value that points to one of the INDFn, an indirect read will read 00h (zero bit is set), while an indirect write will be equivalent to a NOP (Status bits are not affected). If an indirect addressing write is performed when the target address is an FSRnH or FSRnL register, the data is written to the FSR register, but no pre- or post-increment/ decrement is performed. LFSR FSR0,0x100 ; NEXT CLRF POSTINC0 ; Clear INDF ; register then ; inc pointer BTFSS FSR0H, 1 ; All done with ; Bank1? GOTO NEXT ; NO, clear next CONTINUE ; YES, continue PIC18F1220/1320 DS39605F-page 54 © 2007 Microchip Technology Inc. FIGURE 5-8: INDIRECT ADDRESSING OPERATION FIGURE 5-9: INDIRECT ADDRESSING Opcode Address File Address = Access of an Indirect Addressing Register FSR Instruction Executed Instruction Fetched RAM Opcode File 12 12 12 BSR<3:0> 4 8 0h FFFh Note 1: For register file map detail, see Table 5-1. Data Memory(1) Indirect Addressing FSRnH:FSRnL 3 0 0FFFh 0000h Location Select 11 0 0 7© 2007 Microchip Technology Inc. DS39605F-page 55 PIC18F1220/1320 5.13 Status Register The Status register, shown in Register 5-2, contains the arithmetic status of the ALU. As with any other SFR, it can be the operand for any instruction. If the Status register is the destination for an instruction that affects the Z, DC, C, OV or N bits, the results of the instruction are not written; instead, the status is updated according to the instruction performed. Therefore, the result of an instruction with the Status register as its destination may be different than intended. As an example, CLRF STATUS will set the Z bit and leave the remaining Status bits unchanged (‘000u u1uu’). It is recommended that only BCF, BSF, SWAPF, MOVFF and MOVWF instructions are used to alter the Status register, because these instructions do not affect the Z, C, DC, OV or N bits in the Status register. For other instructions that do not affect Status bits, see the instruction set summaries in Table 20-1. REGISTER 5-2: STATUS REGISTER Note: The C and DC bits operate as the borrow and digit borrow bits, respectively, in subtraction. U-0 U-0 U-0 R/W-x R/W-x R/W-x R/W-x R/W-x — — — N OV Z DC C bit 7 bit 0 bit 7-5 Unimplemented: Read as ‘0’ bit 4 N: Negative bit This bit is used for signed arithmetic (2’s complement). It indicates whether the result was negative (ALU MSB = 1). 1 = Result was negative 0 = Result was positive bit 3 OV: Overflow bit This bit is used for signed arithmetic (2’s complement). It indicates an overflow of the 7-bit magnitude, which causes the sign bit (bit 7) to change state. 1 = Overflow occurred for signed arithmetic (in this arithmetic operation) 0 = No overflow occurred bit 2 Z: Zero bit 1 = The result of an arithmetic or logic operation is zero 0 = The result of an arithmetic or logic operation is not zero bit 1 DC: Digit carry/borrow bit For ADDWF, ADDLW, SUBLW and SUBWF instructions: 1 = A carry-out from the 4th low-order bit of the result occurred 0 = No carry-out from the 4th low-order bit of the result Note: For borrow, the polarity is reversed. A subtraction is executed by adding the 2’s complement of the second operand. For rotate (RRF, RLF) instructions, this bit is loaded with either the bit 4 or bit 3 of the source register. bit 0 C: Carry/borrow bit For ADDWF, ADDLW, SUBLW and SUBWF instructions: 1 = A carry-out from the Most Significant bit of the result occurred 0 = No carry-out from the Most Significant bit of the result occurred Note: For borrow, the polarity is reversed. A subtraction is executed by adding the 2’s complement of the second operand. For rotate (RRF, RLF) instructions, this bit is loaded with either the high or low-order bit of the source register. Legend: R = Readable bit W = Writable bit U = Unimplemented bit, read as ‘0’ -n = Value at POR ‘1’ = Bit is set ‘0’ = Bit is cleared x = Bit is unknownPIC18F1220/1320 DS39605F-page 56 © 2007 Microchip Technology Inc. 5.14 RCON Register The Reset Control (RCON) register contains flag bits that allow differentiation between the sources of a device Reset. These flags include the TO, PD, POR, BOR and RI bits. This register is readable and writable. REGISTER 5-3: RCON REGISTER Note 1: If the BOR configuration bit is set (Brownout Reset enabled), the BOR bit is ‘1’ on a Power-on Reset. After a Brown-out Reset has occurred, the BOR bit will be cleared and must be set by firmware to indicate the occurrence of the next Brown-out Reset. 2: It is recommended that the POR bit be set after a Power-on Reset has been detected, so that subsequent Power-on Resets may be detected. R/W-0 U-0 U-0 R/W-1 R-1 R-1 R/W-0 R/W-0 IPEN — — RI TO PD POR BOR bit 7 bit 0 bit 7 IPEN: Interrupt Priority Enable bit 1 = Enable priority levels on interrupts 0 = Disable priority levels on interrupts (PIC16CXXX Compatibility mode) bit 6-5 Unimplemented: Read as ‘0’ bit 4 RI: RESET Instruction Flag bit 1 = The RESET instruction was not executed (set by firmware only) 0 = The RESET instruction was executed causing a device Reset (must be set in software after a Brown-out Reset occurs) bit 3 TO: Watchdog Time-out Flag bit 1 = Set by power-up, CLRWDT instruction or SLEEP instruction 0 = A WDT time-out occurred bit 2 PD: Power-down Detection Flag bit 1 = Set by power-up or by the CLRWDT instruction 0 = Cleared by execution of the SLEEP instruction bit 1 POR: Power-on Reset Status bit 1 = A Power-on Reset has not occurred (set by firmware only) 0 = A Power-on Reset occurred (must be set in software after a Power-on Reset occurs) bit 0 BOR: Brown-out Reset Status bit 1 = A Brown-out Reset has not occurred (set by firmware only) 0 = A Brown-out Reset occurred (must be set in software after a Brown-out Reset occurs) Legend: R = Readable bit W = Writable bit U = Unimplemented bit, read as ‘0’ -n = Value at POR ‘1’ = Bit is set ‘0’ = Bit is cleared x = Bit is unknown© 2007 Microchip Technology Inc. DS39605F-page 57 PIC18F1220/1320 6.0 FLASH PROGRAM MEMORY The Flash program memory is readable, writable and erasable during normal operation over the entire VDD range. A read from program memory is executed on one byte at a time. A write to program memory is executed on blocks of 8 bytes at a time. Program memory is erased in blocks of 64 bytes at a time. A “Bulk Erase” operation may not be issued from user code. While writing or erasing program memory, instruction fetches cease until the operation is complete. The program memory cannot be accessed during the write or erase, therefore, code cannot execute. An internal programming timer terminates program memory writes and erases. A value written to program memory does not need to be a valid instruction. Executing a program memory location that forms an invalid instruction results in a NOP. 6.1 Table Reads and Table Writes In order to read and write program memory, there are two operations that allow the processor to move bytes between the program memory space and the data RAM: • Table Read (TBLRD) • Table Write (TBLWT) The program memory space is 16 bits wide, while the data RAM space is 8 bits wide. Table reads and table writes move data between these two memory spaces through an 8-bit register (TABLAT). Table read operations retrieve data from program memory and place it into TABLAT in the data RAM space. Figure 6-1 shows the operation of a table read with program memory and data RAM. Table write operations store data from TABLAT in the data memory space into holding registers in program memory. The procedure to write the contents of the holding registers into program memory is detailed in Section 6.5 “Writing to Flash Program Memory”. Figure 6-2 shows the operation of a table write with program memory and data RAM. Table operations work with byte entities. A table block containing data, rather than program instructions, is not required to be word aligned. Therefore, a table block can start and end at any byte address. If a table write is being used to write executable code into program memory, program instructions will need to be word aligned (TBLPTRL<0> = 0). The EEPROM on-chip timer controls the write and erase times. The write and erase voltages are generated by an on-chip charge pump rated to operate over the voltage range of the device for byte or word operations. FIGURE 6-1: TABLE READ OPERATION Table Pointer(1) Table Latch (8-bit) Program Memory TBLPTRH TBLPTRL TABLAT TBLPTRU Instruction: TBLRD* Note 1: Table Pointer points to a byte in program memory. Program Memory (TBLPTR)PIC18F1220/1320 DS39605F-page 58 © 2007 Microchip Technology Inc. FIGURE 6-2: TABLE WRITE OPERATION 6.2 Control Registers Several control registers are used in conjunction with the TBLRD and TBLWT instructions. These include the: • EECON1 register • EECON2 register • TABLAT register • TBLPTR registers 6.2.1 EECON1 AND EECON2 REGISTERS EECON1 is the control register for memory accesses. EECON2 is not a physical register. Reading EECON2 will read all ‘0’s. The EECON2 register is used exclusively in the memory write and erase sequences. Control bit, EEPGD, determines if the access will be to program or data EEPROM memory. When clear, operations will access the data EEPROM memory. When set, program memory is accessed. Control bit, CFGS, determines if the access will be to the configuration registers, or to program memory/data EEPROM memory. When set, subsequent operations access configuration registers. When CFGS is clear, the EEPGD bit selects either program Flash or data EEPROM memory. The FREE bit controls program memory erase operations. When the FREE bit is set, the erase operation is initiated on the next WR command. When FREE is clear, only writes are enabled. The WREN bit enables and disables erase and write operations. When set, erase and write operations are allowed. When clear, erase and write operations are disabled – the WR bit cannot be set while the WREN bit is clear. This process helps to prevent accidental writes to memory due to errant (unexpected) code execution. Firmware should keep the WREN bit clear at all times, except when starting erase or write operations. Once firmware has set the WR bit, the WREN bit may be cleared. Clearing the WREN bit will not affect the operation in progress. The WRERR bit is set when a write operation is interrupted by a Reset. In these situations, the user can check the WRERR bit and rewrite the location. It will be necessary to reload the data and address registers (EEDATA and EEADR) as these registers have cleared as a result of the Reset. Control bits, RD and WR, start read and erase/write operations, respectively. These bits are set by firmware and cleared by hardware at the completion of the operation. The RD bit cannot be set when accessing program memory (EEPGD = 1). Program memory is read using table read instructions. See Section 6.3 “Reading the Flash Program Memory” regarding table reads. Table Pointer(1) Table Latch (8-bit) TBLPTRH TBLPTRL TABLAT Program Memory (TBLPTR) TBLPTRU Instruction: TBLWT* Note 1: Table Pointer actually points to one of eight holding registers, the address of which is determined by TBLPTRL<2:0>. The process for physically writing data to the program memory array is discussed in Section 6.5 “Writing to Flash Program Memory”. Holding Registers Program Memory Note: Interrupt flag bit, EEIF in the PIR2 register, is set when the write is complete. It must be cleared in software.© 2007 Microchip Technology Inc. DS39605F-page 59 PIC18F1220/1320 REGISTER 6-1: EECON1 REGISTER R/W-x R/W-x U-0 R/W-0 R/W-x R/W-0 R/S-0 R/S-0 EEPGD CFGS — FREE WRERR WREN WR RD bit 7 bit 0 bit 7 EEPGD: Flash Program or Data EEPROM Memory Select bit 1 = Access program Flash memory 0 = Access data EEPROM memory bit 6 CFGS: Flash Program/Data EE or Configuration Select bit 1 = Access configuration registers 0 = Access program Flash or data EEPROM memory bit 5 Unimplemented: Read as ‘0’ bit 4 FREE: Flash Row Erase Enable bit 1 = Erase the program memory row addressed by TBLPTR on the next WR command (cleared by completion of erase operation – TBLPTR<5:0> are ignored) 0 = Perform write only bit 3 WRERR: EEPROM Error Flag bit 1 = A write operation was prematurely terminated (any Reset during self-timed programming) 0 = The write operation completed normally Note: When a WRERR occurs, the EEPGD and CFGS bits are not cleared. This allows tracing of the error condition. bit 2 WREN: Write Enable bit 1 = Allows erase or write cycles 0 = Inhibits erase or write cycles bit 1 WR: Write Control bit 1 = Initiates a data EEPROM erase/write cycle or a program memory erase cycle or write cycle. (The operation is self-timed and the bit is cleared by hardware once write is complete. The WR bit can only be set (not cleared) in software.) 0 = Write cycle completed bit 0 RD: Read Control bit 1 = Initiates a memory read (Read takes one cycle. RD is cleared in hardware. The RD bit can only be set (not cleared) in software. RD bit cannot be set when EEPGD = 1.) 0 = Read completed Legend: R = Readable bit S = Settable only U = Unimplemented bit, read as ‘0’ W = Writable bit -n = Value at POR ‘1’ = Bit is set ‘0’ = Bit is cleared x = Bit is unknownPIC18F1220/1320 DS39605F-page 60 © 2007 Microchip Technology Inc. 6.2.2 TABLAT – TABLE LATCH REGISTER The Table Latch (TABLAT) is an 8-bit register mapped into the SFR space. The table latch is used to hold 8-bit data during data transfers between program memory and data RAM. 6.2.3 TBLPTR – TABLE POINTER REGISTER The Table Pointer (TBLPTR) addresses a byte within the program memory. The TBLPTR is comprised of three SFR registers: Table Pointer Upper Byte, Table Pointer High Byte and Table Pointer Low Byte (TBLPTRU:TBLPTRH:TBLPTRL). These three registers join to form a 22-bit wide pointer. The low-order 21 bits allow the device to address up to 2 Mbytes of program memory space. Setting the 22nd bit allows access to the device ID, the user ID and the configuration bits. The Table Pointer (TBLPTR) register is used by the TBLRD and TBLWT instructions. These instructions can update the TBLPTR in one of four ways based on the table operation. These operations are shown in Table 6-1. These operations on the TBLPTR only affect the low-order 21 bits. 6.2.4 TABLE POINTER BOUNDARIES TBLPTR is used in reads, writes and erases of the Flash program memory. When a TBLRD is executed, all 22 bits of the Table Pointer determine which byte is read from program or configuration memory into TABLAT. When a TBLWT is executed, the three LSbs of the Table Pointer (TBLPTR<2:0>) determine which of the eight program memory holding registers is written to. When the timed write to program memory (long write) begins, the 19 MSbs of the Table Pointer (TBLPTR<21:3>) will determine which program memory block of 8 bytes is written to (TBLPTR<2:0> are ignored). For more detail, see Section 6.5 “Writing to Flash Program Memory”. When an erase of program memory is executed, the 16 MSbs of the Table Pointer (TBLPTR<21:6>) point to the 64-byte block that will be erased. The Least Significant bits (TBLPTR<5:0>) are ignored. Figure 6-3 describes the relevant boundaries of TBLPTR based on Flash program memory operations. TABLE 6-1: TABLE POINTER OPERATIONS WITH TBLRD AND TBLWT INSTRUCTIONS FIGURE 6-3: TABLE POINTER BOUNDARIES BASED ON OPERATION Example Operation on Table Pointer TBLRD* TBLWT* TBLPTR is not modified TBLRD*+ TBLWT*+ TBLPTR is incremented after the read/write TBLRD*- TBLWT*- TBLPTR is decremented after the read/write TBLRD+* TBLWT+* TBLPTR is incremented before the read/write 21 16 15 8 7 0 ERASE – TBLPTR<21:6> LONG WRITE – TBLPTR<21:3> READ or WRITE – TBLPTR<21:0> TBLPTRU TBLPTRH TBLPTRL© 2007 Microchip Technology Inc. DS39605F-page 61 PIC18F1220/1320 6.3 Reading the Flash Program Memory The TBLRD instruction is used to retrieve data from program memory and place it into data RAM. Table reads from program memory are performed one byte at a time. TBLPTR points to a byte address in program space. Executing a TBLRD instruction places the byte pointed to into TABLAT. In addition, TBLPTR can be modified automatically for the next table read operation. The internal program memory is typically organized by words. The Least Significant bit of the address selects between the high and low bytes of the word. Figure 6-4 shows the interface between the internal program memory and the TABLAT. FIGURE 6-4: READS FROM FLASH PROGRAM MEMORY EXAMPLE 6-1: READING A FLASH PROGRAM MEMORY WORD Odd (High) Byte Program Memory Even (Low) Byte TABLAT TBLPTR Instruction Register (IR) Read Register LSB = 1 TBLPTR LSB = 0 MOVLW CODE_ADDR_UPPER ; Load TBLPTR with the base MOVWF TBLPTRU ; address of the word MOVLW CODE_ADDR_HIGH MOVWF TBLPTRH MOVLW CODE_ADDR_LOW MOVWF TBLPTRL READ_WORD TBLRD*+ ; read into TABLAT and increment TBLPTR MOVFW TABLAT ; get data MOVWF WORD_EVEN TBLRD*+ ; read into TABLAT and increment TBLPTR MOVFW TABLAT ; get data MOVWF WORD_ODDPIC18F1220/1320 DS39605F-page 62 © 2007 Microchip Technology Inc. 6.4 Erasing Flash Program Memory The minimum erase block size is 32 words or 64 bytes under firmware control. Only through the use of an external programmer, or through ICSP control, can larger blocks of program memory be bulk erased. Word erase in Flash memory is not supported. When initiating an erase sequence from the microcontroller itself, a block of 64 bytes of program memory is erased. The Most Significant 16 bits of the TBLPTR<21:6> point to the block being erased. TBLPTR<5:0> are ignored. The EECON1 register commands the erase operation. The EEPGD bit must be set to point to the Flash program memory. The CFGS bit must be clear to access program Flash and data EEPROM memory. The WREN bit must be set to enable write operations. The FREE bit is set to select an erase operation. The WR bit is set as part of the required instruction sequence (as shown in Example 6-2) and starts the actual erase operation. It is not necessary to load the TABLAT register with any data as it is ignored. For protection, the write initiate sequence using EECON2 must be used. A long write is necessary for erasing the internal Flash. Instruction execution is halted while in a long write cycle. The long write will be terminated by the internal programming timer. 6.4.1 FLASH PROGRAM MEMORY ERASE SEQUENCE The sequence of events for erasing a block of internal program memory location is: 1. Load Table Pointer with address of row being erased. 2. Set the EECON1 register for the erase operation: • set EEPGD bit to point to program memory; • clear the CFGS bit to access program memory; • set WREN bit to enable writes; • set FREE bit to enable the erase. 3. Disable interrupts. 4. Write 55h to EECON2. 5. Write AAh to EECON2. 6. Set the WR bit. This will begin the row erase cycle. 7. The CPU will stall for duration of the erase (about 2 ms using internal timer). 8. Execute a NOP. 9. Re-enable interrupts. EXAMPLE 6-2: ERASING A FLASH PROGRAM MEMORY ROW MOVLW CODE_ADDR_UPPER ; load TBLPTR with the base MOVWF TBLPTRU ; address of the memory block MOVLW CODE_ADDR_HIGH MOVWF TBLPTRH MOVLW CODE_ADDR_LOW MOVWF TBLPTRL ERASE_ROW BSF EECON1, EEPGD ; point to FLASH program memory BSF EECON1, WREN ; enable write to memory BSF EECON1, FREE ; enable Row Erase operation BCF INTCON, GIE ; disable interrupts MOVLW 55h MOVWF EECON2 ; write 55H Required MOVLW AAh Sequence MOVWF EECON2 ; write AAH BSF EECON1, WR ; start erase (CPU stall) NOP BSF INTCON, GIE ; re-enable interrupts© 2007 Microchip Technology Inc. DS39605F-page 63 PIC18F1220/1320 6.5 Writing to Flash Program Memory The programming block size is 4 words or 8 bytes. Word or byte programming is not supported. Table writes are used internally to load the holding registers needed to program the Flash memory. There are 8 holding registers used by the table writes for programming. Since the Table Latch (TABLAT) is only a single byte, the TBLWT instruction must be executed 8 times for each programming operation. All of the table write operations will essentially be short writes, because only the holding registers are written. At the end of updating 8 registers, the EECON1 register must be written to, to start the programming operation with a long write. The long write is necessary for programming the internal Flash. Instruction execution is halted while in a long write cycle. The long write will be terminated by the internal programming timer. FIGURE 6-5: TABLE WRITES TO FLASH PROGRAM MEMORY 6.5.1 FLASH PROGRAM MEMORY WRITE SEQUENCE The sequence of events for programming an internal program memory location should be: 1. Read 64 bytes into RAM. 2. Update data values in RAM as necessary. 3. Load Table Pointer with address being erased. 4. Do the row erase procedure (see Section 6.4.1 “Flash Program Memory Erase Sequence”). 5. Load Table Pointer with address of first byte being written. 6. Write the first 8 bytes into the holding registers with auto-increment. 7. Set the EECON1 register for the write operation: • set EEPGD bit to point to program memory; • clear the CFGS bit to access program memory; • set WREN bit to enable byte writes. 8. Disable interrupts. 9. Write 55h to EECON2. 10. Write AAh to EECON2. 11. Set the WR bit. This will begin the write cycle. 12. The CPU will stall for duration of the write (about 2 ms using internal timer). 13. Execute a NOP. 14. Re-enable interrupts. 15. Repeat steps 6-14 seven times to write 64 bytes. 16. Verify the memory (table read). This procedure will require about 18 ms to update one row of 64 bytes of memory. An example of the required code is given in Example 6-3. Holding Register TABLAT Holding Register TBLPTR = xxxxx7 Holding Register TBLPTR = xxxxx1 Holding Register TBLPTR = xxxxx0 8 8 8 8 Write Register TBLPTR = xxxxx2 Program MemoryPIC18F1220/1320 DS39605F-page 64 © 2007 Microchip Technology Inc. EXAMPLE 6-3: WRITING TO FLASH PROGRAM MEMORY MOVLW D'64 ; number of bytes in erase block MOVWF COUNTER MOVLW BUFFER_ADDR_HIGH ; point to buffer MOVWF FSR0H MOVLW BUFFER_ADDR_LOW MOVWF FSR0L MOVLW CODE_ADDR_UPPER ; Load TBLPTR with the base MOVWF TBLPTRU ; address of the memory block MOVLW CODE_ADDR_HIGH MOVWF TBLPTRH MOVLW CODE_ADDR_LOW ; 6 LSB = 0 MOVWF TBLPTRL READ_BLOCK TBLRD*+ ; read into TABLAT, and inc MOVF TABLAT, W ; get data MOVWF POSTINC0 ; store data and increment FSR0 DECFSZ COUNTER ; done? GOTO READ_BLOCK ; repeat MODIFY_WORD MOVLW DATA_ADDR_HIGH ; point to buffer MOVWF FSR0H MOVLW DATA_ADDR_LOW MOVWF FSR0L MOVLW NEW_DATA_LOW ; update buffer word and increment FSR0 MOVWF POSTINC0 MOVLW NEW_DATA_HIGH ; update buffer word MOVWF INDF0 ERASE_BLOCK MOVLW CODE_ADDR_UPPER ; load TBLPTR with the base MOVWF TBLPTRU ; address of the memory block MOVLW CODE_ADDR_HIGH MOVWF TBLPTRH MOVLW CODE_ADDR_LOW ; 6 LSB = 0 MOVWF TBLPTRL BCF EECON1, CFGS ; point to PROG/EEPROM memory BSF EECON1, EEPGD ; point to FLASH program memory BSF EECON1, WREN ; enable write to memory BSF EECON1, FREE ; enable Row Erase operation BCF INTCON, GIE ; disable interrupts MOVLW 55h ; Required sequence MOVWF EECON2 ; write 55H MOVLW AAh MOVWF EECON2 ; write AAH BSF EECON1, WR ; start erase (CPU stall) NOP BSF INTCON, GIE ; re-enable interrupts WRITE_BUFFER_BACK MOVLW 8 ; number of write buffer groups of 8 bytes MOVWF COUNTER_HI MOVLW BUFFER_ADDR_HIGH ; point to buffer MOVWF FSR0H MOVLW BUFFER_ADDR_LOW MOVWF FSR0L PROGRAM_LOOP MOVLW 8 ; number of bytes in holding register MOVWF COUNTER© 2007 Microchip Technology Inc. DS39605F-page 65 PIC18F1220/1320 EXAMPLE 6-3: WRITING TO FLASH PROGRAM MEMORY (CONTINUED) 6.5.2 WRITE VERIFY Depending on the application, good programming practice may dictate that the value written to the memory should be verified against the original value. This should be used in applications where excessive writes can stress bits near the specification limit. 6.5.3 UNEXPECTED TERMINATION OF WRITE OPERATION If a write is terminated by an unplanned event, such as loss of power or an unexpected Reset, the memory location just programmed should be verified and reprogrammed if needed. The WRERR bit is set when a write operation is interrupted by a MCLR Reset, or a WDT Time-out Reset during normal operation. In these situations, users can check the WRERR bit and rewrite the location. 6.6 Flash Program Operation During Code Protection See Section 19.0 “Special Features of the CPU” for details on code protection of Flash program memory. TABLE 6-2: REGISTERS ASSOCIATED WITH PROGRAM FLASH MEMORY WRITE_WORD_TO_HREGS MOVF POSTINC0, W ; get low byte of buffer data and increment FSR0 MOVWF TABLAT ; present data to table latch TBLWT+* ; short write ; to internal TBLWT holding register, increment TBLPTR DECFSZ COUNTER ; loop until buffers are full GOTO WRITE_WORD_TO_HREGS PROGRAM_MEMORY BCF INTCON, GIE ; disable interrupts MOVLW 55h ; required sequence MOVWF EECON2 ; write 55H MOVLW AAh MOVWF EECON2 ; write AAH BSF EECON1, WR ; start program (CPU stall) NOP BSF INTCON, GIE ; re-enable interrupts DECFSZ COUNTER_HI ; loop until done GOTO PROGRAM_LOOP BCF EECON1, WREN ; disable write to memory Name Bit 7 Bit 6 Bit 5 Bit 4 Bit 3 Bit 2 Bit 1 Bit 0 Value on: POR, BOR Value on all other Resets TBLPTRU — — bit 21 Program Memory Table Pointer Upper Byte (TBLPTR<20:16>) --00 0000 --00 0000 TBPLTRH Program Memory Table Pointer High Byte (TBLPTR<15:8>) 0000 0000 0000 0000 TBLPTRL Program Memory Table Pointer High Byte (TBLPTR<7:0>) 0000 0000 0000 0000 TABLAT Program Memory Table Latch 0000 0000 0000 0000 INTCON GIE/GIEH PEIE/GIEL TMR0IE INTE RBIE TMR0IF INTF RBIF 0000 000x 0000 000u EECON2 EEPROM Control Register 2 (not a physical register) — — EECON1 EEPGD CFGS — FREE WRERR WREN WR RD xx-0 x000 uu-0 u000 IPR2 OSCFIP — — EEIP — LVDIP TMR3IP — 1--1 -11- 1--1 -11- PIR2 OSCFIF — — EEIF — LVDIF TMR3IF — 0--0 -00- 0--0 -00- PIE2 OSCFIE — — EEIE — LVDIE TMR3IE — 0--0 -00- 0--0 -00- Legend: x = unknown, u = unchanged, – = unimplemented, read as ‘0’. Shaded cells are not used during Flash/EEPROM access.PIC18F1220/1320 DS39605F-page 66 © 2007 Microchip Technology Inc. NOTES:© 2007 Microchip Technology Inc. DS39605F-page 67 PIC18F1220/1320 7.0 DATA EEPROM MEMORY The data EEPROM is readable and writable during normal operation over the entire VDD range. The data memory is not directly mapped in the register file space. Instead, it is indirectly addressed through the Special Function Registers (SFR). There are four SFRs used to read and write the program and data EEPROM memory. These registers are: • EECON1 • EECON2 • EEDATA • EEADR The EEPROM data memory allows byte read and write. When interfacing to the data memory block, EEDATA holds the 8-bit data for read/write and EEADR holds the address of the EEPROM location being accessed. These devices have 256 bytes of data EEPROM with an address range from 00h to FFh. The EEPROM data memory is rated for high erase/ write cycle endurance. A byte write automatically erases the location and writes the new data (erasebefore-write). The write time is controlled by an on-chip timer. The write time will vary with voltage and temperature, as well as from chip to chip. Please refer to parameter D122 (Table 22-1 in Section 22.0 “Electrical Characteristics”) for exact limits. 7.1 EEADR The address register can address 256 bytes of data EEPROM. 7.2 EECON1 and EECON2 Registers EECON1 is the control register for memory accesses. EECON2 is not a physical register. Reading EECON2 will read all ‘0’s. The EECON2 register is used exclusively in the memory write and erase sequences. Control bit, EEPGD, determines if the access will be to program or data EEPROM memory. When clear, operations will access the data EEPROM memory. When set, program memory is accessed. Control bit, CFGS, determines if the access will be to the configuration registers or to program memory/data EEPROM memory. When set, subsequent operations access configuration registers. When CFGS is clear, the EEPGD bit selects either program Flash or data EEPROM memory. The WREN bit enables and disables erase and write operations. When set, erase and write operations are allowed. When clear, erase and write operations are disabled – the WR bit cannot be set while the WREN bit is clear. This mechanism helps to prevent accidental writes to memory due to errant (unexpected) code execution. Firmware should keep the WREN bit clear at all times, except when starting erase or write operations. Once firmware has set the WR bit, the WREN bit may be cleared. Clearing the WREN bit will not affect the operation in progress. The WRERR bit is set when a write operation is interrupted by a Reset. In these situations, the user can check the WRERR bit and rewrite the location. It is necessary to reload the data and address registers (EEDATA and EEADR), as these registers have cleared as a result of the Reset. Control bits, RD and WR, start read and erase/write operations, respectively. These bits are set by firmware and cleared by hardware at the completion of the operation. The RD bit cannot be set when accessing program memory (EEPGD = 1). Program memory is read using table read instructions. See Section 6.1 “Table Reads and Table Writes” regarding table reads. Note: Interrupt flag bit, EEIF in the PIR2 register, is set when write is complete. It must be cleared in software.PIC18F1220/1320 DS39605F-page 68 © 2007 Microchip Technology Inc. REGISTER 7-1: EECON1 REGISTER R/W-x R/W-x U-0 R/W-0 R/W-x R/W-0 R/S-0 R/S-0 EEPGD CFGS — FREE WRERR WREN WR RD bit 7 bit 0 bit 7 EEPGD: Flash Program or Data EEPROM Memory Select bit 1 = Access program Flash memory 0 = Access data EEPROM memory bit 6 CFGS: Flash Program/Data EEPROM or Configuration Select bit 1 = Access configuration or calibration registers 0 = Access program Flash or data EEPROM memory bit 5 Unimplemented: Read as ‘0’ bit 4 FREE: Flash Row Erase Enable bit 1 = Erase the program memory row addressed by TBLPTR on the next WR command (cleared by completion of erase operation) 0 = Perform write only bit 3 WRERR: EEPROM Error Flag bit 1 = A write operation was prematurely terminated (MCLR or WDT Reset during self-timed erase or program operation) 0 = The write operation completed normally Note: When a WRERR occurs, the EEPGD or FREE bits are not cleared. This allows tracing of the error condition. bit 2 WREN: Erase/Write Enable bit 1 = Allows erase/write cycles 0 = Inhibits erase/write cycles bit 1 WR: Write Control bit 1 = Initiates a data EEPROM erase/write cycle, or a program memory erase cycle, or write cycle. (The operation is self-timed and the bit is cleared by hardware once write is complete. The WR bit can only be set (not cleared) in software.) 0 = Write cycle is completed bit 0 RD: Read Control bit 1 = Initiates a memory read (Read takes one cycle. RD is cleared in hardware. The RD bit can only be set (not cleared) in software. RD bit cannot be set when EEPGD = 1.) 0 = Read completed Legend: R = Readable bit S = Settable only U = Unimplemented bit, read as ‘0’ W = Writable bit -n = Value at POR ‘1’ = Bit is set ‘0’ = Bit is cleared x = Bit is unknown© 2007 Microchip Technology Inc. DS39605F-page 69 PIC18F1220/1320 7.3 Reading the Data EEPROM Memory To read a data memory location, the user must write the address to the EEADR register, clear the EEPGD control bit (EECON1<7>) and then set control bit, RD (EECON1<0>). The data is available for the very next instruction cycle; therefore, the EEDATA register can be read by the next instruction. EEDATA will hold this value until another read operation, or until it is written to by the user (during a write operation). 7.4 Writing to the Data EEPROM Memory To write an EEPROM data location, the address must first be written to the EEADR register and the data written to the EEDATA register. The sequence in Example 7-2 must be followed to initiate the write cycle. The write will not begin if this sequence is not exactly followed (write 55h to EECON2, write AAh to EECON2, then set WR bit) for each byte. It is strongly recommended that interrupts be disabled during this code segment. Additionally, the WREN bit in EECON1 must be set to enable writes. This mechanism prevents accidental writes to data EEPROM due to unexpected code execution (i.e., runaway programs). The WREN bit should be kept clear at all times, except when updating the EEPROM. The WREN bit is not cleared by hardware. After a write sequence has been initiated, EECON1, EEADR and EEDATA cannot be modified. The WR bit will be inhibited from being set unless the WREN bit is set. The WREN bit must be set on a previous instruction. Both WR and WREN cannot be set with the same instruction. At the completion of the write cycle, the WR bit is cleared in hardware and the EEPROM Interrupt Flag bit (EEIF) is set. The user may either enable this interrupt or poll this bit. EEIF must be cleared by software. 7.5 Write Verify Depending on the application, good programming practice may dictate that the value written to the memory should be verified against the original value. This should be used in applications where excessive writes can stress bits near the specification limit. 7.6 Protection Against Spurious Write There are conditions when the device may not want to write to the data EEPROM memory. To protect against spurious EEPROM writes, various mechanisms have been built-in. On power-up, the WREN bit is cleared. Also, the Power-up Timer (72 ms duration) prevents EEPROM write. The write initiate sequence and the WREN bit together help prevent an accidental write during brown-out, power glitch or software malfunction. EXAMPLE 7-1: DATA EEPROM READ EXAMPLE 7-2: DATA EEPROM WRITE MOVLW DATA_EE_ADDR ; MOVWF EEADR ; Data Memory Address to read BCF EECON1, EEPGD ; Point to DATA memory BSF EECON1, RD ; EEPROM Read MOVF EEDATA, W ; W = EEDATA MOVLW DATA_EE_ADDR ; MOVWF EEADR ; Data Memory Address to write MOVLW DATA_EE_DATA ; MOVWF EEDATA ; Data Memory Value to write BCF EECON1, EEPGD ; Point to DATA memory BSF EECON1, WREN ; Enable writes BCF INTCON, GIE ; Disable Interrupts MOVLW 55h ; Required MOVWF EECON2 ; Write 55h Sequence MOVLW AAh ; MOVWF EECON2 ; Write AAh BSF EECON1, WR ; Set WR bit to begin write BSF INTCON, GIE ; Enable Interrupts SLEEP ; Wait for interrupt to signal write complete BCF EECON1, WREN ; Disable writesPIC18F1220/1320 DS39605F-page 70 © 2007 Microchip Technology Inc. 7.7 Operation During Code-Protect Data EEPROM memory has its own code-protect bits in configuration words. External read and write operations are disabled if either of these mechanisms are enabled. The microcontroller itself can both read and write to the internal data EEPROM, regardless of the state of the code-protect configuration bit. Refer to Section 19.0 “Special Features of the CPU” for additional information. 7.8 Using the Data EEPROM The data EEPROM is a high endurance, byte addressable array that has been optimized for the storage of frequently changing information (e.g., program variables or other data that are updated often). Frequently changing values will typically be updated more often than specification D124. If this is not the case, an array refresh must be performed. For this reason, variables that change infrequently (such as constants, IDs, calibration, etc.) should be stored in Flash program memory. A simple data EEPROM refresh routine is shown in Example 7-3. EXAMPLE 7-3: DATA EEPROM REFRESH ROUTINE TABLE 7-1: REGISTERS ASSOCIATED WITH DATA EEPROM MEMORY Note: If data EEPROM is only used to store constants and/or data that changes rarely, an array refresh is likely not required. See specification D124. CLRF EEADR ; Start at address 0 BCF EECON1, CFGS ; Set for memory BCF EECON1, EEPGD ; Set for Data EEPROM BCF INTCON, GIE ; Disable interrupts BSF EECON1, WREN ; Enable writes Loop ; Loop to refresh array BSF EECON1, RD ; Read current address MOVLW 55h ; MOVWF EECON2 ; Write 55h MOVLW AAh ; MOVWF EECON2 ; Write AAh BSF EECON1, WR ; Set WR bit to begin write BTFSC EECON1, WR ; Wait for write to complete BRA $-2 INCFSZ EEADR, F ; Increment address BRA Loop ; Not zero, do it again BCF EECON1, WREN ; Disable writes BSF INTCON, GIE ; Enable interrupts Name Bit 7 Bit 6 Bit 5 Bit 4 Bit 3 Bit 2 Bit 1 Bit 0 Value on: POR, BOR Value on all other Resets INTCON GIE/GIEH PEIE/GIEL TMR0IE INTE RBIE TMR0IF INTF RBIF 0000 000x 0000 000u EEADR EEPROM Address Register 0000 0000 0000 0000 EEDATA EEPROM Data Register 0000 0000 0000 0000 EECON2 EEPROM Control Register 2 (not a physical register) — — EECON1 EEPGD CFGS — FREE WRERR WREN WR RD xx-0 x000 uu-0 u000 IPR2 OSCFIP — — EEIP — LVDIP TMR3IP — 1--1 -11- 1--1 -11- PIR2 OSCFIF — — EEIF — LVDIF TMR3IF — 0--0 -00- 0--0 -00- PIE2 OSCFIE — — EEIE — LVDIE TMR3IE — 0--0 -00- 0--0 -00- Legend: x = unknown, u = unchanged, – = unimplemented, read as ‘0’. Shaded cells are not used during Flash/EEPROM access.© 2007 Microchip Technology Inc. DS39605F-page 71 PIC18F1220/1320 8.0 8 x 8 HARDWARE MULTIPLIER 8.1 Introduction An 8 x 8 hardware multiplier is included in the ALU of the PIC18F1220/1320 devices. By making the multiply a hardware operation, it completes in a single instruction cycle. This is an unsigned multiply that gives a 16-bit result. The result is stored into the 16-bit product register pair (PRODH:PRODL). The multiplier does not affect any flags in the Status register. Making the 8 x 8 multiplier execute in a single cycle gives the following advantages: • Higher computational throughput • Reduces code size requirements for multiply algorithms The performance increase allows the device to be used in applications previously reserved for Digital Signal Processors. Table 8-1 shows a performance comparison between Enhanced devices using the single-cycle hardware multiply and performing the same function without the hardware multiply. TABLE 8-1: PERFORMANCE COMPARISON 8.2 Operation Example 8-1 shows the sequence to do an 8 x 8 unsigned multiply. Only one instruction is required when one argument of the multiply is already loaded in the WREG register. Example 8-2 shows the sequence to do an 8 x 8 signed multiply. To account for the sign bits of the arguments, each argument’s Most Significant bit (MSb) is tested and the appropriate subtractions are done. EXAMPLE 8-1: 8 x 8 UNSIGNED MULTIPLY ROUTINE EXAMPLE 8-2: 8 x 8 SIGNED MULTIPLY ROUTINE Routine Multiply Method Program Memory (Words) Cycles (Max) Time @ 40 MHz @ 10 MHz @ 4 MHz 8 x 8 unsigned Without hardware multiply 13 69 6.9 μs 27.6 μs 69 μs Hardware multiply 1 1 100 ns 400 ns 1 μs 8 x 8 signed Without hardware multiply 33 91 9.1 μs 36.4 μs 91 μs Hardware multiply 6 6 600 ns 2.4 μs 6 μs 16 x 16 unsigned Without hardware multiply 21 242 24.2 μs 96.8 μs 242 μs Hardware multiply 28 28 2.8 μs 11.2 μs 28 μs 16 x 16 signed Without hardware multiply 52 254 25.4 μs 102.6 μs 254 μs Hardware multiply 35 40 4 μs 16 μs 40 μs MOVF ARG1, W ; MULWF ARG2 ; ARG1 * ARG2 -> ; PRODH:PRODL MOVF ARG1, W MULWF ARG2 ; ARG1 * ARG2 -> ; PRODH:PRODL BTFSC ARG2, SB ; Test Sign Bit SUBWF PRODH, F ; PRODH = PRODH ; - ARG1 MOVF ARG2, W BTFSC ARG1, SB ; Test Sign Bit SUBWF PRODH, F ; PRODH = PRODH ; - ARG2 PIC18F1220/1320 DS39605F-page 72 © 2007 Microchip Technology Inc. Example 8-3 shows the sequence to do a 16 x 16 unsigned multiply. Equation 8-1 shows the algorithm that is used. The 32-bit result is stored in four registers, RES3:RES0. EQUATION 8-1: 16 x 16 UNSIGNED MULTIPLICATION ALGORITHM EXAMPLE 8-3: 16 x 16 UNSIGNED MULTIPLY ROUTINE Example 8-4 shows the sequence to do a 16 x 16 signed multiply. Equation 8-2 shows the algorithm used. The 32-bit result is stored in four registers, RES3:RES0. To account for the sign bits of the arguments, each argument pairs’ Most Significant bit (MSb) is tested and the appropriate subtractions are done. EQUATION 8-2: 16 x 16 SIGNED MULTIPLICATION ALGORITHM EXAMPLE 8-4: 16 x 16 SIGNED MULTIPLY ROUTINE MOVF ARG1L, W MULWF ARG2L ; ARG1L * ARG2L -> ; PRODH:PRODL MOVFF PRODH, RES1 ; MOVFF PRODL, RES0 ; ; MOVF ARG1H, W MULWF ARG2H ; ARG1H * ARG2H -> ; PRODH:PRODL MOVFF PRODH, RES3 ; MOVFF PRODL, RES2 ; ; MOVF ARG1L, W MULWF ARG2H ; ARG1L * ARG2H -> ; PRODH:PRODL MOVF PRODL, W ; ADDWF RES1, F ; Add cross MOVF PRODH, W ; products ADDWFC RES2, F ; CLRF WREG ; ADDWFC RES3,F ; ; MOVF ARG1H, W ; MULWF ARG2L ; ARG1H * ARG2L -> ; PRODH:PRODL MOVF PRODL, W ; ADDWF RES1, F ; Add cross MOVF PRODH, W ; products ADDWFC RES2, F ; CLRF WREG ; ADDWFC RES3, F ; RES3:RES0 = ARG1H:ARG1L • ARG2H:ARG2L = (ARG1H • ARG2H • 216) + (ARG1H • ARG2L • 28 ) + (ARG1L • ARG2H • 28 ) + (ARG1L • ARG2L) MOVF ARG1L, W MULWF ARG2L ; ARG1L * ARG2L -> ; PRODH:PRODL MOVFF PRODH, RES1 ; MOVFF PRODL, RES0 ; ; MOVF ARG1H, W MULWF ARG2H ; ARG1H * ARG2H -> ; PRODH:PRODL MOVFF PRODH, RES3 ; MOVFF PRODL, RES2 ; ; MOVF ARG1L, W MULWF ARG2H ; ARG1L * ARG2H -> ; PRODH:PRODL MOVF PRODL, W ; ADDWF RES1, F ; Add cross MOVF PRODH, W ; products ADDWFC RES2, F ; CLRF WREG ; ADDWFC RES3, F ; ; MOVF ARG1H, W ; MULWF ARG2L ; ARG1H * ARG2L -> ; PRODH:PRODL MOVF PRODL, W ; ADDWF RES1, F ; Add cross MOVF PRODH, W ; products ADDWFC RES2, F ; CLRF WREG ; ADDWFC RES3, F ; ; BTFSS ARG2H, 7 ; ARG2H:ARG2L neg? BRA SIGN_ARG1 ; no, check ARG1 MOVF ARG1L, W ; SUBWF RES2 ; MOVF ARG1H, W ; SUBWFB RES3 ; SIGN_ARG1 BTFSS ARG1H, 7 ; ARG1H:ARG1L neg? BRA CONT_CODE ; no, done MOVF ARG2L, W ; SUBWF RES2 ; MOVF ARG2H, W ; SUBWFB RES3 ; CONT_CODE : RES3:RES0 = ARG1H:ARG1L • ARG2H:ARG2L = (ARG1H • ARG2H • 216) + (ARG1H • ARG2L • 28) + (ARG1L • ARG2H • 28) + (ARG1L • ARG2L) + (-1 • ARG2H<7> • ARG1H:ARG1L • 216) + (-1 • ARG1H<7> • ARG2H:ARG2L • 216) © 2007 Microchip Technology Inc. DS39605F-page 73 PIC18F1220/1320 9.0 INTERRUPTS The PIC18F1220/1320 devices have multiple interrupt sources and an interrupt priority feature that allows each interrupt source to be assigned a high priority level or a low priority level. The high priority interrupt vector is at 000008h and the low priority interrupt vector is at 000018h. High priority interrupt events will interrupt any low priority interrupts that may be in progress. There are ten registers which are used to control interrupt operation. These registers are: • RCON • INTCON • INTCON2 • INTCON3 • PIR1, PIR2 • PIE1, PIE2 • IPR1, IPR2 It is recommended that the Microchip header files supplied with MPLAB® IDE be used for the symbolic bit names in these registers. This allows the assembler/ compiler to automatically take care of the placement of these bits within the specified register. In general, each interrupt source has three bits to control its operation. The functions of these bits are: • Flag bit to indicate that an interrupt event occurred • Enable bit that allows program execution to branch to the interrupt vector address when the flag bit is set • Priority bit to select high priority or low priority (INT0 has no priority bit and is always high priority) The interrupt priority feature is enabled by setting the IPEN bit (RCON<7>). When interrupt priority is enabled, there are two bits which enable interrupts globally. Setting the GIEH bit (INTCON<7>) enables all interrupts that have the priority bit set (high priority). Setting the GIEL bit (INTCON<6>) enables all interrupts that have the priority bit cleared (low priority). When the interrupt flag, enable bit and appropriate global interrupt enable bit are set, the interrupt will vector immediately to address 000008h or 000018h, depending on the priority bit setting. Individual interrupts can be disabled through their corresponding enable bits. When the IPEN bit is cleared (default state), the interrupt priority feature is disabled and interrupts are compatible with PIC mid-range devices. In Compatibility mode, the interrupt priority bits for each source have no effect. INTCON<6> is the PEIE bit, which enables/disables all peripheral interrupt sources. INTCON<7> is the GIE bit, which enables/disables all interrupt sources. All interrupts branch to address 000008h in Compatibility mode. When an interrupt is responded to, the global interrupt enable bit is cleared to disable further interrupts. If the IPEN bit is cleared, this is the GIE bit. If interrupt priority levels are used, this will be either the GIEH or GIEL bit. High priority interrupt sources can interrupt a low priority interrupt. Low priority interrupts are not processed while high priority interrupts are in progress. The return address is pushed onto the stack and the PC is loaded with the interrupt vector address (000008h or 000018h). Once in the Interrupt Service Routine, the source(s) of the interrupt can be determined by polling the interrupt flag bits. The interrupt flag bits must be cleared in software before re-enabling interrupts to avoid recursive interrupts. The “return from interrupt” instruction, RETFIE, exits the interrupt routine and sets the GIE bit (GIEH or GIEL, if priority levels are used), which re-enables interrupts. For external interrupt events, such as the INT pins or the PORTB input change interrupt, the interrupt latency will be three to four instruction cycles. The exact latency is the same for one or two-cycle instructions. Individual interrupt flag bits are set, regardless of the status of their corresponding enable bit or the GIE bit. Note: Do not use the MOVFF instruction to modify any of the interrupt control registers while any interrupt is enabled. Doing so may cause erratic microcontroller behavior.PIC18F1220/1320 DS39605F-page 74 © 2007 Microchip Technology Inc. FIGURE 9-1: INTERRUPT LOGIC TMR0IE GIEH/GIE GIEL/PEIE Wake-up if in Low-Power Mode Interrupt to CPU Vector to Location 0008h INT2IF INT2IE INT2IP INT1IF INT1IE INT1IP TMR0IF TMR0IE TMR0IP INT0IF INT0IE RBIF RBIE RBIP IPEN TMR0IF TMR0IP INT1IF INT1IE INT1IP INT2IF INT2IE INT2IP RBIF RBIE RBIP INT0IF INT0IE GIEL\PEIE Interrupt to CPU Vector to Location IPEN IPEN 0018h INT0IF INT0IE INT0IF INT0IE ADIF ADIE ADIP RCIF RCIE RCIP Additional Peripheral Interrupts ADIF ADIE ADIP High Priority Interrupt Generation Low Priority Interrupt Generation RCIF RCIE RCIP Additional Peripheral Interrupts GIE\GIEH© 2007 Microchip Technology Inc. DS39605F-page 75 PIC18F1220/1320 9.1 INTCON Registers The INTCON registers are readable and writable registers, which contain various enable, priority and flag bits. REGISTER 9-1: INTCON REGISTER Note: Interrupt flag bits are set when an interrupt condition occurs, regardless of the state of its corresponding enable bit or the global interrupt enable bit. User software should ensure the appropriate interrupt flag bits are clear prior to enabling an interrupt. This feature allows for software polling. R/W-0 R/W-0 R/W-0 R/W-0 R/W-0 R/W-0 R/W-0 R/W-x GIE/GIEH PEIE/GIEL TMR0IE INT0IE RBIE TMR0IF INT0IF RBIF bit 7 bit 0 bit 7 GIE/GIEH: Global Interrupt Enable bit When IPEN = 0: 1 = Enables all unmasked interrupts 0 = Disables all interrupts When IPEN = 1: 1 = Enables all high priority interrupts 0 = Disables all interrupts bit 6 PEIE/GIEL: Peripheral Interrupt Enable bit When IPEN = 0: 1 = Enables all unmasked peripheral interrupts 0 = Disables all peripheral interrupts When IPEN = 1: 1 = Enables all low priority peripheral interrupts 0 = Disables all low priority peripheral interrupts bit 5 TMR0IE: TMR0 Overflow Interrupt Enable bit 1 = Enables the TMR0 overflow interrupt 0 = Disables the TMR0 overflow interrupt bit 4 INT0IE: INT0 External Interrupt Enable bit 1 = Enables the INT0 external interrupt 0 = Disables the INT0 external interrupt bit 3 RBIE: RB Port Change Interrupt Enable bit 1 = Enables the RB port change interrupt 0 = Disables the RB port change interrupt bit 2 TMR0IF: TMR0 Overflow Interrupt Flag bit 1 = TMR0 register has overflowed (must be cleared in software) 0 = TMR0 register did not overflow bit 1 INT0IF: INT0 External Interrupt Flag bit 1 = The INT0 external interrupt occurred (must be cleared in software) 0 = The INT0 external interrupt did not occur bit 0 RBIF: RB Port Change Interrupt Flag bit 1 = At least one of the RB7:RB4 pins changed state (must be cleared in software) 0 = None of the RB7:RB4 pins have changed state Note: A mismatch condition will continue to set this bit. Reading PORTB will end the mismatch condition and allow the bit to be cleared. Legend: R = Readable bit W = Writable bit U = Unimplemented bit, read as ‘0’ -n = Value at POR ‘1’ = Bit is set ‘0’ = Bit is cleared x = Bit is unknownPIC18F1220/1320 DS39605F-page 76 © 2007 Microchip Technology Inc. REGISTER 9-2: INTCON2 REGISTER R/W-1 R/W-1 R/W-1 R/W-1 U-0 R/W-1 U-0 R/W-1 RBPU INTEDG0 INTEDG1 INTEDG2 — TMR0IP — RBIP bit 7 bit 0 bit 7 RBPU: PORTB Pull-up Enable bit 1 = All PORTB pull-ups are disabled 0 = PORTB pull-ups are enabled by individual port latch values bit 6 INTEDG0: External Interrupt 0 Edge Select bit 1 = Interrupt on rising edge 0 = Interrupt on falling edge bit 5 INTEDG1: External Interrupt 1 Edge Select bit 1 = Interrupt on rising edge 0 = Interrupt on falling edge bit 4 INTEDG2: External Interrupt 2 Edge Select bit 1 = Interrupt on rising edge 0 = Interrupt on falling edge bit 3 Unimplemented: Read as ‘0’ bit 2 TMR0IP: TMR0 Overflow Interrupt Priority bit 1 = High priority 0 = Low priority bit 1 Unimplemented: Read as ‘0’ bit 0 RBIP: RB Port Change Interrupt Priority bit 1 = High priority 0 = Low priority Legend: R = Readable bit W = Writable bit U = Unimplemented bit, read as ‘0’ -n = Value at POR ‘1’ = Bit is set ‘0’ = Bit is cleared x = Bit is unknown Note: Interrupt flag bits are set when an interrupt condition occurs, regardless of the state of its corresponding enable bit or the global interrupt enable bit. User software should ensure the appropriate interrupt flag bits are clear prior to enabling an interrupt. This feature allows for software polling.© 2007 Microchip Technology Inc. DS39605F-page 77 PIC18F1220/1320 REGISTER 9-3: INTCON3 REGISTER R/W-1 R/W-1 U-0 R/W-0 R/W-0 U-0 R/W-0 R/W-0 INT2IP INT1IP — INT2IE INT1IE — INT2IF INT1IF bit 7 bit 0 bit 7 INT2IP: INT2 External Interrupt Priority bit 1 = High priority 0 = Low priority bit 6 INT1IP: INT1 External Interrupt Priority bit 1 = High priority 0 = Low priority bit 5 Unimplemented: Read as ‘0’ bit 4 INT2IE: INT2 External Interrupt Enable bit 1 = Enables the INT2 external interrupt 0 = Disables the INT2 external interrupt bit 3 INT1IE: INT1 External Interrupt Enable bit 1 = Enables the INT1 external interrupt 0 = Disables the INT1 external interrupt bit 2 Unimplemented: Read as ‘0’ bit 1 INT2IF: INT2 External Interrupt Flag bit 1 = The INT2 external interrupt occurred (must be cleared in software) 0 = The INT2 external interrupt did not occur bit 0 INT1IF: INT1 External Interrupt Flag bit 1 = The INT1 external interrupt occurred (must be cleared in software) 0 = The INT1 external interrupt did not occur Legend: R = Readable bit W = Writable bit U = Unimplemented bit, read as ‘0’ -n = Value at POR ‘1’ = Bit is set ‘0’ = Bit is cleared x = Bit is unknown Note: Interrupt flag bits are set when an interrupt condition occurs, regardless of the state of its corresponding enable bit or the global interrupt enable bit. User software should ensure the appropriate interrupt flag bits are clear prior to enabling an interrupt. This feature allows for software polling.PIC18F1220/1320 DS39605F-page 78 © 2007 Microchip Technology Inc. 9.2 PIR Registers The PIR registers contain the individual flag bits for the peripheral interrupts. Due to the number of peripheral interrupt sources, there are two Peripheral Interrupt Request (Flag) registers (PIR1, PIR2). REGISTER 9-4: PIR1: PERIPHERAL INTERRUPT REQUEST (FLAG) REGISTER 1 Note 1: Interrupt flag bits are set when an interrupt condition occurs, regardless of the state of its corresponding enable bit or the Global Interrupt Enable bit, GIE (INTCON<7>). 2: User software should ensure the appropriate interrupt flag bits are cleared prior to enabling an interrupt and after servicing that interrupt. U-0 R/W-0 R-0 R-0 U-0 R/W-0 R/W-0 R/W-0 — ADIF RCIF TXIF — CCP1IF TMR2IF TMR1IF bit 7 bit 0 bit 7 Unimplemented: Read as ‘0’ bit 6 ADIF: A/D Converter Interrupt Flag bit 1 = An A/D conversion completed (must be cleared in software) 0 = The A/D conversion is not complete bit 5 RCIF: EUSART Receive Interrupt Flag bit 1 = The EUSART receive buffer, RCREG, is full (cleared when RCREG is read) 0 = The EUSART receive buffer is empty bit 4 TXIF: EUSART Transmit Interrupt Flag bit 1 = The EUSART transmit buffer, TXREG, is empty (cleared when TXREG is written) 0 = The EUSART transmit buffer is full bit 3 Unimplemented: Read as ‘0’ bit 2 CCP1IF: CCP1 Interrupt Flag bit Capture mode: 1 = A TMR1 register capture occurred (must be cleared in software) 0 = No TMR1 register capture occurred Compare mode: 1 = A TMR1 register compare match occurred (must be cleared in software) 0 = No TMR1 register compare match occurred PWM mode: Unused in this mode. bit 1 TMR2IF: TMR2 to PR2 Match Interrupt Flag bit 1 = TMR2 to PR2 match occurred (must be cleared in software) 0 = No TMR2 to PR2 match occurred bit 0 TMR1IF: TMR1 Overflow Interrupt Flag bit 1 = TMR1 register overflowed (must be cleared in software) 0 = TMR1 register did not overflow Legend: R = Readable bit W = Writable bit U = Unimplemented bit, read as ‘0’ -n = Value at POR ‘1’ = Bit is set ‘0’ = Bit is cleared x = Bit is unknown© 2007 Microchip Technology Inc. DS39605F-page 79 PIC18F1220/1320 REGISTER 9-5: PIR2: PERIPHERAL INTERRUPT REQUEST (FLAG) REGISTER 2 R/W-0 U-0 U-0 R/W-0 U-0 R/W-0 R/W-0 U-0 OSCFIF — — EEIF — LVDIF TMR3IF — bit 7 bit 0 bit 7 OSCFIF: Oscillator Fail Interrupt Flag bit 1 = System oscillator failed, clock input has changed to INTOSC (must be cleared in software) 0 = System clock operating bit 6-5 Unimplemented: Read as ‘0’ bit 4 EEIF: Data EEPROM/Flash Write Operation Interrupt Flag bit 1 = The write operation is complete (must be cleared in software) 0 = The write operation is not complete or has not been started bit 3 Unimplemented: Read as ‘0’ bit 2 LVDIF: Low-Voltage Detect Interrupt Flag bit 1 = A low-voltage condition occurred (must be cleared in software) 0 = The device voltage is above the Low-Voltage Detect trip point bit 1 TMR3IF: TMR3 Overflow Interrupt Flag bit 1 = TMR3 register overflowed (must be cleared in software) 0 = TMR3 register did not overflow bit 0 Unimplemented: Read as ‘0’ Legend: R = Readable bit W = Writable bit U = Unimplemented bit, read as ‘0’ -n = Value at POR ‘1’ = Bit is set ‘0’ = Bit is cleared x = Bit is unknownPIC18F1220/1320 DS39605F-page 80 © 2007 Microchip Technology Inc. 9.3 PIE Registers The PIE registers contain the individual enable bits for the peripheral interrupts. Due to the number of peripheral interrupt sources, there are two Peripheral Interrupt Enable registers (PIE1, PIE2). When IPEN = 0, the PEIE bit must be set to enable any of these peripheral interrupts. REGISTER 9-6: PIE1: PERIPHERAL INTERRUPT ENABLE REGISTER 1 U-0 R/W-0 R/W-0 R/W-0 U-0 R/W-0 R/W-0 R/W-0 — ADIE RCIE TXIE — CCP1IE TMR2IE TMR1IE bit 7 bit 0 bit 7 Unimplemented: Read as ‘0’ bit 6 ADIE: A/D Converter Interrupt Enable bit 1 = Enables the A/D interrupt 0 = Disables the A/D interrupt bit 5 RCIE: EUSART Receive Interrupt Enable bit 1 = Enables the EUSART receive interrupt 0 = Disables the EUSART receive interrupt bit 4 TXIE: EUSART Transmit Interrupt Enable bit 1 = Enables the EUSART transmit interrupt 0 = Disables the EUSART transmit interrupt bit 3 Unimplemented: Read as ‘0’ bit 2 CCP1IE: CCP1 Interrupt Enable bit 1 = Enables the CCP1 interrupt 0 = Disables the CCP1 interrupt bit 1 TMR2IE: TMR2 to PR2 Match Interrupt Enable bit 1 = Enables the TMR2 to PR2 match interrupt 0 = Disables the TMR2 to PR2 match interrupt bit 0 TMR1IE: TMR1 Overflow Interrupt Enable bit 1 = Enables the TMR1 overflow interrupt 0 = Disables the TMR1 overflow interrupt Legend: R = Readable bit W = Writable bit U = Unimplemented bit, read as ‘0’ -n = Value at POR ‘1’ = Bit is set ‘0’ = Bit is cleared x = Bit is unknown© 2007 Microchip Technology Inc. DS39605F-page 81 PIC18F1220/1320 REGISTER 9-7: PIE2: PERIPHERAL INTERRUPT ENABLE REGISTER 2 R/W-0 U-0 U-0 R/W-0 U-0 R/W-0 R/W-0 U-0 OSCFIE — — EEIE — LVDIE TMR3IE — bit 7 bit 0 bit 7 OSCFIE: Oscillator Fail Interrupt Enable bit 1 = Enabled 0 = Disabled bit 6-5 Unimplemented: Read as ‘0’ bit 4 EEIE: Data EEPROM/Flash Write Operation Interrupt Enable bit 1 = Enabled 0 = Disabled bit 3 Unimplemented: Read as ‘0’ bit 2 LVDIE: Low-Voltage Detect Interrupt Enable bit 1 = Enabled 0 = Disabled bit 1 TMR3IE: TMR3 Overflow Interrupt Enable bit 1 = Enabled 0 = Disabled bit 0 Unimplemented: Read as ‘0’ Legend: R = Readable bit W = Writable bit U = Unimplemented bit, read as ‘0’ -n = Value at POR ‘1’ = Bit is set ‘0’ = Bit is cleared x = Bit is unknownPIC18F1220/1320 DS39605F-page 82 © 2007 Microchip Technology Inc. 9.4 IPR Registers The IPR registers contain the individual priority bits for the peripheral interrupts. Due to the number of peripheral interrupt sources, there are two Peripheral Interrupt Priority registers (IPR1, IPR2). Using the priority bits requires that the Interrupt Priority Enable (IPEN) bit be set. REGISTER 9-8: IPR1: PERIPHERAL INTERRUPT PRIORITY REGISTER 1 U-0 R/W-1 R/W-1 R/W-1 U-0 R/W-1 R/W-1 R/W-1 — ADIP RCIP TXIP — CCP1IP TMR2IP TMR1IP bit 7 bit 0 bit 7 Unimplemented: Read as ‘0’ bit 6 ADIP: A/D Converter Interrupt Priority bit 1 = High priority 0 = Low priority bit 5 RCIP: EUSART Receive Interrupt Priority bit 1 = High priority 0 = Low priority bit 4 TXIP: EUSART Transmit Interrupt Priority bit 1 = High priority 0 = Low priority bit 3 Unimplemented: Read as ‘0’ bit 2 CCP1IP: CCP1 Interrupt Priority bit 1 = High priority 0 = Low priority bit 1 TMR2IP: TMR2 to PR2 Match Interrupt Priority bit 1 = High priority 0 = Low priority bit 0 TMR1IP: TMR1 Overflow Interrupt Priority bit 1 = High priority 0 = Low priority Legend: R = Readable bit W = Writable bit U = Unimplemented bit, read as ‘0’ -n = Value at POR ‘1’ = Bit is set ‘0’ = Bit is cleared x = Bit is unknown© 2007 Microchip Technology Inc. DS39605F-page 83 PIC18F1220/1320 REGISTER 9-9: IPR2: PERIPHERAL INTERRUPT PRIORITY REGISTER 2 R/W-1 U-0 U-0 R/W-1 U-0 R/W-1 R/W-1 U-0 OSCFIP — — EEIP — LVDIP TMR3IP — bit 7 bit 0 bit 7 OSCFIP: Oscillator Fail Interrupt Priority bit 1 = High priority 0 = Low priority bit 6-5 Unimplemented: Read as ‘0’ bit 4 EEIP: Data EEPROM/Flash Write Operation Interrupt Priority bit 1 = High priority 0 = Low priority bit 3 Unimplemented: Read as ‘0’ bit 2 LVDIP: Low-Voltage Detect Interrupt Priority bit 1 = High priority 0 = Low priority bit 1 TMR3IP: TMR3 Overflow Interrupt Priority bit 1 = High priority 0 = Low priority bit 0 Unimplemented: Read as ‘0’ Legend: R = Readable bit W = Writable bit U = Unimplemented bit, read as ‘0’ -n = Value at POR ‘1’ = Bit is set ‘0’ = Bit is cleared x = Bit is unknownPIC18F1220/1320 DS39605F-page 84 © 2007 Microchip Technology Inc. 9.5 RCON Register The RCON register contains bits used to determine the cause of the last Reset or wake-up from a low-power mode. RCON also contains the bit that enables interrupt priorities (IPEN). REGISTER 9-10: RCON REGISTER R/W-0 U-0 U-0 R/W-1 R-1 R-1 R/W-0 R/W-0 IPEN — — RI TO PD POR BOR bit 7 bit 0 bit 7 IPEN: Interrupt Priority Enable bit 1 = Enable priority levels on interrupts 0 = Disable priority levels on interrupts (PIC16CXXX Compatibility mode) bit 6-5 Unimplemented: Read as ‘0’ bit 4 RI: RESET Instruction Flag bit For details of bit operation, see Register 5-3. bit 3 TO: Watchdog Time-out Flag bit For details of bit operation, see Register 5-3. bit 2 PD: Power-down Detection Flag bit For details of bit operation, see Register 5-3. bit 1 POR: Power-on Reset Status bit For details of bit operation, see Register 5-3. bit 0 BOR: Brown-out Reset Status bit For details of bit operation, see Register 5-3. Legend: R = Readable bit W = Writable bit U = Unimplemented bit, read as ‘0’ -n = Value at POR ‘1’ = Bit is set ‘0’ = Bit is cleared x = Bit is unknown© 2007 Microchip Technology Inc. DS39605F-page 85 PIC18F1220/1320 9.6 INTn Pin Interrupts External interrupts on the RB0/INT0, RB1/INT1 and RB2/INT2 pins are edge-triggered: either rising if the corresponding INTEDGx bit is set in the INTCON2 register, or falling if the INTEDGx bit is clear. When a valid edge appears on the RBx/INTx pin, the corresponding flag bit, INTxF, is set. This interrupt can be disabled by clearing the corresponding enable bit, INTxE. Flag bit, INTxF, must be cleared in software in the Interrupt Service Routine before re-enabling the interrupt. All external interrupts (INT0, INT1 and INT2) can wake-up the processor from low-power modes if bit INTxE was set prior to going into low-power modes. If the Global Interrupt Enable bit, GIE, is set, the processor will branch to the interrupt vector following wake-up. Interrupt priority for INT1 and INT2 is determined by the value contained in the interrupt priority bits, INT1IP (INTCON3<6>) and INT2IP (INTCON3<7>). There is no priority bit associated with INT0. It is always a high priority interrupt source. 9.7 TMR0 Interrupt In 8-bit mode (which is the default), an overflow (FFh → 00h) in the TMR0 register will set flag bit, TMR0IF. In 16-bit mode, an overflow (FFFFh → 0000h) in the TMR0H:TMR0L registers will set flag bit, TMR0IF. The interrupt can be enabled/disabled by setting/clearing enable bit, TMR0IE (INTCON<5>). Interrupt priority for Timer0 is determined by the value contained in the interrupt priority bit, TMR0IP (INTCON2<2>). See Section 11.0 “Timer0 Module” for further details on the Timer0 module. 9.8 PORTB Interrupt-on-Change An input change on PORTB<7:4> sets flag bit, RBIF (INTCON<0>). The interrupt can be enabled/disabled by setting/clearing enable bit, RBIE (INTCON<3>). Interrupt priority for PORTB interrupt-on-change is determined by the value contained in the interrupt priority bit, RBIP (INTCON2<0>). 9.9 Context Saving During Interrupts During interrupts, the return PC address is saved on the stack. Additionally, the WREG, Status and BSR registers are saved on the fast return stack. If a fast return from interrupt is not used (see Section 5.3 “Fast Register Stack”), the user may need to save the WREG, Status and BSR registers on entry to the Interrupt Service Routine. Depending on the user’s application, other registers may also need to be saved. Example 9-1 saves and restores the WREG, Status and BSR registers during an Interrupt Service Routine. EXAMPLE 9-1: SAVING STATUS, WREG AND BSR REGISTERS IN RAM MOVWF W_TEMP ; W_TEMP is in virtual bank MOVFF STATUS, STATUS_TEMP ; STATUS_TEMP located anywhere MOVFF BSR, BSR_TEMP ; BSR_TMEP located anywhere ; ; USER ISR CODE ; MOVFF BSR_TEMP, BSR ; Restore BSR MOVF W_TEMP, W ; Restore WREG MOVFF STATUS_TEMP, STATUS ; Restore STATUSPIC18F1220/1320 DS39605F-page 86 © 2007 Microchip Technology Inc. NOTES: © 2007 Microchip Technology Inc. DS39605F-page 87 PIC18F1220/1320 10.0 I/O PORTS Depending on the device selected and features enabled, there are up to five ports available. Some pins of the I/O ports are multiplexed with an alternate function from the peripheral features on the device. In general, when a peripheral is enabled, that pin may not be used as a general purpose I/O pin. Each port has three registers for its operation. These registers are: • TRIS register (data direction register) • PORT register (reads the levels on the pins of the device) • LAT register (output latch) The Data Latch (LATA) register is useful for readmodify-write operations on the value that the I/O pins are driving. A simplified model of a generic I/O port without the interfaces to other peripherals is shown in Figure 10-1. FIGURE 10-1: GENERIC I/O PORT OPERATION 10.1 PORTA, TRISA and LATA Registers PORTA is an 8-bit wide, bidirectional port. The corresponding data direction register is TRISA. Setting a TRISA bit (= 1) will make the corresponding PORTA pin an input (i.e., put the corresponding output driver in a high-impedance mode). Clearing a TRISA bit (= 0) will make the corresponding PORTA pin an output (i.e., put the contents of the output latch on the selected pin). Reading the PORTA register reads the status of the pins, whereas writing to it will write to the port latch. The Data Latch register (LATA) is also memory mapped. Read-modify-write operations on the LATA register read and write the latched output value for PORTA. The RA4 pin is multiplexed with the Timer0 module clock input to become the RA4/T0CKI pin. The sixth pin of PORTA (MCLR/VPP/RA5) is an input only pin. Its operation is controlled by the MCLRE configuration bit in Configuration Register 3H (CONFIG3H<7>). When selected as a port pin (MCLRE = 0), it functions as a digital input only pin; as such, it does not have TRIS or LAT bits associated with its operation. Otherwise, it functions as the device’s Master Clear input. In either configuration, RA5 also functions as the programming voltage input during programming. Pins RA6 and RA7 are multiplexed with the main oscillator pins; they are enabled as oscillator or I/O pins by the selection of the main oscillator in Configuration Register 1H (see Section 19.1 “Configuration Bits” for details). When they are not used as port pins, RA6 and RA7 and their associated TRIS and LAT bits are read as ‘0’. The other PORTA pins are multiplexed with analog inputs, the analog VREF+ and VREF- inputs and the LVD input. The operation of pins RA3:RA0 as A/D converter inputs is selected by clearing/setting the control bits in the ADCON1 register (A/D Control Register 1). The RA4/T0CKI pin is a Schmitt Trigger input and an open-drain output. All other PORTA pins have TTL input levels and full CMOS output drivers. The TRISA register controls the direction of the RA pins, even when they are being used as analog inputs. The user must ensure the bits in the TRISA register are maintained set when using them as analog inputs. EXAMPLE 10-1: INITIALIZING PORTA Data Bus WR LAT WR TRIS RD Port Data Latch TRIS Latch RD TRIS Input Buffer I/O pin(1) D Q CK D Q CK EN Q D EN RD LAT or Port Note 1: I/O pins have diode protection to VDD and VSS. Note: On a Power-on Reset, RA5 is enabled as a digital input only if Master Clear functionality is disabled. Note: On a Power-on Reset, RA3:RA0 are configured as analog inputs and read as ‘0’. RA4 is always a digital pin. CLRF PORTA ; Initialize PORTA by ; clearing output ; data latches CLRF LATA ; Alternate method ; to clear output ; data latches MOVLW 0x7F ; Configure A/D MOVWF ADCON1 ; for digital inputs MOVLW 0xD0 ; Value used to ; initialize data ; direction MOVWF TRISA ; Set RA<3:0> as outputs ; RA<7:4> as inputsPIC18F1220/1320 DS39605F-page 88 © 2007 Microchip Technology Inc. FIGURE 10-2: BLOCK DIAGRAM OF RA3:RA0 PINS FIGURE 10-3: BLOCK DIAGRAM OF OSC2/CLKO/RA6 PIN FIGURE 10-4: BLOCK DIAGRAM OF RA4/T0CKI PIN FIGURE 10-5: BLOCK DIAGRAM OF OSC1/CLKI/RA7 PIN Data Bus Q D EN P N WR LATA WR TRISA Data Latch TRIS Latch RD TRISA RD PORTA VSS VDD I/O pin(1) Note 1: I/O pins have protection diodes to VDD and VSS. Analog Input Mode To A/D Converter and LVD Modules RD LATA or PORTA D Q CK Q D Q CK Q Schmitt Trigger Input Buffer Data Bus D Q CK Q Q D EN P N WR LATA WR Data Latch TRIS Latch RD RD PORTA VSS VDD I/O pin(1) Note 1: I/O pins have protection diodes to VDD and VSS. or PORTA RD LATA RA6 Enable ECIO or Enable RCIO TRISA D Q CK Q TRISA Schmitt Trigger Input Buffer Data Bus WR TRISA RD PORTA Data Latch TRIS Latch Schmitt Trigger Input Buffer N VSS I/O pin(1) TMR0 Clock Input D Q CK Q D Q CK Q EN Q D EN RD LATA WR LATA or PORTA Note 1: I/O pins have protection diodes to VDD and VSS. RD TRISA Data Bus D Q CK Q Q D EN P N WR LATA WR Data Latch TRIS Latch RD RD PORTA VSS VDD I/O pin(1) Note 1: I/O pins have protection diodes to VDD and VSS. or PORTA RD LATA Enable RA7 TRISA D Q CK Q TRISA RA7 Enable To Oscillator Schmitt Trigger Input Buffer© 2007 Microchip Technology Inc. DS39605F-page 89 PIC18F1220/1320 FIGURE 10-6: MCLR/VPP/RA5 PIN BLOCK DIAGRAM TABLE 10-1: PORTA FUNCTIONS TABLE 10-2: SUMMARY OF REGISTERS ASSOCIATED WITH PORTA MCLR/VPP/RA5 Data Bus RD PORTA RD LATA Schmitt Trigger MCLRE RD TRISA Q D EN Latch Filter Low-Level MCLR Detect High-Voltage Detect Internal MCLR HV Name Bit# Buffer Function RA0/AN0 bit 0 ST Input/output port pin or analog input. RA1/AN1/LVDIN bit 1 ST Input/output port pin, analog input or Low-Voltage Detect input. RA2/AN2/VREF- bit 2 ST Input/output port pin, analog input or VREF-. RA3/AN3/VREF+ bit 3 ST Input/output port pin, analog input or VREF+. RA4/T0CKI bit 4 ST Input/output port pin or external clock input for Timer0. Output is open-drain type. MCLR/VPP/RA5 bit 5 ST Master Clear input or programming voltage input (if MCLR is enabled); input only port pin or programming voltage input (if MCLR is disabled). OSC2/CLKO/RA6 bit 6 ST OSC2, clock output or I/O pin. OSC1/CLKI/RA7 bit 7 ST OSC1, clock input or I/O pin. Legend: TTL = TTL input, ST = Schmitt Trigger input Name Bit 7 Bit 6 Bit 5 Bit 4 Bit 3 Bit 2 Bit 1 Bit 0 Value on POR, BOR Value on all other Resets PORTA RA7(1) RA6(1) RA5(2) RA4 RA3 RA2 RA1 RA0 xx0x 0000 uu0u 0000 LATA LATA7(1) LATA6(1) — LATA Data Output Register xx-x xxxx uu-u uuuu TRISA TRISA7(1) TRISA6(1) — PORTA Data Direction Register 11-1 1111 11-1 1111 ADCON1 — PCFG6 PCFG5 PCFG4 PCFG3 PCFG2 PCFG1 PCFG0 -000 0000 -000 0000 Legend: x = unknown, u = unchanged, – = unimplemented locations read as ‘0’. Shaded cells are not used by PORTA. Note 1: RA7:RA6 and their associated latch and data direction bits are enabled as I/O pins based on oscillator configuration; otherwise, they are read as ‘0’. 2: RA5 is an input only if MCLR is disabled.PIC18F1220/1320 DS39605F-page 90 © 2007 Microchip Technology Inc. 10.2 PORTB, TRISB and LATB Registers PORTB is an 8-bit wide, bidirectional port. The corresponding data direction register is TRISB. Setting a TRISB bit (= 1) will make the corresponding PORTB pin an input (i.e., put the corresponding output driver in a high-impedance mode). Clearing a TRISB bit (= 0) will make the corresponding PORTB pin an output (i.e., put the contents of the output latch on the selected pin). The Data Latch register (LATB) is also memory mapped. Read-modify-write operations on the LATB register read and write the latched output value for PORTB. EXAMPLE 10-2: INITIALIZING PORTB Pins RB0-RB2 are multiplexed with INT0-INT2; pins RB0, RB1 and RB4 are multiplexed with A/D inputs; pins RB1 and RB4 are multiplexed with EUSART; and pins RB2, RB3, RB6 and RB7 are multiplexed with ECCP. Each of the PORTB pins has a weak internal pull-up. A single control bit can turn on all the pull-ups. This is performed by clearing bit, RBPU (INTCON2<7>). The weak pull-up is automatically turned off when the port pin is configured as an output. The pull-ups are disabled on a Power-on Reset. Four of the PORTB pins (RB7:RB4) have an interrupton-change feature. Only pins configured as inputs can cause this interrupt to occur (i.e., any RB7:RB4 pin configured as an output is excluded from the interrupton-change comparison). The input pins (of RB7:RB4) are compared with the old value latched on the last read of PORTB. The “mismatch” outputs of RB7:RB4 are OR’ed together to generate the RB Port Change Interrupt with Flag bit, RBIF (INTCON<0>). This interrupt can wake the device from Sleep. The user, in the Interrupt Service Routine, can clear the interrupt in the following manner: a) Any read or write of PORTB (except with the MOVFF instruction). This will end the mismatch condition. b) Clear flag bit, RBIF. A mismatch condition will continue to set flag bit, RBIF. Reading PORTB will end the mismatch condition and allow flag bit, RBIF, to be cleared. The interrupt-on-change feature is recommended for wake-up on key depression operation and operations where PORTB is only used for the interrupt-on-change feature. Polling of PORTB is not recommended while using the interrupt-on-change feature. FIGURE 10-7: BLOCK DIAGRAM OF RB0/AN4/INT0 PIN Note: On a Power-on Reset, RB4:RB0 are configured as analog inputs by default and read as ‘0’; RB7:RB5 are configured as digital inputs. CLRF PORTB ; Initialize PORTB by ; clearing output ; data latches CLRF LATB ; Alternate method ; to clear output ; data latches MOVLW 0x70 ; Set RB0, RB1, RB4 as MOVWF ADCON1 ; digital I/O pins MOVLW 0xCF ; Value used to ; initialize data ; direction MOVWF TRISB ; Set RB<3:0> as inputs ; RB<5:4> as outputs ; RB<7:6> as inputs Data Latch RBPU(2) P VDD Data Bus WR LATB WR TRISB RD TRISB RD PORTB Weak Pull-up INTx I/O pin(1) Schmitt Trigger Buffer TRIS Latch RD LATB or PORTB Note 1: I/O pins have diode protection to VDD and VSS. 2: To enable weak pull-ups, set the appropriate TRIS bit(s) and clear the RBPU bit (INTCON2<7>). To A/D Converter Analog Input Mode TTL Input Buffer D Q CK D Q CK EN Q D EN© 2007 Microchip Technology Inc. DS39605F-page 91 PIC18F1220/1320 FIGURE 10-8: BLOCK DIAGRAM OF RB1/AN5/TX/CK/INT1 PIN Data Latch RBPU(2) P VDD D Q CK D Q CK Q D EN Data Bus WR LATB WR TRISB RD TRISB RD PORTB Weak Pull-up RD PORTB RB1 pin(1) TRIS Latch RD LATB or PORTB Note 1: I/O pins have diode protection to VDD and VSS. 2: To enable weak pull-ups, set the appropriate TRIS bit(s) and clear the RBPU bit (INTCON2<7>). To A/D Converter INT1/CK Input Analog Input Mode 1 0 TX/CK Data EUSART Enable Schmitt Trigger Input Buffer TX/CK TRIS Analog Input Mode TTL Input BufferPIC18F1220/1320 DS39605F-page 92 © 2007 Microchip Technology Inc. FIGURE 10-9: BLOCK DIAGRAM OF RB2/P1B/INT2 PIN Data Latch RBPU(2) P VDD D Q CK D Q CK Q D EN Data Bus WR LATB or WR TRISB RD TRISB RD PORTB Weak Pull-up RD PORTB RB2 pin(1) TTL Input Buffer TRIS Latch RD LATB PORTB P1B Data 1 0 Note 1: I/O pins have diode protection to VDD and VSS. 2: To enable weak pull-ups, set the appropriate TRIS bit(s) and clear the RBPU bit (INTCON2<7>). P1B Enable INT2 Input Schmitt Trigger P1B/D Tri-State Auto-Shutdown© 2007 Microchip Technology Inc. DS39605F-page 93 PIC18F1220/1320 FIGURE 10-10: BLOCK DIAGRAM OF RB3/CCP1/P1A PIN Data Bus WR LATB or WR TRISB Data Latch TRIS Latch RD TRISB D Q CK Q Q D EN ECCP1/P1A Data Out 1 0 D Q CK Q P N VDD VSS RD PORTB ECCP1 Input RB3 pin PORTB RD LATB Schmitt Trigger VDD Weak Pull-up P RBPU(2) TTL Input Buffer Note 1: I/O pins have diode protection to VDD and VSS. 2: To enable weak pull-ups, set the appropriate TRIS bit(s) and clear the RBPU bit (INTCON2<7>). 3: ECCP1 pin output enable active for any PWM mode and Compare mode, where CCP1M<3:0> = 1000 or 1001. 4: ECCP1 pin input enable active for Capture mode only. ECCP1(3) pin Output Enable P1A/C Tri-State Auto-Shutdown ECCP1(4) pin Input EnablePIC18F1220/1320 DS39605F-page 94 © 2007 Microchip Technology Inc. FIGURE 10-11: BLOCK DIAGRAM OF RB4/AN6/RX/DT/KBI0 PIN Data Bus WR LATB or WR TRISB Data Latch TRIS Latch RD TRISB D Q CK Q Q D EN DT Data 1 0 D Q CK Q RD PORTB RB4 pin PORTB RD LATB RBPU(2) P Weak Pull-up Q1 From other Q D EN Set RBIF RB7:RB4 pins RD PORTB Q3 To A/D Converter EUSART Enabled TTL Input Buffer Note 1: I/O pins have diode protection to VDD and VSS. 2: To enable weak pull-ups, set the appropriate TRIS bit(s) and clear the RBPU bit (INTCON2<7>). DT TRIS Analog Input Mode RX/DT Input Analog Input Mode Schmitt Trigger VDD© 2007 Microchip Technology Inc. DS39605F-page 95 PIC18F1220/1320 FIGURE 10-12: BLOCK DIAGRAM OF RB5/PGM/KBI1 PIN Data Latch From other RBPU(2) P VDD I/O pin(1) D Q CK D Q CK Q D EN Q D EN Data Bus WR LATB WR TRISB Set RBIF TRIS Latch RD TRISB RD PORTB RB7:RB5 and Weak Pull-up RD PORTB Latch TTL Input Buffer ST Buffer RB7:RB5 in Serial Programming Mode Q3 Q1 RD LATB or PORTB Note 1: I/O pins have diode protection to VDD and VSS. 2: To enable weak pull-ups, set the appropriate TRIS bit(s) and clear the RBPU bit (INTCON2<7>). RB4 pinsPIC18F1220/1320 DS39605F-page 96 © 2007 Microchip Technology Inc. FIGURE 10-13: BLOCK DIAGRAM OF RB6/PGC/T1OSO/T13CKI/P1C/KBI2 PIN Data Bus WR LATB or WR TRISB Data Latch TRIS Latch RD TRISB D Q CK Q Q D EN P1C Data 1 0 D Q CK Q RD PORTB RB6 pin PORTB RD LATB Schmitt Trigger RBPU(2) P Weak Pull-up Q1 From other Q D EN Set RBIF RB7:RB4 pins RD PORTB Q3 PGC From RB7 pin Timer1 Oscillator T1OSCEN T13CKI Note 1: I/O pins have diode protection to VDD and VSS. 2: To enable weak pull-ups, set the appropriate TRIS bit(s) and clear the RBPU bit (INTCON2<7>). TTL Buffer ECCP1 P1C/D Enable P1B/D Tri-State Auto-Shutdown VDD© 2007 Microchip Technology Inc. DS39605F-page 97 PIC18F1220/1320 FIGURE 10-14: BLOCK DIAGRAM OF RB7/PGD/T1OSI/P1D/KBI3 PIN Data Bus WR LATB or WR TRISB Data Latch TRIS Latch RD TRISB D Q CK Q Q D EN P1D Data 1 0 D Q CK Q RD PORTB RB7 pin PORTB RD LATB Schmitt Trigger To RB6 pin RBPU(2) P Weak Pull-up Q1 From other Q D EN Set RBIF RB7:RB4 pins RD PORTB Q3 PGD ECCP1 P1C/D Enable TTL Input Buffer Note 1: I/O pins have diode protection to VDD and VSS. 2: To enable weak pull-ups, set the appropriate TRIS bit(s) and clear the RBPU bit (INTCON2<7>). P1B/D Tri-State Auto-Shutdown T1OSCEN VDDPIC18F1220/1320 DS39605F-page 98 © 2007 Microchip Technology Inc. TABLE 10-3: PORTB FUNCTIONS TABLE 10-4: SUMMARY OF REGISTERS ASSOCIATED WITH PORTB Name Bit# Buffer Function RB0/AN4/INT0 bit 0 TTL(1)/ST(2) Input/output port pin, analog input or external interrupt input 0. RB1/AN5/TX/CK/INT1 bit 1 TTL(1)/ST(2) Input/output port pin, analog input, Enhanced USART Asynchronous Transmit, Addressable USART Synchronous Clock or external interrupt input 1. RB2/P1B/INT2 bit 2 TTL(1)/ST(2) Input/output port pin or external interrupt input 2. Internal software programmable weak pull-up. RB3/CCP1/P1A bit 3 TTL(1)/ST(3) Input/output port pin or Capture1 input/Compare1 output/ PWM output. Internal software programmable weak pull-up. RB4/AN6/RX/DT/KBI0 bit 4 TTL(1)/ST(4) Input/output port pin (with interrupt-on-change), analog input, Enhanced USART Asynchronous Receive or Addressable USART Synchronous Data. RB5/PGM/KBI1 bit 5 TTL(1)/ST(5) Input/output port pin (with interrupt-on-change). Internal software programmable weak pull-up. Low-Voltage ICSP enable pin. RB6/PGC/T1OSO/T13CKI/ P1C/KBI2 bit 6 TTL(1)/ST(5,6) Input/output port pin (with interrupt-on-change), Timer1/ Timer3 clock input or Timer1oscillator output. Internal software programmable weak pull-up. Serial programming clock. RB7/PGD/T1OSI/P1D/KBI3 bit 7 TTL(1)/ST(5) Input/output port pin (with interrupt-on-change) or Timer1 oscillator input. Internal software programmable weak pull-up. Serial programming data. Legend: TTL = TTL input, ST = Schmitt Trigger input Note 1: This buffer is a TTL input when configured as a port input pin. 2: This buffer is a Schmitt Trigger input when configured as the external interrupt. 3: This buffer is a Schmitt Trigger input when configured as the CCP1 input. 4: This buffer is a Schmitt Trigger input when used as EUSART receive input. 5: This buffer is a Schmitt Trigger input when used in Serial Programming mode. 6: This buffer is a TTL input when used as the T13CKI input. Name Bit 7 Bit 6 Bit 5 Bit 4 Bit 3 Bit 2 Bit 1 Bit 0 Value on POR, BOR Value on all other Resets PORTB RB7 RB6 RB5 RB4 RB3 RB2 RB1 RB0 xxxq qqqq uuuu uuuu LATB LATB Data Output Register xxxx xxxx uuuu uuuu TRISB PORTB Data Direction Register 1111 1111 1111 1111 INTCON GIE/GIEH PEIE/GIEL TMR0IE INT0IE RBIE TMR0IF INT0IF RBIF 0000 000x 0000 000u INTCON2 RBPU INTEDG0 INTEDG1 INTEDG2 — TMR0IP — RBIP 1111 -1-1 1111 -1-1 INTCON3 INT2IP INT1IP — INT2IE INT1IE — INT2IF INT1IF 11-0 0-00 11-0 0-00 ADCON1 — PCFG6 PCFG5 PCFG4 PCFG3 PCFG2 PCFG1 PCFG0 -000 0000 -000 0000 Legend: x = unknown, u = unchanged, q = value depends on condition. Shaded cells are not used by PORTB.© 2007 Microchip Technology Inc. DS39605F-page 99 PIC18F1220/1320 11.0 TIMER0 MODULE The Timer0 module has the following features: • Software selectable as an 8-bit or 16-bit timer/ counter • Readable and writable • Dedicated 8-bit software programmable prescaler • Clock source selectable to be external or internal • Interrupt-on-overflow from FFh to 00h in 8-bit mode and FFFFh to 0000h in 16-bit mode • Edge select for external clock Figure 11-1 shows a simplified block diagram of the Timer0 module in 8-bit mode and Figure 11-2 shows a simplified block diagram of the Timer0 module in 16-bit mode. The T0CON register (Register 11-1) is a readable and writable register that controls all the aspects of Timer0, including the prescale selection. REGISTER 11-1: T0CON: TIMER0 CONTROL REGISTER R/W-1 R/W-1 R/W-1 R/W-1 R/W-1 R/W-1 R/W-1 R/W-1 TMR0ON T08BIT T0CS T0SE PSA T0PS2 T0PS1 T0PS0 bit 7 bit 0 bit 7 TMR0ON: Timer0 On/Off Control bit 1 = Enables Timer0 0 = Stops Timer0 bit 6 T08BIT: Timer0 8-bit/16-bit Control bit 1 = Timer0 is configured as an 8-bit timer/counter 0 = Timer0 is configured as a 16-bit timer/counter bit 5 T0CS: Timer0 Clock Source Select bit 1 = Transition on T0CKI pin 0 = Internal instruction cycle clock (CLKO) bit 4 T0SE: Timer0 Source Edge Select bit 1 = Increment on high-to-low transition on T0CKI pin 0 = Increment on low-to-high transition on T0CKI pin bit 3 PSA: Timer0 Prescaler Assignment bit 1 = TImer0 prescaler is NOT assigned. Timer0 clock input bypasses prescaler. 0 = Timer0 prescaler is assigned. Timer0 clock input comes from prescaler output. bit 2-0 T0PS2:T0PS0: Timer0 Prescaler Select bits 111 = 1:256 Prescale value 110 = 1:128 Prescale value 101 = 1:64 Prescale value 100 = 1:32 Prescale value 011 = 1:16 Prescale value 010 = 1:8 Prescale value 001 = 1:4 Prescale value 000 = 1:2 Prescale value Legend: R = Readable bit W = Writable bit U = Unimplemented bit, read as ‘0’ -n = Value at POR ‘1’ = Bit is set ‘0’ = Bit is cleared x = Bit is unknownPIC18F1220/1320 DS39605F-page 100 © 2007 Microchip Technology Inc. FIGURE 11-1: TIMER0 BLOCK DIAGRAM IN 8-BIT MODE FIGURE 11-2: TIMER0 BLOCK DIAGRAM IN 16-BIT MODE Note: Upon Reset, Timer0 is enabled in 8-bit mode with clock input from T0CKI maximum prescale. RA4/T0CKI T0SE 0 1 1 0 T0CS FOSC/4 Programmable Prescaler Sync with Internal Clocks TMR0 (2 TCY Delay) Data Bus 8 PSA T0PS2, T0PS1, T0PS0 Set Interrupt Flag bit TMR0IF on Overflow 3 pin Note: Upon Reset, Timer0 is enabled in 8-bit mode with clock input from T0CKI maximum prescale. T0SE 0 1 1 0 T0CS FOSC/4 Programmable Prescaler Sync with Internal Clocks TMR0L (2 TCY Delay) Data Bus<7:0> 8 PSA T0PS2, T0PS1, T0PS0 Set Interrupt Flag bit TMR0IF on Overflow 3 TMR0 TMR0H High Byte 8 8 8 Read TMR0L Write TMR0L RA4/T0CKI pin© 2007 Microchip Technology Inc. DS39605F-page 101 PIC18F1220/1320 11.1 Timer0 Operation Timer0 can operate as a timer or as a counter. Timer mode is selected by clearing the T0CS bit. In Timer mode, the Timer0 module will increment every instruction cycle (without prescaler). If the TMR0 register is written, the increment is inhibited for the following two instruction cycles. The user can work around this by writing an adjusted value to the TMR0 register. Counter mode is selected by setting the T0CS bit. In Counter mode, Timer0 will increment either on every rising or falling edge of pin RA4/T0CKI. The incrementing edge is determined by the Timer0 Source Edge Select bit (T0SE). Clearing the T0SE bit selects the rising edge. When an external clock input is used for Timer0, it must meet certain requirements. The requirements ensure the external clock can be synchronized with the internal phase clock (TOSC). Also, there is a delay in the actual incrementing of Timer0 after synchronization. 11.2 Prescaler An 8-bit counter is available as a prescaler for the Timer0 module. The prescaler is not readable or writable. The PSA and T0PS2:T0PS0 bits determine the prescaler assignment and prescale ratio. Clearing bit PSA will assign the prescaler to the Timer0 module. When the prescaler is assigned to the Timer0 module, prescale values of 1:2, 1:4, ..., 1:256 are selectable. When assigned to the Timer0 module, all instructions writing to the TMR0 register (e.g., CLRF TMR0, MOVWF TMR0, BSF TMR0, x, ..., etc.) will clear the prescaler count. 11.2.1 SWITCHING PRESCALER ASSIGNMENT The prescaler assignment is fully under software control (i.e., it can be changed “on-the-fly” during program execution). 11.3 Timer0 Interrupt The TMR0 interrupt is generated when the TMR0 register overflows from FFh to 00h in 8-bit mode, or FFFFh to 0000h in 16-bit mode. This overflow sets the TMR0IF bit. The interrupt can be masked by clearing the TMR0IE bit. The TMR0IF bit must be cleared in software by the Timer0 module Interrupt Service Routine before re-enabling this interrupt. The TMR0 interrupt cannot awaken the processor from Low-Power Sleep mode, since the timer requires clock cycles even when T0CS is set. 11.4 16-Bit Mode Timer Reads and Writes TMR0H is not the high byte of the timer/counter in 16-bit mode, but is actually a buffered version of the high byte of Timer0 (refer to Figure 11-2). The high byte of the Timer0 counter/timer is not directly readable nor writable. TMR0H is updated with the contents of the high byte of Timer0 during a read of TMR0L. This provides the ability to read all 16 bits of Timer0, without having to verify that the read of the high and low byte were valid due to a rollover between successive reads of the high and low byte. A write to the high byte of Timer0 must also take place through the TMR0H Buffer register. Timer0 high byte is updated with the contents of TMR0H when a write occurs to TMR0L. This allows all 16 bits of Timer0 to be updated at once. TABLE 11-1: REGISTERS ASSOCIATED WITH TIMER0 Note: Writing to TMR0 when the prescaler is assigned to Timer0 will clear the prescaler count, but will not change the prescaler assignment. Name Bit 7 Bit 6 Bit 5 Bit 4 Bit 3 Bit 2 Bit 1 Bit 0 Value on POR, BOR Value on all other Resets TMR0L Timer0 Module Low Byte Register xxxx xxxx uuuu uuuu TMR0H Timer0 Module High Byte Register 0000 0000 0000 0000 INTCON GIE/GIEH PEIE/GIEL TMR0IE INT0IE RBIE TMR0IF INT0IF RBIF 0000 000x 0000 000u T0CON TMR0ON T08BIT T0CS T0SE PSA T0PS2 T0PS1 T0PS0 1111 1111 1111 1111 TRISA RA7(1) RA6(1) — PORTA Data Direction Register 11-1 1111 11-1 1111 Legend: x = unknown, u = unchanged, – = unimplemented locations read as ‘0’. Shaded cells are not used by Timer0. Note 1: RA6 and RA7 are enabled as I/O pins, depending on the oscillator mode selected in Configuration Word 1H.PIC18F1220/1320 DS39605F-page 102 © 2007 Microchip Technology Inc. NOTES:© 2007 Microchip Technology Inc. DS39605F-page 103 PIC18F1220/1320 12.0 TIMER1 MODULE The Timer1 module timer/counter has the following features: • 16-bit timer/counter (two 8-bit registers: TMR1H and TMR1L) • Readable and writable (both registers) • Internal or external clock select • Interrupt-on-overflow from FFFFh to 0000h • Reset from CCP module special event trigger • Status of system clock operation Figure 12-1 is a simplified block diagram of the Timer1 module. Register 12-1 details the Timer1 Control register. This register controls the operating mode of the Timer1 module and contains the Timer1 Oscillator Enable bit (T1OSCEN). Timer1 can be enabled or disabled by setting or clearing control bit, TMR1ON (T1CON<0>). The Timer1 oscillator can be used as a secondary clock source in power managed modes. When the T1RUN bit is set, the Timer1 oscillator is providing the system clock. If the Fail-Safe Clock Monitor is enabled and the Timer1 oscillator fails while providing the system clock, polling the T1RUN bit will indicate whether the clock is being provided by the Timer1 oscillator or another source. Timer1 can also be used to provide Real-Time Clock (RTC) functionality to applications, with only a minimal addition of external components and code overhead. REGISTER 12-1: T1CON: TIMER1 CONTROL REGISTER R/W-0 R-0 R/W-0 R/W-0 R/W-0 R/W-0 R/W-0 R/W-0 RD16 T1RUN T1CKPS1 T1CKPS0 T1OSCEN T1SYNC TMR1CS TMR1ON bit 7 bit 0 bit 7 RD16: 16-bit Read/Write Mode Enable bit 1 = Enables register read/write of TImer1 in one 16-bit operation 0 = Enables register read/write of Timer1 in two 8-bit operations bit 6 T1RUN: Timer1 System Clock Status bit 1 = System clock is derived from Timer1 oscillator 0 = System clock is derived from another source bit 5-4 T1CKPS1:T1CKPS0: Timer1 Input Clock Prescale Select bits 11 = 1:8 Prescale value 10 = 1:4 Prescale value 01 = 1:2 Prescale value 00 = 1:1 Prescale value bit 3 T1OSCEN: Timer1 Oscillator Enable bit 1 = Timer1 oscillator is enabled 0 = Timer1 oscillator is shut off The oscillator inverter and feedback resistor are turned off to eliminate power drain. bit 2 T1SYNC: Timer1 External Clock Input Synchronization Select bit When TMR1CS = 1: 1 = Do not synchronize external clock input 0 = Synchronize external clock input When TMR1CS = 0: This bit is ignored. Timer1 uses the internal clock when TMR1CS = 0. bit 1 TMR1CS: Timer1 Clock Source Select bit 1 = External clock from pin RB6/PGC/T1OSO/T13CKI/P1C/KBI2 (on the rising edge) 0 = Internal clock (Fosc/4) bit 0 TMR1ON: Timer1 On bit 1 = Enables Timer1 0 = Stops Timer1 Legend: R = Readable bit W = Writable bit U = Unimplemented bit, read as ‘0’ -n = Value at POR ‘1’ = Bit is set ‘0’ = Bit is cleared x = Bit is unknownPIC18F1220/1320 DS39605F-page 104 © 2007 Microchip Technology Inc. 12.1 Timer1 Operation Timer1 can operate in one of these modes: • As a timer • As a synchronous counter • As an asynchronous counter The operating mode is determined by the clock select bit, TMR1CS (T1CON<1>). When TMR1CS = 0, Timer1 increments every instruction cycle. When TMR1CS = 1, Timer1 increments on every rising edge of the external clock input, or the Timer1 oscillator, if enabled. When the Timer1 oscillator is enabled (T1OSCEN is set), the RB7/PGD/T1OSI/P1D/KBI3 and RB6/T1OSO/ T13CKI/P1C/KBI2 pins become inputs. That is, the TRISB7:TRISB6 values are ignored and the pins read as ‘0’. Timer1 also has an internal “Reset input”. This Reset can be generated by the CCP module (see Section 15.4.4 “Special Event Trigger”). FIGURE 12-1: TIMER1 BLOCK DIAGRAM FIGURE 12-2: TIMER1 BLOCK DIAGRAM: 16-BIT READ/WRITE MODE TMR1H TMR1L T1SYNC TMR1CS T1CKPS1:T1CKPS0 Peripheral Clocks FOSC/4 Internal Clock TMR1ON On/Off Prescaler 1, 2, 4, 8 Synchronize det 1 0 0 1 Synchronized Clock Input 2 TMR1IF Overflow TMR1 CLR CCP Special Event Trigger T1OSCEN Enable Oscillator(1) T1OSC Interrupt Flag bit Note 1: When enable bit, T1OSCEN, is cleared, the inverter and feedback resistor are turned off. This eliminates power drain. T1OSI T13CKI/T1OSO Timer 1 TMR1L T1OSC T1SYNC TMR1CS T1CKPS1:T1CKPS0 Peripheral Clocks T1OSCEN Enable Oscillator(1) TMR1IF Overflow Interrupt FOSC/4 Internal Clock TMR1ON on/off Prescaler 1, 2, 4, 8 Synchronize det 1 0 0 1 Synchronized Clock Input 2 T13CKI/T1OSO T1OSI TMR1 Flag bit Note 1: When enable bit, T1OSCEN, is cleared, the inverter and feedback resistor are turned off. This eliminates power drain. High Byte Data Bus<7:0> 8 TMR1H 8 8 8 Read TMR1L Write TMR1L CLR CCP Special Event Trigger© 2007 Microchip Technology Inc. DS39605F-page 105 PIC18F1220/1320 12.2 Timer1 Oscillator A crystal oscillator circuit is built-in between pins T1OSI (input) and T1OSO (amplifier output). It is enabled by setting control bit, T1OSCEN (T1CON<3>). The oscillator is a low-power oscillator rated for 32 kHz crystals. It will continue to run during all power managed modes. The circuit for a typical LP oscillator is shown in Figure 12-3. Table 12-1 shows the capacitor selection for the Timer1 oscillator. The user must provide a software time delay to ensure proper start-up of the Timer1 oscillator. FIGURE 12-3: EXTERNAL COMPONENTS FOR THE TIMER1 LP OSCILLATOR TABLE 12-1: CAPACITOR SELECTION FOR THE TIMER OSCILLATOR Note: The Timer1 oscillator shares the T1OSI and T1OSO pins with the PGD and PGC pins used for programming and debugging. When using the Timer1 oscillator, In-Circuit Serial Programming (ICSP) may not function correctly (high voltage or low voltage), or the In-Circuit Debugger (ICD) may not communicate with the controller. As a result of using either ICSP or ICD, the Timer1 crystal may be damaged. If ICSP or ICD operations are required, the crystal should be disconnected from the circuit (disconnect either lead), or installed after programming. The oscillator loading capacitors may remain in-circuit during ICSP or ICD operation. Osc Type Freq C1 C2 LP 32 kHz 22 pF(1) 22 pF(1) Note 1: Microchip suggests this value as a starting point in validating the oscillator circuit. Oscillator operation should then be tested to ensure expected performance under all expected conditions (VDD and temperature). 2: Higher capacitance increases the stability of the oscillator, but also increases the start-up time. 3: Since each resonator/crystal has its own characteristics, the user should consult the resonator/crystal manufacturer for appropriate values of external components. 4: Capacitor values are for design guidance only. Note: See the Notes with Table 12-1 for additional information about capacitor selection. C1 C2 XTAL PIC18FXXXX PGD/T1OSI PGC/T1OSO 32.768 kHz 22 pF 22 pF PGD PGC PIC18F1220/1320 DS39605F-page 106 © 2007 Microchip Technology Inc. 12.3 Timer1 Oscillator Layout Considerations The Timer1 oscillator circuit draws very little power during operation. Due to the low-power nature of the oscillator, it may also be sensitive to rapidly changing signals in close proximity. The oscillator circuit, shown in Figure 12-3, should be located as close as possible to the microcontroller. There should be no circuits passing within the oscillator circuit boundaries other than VSS or VDD. If a high-speed circuit must be located near the oscillator (such as the CCP1 pin in output compare or PWM mode, or the primary oscillator using the OSC2 pin), a grounded guard ring around the oscillator circuit, as shown in Figure 12-4, may be helpful when used on a single sided PCB, or in addition to a ground plane. FIGURE 12-4: OSCILLATOR CIRCUIT WITH GROUNDED GUARD RING 12.4 Timer1 Interrupt The TMR1 register pair (TMR1H:TMR1L) increments from 0000h to FFFFh and rolls over to 0000h. The Timer1 interrupt, if enabled, is generated on overflow, which is latched in interrupt flag bit, TMR1IF (PIR1<0>). This interrupt can be enabled/disabled by setting/clearing Timer1 Interrupt Enable bit, TMR1IE (PIE1<0>). 12.5 Resetting Timer1 Using a CCP Trigger Output If the CCP module is configured in Compare mode to generate a “special event trigger” (CCP1M3:CCP1M0 = 1011), this signal will reset Timer1 and start an A/D conversion, if the A/D module is enabled (see Section 15.4.4 “Special Event Trigger” for more information). Timer1 must be configured for either Timer or Synchronized Counter mode to take advantage of this feature. If Timer1 is running in Asynchronous Counter mode, this Reset operation may not work. In the event that a write to Timer1 coincides with a special event trigger from CCP1, the write will take precedence. In this mode of operation, the CCPR1H:CCPR1L register pair effectively becomes the period register for Timer1. 12.6 Timer1 16-Bit Read/Write Mode Timer1 can be configured for 16-bit reads and writes (see Figure 12-2). When the RD16 control bit (T1CON<7>) is set, the address for TMR1H is mapped to a buffer register for the high byte of Timer1. A read from TMR1L will load the contents of the high byte of Timer1 into the Timer1 high byte buffer. This provides the user with the ability to accurately read all 16 bits of Timer1 without having to determine whether a read of the high byte, followed by a read of the low byte, is valid, due to a rollover between reads. A write to the high byte of Timer1 must also take place through the TMR1H Buffer register. Timer1 high byte is updated with the contents of TMR1H when a write occurs to TMR1L. This allows a user to write all 16 bits to both the high and low bytes of Timer1 at once. The high byte of Timer1 is not directly readable or writable in this mode. All reads and writes must take place through the Timer1 High Byte Buffer register. Writes to TMR1H do not clear the Timer1 prescaler. The prescaler is only cleared on writes to TMR1L. RA1 RA4 RB0 MCLR VSS RA2 RA3 Note: Not drawn to scale. RB2 OSC1 RB5 OSC2 VDD RB7 RB6 C2 X1 C3 C4 X2 C5 C1 Note: The special event triggers from the CCP1 module will not set interrupt flag bit, TMR1IF (PIR1<0>). © 2007 Microchip Technology Inc. DS39605F-page 107 PIC18F1220/1320 12.7 Using Timer1 as a Real-Time Clock Adding an external LP oscillator to Timer1 (such as the one described in Section 12.2 “Timer1 Oscillator”, above), gives users the option to include RTC functionality to their applications. This is accomplished with an inexpensive watch crystal to provide an accurate time base and several lines of application code to calculate the time. When operating in Sleep mode and using a battery or supercapacitor as a power source, it can completely eliminate the need for a separate RTC device and battery backup. The application code routine, RTCisr, shown in Example 12-1, demonstrates a simple method to increment a counter at one-second intervals using an Interrupt Service Routine. Incrementing the TMR1 register pair to overflow, triggers the interrupt and calls the routine, which increments the seconds counter by one; additional counters for minutes and hours are incremented as the previous counter overflow. Since the register pair is 16 bits wide, counting up to overflow the register directly from a 32.768 kHz clock would take 2 seconds. To force the overflow at the required one-second intervals, it is necessary to preload it; the simplest method is to set the MSb of TMR1H with a BSF instruction. Note that the TMR1L register is never preloaded or altered; doing so may introduce cumulative error over many cycles. For this method to be accurate, Timer1 must operate in Asynchronous mode and the Timer1 overflow interrupt must be enabled (PIE1<0> = 1), as shown in the routine, RTCinit. The Timer1 oscillator must also be enabled and running at all times. EXAMPLE 12-1: IMPLEMENTING A REAL-TIME CLOCK USING A TIMER1 INTERRUPT SERVICE RTCinit MOVLW 0x80 ; Preload TMR1 register pair MOVWF TMR1H ; for 1 second overflow CLRF TMR1L MOVLW b’00001111’ ; Configure for external clock, MOVWF T1OSC ; Asynchronous operation, external oscillator CLRF secs ; Initialize timekeeping registers CLRF mins ; MOVLW .12 MOVWF hours BSF PIE1, TMR1IE ; Enable Timer1 interrupt RETURN RTCisr BSF TMR1H, 7 ; Preload for 1 sec overflow BCF PIR1, TMR1IF ; Clear interrupt flag INCF secs, F ; Increment seconds MOVLW .59 ; 60 seconds elapsed? CPFSGT secs RETURN ; No, done CLRF secs ; Clear seconds INCF mins, F ; Increment minutes MOVLW .59 ; 60 minutes elapsed? CPFSGT mins RETURN ; No, done CLRF mins ; clear minutes INCF hours, F ; Increment hours MOVLW .23 ; 24 hours elapsed? CPFSGT hours RETURN ; No, done MOVLW .01 ; Reset hours to 1 MOVWF hours RETURN ; DonePIC18F1220/1320 DS39605F-page 108 © 2007 Microchip Technology Inc. TABLE 12-2: REGISTERS ASSOCIATED WITH TIMER1 AS A TIMER/COUNTER Name Bit 7 Bit 6 Bit 5 Bit 4 Bit 3 Bit 2 Bit 1 Bit 0 Value on POR, BOR Value on all other Resets INTCON GIE/GIEH PEIE/GIEL TMR0IE INT0IE RBIE TMR0IF INT0IF RBIF 0000 000x 0000 000u PIR1 — ADIF RCIF TXIF — CCP1IF TMR2IF TMR1IF -000 -000 -000 -000 PIE1 — ADIE RCIE TXIE — CCP1IE TMR2IE TMR1IE -000 -000 -000 -000 IPR1 — ADIP RCIP TXIP — CCP1IP TMR2IP TMR1IP -111 -111 -111 -111 TMR1L Holding Register for the Least Significant Byte of the 16-bit TMR1 Register xxxx xxxx uuuu uuuu TMR1H Holding Register for the Most Significant Byte of the 16-bit TMR1 Register xxxx xxxx uuuu uuuu T1CON RD16 T1RUN T1CKPS1 T1CKPS0 T1OSCEN T1SYNC TMR1CS TMR1ON 0000 0000 u0uu uuuu Legend: x = unknown, u = unchanged, – = unimplemented, read as ‘0’. Shaded cells are not used by the Timer1 module.© 2007 Microchip Technology Inc. DS39605F-page 109 PIC18F1220/1320 13.0 TIMER2 MODULE The Timer2 module timer has the following features: • 8-bit timer (TMR2 register) • 8-bit period register (PR2) • Readable and writable (both registers) • Software programmable prescaler (1:1, 1:4, 1:16) • Software programmable postscaler (1:1 to 1:16) • Interrupt on TMR2 match with PR2 Timer2 has a control register shown in Register 13-1. TMR2 can be shut off by clearing control bit, TMR2ON (T2CON<2>), to minimize power consumption. Figure 13-1 is a simplified block diagram of the Timer2 module. Register 13-1 shows the Timer2 Control register. The prescaler and postscaler selection of Timer2 are controlled by this register. 13.1 Timer2 Operation Timer2 can be used as the PWM time base for the PWM mode of the CCP module. The TMR2 register is readable and writable and is cleared on any device Reset. The input clock (FOSC/4) has a prescale option of 1:1, 1:4 or 1:16, selected by control bits, T2CKPS1:T2CKPS0 (T2CON<1:0>). The match output of TMR2 goes through a 4-bit postscaler (which gives a 1:1 to 1:16 scaling inclusive) to generate a TMR2 interrupt (latched in flag bit, TMR2IF (PIR1<1>)). The prescaler and postscaler counters are cleared when any of the following occurs: • A write to the TMR2 register • A write to the T2CON register • Any device Reset (Power-on Reset, MCLR Reset, Watchdog Timer Reset or Brown-out Reset) TMR2 is not cleared when T2CON is written. REGISTER 13-1: T2CON: TIMER2 CONTROL REGISTER U-0 R/W-0 R/W-0 R/W-0 R/W-0 R/W-0 R/W-0 R/W-0 — TOUTPS3 TOUTPS2 TOUTPS1 TOUTPS0 TMR2ON T2CKPS1 T2CKPS0 bit 7 bit 0 bit 7 Unimplemented: Read as ‘0’ bit 6-3 TOUTPS3:TOUTPS0: Timer2 Output Postscale Select bits 0000 = 1:1 Postscale 0001 = 1:2 Postscale • • • 1111 = 1:16 Postscale bit 2 TMR2ON: Timer2 On bit 1 = Timer2 is on 0 = Timer2 is off bit 1-0 T2CKPS1:T2CKPS0: Timer2 Clock Prescale Select bits 00 = Prescaler is 1 01 = Prescaler is 4 1x = Prescaler is 16 Legend: R = Readable bit W = Writable bit U = Unimplemented bit, read as ‘0’ -n = Value at POR ‘1’ = Bit is set ‘0’ = Bit is cleared x = Bit is unknownPIC18F1220/1320 DS39605F-page 110 © 2007 Microchip Technology Inc. 13.2 Timer2 Interrupt The Timer2 module has an 8-bit period register, PR2. Timer2 increments from 00h until it matches PR2 and then resets to 00h on the next increment cycle. PR2 is a readable and writable register. The PR2 register is initialized to FFh upon Reset. 13.3 Output of TMR2 The output of TMR2 (before the postscaler) is fed to the Synchronous Serial Port module, which optionally uses it to generate the shift clock. FIGURE 13-1: TIMER2 BLOCK DIAGRAM TABLE 13-1: REGISTERS ASSOCIATED WITH TIMER2 AS A TIMER/COUNTER Comparator TMR2 Sets Flag TMR2 Output(1) Reset Postscaler Prescaler PR2 2 FOSC/4 1:1 to 1:16 1:1, 1:4, 1:16 EQ 4 bit TMR2IF TOUTPS3:TOUTPS0 T2CKPS1:T2CKPS0 Name Bit 7 Bit 6 Bit 5 Bit 4 Bit 3 Bit 2 Bit 1 Bit 0 Value on POR, BOR Value on all other Resets INTCON GIE/GIEH PEIE/GIEL TMR0IE INT0IE RBIE TMR0IF INT0IF RBIF 0000 000x 0000 000u PIR1 — ADIF RCIF TXIF — CCP1IF TMR2IF TMR1IF -000 -000 -000 -000 PIE1 — ADIE RCIE TXIE — CCP1IE TMR2IE TMR1IE -000 -000 -000 -000 IPR1 — ADIP RCIP TXIP — CCP1IP TMR2IP TMR1IP -111 -111 -111 -111 TMR2 Timer2 Module Register 0000 0000 0000 0000 T2CON — TOUTPS3 TOUTPS2 TOUTPS1 TOUTPS0 TMR2ON T2CKPS1 T2CKPS0 -000 0000 -000 0000 PR2 Timer2 Period Register 1111 1111 1111 1111 Legend: x = unknown, u = unchanged, – = unimplemented, read as ‘0’. Shaded cells are not used by the Timer2 module.© 2007 Microchip Technology Inc. DS39605F-page 111 PIC18F1220/1320 14.0 TIMER3 MODULE The Timer3 module timer/counter has the following features: • 16-bit timer/counter (two 8-bit registers; TMR3H and TMR3L) • Readable and writable (both registers) • Internal or external clock select • Interrupt-on-overflow from FFFFh to 0000h • Reset from CCP module trigger Figure 14-1 is a simplified block diagram of the Timer3 module. Register 14-1 shows the Timer3 Control register. This register controls the operating mode of the Timer3 module and sets the CCP clock source. Register 12-1 shows the Timer1 Control register. This register controls the operating mode of the Timer1 module, as well as contains the Timer1 Oscillator Enable bit (T1OSCEN), which can be a clock source for Timer3. REGISTER 14-1: T3CON: TIMER3 CONTROL REGISTER R/W-0 U-0 R/W-0 R/W-0 R/W-0 R/W-0 R/W-0 R/W-0 RD16 — T3CKPS1 T3CKPS0 T3CCP1 T3SYNC TMR3CS TMR3ON bit 7 bit 0 bit 7 RD16: 16-bit Read/Write Mode Enable bit 1 = Enables register read/write of Timer3 in one 16-bit operation 0 = Enables register read/write of Timer3 in two 8-bit operations bit 6 Unimplemented: Read as ‘0’ bit 5-4 T3CKPS1:T3CKPS0: Timer3 Input Clock Prescale Select bits 11 = 1:8 Prescale value 10 = 1:4 Prescale value 01 = 1:2 Prescale value 00 = 1:1 Prescale value bit 3 T3CCP1: Timer3 and Timer1 to CCP1 Enable bits 1 = Timer3 is the clock source for compare/capture CCP module 0 = Timer1 is the clock source for compare/capture CCP module bit 2 T3SYNC: Timer3 External Clock Input Synchronization Control bit (Not usable if the system clock comes from Timer1/Timer3.) When TMR3CS = 1: 1 = Do not synchronize external clock input 0 = Synchronize external clock input When TMR3CS = 0: This bit is ignored. Timer3 uses the internal clock when TMR3CS = 0. bit 1 TMR3CS: Timer3 Clock Source Select bit 1 = External clock input from Timer1 oscillator or T13CKI (on the rising edge after the first falling edge) 0 = Internal clock (FOSC/4) bit 0 TMR3ON: Timer3 On bit 1 = Enables Timer3 0 = Stops Timer3 Legend: R = Readable bit W = Writable bit U = Unimplemented bit, read as ‘0’ -n = Value at POR ‘1’ = Bit is set ‘0’ = Bit is cleared x = Bit is unknownPIC18F1220/1320 DS39605F-page 112 © 2007 Microchip Technology Inc. 14.1 Timer3 Operation Timer3 can operate in one of these modes: • As a timer • As a synchronous counter • As an asynchronous counter The operating mode is determined by the clock select bit, TMR3CS (T3CON<1>). When TMR3CS = 0, Timer3 increments every instruction cycle. When TMR3CS = 1, Timer3 increments on every rising edge of the Timer1 external clock input or the Timer1 oscillator, if enabled. When the Timer1 oscillator is enabled (T1OSCEN is set), the RB7/PGD/T1OSI/P1D/KBI3 and RB6/PGC/ T1OSO/T13CKI/P1C/KBI2 pins become inputs. That is, the TRISB7:TRISB6 value is ignored and the pins are read as ‘0’. Timer3 also has an internal “Reset input”. This Reset can be generated by the CCP module (see Section 15.4.4 “Special Event Trigger”). FIGURE 14-1: TIMER3 BLOCK DIAGRAM FIGURE 14-2: TIMER3 BLOCK DIAGRAM CONFIGURED IN 16-BIT READ/WRITE MODE TMR3H TMR3L T1OSC T3SYNC TMR3CS T3CKPS1:T3CKPS0 Peripheral Clocks T1OSCEN Enable Oscillator(1) TMR3IF Overflow Interrupt FOSC/4 Internal Clock TMR3ON On/Off Prescaler 1, 2, 4, 8 Synchronize det 1 0 0 1 Synchronized Clock Input 2 T1OSO/ T1OSI Flag bit Note 1: When enable bit, T1OSCEN, is cleared, the inverter and feedback resistor are turned off. This eliminates power drain. T13CKI CLR CCP Special Event Trigger T3CCPx Timer3 TMR3L T1OSC T3SYNC TMR3CS T3CKPS1:T3CKPS0 Peripheral T1OSCEN Enable Oscillator(1) FOSC/4 Internal Clock TMR3ON On/Off Prescaler 1, 2, 4, 8 Synchronize det 1 0 0 1 Synchronized Clock Input 2 T1OSO/ T1OSI TMR3 T13CKI CLR CCP Special Event Trigger T3CCPx To Timer1 Clock Input Note 1: When the T1OSCEN bit is cleared, the inverter and feedback resistor are turned off. This eliminates power drain. High Byte Data Bus<7:0> 8 TMR3H 8 8 8 Read TMR3L Write TMR3L Set TMR3IF Flag bit on Overflow Clocks© 2007 Microchip Technology Inc. DS39605F-page 113 PIC18F1220/1320 14.2 Timer1 Oscillator The Timer1 oscillator may be used as the clock source for Timer3. The Timer1 oscillator is enabled by setting the T1OSCEN (T1CON<3>) bit. The oscillator is a lowpower oscillator rated for 32 kHz crystals. See Section 12.2 “Timer1 Oscillator” for further details. 14.3 Timer3 Interrupt The TMR3 register pair (TMR3H:TMR3L) increments from 0000h to FFFFh and rolls over to 0000h. The TMR3 interrupt, if enabled, is generated on overflow, which is latched in interrupt flag bit, TMR3IF (PIR2<1>). This interrupt can be enabled/disabled by setting/clearing TMR3 Interrupt Enable bit, TMR3IE (PIE2<1>). 14.4 Resetting Timer3 Using a CCP Trigger Output If the CCP module is configured in Compare mode to generate a “special event trigger” (CCP1M3:CCP1M0 = 1011), this signal will reset Timer3. See Section 15.4.4 “Special Event Trigger” for more information. Timer3 must be configured for either Timer or Synchronized Counter mode to take advantage of this feature. If Timer3 is running in Asynchronous Counter mode, this Reset operation may not work. In the event that a write to Timer3 coincides with a special event trigger from CCP1, the write will take precedence. In this mode of operation, the CCPR1H:CCPR1L register pair effectively becomes the period register for Timer3. TABLE 14-1: REGISTERS ASSOCIATED WITH TIMER3 AS A TIMER/COUNTER Note: The special event triggers from the CCP module will not set interrupt flag bit, TMR3IF (PIR1<0>). Name Bit 7 Bit 6 Bit 5 Bit 4 Bit 3 Bit 2 Bit 1 Bit 0 Value on POR, BOR Value on all other Resets INTCON GIE/ GIEH PEIE/ GIEL TMR0IE INT0IE RBIE TMR0IF INT0IF RBIF 0000 000x 0000 000u PIR2 OSCFIF — — EEIF — LVDIF TMR3IF — 0--0 -00- 0--0 -00- PIE2 OSCFIE — — EEIE — LVDIE TMR3IE — 0--0 -00- 0--0 -00- IPR2 OSCFIP — — EEIP — LVDIP TMR3IP — 1--1 -11- 1--1 -11- TMR3L Holding Register for the Least Significant Byte of the 16-bit TMR3 Register xxxx xxxx uuuu uuuu TMR3H Holding Register for the Most Significant Byte of the 16-bit TMR3 Register xxxx xxxx uuuu uuuu T1CON RD16 T1RUN T1CKPS1 T1CKPS0 T1OSCEN T1SYNC TMR1CS TMR1ON 0000 0000 u0uu uuuu T3CON RD16 — T3CKPS1 T3CKPS0 T3CCP1 T3SYNC TMR3CS TMR3ON 0-00 0000 u-uu uuuu Legend: x = unknown, u = unchanged, – = unimplemented, read as ‘0’. Shaded cells are not used by the Timer3 module.PIC18F1220/1320 DS39605F-page 114 © 2007 Microchip Technology Inc. NOTES:© 2007 Microchip Technology Inc. DS39605F-page 115 PIC18F1220/1320 15.0 ENHANCED CAPTURE/ COMPARE/PWM (ECCP) MODULE The Enhanced CCP module is implemented as a standard CCP module with Enhanced PWM capabilities. These capabilities allow for 2 or 4 output channels, user-selectable polarity, dead-band control and automatic shutdown and restart and are discussed in detail in Section 15.5 “Enhanced PWM Mode”. The control register for CCP1 is shown in Register 15-1. In addition to the expanded functions of the CCP1CON register, the ECCP module has two additional registers associated with Enhanced PWM operation and auto-shutdown features: • PWM1CON • ECCPAS REGISTER 15-1: CCP1CON REGISTER FOR ENHANCED CCP OPERATION R/W-0 R/W-0 R/W-0 R/W-0 R/W-0 R/W-0 R/W-0 R/W-0 P1M1 P1M0 DC1B1 DC1B0 CCP1M3 CCP1M2 CCP1M1 CCP1M0 bit 7 bit 0 bit 7-6 P1M1:P1M0: PWM Output Configuration bits If CCP1M<3:2> = 00, 01, 10: xx = P1A assigned as Capture/Compare input; P1B, P1C, P1D assigned as port pins If CCP1M<3:2> = 11: 00 = Single output; P1A modulated; P1B, P1C, P1D assigned as port pins 01 = Full-bridge output forward; P1D modulated; P1A active; P1B, P1C inactive 10 = Half-bridge output; P1A, P1B modulated with dead-band control; P1C, P1D assigned as port pins 11 = Full-bridge output reverse; P1B modulated; P1C active; P1A, P1D inactive bit 5-4 DC1B1:DC1B0: PWM Duty Cycle Least Significant bits Capture mode: Unused. Compare mode: Unused. PWM mode: These bits are the two LSbs of the PWM duty cycle. The eight MSbs are found in CCPR1L. bit 3-0 CCP1M3:CCP1M0: ECCP1 Mode Select bits 0000 = Capture/Compare/PWM off (resets ECCP module) 0001 = Unused (reserved) 0010 = Compare mode, toggle output on match (ECCP1IF bit is set) 0011 = Unused (reserved) 0100 = Capture mode, every falling edge 0101 = Capture mode, every rising edge 0110 = Capture mode, every 4th rising edge 0111 = Capture mode, every 16th rising edge 1000 = Compare mode, set output on match (ECCP1IF bit is set) 1001 = Compare mode, clear output on match (ECCP1IF bit is set) 1010 = Compare mode, generate software interrupt on match (ECCP1IF bit is set, ECCP1 pin returns to port pin operation) 1011 = Compare mode, trigger special event (ECCP1IF bit is set; ECCP resets TMR1 or TMR3 and starts an A/D conversion if the A/D module is enabled) 1100 = PWM mode; P1A, P1C active-high; P1B, P1D active-high 1101 = PWM mode; P1A, P1C active-high; P1B, P1D active-low 1110 = PWM mode; P1A, P1C active-low; P1B, P1D active-high 1111 = PWM mode; P1A, P1C active-low; P1B, P1D active-low Legend: R = Readable bit W = Writable bit U = Unimplemented bit, read as ‘0’ -n = Value at POR ‘1’ = Bit is set ‘0’ = Bit is cleared x = Bit is unknownPIC18F1220/1320 DS39605F-page 116 © 2007 Microchip Technology Inc. 15.1 ECCP Outputs The Enhanced CCP module may have up to four outputs, depending on the selected operating mode. These outputs, designated P1A through P1D, are multiplexed with I/O pins on PORTB. The pin assignments are summarized in Table 15-1. To configure I/O pins as PWM outputs, the proper PWM mode must be selected by setting the P1Mn and CCP1Mn bits (CCP1CON<7:6> and <3:0>, respectively). The appropriate TRISB direction bits for the port pins must also be set as outputs. TABLE 15-1: PIN ASSIGNMENTS FOR VARIOUS ECCP MODES 15.2 CCP Module Capture/Compare/PWM Register 1 (CCPR1) is comprised of two 8-bit registers: CCPR1L (low byte) and CCPR1H (high byte). The CCP1CON register controls the operation of CCP1. All are readable and writable. TABLE 15-2: CCP MODE – TIMER RESOURCE 15.3 Capture Mode In Capture mode, CCPR1H:CCPR1L captures the 16-bit value of the TMR1 or TMR3 registers when an event occurs on pin RB3/CCP1/P1A. An event is defined as one of the following: • every falling edge • every rising edge • every 4th rising edge • every 16th rising edge The event is selected by control bits, CCP1M3:CCP1M0 (CCP1CON<3:0>). When a capture is made, the interrupt request flag bit, CCP1IF (PIR1<2>), is set; it must be cleared in software. If another capture occurs before the value in register CCPR1 is read, the old captured value is overwritten by the new captured value. 15.3.1 CCP PIN CONFIGURATION In Capture mode, the RB3/CCP1/P1A pin should be configured as an input by setting the TRISB<3> bit. 15.3.2 TIMER1/TIMER3 MODE SELECTION The timers that are to be used with the capture feature (either Timer1 and/or Timer3) must be running in Timer mode or Synchronized Counter mode. In Asynchronous Counter mode, the capture operation may not work. The timer to be used with the CCP module is selected in the T3CON register. 15.3.3 SOFTWARE INTERRUPT When the Capture mode is changed, a false capture interrupt may be generated. The user should keep bit, CCP1IE (PIE1<2>), clear while changing capture modes to avoid false interrupts and should clear the flag bit, CCP1IF, following any such change in operating mode. ECCP Mode CCP1CON Configuration RB3 RB2 RB6 RB7 Compatible CCP 00xx 11xx CCP1 RB2/INT2 RB6/PGC/T1OSO/T13CKI/KBI2 RB7/PGD/T1OSI/KBI3 Dual PWM 10xx 11xx P1A P1B RB6/PGC/T1OSO/T13CKI/KBI2 RB7/PGD/T1OSI/KBI3 Quad PWM x1xx 11xx P1A P1B P1C P1D Legend: x = Don’t care. Shaded cells indicate pin assignments not used by ECCP in a given mode. Note 1: TRIS register values must be configured appropriately. CCP Mode Timer Resource Capture Compare PWM Timer1 or Timer3 Timer1 or Timer3 Timer2 Note: If the RB3/CCP1/P1A is configured as an output, a write to the port can cause a capture condition. © 2007 Microchip Technology Inc. DS39605F-page 117 PIC18F1220/1320 15.3.4 CCP PRESCALER There are four prescaler settings, specified by bits CCP1M3:CCP1M0. Whenever the CCP module is turned off or the CCP module is not in Capture mode, the prescaler counter is cleared. This means that any Reset will clear the prescaler counter. Switching from one capture prescaler to another may generate an interrupt. Also, the prescaler counter will not be cleared; therefore, the first capture may be from a non-zero prescaler. Example 15-1 shows the recommended method for switching between capture prescalers. This example also clears the prescaler counter and will not generate the “false” interrupt. EXAMPLE 15-1: CHANGING BETWEEN CAPTURE PRESCALERS FIGURE 15-1: CAPTURE MODE OPERATION BLOCK DIAGRAM 15.4 Compare Mode In Compare mode, the 16-bit CCPR1 register value is constantly compared against either the TMR1 register pair value, or the TMR3 register pair value. When a match occurs, the RB3/CCP1/P1A pin: • Is driven high • Is driven low • Toggles output (high-to-low or low-to-high) • Remains unchanged (interrupt only) The action on the pin is based on the value of control bits, CCP1M3:CCP1M0. At the same time, interrupt flag bit, CCP1IF, is set. 15.4.1 CCP PIN CONFIGURATION The user must configure the RB3/CCP1/P1A pin as an output by clearing the TRISB<3> bit. 15.4.2 TIMER1/TIMER3 MODE SELECTION Timer1 and/or Timer3 must be running in Timer mode or Synchronized Counter mode if the CCP module is using the compare feature. In Asynchronous Counter mode, the compare operation may not work. 15.4.3 SOFTWARE INTERRUPT MODE When generate software interrupt is chosen, the RB3/ CCP1/P1A pin is not affected. CCP1IF is set and an interrupt is generated (if enabled). 15.4.4 SPECIAL EVENT TRIGGER In this mode, an internal hardware trigger is generated, which may be used to initiate an action. The special event trigger output of CCP1 resets the TMR1 register pair. This allows the CCPR1 register to effectively be a 16-bit programmable period register for Timer1. The special event trigger also sets the GO/DONE bit (ADCON0<1>). This starts a conversion of the currently selected A/D channel if the A/D is on. CLRF CCP1CON ; Turn CCP module off MOVLW NEW_CAPT_PS ; Load WREG with the ; new prescaler mode ; value and CCP ON MOVWF CCP1CON ; Load CCP1CON with ; this value CCPR1H CCPR1L TMR1H TMR1L Set Flag bit CCP1IF TMR3 Enable Q’s CCP1CON<3:0> CCP1 pin Prescaler ÷ 1, 4, 16 and Edge Detect TMR3H TMR3L TMR1 Enable T3CCP1 T3CCP1 Note: Clearing the CCP1CON register will force the RB3/CCP1/P1A compare output latch to the default low level. This is not the PORTB I/O data latch.PIC18F1220/1320 DS39605F-page 118 © 2007 Microchip Technology Inc. FIGURE 15-2: COMPARE MODE OPERATION BLOCK DIAGRAM TABLE 15-3: REGISTERS ASSOCIATED WITH CAPTURE, COMPARE, TIMER1 AND TIMER3 CCPR1H CCPR1L TMR1H TMR1L Comparator Q S R Output Logic Special Event Trigger Set Flag bit CCP1IF RB3/CCP1/P1A pin Match TRISB<3> CCP1CON<3:0> Mode Select Output Enable Special Event Trigger will: Reset Timer1 or Timer3, but does not set Timer1 or Timer3 interrupt flag bit and set bit GO/DONE (ADCON0<2>), which starts an A/D conversion. TMR3H TMR3L T3CCP1 0 1 Name Bit 7 Bit 6 Bit 5 Bit 4 Bit 3 Bit 2 Bit 1 Bit 0 Value on POR, BOR Value on all other Resets INTCON GIE/GIEH PEIE/GIEL TMR0IE INT0IE RBIE TMR0IF INT0IF RBIF 0000 000x 0000 000u PIR1 — ADIF RCIF TXIF — CCP1IF TMR2IF TMR1IF -000 -000 -000 -000 PIE1 — ADIE RCIE TXIE — CCP1IE TMR2IE TMR1IE -000 -000 -000 -000 IPR1 — ADIP RCIP TXIP — CCP1IP TMR2IP TMR1IP -111 -111 -111 -111 TRISB PORTB Data Direction Register 1111 1111 1111 1111 TMR1L Holding Register for the Least Significant Byte of the 16-bit TMR1 Register xxxx xxxx uuuu uuuu TMR1H Holding Register for the Most Significant Byte of the 16-bit TMR1 Register xxxx xxxx uuuu uuuu T1CON RD16 T1RUN T1CKPS1 T1CKPS0 T1OSCEN T1SYNC TMR1CS TMR1ON 0000 0000 uuuu uuuu CCPR1L Capture/Compare/PWM Register 1 (LSB) xxxx xxxx uuuu uuuu CCPR1H Capture/Compare/PWM Register 1 (MSB) xxxx xxxx uuuu uuuu CCP1CON P1M1 P1M0 DC1B1 DC1B0 CCP1M3 CCP1M2 CCP1M1 CCP1M0 0000 0000 0000 0000 TMR3L Holding Register for the Least Significant Byte of the 16-bit TMR3 Register xxxx xxxx uuuu uuuu TMR3H Holding Register for the Most Significant Byte of the 16-bit TMR3 Register xxxx xxxx uuuu uuuu T3CON RD16 — T3CKPS1 T3CKPS0 T3CCP1 T3SYNC TMR3CS TMR3ON 0-00 0000 u-uu uuuu ADCON0 VCFG1 VCFG0 — CHS2 CHS1 CHS0 GO/DONE ADON 00-0 0000 00-0 0000 Legend: x = unknown, u = unchanged, – = unimplemented, read as ‘0’. Shaded cells are not used by Capture and Timer1.© 2007 Microchip Technology Inc. DS39605F-page 119 PIC18F1220/1320 15.5 Enhanced PWM Mode The Enhanced PWM Mode provides additional PWM output options for a broader range of control applications. The module is an upwardly compatible version of the standard CCP module and offers up to four outputs, designated P1A through P1D. Users are also able to select the polarity of the signal (either active-high or active-low). The module’s output mode and polarity are configured by setting the P1M1:P1M0 and CCP1M3CCP1M0 bits of the CCP1CON register (CCP1CON<7:6> and CCP1CON<3:0>, respectively). Figure 15-3 shows a simplified block diagram of PWM operation. All control registers are double-buffered and are loaded at the beginning of a new PWM cycle (the period boundary when Timer2 resets) in order to prevent glitches on any of the outputs. The exception is the PWM Delay register, ECCP1DEL, which is loaded at either the duty cycle boundary or the boundary period (whichever comes first). Because of the buffering, the module waits until the assigned timer resets instead of starting immediately. This means that Enhanced PWM waveforms do not exactly match the standard PWM waveforms, but are instead offset by one full instruction cycle (4 TOSC). As before, the user must manually configure the appropriate TRIS bits for output. 15.5.1 PWM PERIOD The PWM period is specified by writing to the PR2 register. The PWM period can be calculated using the equation: EQUATION 15-1: PWM PERIOD PWM frequency is defined as 1/[PWM period]. When TMR2 is equal to PR2, the following three events occur on the next increment cycle: • TMR2 is cleared • The CCP1 pin is set (if PWM duty cycle = 0%, the CCP1 pin will not be set) • The PWM duty cycle is copied from CCPR1L into CCPR1H 15.5.2 PWM DUTY CYCLE The PWM duty cycle is specified by writing to the CCPR1L register and to the CCP1CON<5:4> bits. Up to 10-bit resolution is available. The CCPR1L contains the eight MSbs and the CCP1CON<5:4> contains the two LSbs. This 10-bit value is represented by CCPR1L:CCP1CON<5:4>. The PWM duty cycle is calculated by the equation: EQUATION 15-2: PWM DUTY CYCLE CCPR1L and CCP1CON<5:4> can be written to at any time, but the duty cycle value is not copied into CCPR1H until a match between PR2 and TMR2 occurs (i.e., the period is complete). In PWM mode, CCPR1H is a read-only register. The CCPR1H register and a 2-bit internal latch are used to double-buffer the PWM duty cycle. This double-buffering is essential for glitchless PWM operation. When the CCPR1H and 2-bit latch match TMR2, concatenated with an internal 2-bit Q clock or two bits of the TMR2 prescaler, the CCP1 pin is cleared. The maximum PWM resolution (bits) for a given PWM frequency is given by the equation: EQUATION 15-3: PWM RESOLUTION 15.5.3 PWM OUTPUT CONFIGURATIONS The P1M1:P1M0 bits in the CCP1CON register allow one of four configurations: • Single Output • Half-Bridge Output • Full-Bridge Output, Forward mode • Full-Bridge Output, Reverse mode The Single Output mode is the Standard PWM mode discussed in Section 15.5 “Enhanced PWM Mode”. The Half-Bridge and Full-Bridge Output modes are covered in detail in the sections that follow. The general relationship of the outputs in all configurations is summarized in Figure 15-4. TABLE 15-4: EXAMPLE PWM FREQUENCIES AND RESOLUTIONS AT 40 MHz Note: The Timer2 postscaler (see Section 13.0 “Timer2 Module”) is not used in the determination of the PWM frequency. The postscaler could be used to have a servo update rate at a different frequency than the PWM output. PWM Period = [(PR2) + 1] • 4 • TOSC • (TMR2 Prescale Value) Note: If the PWM duty cycle value is longer than the PWM period, the CCP1 pin will not be cleared. PWM Duty Cycle = (CCPR1L:CCP1CON<5:4>) • TOSC • (TMR2 Prescale Value) ( ) PWM Resolution (max) = FOSC FPWM log log(2) bits PWM Frequency 2.44 kHz 9.77 kHz 39.06 kHz 156.25 kHz 312.50 kHz 416.67 kHz Timer Prescaler (1, 4, 16) 16 4 1 1 1 1 PR2 Value FFh FFh FFh 3Fh 1Fh 17h Maximum Resolution (bits) 10 10 10 8 7 6.58PIC18F1220/1320 DS39605F-page 120 © 2007 Microchip Technology Inc. FIGURE 15-3: SIMPLIFIED BLOCK DIAGRAM OF THE ENHANCED PWM MODULE FIGURE 15-4: PWM OUTPUT RELATIONSHIPS (ACTIVE-HIGH STATE) CCPR1L CCPR1H (Slave) Comparator TMR2 Comparator PR2 (Note 1) R Q S Duty Cycle Registers CCP1CON<5:4> Clear Timer, set CCP1 pin and latch D.C. Note: The 8-bit TMR2 register is concatenated with the 2-bit internal Q clock, or 2 bits of the prescaler to create the 10-bit time base. TRISB<3> RB3/CCP1/P1A TRISB<2> RB2/P1B/INT2 TRISB<6> RB6/PGC/T1OSO/T13CKI/ TRISB<7> RB7/PGD/T1OSI/P1D/KBI3 Output Controller P1M1<1:0> 2 CCP1M<3:0> 4 CCP1DEL CCP1/P1A P1B P1C P1D P1C/KBI2 0 Period 00 10 01 11 SIGNAL PR2+1 CCP1CON<7:6> P1A Modulated P1A Modulated P1B Modulated P1A Active P1B Inactive P1C Inactive P1D Modulated P1A Inactive P1B Modulated P1C Active P1D Inactive Duty Cycle (Single Output) (Half-Bridge) (Full-Bridge, Forward) (Full-Bridge, Reverse) Delay(1) Delay(1)© 2007 Microchip Technology Inc. DS39605F-page 121 PIC18F1220/1320 FIGURE 15-5: PWM OUTPUT RELATIONSHIPS (ACTIVE-LOW STATE) 0 Period 00 10 01 11 SIGNAL PR2+1 CCP1CON<7:6> P1A Modulated P1A Modulated P1B Modulated P1A Active P1B Inactive P1C Inactive P1D Modulated P1A Inactive P1B Modulated P1C Active P1D Inactive Duty Cycle (Single Output) (Half-Bridge) (Full-Bridge, Forward) (Full-Bridge, Reverse) Delay(1) Delay(1) Relationships: • Period = 4 * TOSC * (PR2 + 1) * (TMR2 Prescale Value) • Duty Cycle = TOSC * (CCPR1L<7:0>:CCP1CON<5:4>) * (TMR2 Prescale Value) • Delay = 4 * TOSC * (PWM1CON<6:0>) Note 1: Dead-band delay is programmed using the PWM1CON register (Section 15.5.6 “Programmable Dead-Band Delay”).PIC18F1220/1320 DS39605F-page 122 © 2007 Microchip Technology Inc. 15.5.4 HALF-BRIDGE MODE In the Half-Bridge Output mode, two pins are used as outputs to drive push-pull loads. The PWM output signal is output on the RB3/CCP1/P1A pin, while the complementary PWM output signal is output on the RB2/P1B/INT2 pin (Figure 15-6). This mode can be used for half-bridge applications, as shown in Figure 15-7, or for full-bridge applications, where four power switches are being modulated with two PWM signals. In Half-Bridge Output mode, the programmable deadband delay can be used to prevent shoot-through current in half-bridge power devices. The value of bits, PDC6:PDC0 (PWM1CON<6:0>), sets the number of instruction cycles before the output is driven active. If the value is greater than the duty cycle, the corresponding output remains inactive during the entire cycle. See Section 15.5.6 “Programmable Dead-Band Delay” for more details of the dead-band delay operations. The TRISB<3> and TRISB<2> bits must be cleared to configure P1A and P1B as outputs. FIGURE 15-6: HALF-BRIDGE PWM OUTPUT (ACTIVE-HIGH) FIGURE 15-7: EXAMPLES OF HALF-BRIDGE OUTPUT MODE APPLICATIONS Period Duty Cycle td td (1) P1A P1B td = Dead-Band Delay Period (1) (1) Note 1: At this time, the TMR2 register is equal to the PR2 register. PIC18F1220/1320 P1A P1B FET Driver FET Driver Load + V - + V - FET Driver FET Driver V+ V- Load FET Driver FET Driver PIC18F1220/1320 P1A P1B Standard Half-Bridge Circuit (“Push-Pull”) Half-Bridge Output Driving a Full-Bridge Circuit© 2007 Microchip Technology Inc. DS39605F-page 123 PIC18F1220/1320 15.5.5 FULL-BRIDGE MODE In Full-Bridge Output mode, four pins are used as outputs; however, only two outputs are active at a time. In the Forward mode, pin RB3/CCP1/P1A is continuously active and pin RB7/PGD/T1OSI/P1D/KBI3 is modulated. In the Reverse mode, pin RB6/PGC/ T1OSO/T13CKI/P1C/KBI2 is continuously active and pin RB2/P1B/INT2 is modulated. These are illustrated in Figure 15-8. The TRISB<3:2> and TRISB<7:6> bits must be cleared to make the P1A, P1B, P1C and P1D pins output. FIGURE 15-8: FULL-BRIDGE PWM OUTPUT (ACTIVE-HIGH) Period Duty Cycle P1A P1B P1C P1D Forward Mode (1) Period Duty Cycle P1A P1C P1D P1B Reverse Mode (1) (1) (1) Note 1: At this time, the TMR2 register is equal to the PR2 register.PIC18F1220/1320 DS39605F-page 124 © 2007 Microchip Technology Inc. FIGURE 15-9: EXAMPLE OF FULL-BRIDGE APPLICATION 15.5.5.1 Direction Change in Full-Bridge Mode In the Full-Bridge Output mode, the P1M1 bit in the CCP1CON register allows the user to control the Forward/Reverse direction. When the application firmware changes this direction control bit, the module will assume the new direction on the next PWM cycle. Just before the end of the current PWM period, the modulated outputs (P1B and P1D) are placed in their inactive state, while the unmodulated outputs (P1A and P1C) are switched to drive in the opposite direction. This occurs in a time interval of (4 TOSC * (Timer2 Prescale Value) before the next PWM period begins. The Timer2 prescaler will be either 1,4 or 16, depending on the value of the T2CKPS bit (T2CON<1:0>). During the interval from the switch of the unmodulated outputs to the beginning of the next period, the modulated outputs (P1B and P1D) remain inactive. This relationship is shown in Figure 15-10. Note that in the Full-Bridge Output mode, the ECCP module does not provide any dead-band delay. In general, since only one output is modulated at all times, dead-band delay is not required. However, there is a situation where a dead-band delay might be required. This situation occurs when both of the following conditions are true: 1. The direction of the PWM output changes when the duty cycle of the output is at or near 100%. 2. The turn-off time of the power switch, including the power device and driver circuit, is greater than the turn-on time. Figure 15-11 shows an example where the PWM direction changes from forward to reverse, at a near 100% duty cycle. At time t1, the output P1A and P1D become inactive, while output P1C becomes active. In this example, since the turn-off time of the power devices is longer than the turn-on time, a shoot-through current may flow through power devices QC and QD (see Figure 15-9) for the duration of ‘t’. The same phenomenon will occur to power devices QA and QB for PWM direction change from reverse to forward. If changing PWM direction at high duty cycle is required for an application, one of the following requirements must be met: 1. Reduce PWM for a PWM period before changing directions. 2. Use switch drivers that can drive the switches off faster than they can drive them on. Other options to prevent shoot-through current may exist. PIC18F1220/1320 P1A P1C FET Driver FET Driver V+ V- Load FET Driver FET Driver P1B P1D QA QB QD QC© 2007 Microchip Technology Inc. DS39605F-page 125 PIC18F1220/1320 FIGURE 15-10: PWM DIRECTION CHANGE (ACTIVE-HIGH) FIGURE 15-11: PWM DIRECTION CHANGE AT NEAR 100% DUTY CYCLE (ACTIVE-HIGH) DC PWM Period(1) SIGNAL Note 1: The direction bit in the CCP1 Control register (CCP1CON<7>) is written any time during the PWM cycle. 2: When changing directions, the P1A and P1C toggle one Timer2 count before the end of the current PWM cycle. The modulated P1B and P1D signals are inactive at this time. PWM Period One Timer2 Count(2) P1A P1B P1C P1D DC Forward Period Reverse Period P1A tON tOFF t = tOFF – tON P1B P1C P1D External Switch D Potential Shoot-Through Current Note 1: tON is the turn-on delay of power switch QC and its driver. 2: tOFF is the turn-off delay of power switch QD and its driver. External Switch C t1 DC DCPIC18F1220/1320 DS39605F-page 126 © 2007 Microchip Technology Inc. 15.5.6 PROGRAMMABLE DEAD-BAND DELAY In half-bridge applications where all power switches are modulated at the PWM frequency at all times, the power switches normally require more time to turn off than to turn on. If both the upper and lower power switches are switched at the same time (one turned on and the other turned off), both switches may be on for a short period of time until one switch completely turns off. During this brief interval, a very high current (shootthrough current) may flow through both power switches, shorting the bridge supply. To avoid this potentially destructive shoot-through current from flowing during switching, turning on either of the power switches is normally delayed to allow the other switch to completely turn off. In the Half-Bridge Output mode, a digitally programmable dead-band delay is available to avoid shoot-through current from destroying the bridge power switches. The delay occurs at the signal transition from the non-active state to the active state. See Figure 15-6 for an illustration. The lower seven bits of the PWM1CON register (Register 15-2) sets the delay period in terms of microcontroller instruction cycles (TCY or 4 TOSC). 15.5.7 ENHANCED PWM AUTO-SHUTDOWN When the ECCP is programmed for any of the Enhanced PWM modes, the active output pins may be configured for auto-shutdown. Auto-shutdown immediately places the Enhanced PWM output pins into a defined shutdown state when a shutdown event occurs. A shutdown event can be caused by the INT0, INT1 or INT2 pins (or any combination of these three sources). The auto-shutdown feature can be disabled by not selecting any auto-shutdown sources. The autoshutdown sources to be used are selected using the ECCPAS2:ECCPAS0 bits (bits <6:4> of the ECCPAS register). When a shutdown occurs, the output pins are asynchronously placed in their shutdown states, specified by the PSSAC1:PSSAC0 and PSSBD1:PSSBD0 bits (ECCPAS<3:0>). Each pin pair (P1A/P1C and P1B/P1D) may be set to drive high, drive low or be tristated (not driving). The ECCPASE bit (ECCPAS<7>) is also set to hold the Enhanced PWM outputs in their shutdown states. The ECCPASE bit is set by hardware when a shutdown event occurs. If automatic restarts are not enabled, the ECCPASE bit is cleared by firmware when the cause of the shutdown clears. If automatic restarts are enabled, the ECCPASE bit is automatically cleared when the cause of the auto-shutdown has cleared. If the ECCPASE bit is set when a PWM period begins, the PWM outputs remain in their shutdown state for that entire PWM period. When the ECCPASE bit is cleared, the PWM outputs will return to normal operation at the beginning of the next PWM period. REGISTER 15-2: PWM1CON: PWM CONFIGURATION REGISTER Note: Writing to the ECCPASE bit is disabled while a shutdown condition is active. R/W-0 R/W-0 R/W-0 R/W-0 R/W-0 R/W-0 R/W-0 R/W-0 PRSEN PDC6 PDC5 PDC4 PDC3 PDC2 PDC1 PDC0 bit 7 bit 0 bit 7 PRSEN: PWM Restart Enable bit 1 = Upon auto-shutdown, the ECCPASE bit clears automatically once the shutdown event goes away; the PWM restarts automatically 0 = Upon auto-shutdown, ECCPASE must be cleared in software to restart the PWM bit 6-0 PDC<6:0>: PWM Delay Count bits Number of FOSC/4 (4 * TOSC) cycles between the scheduled time when a PWM signal should transition active and the actual time it transitions active. Legend: R = Readable bit W = Writable bit U = Unimplemented bit, read as ‘0’ -n = Value at POR ‘1’ = Bit is set ‘0’ = Bit is cleared x = Bit is unknown© 2007 Microchip Technology Inc. DS39605F-page 127 PIC18F1220/1320 REGISTER 15-3: ECCPAS: ENHANCED CAPTURE/COMPARE/PWM/AUTO-SHUTDOWN CONTROL REGISTER R/W-0 R/W-0 R/W-0 R/W-0 R/W-0 R/W-0 R/W-0 R/W-0 ECCPASE ECCPAS2 ECCPAS1 ECCPAS0 PSSAC1 PSSAC0 PSSBD1 PSSBD0 bit 7 bit 0 bit 7 ECCPASE: ECCP Auto-Shutdown Event Status bit 0 = ECCP outputs are operating 1 = A shutdown event has occurred; ECCP outputs are in shutdown state bit 6 ECCPAS2: ECCP Auto-Shutdown bit 2 0 = INT0 pin has no effect 1 = INT0 pin low causes shutdown bit 5 ECCPAS1: ECCP Auto-Shutdown bit 1 0 = INT2 pin has no effect 1 = INT2 pin low causes shutdown bit 4 ECCPAS0: ECCP Auto-Shutdown bit 0 0 = INT1 pin has no effect 1 = INT1 pin low causes shutdown bit 3-2 PSSACn: Pins A and C Shutdown State Control bits 00 = Drive Pins A and C to ‘0’ 01 = Drive Pins A and C to ‘1’ 1x = Pins A and C tri-state bit 1-0 PSSBDn: Pins B and D Shutdown State Control bits 00 = Drive Pins B and D to ‘0’ 01 = Drive Pins B and D to ‘1’ 1x = Pins B and D tri-state Legend: R = Readable bit W = Writable bit U = Unimplemented bit, read as ‘0’ -n = Value at POR ‘1’ = Bit is set ‘0’ = Bit is cleared x = Bit is unknownPIC18F1220/1320 DS39605F-page 128 © 2007 Microchip Technology Inc. 15.5.7.1 Auto-Shutdown and Automatic Restart The auto-shutdown feature can be configured to allow automatic restarts of the module, following a shutdown event. This is enabled by setting the PRSEN bit of the PWM1CON register (PWM1CON<7>). In Shutdown mode with PRSEN = 1 (Figure 15-12), the ECCPASE bit will remain set for as long as the cause of the shutdown continues. When the shutdown condition clears, the ECCPASE bit is automatically cleared. If PRSEN = 0 (Figure 15-13), once a shutdown condition occurs, the ECCPASE bit will remain set until it is cleared by firmware. Once ECCPASE is cleared, the Enhanced PWM will resume at the beginning of the next PWM period. Independent of the PRSEN bit setting, the ECCPASE bit cannot be cleared as long as the cause of the shutdown persists. The Auto-Shutdown mode can be forced by writing a ‘1’ to the ECCPASE bit. 15.5.8 START-UP CONSIDERATIONS When the ECCP module is used in the PWM mode, the application hardware must use the proper external pullup and/or pull-down resistors on the PWM output pins. When the microcontroller is released from Reset, all of the I/O pins are in the high-impedance state. The external circuits must keep the power switch devices in the off state, until the microcontroller drives the I/O pins with the proper signal levels, or activates the PWM output(s). The CCP1M1:CCP1M0 bits (CCP1CON<1:0>) allow the user to choose whether the PWM output signals are active-high or active-low for each pair of PWM output pins (P1A/P1C and P1B/P1D). The PWM output polarities must be selected before the PWM pins are configured as outputs. Changing the polarity configuration while the PWM pins are configured as outputs is not recommended, since it may result in damage to the application circuits. The P1A, P1B, P1C and P1D output latches may not be in the proper states when the PWM module is initialized. Enabling the PWM pins for output at the same time as the ECCP module may cause damage to the application circuit. The ECCP module must be enabled in the proper output mode and complete a full PWM cycle, before configuring the PWM pins as outputs. The completion of a full PWM cycle is indicated by the TMR2IF bit being set as the second PWM period begins. FIGURE 15-12: PWM AUTO-SHUTDOWN (PRSEN = 1, AUTO-RESTART ENABLED) FIGURE 15-13: PWM AUTO-SHUTDOWN (PRSEN = 0, AUTO-RESTART DISABLED) Note: Writing to the ECCPASE bit is disabled while a shutdown condition is active. Shutdown PWM ECCPASE bit Activity Event PWM Period PWM Period PWM Period Duty Cycle Dead Time Duty Cycle Duty Cycle Dead Time Dead Time Shutdown PWM ECCPASE bit Activity Event PWM Period PWM Period PWM Period ECCPASE Cleared by Firmware Duty Cycle Dead Time Duty Cycle Duty Cycle Dead Time Dead Time© 2007 Microchip Technology Inc. DS39605F-page 129 PIC18F1220/1320 15.5.9 SETUP FOR PWM OPERATION The following steps should be taken when configuring the ECCP1 module for PWM operation: 1. Configure the PWM pins P1A and P1B (and P1C and P1D, if used) as inputs by setting the corresponding TRISB bits. 2. Set the PWM period by loading the PR2 register. 3. Configure the ECCP module for the desired PWM mode and configuration by loading the CCP1CON register with the appropriate values: • Select one of the available output configurations and direction with the P1M1:P1M0 bits. • Select the polarities of the PWM output signals with the CCP1M3:CCP1M0 bits. 4. Set the PWM duty cycle by loading the CCPR1L register and CCP1CON<5:4> bits. 5. For Half-Bridge Output mode, set the deadband delay by loading PWM1CON<6:0> with the appropriate value. 6. If auto-shutdown operation is required, load the ECCPAS register: • Select the auto-shutdown sources using the ECCPAS<2:0> bits. • Select the shutdown states of the PWM output pins using PSSAC1:PSSAC0 and PSSBD1:PSSBD0 bits. • Set the ECCPASE bit (ECCPAS<7>). 7. If auto-restart operation is required, set the PRSEN bit (PWM1CON<7>). 8. Configure and start TMR2: • Clear the TMR2 interrupt flag bit by clearing the TMR2IF bit (PIR1<1>). • Set the TMR2 prescale value by loading the T2CKPS bits (T2CON<1:0>). • Enable Timer2 by setting the TMR2ON bit (T2CON<2>). 9. Enable PWM outputs after a new PWM cycle has started: • Wait until TMR2 overflows (TMR2IF bit is set). • Enable the CCP1/P1A, P1B, P1C and/or P1D pin outputs by clearing the respective TRISB bits. • Clear the ECCPASE bit (ECCPAS<7>). 15.5.10 OPERATION IN LOW-POWER MODES In the Low-Power Sleep mode, all clock sources are disabled. Timer2 will not increment and the state of the module will not change. If the ECCP pin is driving a value, it will continue to drive that value. When the device wakes up, it will continue from this state. If TwoSpeed Start-ups are enabled, the initial start-up frequency may not be stable if the INTOSC is being used. In PRI_IDLE mode, the primary clock will continue to clock the ECCP module without change. In all other low-power modes, the selected low-power mode clock will clock Timer2. Other low-power mode clocks will most likely be different than the primary clock frequency. 15.5.10.1 Operation with Fail-Safe Clock Monitor If the Fail-Safe Clock Monitor is enabled (CONFIG1H<6> is programmed), a clock failure will force the device into the Low-Power RC_RUN mode and the OSCFIF bit (PIR2<7>) will be set. The ECCP will then be clocked from the INTRC clock source, which may have a different clock frequency than the primary clock. By loading the IRCF2:IRCF0 bits on Resets, the user can enable the INTOSC at a high clock speed in the event of a clock failure. See the previous section for additional details. 15.5.11 EFFECTS OF A RESET Both power-on and subsequent Resets will force all ports to input mode and the CCP registers to their Reset states. This forces the Enhanced CCP module to reset to a state compatible with the standard CCP module.PIC18F1220/1320 DS39605F-page 130 © 2007 Microchip Technology Inc. TABLE 15-5: REGISTERS ASSOCIATED WITH ENHANCED PWM AND TIMER2 Name Bit 7 Bit 6 Bit 5 Bit 4 Bit 3 Bit 2 Bit 1 Bit 0 Value on POR, BOR Value on all other Resets INTCON GIE/GIEH PEIE/GIEL TMR0IE INT0IE RBIE TMR0IF INT0IF RBIF 0000 000x 0000 000u RCON IPEN — — RI TO PD POR BOR 0--1 11qq 0--q qquu PIR1 — ADIF RCIF TXIF — CCP1IF TMR2IF TMR1IF -000 -000 -000 -000 PIE1 — ADIE RCIE TXIE — CCP1IE TMR2IE TMR1IE -000 -000 -000 -000 IPR1 — ADIP RCIP TXIP — CCP1IP TMR2IP TMR1IP -111 -111 -111 -111 TMR2 Timer2 Module Register 0000 0000 0000 0000 PR2 Timer2 Module Period Register 1111 1111 1111 1111 T2CON — TOUTPS3 TOUTPS2 TOUTPS1 TOUTPS0 TMR2ON T2CKPS1 T2CKPS0 -000 0000 -000 0000 TRISB PORTB Data Direction Register 1111 1111 1111 1111 CCPR1H Enhanced Capture/Compare/PWM Register 1 High Byte xxxx xxxx uuuu uuuu CCPR1L Enhanced Capture/Compare/PWM Register 1 Low Byte xxxx xxxx uuuu uuuu CCP1CON P1M1 P1M0 DC1B1 DC1B0 CCP1M3 CCP1M2 CCP1M1 CCP1M0 0000 0000 0000 0000 ECCPAS ECCPASE ECCPAS2 ECCPAS1 ECCPAS0 PSSAC1 PSSAC0 PSSBD1 PSSBD0 0000 0000 0000 0000 PWM1CON PRSEN PDC6 PDC5 PDC4 PDC3 PDC2 PDC1 PDC0 0000 0000 uuuu uuuu OSCCON IDLEN IRCF2 IRCF1 IRCF0 OSTS IOFS SCS1 SCS0 0000 qq00 0000 qq00 Legend: x = unknown, u = unchanged, – = unimplemented, read as ‘0’. Shaded cells are not used by the ECCP module in Enhanced PWM mode.© 2007 Microchip Technology Inc. DS39605F-page 131 PIC18F1220/1320 16.0 ENHANCED ADDRESSABLE UNIVERSAL SYNCHRONOUS ASYNCHRONOUS RECEIVER TRANSMITTER (EUSART) The Enhanced Addressable Universal Synchronous Asynchronous Receiver Transmitter (EUSART) module can be configured as a full-duplex asynchronous system that can communicate with peripheral devices, such as CRT terminals and personal computers. It can also be configured as a half-duplex synchronous system that can communicate with peripheral devices, such as A/D or D/A integrated circuits, serial EEPROMs, etc. The Enhanced Addressable USART module implements additional features, including automatic baud rate detection and calibration, automatic wake-up on Sync Break reception and 12-bit Break character transmit. These features make it ideally suited for use in Local Interconnect Network (LIN) bus systems. The EUSART can be configured in the following modes: • Asynchronous (full duplex) with: - Auto-wake-up on character reception - Auto-baud calibration - 12-bit Break character transmission • Synchronous – Master (half duplex) with selectable clock polarity • Synchronous – Slave (half duplex) with selectable clock polarity The RB1/AN5/TX/CK/INT1 and RB4/AN6/RX/DT/KBI0 pins must be configured as follows for use with the Universal Synchronous Asynchronous Receiver Transmitter: • SPEN (RCSTA<7>) bit must be set ( = 1), • PCFG6:PCFG5 (ADCON1<5:6>) must be set ( = 1), • TRISB<4> bit must be set ( = 1) and • TRISB<1> bit must be set ( = 1). The operation of the Enhanced USART module is controlled through three registers: • Transmit Status and Control (TXSTA) • Receive Status and Control (RCSTA) • Baud Rate Control (BAUDCTL) These are detailed in on the following pages in Register 16-1, Register 16-2 and Register 16-3, respectively. 16.1 Asynchronous Operation in Power Managed Modes The EUSART may operate in Asynchronous mode while the peripheral clocks are being provided by the internal oscillator block. This makes it possible to remove the crystal or resonator that is commonly connected as the primary clock on the OSC1 and OSC2 pins. The factory calibrates the internal oscillator block output (INTOSC) for 8 MHz (see Table 22-6). However, this frequency may drift as VDD or temperature changes and this directly affects the asynchronous baud rate. Two methods may be used to adjust the baud rate clock, but both require a reference clock source of some kind. The first (preferred) method uses the OSCTUNE register to adjust the INTOSC output back to 8 MHz. Adjusting the value in the OSCTUNE register allows for fine resolution changes to the system clock source (see Section 3.6 “INTOSC Frequency Drift” for more information). The other method adjusts the value in the Baud Rate Generator (BRG). There may not be fine enough resolution when adjusting the Baud Rate Generator to compensate for a gradual change in the peripheral clock frequency. Note: The EUSART control will automatically reconfigure the pin from input to output as needed.PIC18F1220/1320 DS39605F-page 132 © 2007 Microchip Technology Inc. REGISTER 16-1: TXSTA: TRANSMIT STATUS AND CONTROL REGISTER R/W-0 R/W-0 R/W-0 R/W-0 U-0 R/W-0 R-1 R/W-0 CSRC TX9 TXEN SYNC SENDB BRGH TRMT TX9D bit 7 bit 0 bit 7 CSRC: Clock Source Select bit Asynchronous mode: Don’t care. Synchronous mode: 1 = Master mode (clock generated internally from BRG) 0 = Slave mode (clock from external source) bit 6 TX9: 9-bit Transmit Enable bit 1 = Selects 9-bit transmission 0 = Selects 8-bit transmission bit 5 TXEN: Transmit Enable bit 1 = Transmit enabled 0 = Transmit disabled Note: SREN/CREN overrides TXEN in Sync mode. bit 4 SYNC: EUSART Mode Select bit 1 = Synchronous mode 0 = Asynchronous mode bit 3 SENDB: Send Break Character bit Asynchronous mode: 1 = Send Sync Break on next transmission (cleared by hardware upon completion) 0 = Sync Break transmission completed Synchronous mode: Don’t care. bit 2 BRGH: High Baud Rate Select bit Asynchronous mode: 1 = High speed 0 = Low speed Synchronous mode: Unused in this mode. bit 1 TRMT: Transmit Shift Register Status bit 1 = TSR Idle 0 = TSR busy bit 0 TX9D: 9th bit of Transmit Data Can be address/data bit or a parity bit. Legend: R = Readable bit W = Writable bit U = Unimplemented bit, read as ‘0’ -n = Value at POR ‘1’ = Bit is set ‘0’ = Bit is cleared x = Bit is unknown© 2007 Microchip Technology Inc. DS39605F-page 133 PIC18F1220/1320 REGISTER 16-2: RCSTA: RECEIVE STATUS AND CONTROL REGISTER R/W-0 R/W-0 R/W-0 R/W-0 R/W-0 R-0 R-0 R-x SPEN RX9 SREN CREN ADDEN FERR OERR RX9D bit 7 bit 0 bit 7 SPEN: Serial Port Enable bit 1 = Serial port enabled (configures RX/DT and TX/CK pins as serial port pins) 0 = Serial port disabled (held in Reset) bit 6 RX9: 9-bit Receive Enable bit 1 = Selects 9-bit reception 0 = Selects 8-bit reception bit 5 SREN: Single Receive Enable bit Asynchronous mode: Don’t care. Synchronous mode – Master: 1 = Enables single receive 0 = Disables single receive This bit is cleared after reception is complete. Synchronous mode – Slave: Don’t care. bit 4 CREN: Continuous Receive Enable bit Asynchronous mode: 1 = Enables receiver 0 = Disables receiver Synchronous mode: 1 = Enables continuous receive until enable bit, CREN, is cleared (CREN overrides SREN) 0 = Disables continuous receive bit 3 ADDEN: Address Detect Enable bit Asynchronous mode 9-bit (RX9 = 1): 1 = Enables address detection, generates RCIF interrupt and loads RCREG when RX9D is set 0 = Disables address detection, all bytes are received and ninth bit can be used as parity bit Asynchronous mode 8-bit (RX9 = 0): Don’t care. bit 2 FERR: Framing Error bit 1 = Framing error (can be updated by reading RCREG register and receiving next valid byte) 0 = No framing error bit 1 OERR: Overrun Error bit 1 = Overrun error (can be cleared by clearing bit CREN) 0 = No overrun error bit 0 RX9D: 9th bit of Received Data This can be address/data bit or a parity bit and must be calculated by user firmware. Legend: R = Readable bit W = Writable bit U = Unimplemented bit, read as ‘0’ -n = Value at POR ‘1’ = Bit is set ‘0’ = Bit is cleared x = Bit is unknownPIC18F1220/1320 DS39605F-page 134 © 2007 Microchip Technology Inc. REGISTER 16-3: BAUDCTL: BAUD RATE CONTROL REGISTER U-0 R-1 U-0 R/W-0 R/W-0 U-0 R/W-0 R/W-0 — RCIDL — SCKP BRG16 — WUE ABDEN bit 7 bit 0 bit 7 Unimplemented: Read as ‘0’ bit 6 RCIDL: Receive Operation Idle Status bit 1 = Receiver is Idle 0 = Receiver is busy bit 5 Unimplemented: Read as ‘0’ bit 4 SCKP: Synchronous Clock Polarity Select bit Asynchronous mode: Unused in this mode. Synchronous mode: 1 = Idle state for clock (CK) is a high level 0 = Idle state for clock (CK) is a low level bit 3 BRG16: 16-bit Baud Rate Register Enable bit 1 = 16-bit Baud Rate Generator – SPBRGH and SPBRG 0 = 8-bit Baud Rate Generator – SPBRG only (Compatible mode), SPBRGH value ignored bit 2 Unimplemented: Read as ‘0’ bit 1 WUE: Wake-up Enable bit Asynchronous mode: 1 = EUSART will continue to sample the RX pin – interrupt generated on falling edge; bit cleared in hardware on following rising edge 0 = RX pin not monitored or rising edge detected Synchronous mode: Unused in this mode. bit 0 ABDEN: Auto-Baud Detect Enable bit Asynchronous mode: 1 = Enable baud rate measurement on the next character – requires reception of a Sync byte (55h); cleared in hardware upon completion 0 = Baud rate measurement disabled or completed Synchronous mode: Unused in this mode. Legend: R = Readable bit W = Writable bit U = Unimplemented bit, read as ‘0’ -n = Value at POR ‘1’ = Bit is set ‘0’ = Bit is cleared x = Bit is unknown© 2007 Microchip Technology Inc. DS39605F-page 135 PIC18F1220/1320 16.2 EUSART Baud Rate Generator (BRG) The BRG is a dedicated 8-bit or 16-bit generator, that supports both the Asynchronous and Synchronous modes of the EUSART. By default, the BRG operates in 8-bit mode; setting the BRG16 bit (BAUDCTL<3>) selects 16-bit mode. The SPBRGH:SPBRG register pair controls the period of a free running timer. In Asynchronous mode, bits BRGH (TXSTA<2>) and BRG16 also control the baud rate. In Synchronous mode, bit BRGH is ignored. Table 16-1 shows the formula for computation of the baud rate for different EUSART modes which only apply in Master mode (internally generated clock). Given the desired baud rate and FOSC, the nearest integer value for the SPBRGH:SPBRG registers can be calculated using the formulas in Table 16-1. From this, the error in baud rate can be determined. An example calculation is shown in Example 16-1. Typical baud rates and error values for the various asynchronous modes are shown in Table 16-2. It may be advantageous to use the high baud rate (BRGH = 1), or the 16-bit BRG to reduce the baud rate error, or achieve a slow baud rate for a fast oscillator frequency. Writing a new value to the SPBRGH:SPBRG registers causes the BRG timer to be reset (or cleared). This ensures the BRG does not wait for a timer overflow before outputting the new baud rate. 16.2.1 POWER MANAGED MODE OPERATION The system clock is used to generate the desired baud rate; however, when a power managed mode is entered, the clock source may be operating at a different frequency than in PRI_RUN mode. In Sleep mode, no clocks are present and in PRI_IDLE mode, the primary clock source continues to provide clocks to the Baud Rate Generator; however, in other power managed modes, the clock frequency will probably change. This may require the value in SPBRG to be adjusted. If the system clock is changed during an active receive operation, a receive error or data loss may result. To avoid this problem, check the status of the RCIDL bit and make sure that the receive operation is Idle before changing the system clock. 16.2.2 SAMPLING The data on the RB4/AN6/RX/DT/KBI0 pin is sampled three times by a majority detect circuit to determine if a high or a low level is present at the RX pin. TABLE 16-1: BAUD RATE FORMULAS EXAMPLE 16-1: CALCULATING BAUD RATE ERROR Configuration Bits BRG/EUSART Mode Baud Rate Formula SYNC BRG16 BRGH 000 8-bit/Asynchronous FOSC/[64 (n + 1)] 001 8-bit/Asynchronous FOSC/[16 (n + 1)] 010 16-bit/Asynchronous 011 16-bit/Asynchronous 10x 8-bit/Synchronous FOSC/[4 (n + 1)] 11x 16-bit/Synchronous Legend: x = Don’t care, n = value of SPBRGH:SPBRG register pair For a device with FOSC of 16 MHz, desired baud rate of 9600, Asynchronous mode, 8-bit BRG: Desired Baud Rate = FOSC/(64 ([SPBRGH:SPBRG] + 1)) Solving for SPBRGH:SPBRG: X = ((FOSC/Desired Baud Rate)/64) – 1 = ((16000000/9600)/64) – 1 = [25.042] = 25 Calculated Baud Rate= 16000000/(64 (25 + 1)) = 9615 Error = (Calculated Baud Rate – Desired Baud Rate)/Desired Baud Rate = (9615 – 9600)/9600 = 0.16%PIC18F1220/1320 DS39605F-page 136 © 2007 Microchip Technology Inc. TABLE 16-2: REGISTERS ASSOCIATED WITH BAUD RATE GENERATOR Name Bit 7 Bit 6 Bit 5 Bit 4 Bit 3 Bit 2 Bit 1 Bit 0 Value on POR, BOR Value on all other Resets TXSTA CSRC TX9 TXEN SYNC SENDB BRGH TRMT TX9D 0000 -010 0000 -010 RCSTA SPEN RX9 SREN CREN ADDEN FERR OERR RX9D 0000 -00x 0000 -00x BAUDCTL — RCIDL — SCKP BRG16 — WUE ABDEN -1-1 0-00 -1-1 0-00 SPBRGH Baud Rate Generator Register High Byte 0000 0000 0000 0000 SPBRG Baud Rate Generator Register Low Byte 0000 0000 0000 0000 Legend: x = unknown, – = unimplemented, read as ‘0’. Shaded cells are not used by the BRG. TABLE 16-3: BAUD RATES FOR ASYNCHRONOUS MODES BAUD RATE (K) SYNC = 0, BRGH = 0, BRG16 = 0 FOSC = 40.000 MHz FOSC = 20.000 MHz FOSC = 10.000 MHz FOSC = 8.000 MHz Actual Rate (K) % Error SPBRG value (decimal) Actual Rate (K) % Error SPBRG value (decimal) Actual Rate (K) % Error SPBRG value (decimal) Actual Rate (K) % Error SPBRG value (decimal) 0.3 — — — — — — — — — — — — 1.2 — — — 1.221 1.73 255 1.202 0.16 129 1201 -0.16 103 2.4 2.441 1.73 255 2.404 0.16 129 2.404 0.16 64 2403 -0.16 51 9.6 9.615 0.16 64 9.766 1.73 31 9.766 1.73 15 9615 -0.16 12 19.2 19.531 1.73 31 19.531 1.73 15 19.531 1.73 7 — — — 57.6 56.818 -1.36 10 62.500 8.51 4 52.083 -9.58 2 — — — 115.2 125.000 8.51 4 104.167 -9.58 2 78.125 -32.18 1 — — — BAUD RATE (K) SYNC = 0, BRGH = 0, BRG16 = 0 FOSC = 4.000 MHz FOSC = 2.000 MHz FOSC = 1.000 MHz Actual Rate (K) % Error SPBRG value (decimal) Actual Rate (K) % Error SPBRG value (decimal) Actual Rate (K) % Error SPBRG value (decimal) 0.3 0.300 0.16 207 300 -0.16 103 300 -0.16 51 1.2 1.202 0.16 51 1201 -0.16 25 1201 -0.16 12 2.4 2.404 0.16 25 2403 -0.16 12 — — — 9.6 8.929 -6.99 6 — — — — — — 19.2 20.833 8.51 2 — — — — — — 57.6 62.500 8.51 0 — — — — — — 115.2 62.500 -45.75 0 — — — — — —© 2007 Microchip Technology Inc. DS39605F-page 137 PIC18F1220/1320 BAUD RATE (K) SYNC = 0, BRGH = 1, BRG16 = 0 FOSC = 40.000 MHz FOSC = 20.000 MHz FOSC = 10.000 MHz FOSC = 8.000 MHz Actual Rate (K) % Error SPBRG value (decimal) Actual Rate (K) % Error SPBRG value (decimal) Actual Rate (K) % Error SPBRG value (decimal) Actual Rate (K) % Error SPBRG value (decimal) 2.4 — — — — — — 2.441 1.73 255 2403 -0.16 207 9.6 9.766 1.73 255 9.615 0.16 129 9.615 0.16 64 9615 -0.16 51 19.2 19.231 0.16 129 19.231 0.16 64 19.531 1.73 31 19230 -0.16 25 57.6 58.140 0.94 42 56.818 -1.36 21 56.818 -1.36 10 55555 3.55 8 115.2 113.636 -1.36 21 113.636 -1.36 10 125.000 8.51 4 — — — BAUD RATE (K) SYNC = 0, BRGH = 1, BRG16 = 0 FOSC = 4.000 MHz FOSC = 2.000 MHz FOSC = 1.000 MHz Actual Rate (K) % Error SPBRG value (decimal) Actual Rate (K) % Error SPBRG value (decimal) Actual Rate (K) % Error SPBRG value (decimal) 0.3 — — — — — — 300 -0.16 207 1.2 1.202 0.16 207 1201 -0.16 103 1201 -0.16 51 2.4 2.404 0.16 103 2403 -0.16 51 2403 -0.16 25 9.6 9.615 0.16 25 9615 -0.16 12 — — — 19.2 19.231 0.16 12 — — — — — — 57.6 62.500 8.51 3 — — — — — — 115.2 125.000 8.51 1 — — — — — — BAUD RATE (K) SYNC = 0, BRGH = 0, BRG16 = 1 FOSC = 40.000 MHz FOSC = 20.000 MHz FOSC = 10.000 MHz FOSC = 8.000 MHz Actual Rate (K) % Error SPBRG value (decimal) Actual Rate (K) % Error SPBRG value (decimal) Actual Rate (K) % Error SPBRG value (decimal) Actual Rate (K) % Error SPBRG value (decimal) 0.3 0.300 0.00 8332 0.300 0.02 4165 0.300 0.02 2082 300 -0.04 1665 1.2 1.200 0.02 2082 1.200 -0.03 1041 1.200 -0.03 520 1201 -0.16 415 2.4 2.402 0.06 1040 2.399 -0.03 520 2.404 0.16 259 2403 -0.16 207 9.6 9.615 0.16 259 9.615 0.16 129 9.615 0.16 64 9615 -0.16 51 19.2 19.231 0.16 129 19.231 0.16 64 19.531 1.73 31 19230 -0.16 25 57.6 58.140 0.94 42 56.818 -1.36 21 56.818 -1.36 10 55555 3.55 8 115.2 113.636 -1.36 21 113.636 -1.36 10 125.000 8.51 4 — — — BAUD RATE (K) SYNC = 0, BRGH = 0, BRG16 = 1 FOSC = 4.000 MHz FOSC = 2.000 MHz FOSC = 1.000 MHz Actual Rate (K) % Error SPBRG value (decimal) Actual Rate (K) % Error SPBRG value (decimal) Actual Rate (K) % Error SPBRG value (decimal) 0.3 0.300 0.04 832 300 -0.16 415 300 -0.16 207 1.2 1.202 0.16 207 1201 -0.16 103 1201 -0.16 51 2.4 2.404 0.16 103 2403 -0.16 51 2403 -0.16 25 9.6 9.615 0.16 25 9615 -0.16 12 — — — 19.2 19.231 0.16 12 — — — — — — 57.6 62.500 8.51 3 — — — — — — 115.2 125.000 8.51 1 — — — — — — TABLE 16-3: BAUD RATES FOR ASYNCHRONOUS MODES (CONTINUED)PIC18F1220/1320 DS39605F-page 138 © 2007 Microchip Technology Inc. BAUD RATE (K) SYNC = 0, BRGH = 1, BRG16 = 1 or SYNC = 1, BRG16 = 1 FOSC = 40.000 MHz FOSC = 20.000 MHz FOSC = 10.000 MHz FOSC = 8.000 MHz Actual Rate (K) % Error SPBRG value (decimal) Actual Rate (K) % Error SPBRG value (decimal) Actual Rate (K) % Error SPBRG value (decimal) Actual Rate (K) % Error SPBRG value (decimal) 0.3 0.300 0.00 33332 0.300 0.00 16665 0.300 0.00 8332 300 -0.01 6665 1.2 1.200 0.00 8332 1.200 0.02 4165 1.200 0.02 2082 1200 -0.04 1665 2.4 2.400 0.02 4165 2.400 0.02 2082 2.402 0.06 1040 2400 -0.04 832 9.6 9.606 0.06 1040 9.596 -0.03 520 9.615 0.16 259 9615 -0.16 207 19.2 19.193 -0.03 520 19.231 0.16 259 19.231 0.16 129 19230 -0.16 103 57.6 57.803 0.35 172 57.471 -0.22 86 58.140 0.94 42 57142 0.79 34 115.2 114.943 -0.22 86 116.279 0.94 42 113.636 -1.36 21 117647 -2.12 16 BAUD RATE (K) SYNC = 0, BRGH = 1, BRG16 = 1 or SYNC = 1, BRG16 = 1 FOSC = 4.000 MHz FOSC = 2.000 MHz FOSC = 1.000 MHz Actual Rate (K) % Error SPBRG value (decimal) Actual Rate (K) % Error SPBRG value (decimal) Actual Rate (K) % Error SPBRG value (decimal) 0.3 0.300 0.01 3332 300 -0.04 1665 300 -0.04 832 1.2 1.200 0.04 832 1201 -0.16 415 1201 -0.16 207 2.4 2.404 0.16 415 2403 -0.16 207 2403 -0.16 103 9.6 9.615 0.16 103 9615 -0.16 51 9615 -0.16 25 19.2 19.231 0.16 51 19230 -0.16 25 19230 -0.16 12 57.6 58.824 2.12 16 55555 3.55 8 — — — 115.2 111.111 -3.55 8 — — — — — — TABLE 16-3: BAUD RATES FOR ASYNCHRONOUS MODES (CONTINUED)© 2007 Microchip Technology Inc. DS39605F-page 139 PIC18F1220/1320 16.2.3 AUTO-BAUD RATE DETECT The Enhanced USART module supports the automatic detection and calibration of baud rate. This feature is active only in Asynchronous mode and while the WUE bit is clear. The automatic baud rate measurement sequence (Figure 16-1) begins whenever a Start bit is received and the ABDEN bit is set. The calculation is self-averaging. In the Auto-Baud Rate Detect (ABD) mode, the clock to the BRG is reversed. Rather than the BRG clocking the incoming RX signal, the RX signal is timing the BRG. In ABD mode, the internal Baud Rate Generator is used as a counter to time the bit period of the incoming serial byte stream. Once the ABDEN bit is set, the state machine will clear the BRG and look for a Start bit. The Auto-Baud Detect must receive a byte with the value 55h (ASCII “U”, which is also the LIN bus Sync character), in order to calculate the proper bit rate. The measurement is taken over both a low and a high bit time in order to minimize any effects caused by asymmetry of the incoming signal. After a Start bit, the SPBRG begins counting up using the preselected clock source on the first rising edge of RX. After eight bits on the RX pin, or the fifth rising edge, an accumulated value totalling the proper BRG period is left in the SPBRGH:SPBRG registers. Once the 5th edge is seen (should correspond to the Stop bit), the ABDEN bit is automatically cleared. While calibrating the baud rate period, the BRG registers are clocked at 1/8th the preconfigured clock rate. Note that the BRG clock will be configured by the BRG16 and BRGH bits. Independent of the BRG16 bit setting, both the SPBRG and SPBRGH will be used as a 16-bit counter. This allows the user to verify that no carry occurred for 8-bit modes, by checking for 00h in the SPBRGH register. Refer to Table 16-4 for counter clock rates to the BRG. While the ABD sequence takes place, the EUSART state machine is held in Idle. The RCIF interrupt is set once the fifth rising edge on RX is detected. The value in the RCREG needs to be read to clear the RCIF interrupt. RCREG content should be discarded. 16.2.4 RECEIVING A SYNC (AUTO-BAUD RATE DETECT) To receive a Sync (Auto-Baud Rate Detect): 1. Configure the EUSART for asynchronous receive. TXEN should remain clear. SPBRGH:SPBRG may be left as is. The controller should operate in either PRI_RUN or PRI_IDLE. 2. Enable RXIF interrupts. Set RCIE, PEIE, GIE. 3. Enable Auto-Baud Rate Detect. Set ABDEN. 4. When the next RCIF interrupt occurs, the received baud rate has been measured. Read RCREG to clear RCIF and discard. Check SPBRGH:SPBRG for a valid value. The EUSART is ready for normal communications. Return from the interrupt. Allow the primary clock to run (PRI_RUN or PRI_IDLE). 5. Process subsequent RCIF interrupts normally as in asynchronous reception. Remain in PRI_RUN or PRI_IDLE until communications are complete. TABLE 16-4: BRG COUNTER CLOCK RATES Note 1: It is up to the user to determine that the incoming character baud rate is within the range of the selected BRG clock source. Some combinations of oscillator frequency and EUSART baud rates are not possible due to bit error rates. Overall system timing and communication baud rates must be taken into consideration when using the Auto-Baud Rate Detection feature. BRG16 BRGH BRG Counter Clock 0 0 FOSC/512 0 1 FOSC/128 1 0 FOSC/128 1 1 FOSC/32 Note: During the ABD sequence, SPBRG and SPBRGH are both used as a 16-bit counter, independent of BRG16 setting.PIC18F1220/1320 DS39605F-page 140 © 2007 Microchip Technology Inc. FIGURE 16-1: AUTOMATIC BAUD RATE CALCULATION 16.3 EUSART Asynchronous Mode The Asynchronous mode of operation is selected by clearing the SYNC bit (TXSTA<4>). In this mode, the EUSART uses standard Non-Return-to-Zero (NRZ) format (one Start bit, eight or nine data bits and one Stop bit). The most common data format is 8 bits. An on-chip dedicated 8-bit/16-bit Baud Rate Generator can be used to derive standard baud rate frequencies from the oscillator. The EUSART transmits and receives the LSb first. The EUSART’s transmitter and receiver are functionally independent, but use the same data format and baud rate. The Baud Rate Generator produces a clock, either x16 or x64 of the bit shift rate, depending on the BRGH and BRG16 bits (TXSTA<2> and BAUDCTL<3>). Parity is not supported by the hardware, but can be implemented in software and stored as the 9th data bit. Asynchronous mode is available in all low-power modes; it is available in Sleep mode only when autowake-up on Sync Break is enabled. When in PRI_IDLE mode, no changes to the Baud Rate Generator values are required; however, other low-power mode clocks may operate at another frequency than the primary clock. Therefore, the Baud Rate Generator values may need to be adjusted. When operating in Asynchronous mode, the EUSART module consists of the following important elements: • Baud Rate Generator • Sampling Circuit • Asynchronous Transmitter • Asynchronous Receiver • Auto-Wake-up on Sync Break Character • 12-bit Break Character Transmit • Auto-Baud Rate Detection 16.3.1 EUSART ASYNCHRONOUS TRANSMITTER The EUSART transmitter block diagram is shown in Figure 16-2. The heart of the transmitter is the Transmit (Serial) Shift Register (TSR). The shift register obtains its data from the Read/Write Transmit Buffer register, TXREG. The TXREG register is loaded with data in software. The TSR register is not loaded until the Stop bit has been transmitted from the previous load. As soon as the Stop bit is transmitted, the TSR is loaded with new data from the TXREG register (if available). Once the TXREG register transfers the data to the TSR register (occurs in one TCY), the TXREG register is empty and flag bit, TXIF (PIR1<4>), is set. This interrupt can be enabled/disabled by setting/clearing enable bit, TXIE (PIE1<4>). Flag bit, TXIF, will be set, regardless of the state of enable bit, TXIE, and cannot be cleared in software. Flag bit, TXIF, is not cleared immediately upon loading the Transmit Buffer register, TXREG. TXIF becomes valid in the second instruction cycle following the load instruction. Polling TXIF immediately following a load of TXREG will return invalid results. While flag bit, TXIF, indicates the status of the TXREG register, another bit, TRMT (TXSTA<1>), shows the status of the TSR register. Status bit, TRMT, is a readonly bit, which is set when the TSR register is empty. No interrupt logic is tied to this bit, so the user has to poll this bit in order to determine if the TSR register is empty. BRG Value RX pin ABDEN bit RCIF bit Bit 0 Bit 1 (Interrupt) Read RCREG BRG Clock Start Set by User Auto-Cleared XXXXh 0000h Edge #1 Bit 2 Bit 3 Edge #2 Bit 4 Bit 5 Edge #3 Bit 6 Bit 7 Edge #4 Edge #5 001Ch Note 1: The ABD sequence requires the EUSART module to be configured in Asynchronous mode and WUE = 0. SPBRG XXXXh 1Ch SPBRGH XXXXh 00h Stop Bit Note 1: The TSR register is not mapped in data memory, so it is not available to the user. 2: Flag bit, TXIF, is set when enable bit, TXEN, is set.© 2007 Microchip Technology Inc. DS39605F-page 141 PIC18F1220/1320 To set up an Asynchronous Transmission: 1. Initialize the SPBRGH:SPBRG registers for the appropriate baud rate. Set or clear the BRGH and BRG16 bits, as required, to achieve the desired baud rate. 2. Enable the asynchronous serial port by clearing bit SYNC and setting bit SPEN. 3. If interrupts are desired, set enable bit TXIE. 4. If 9-bit transmission is desired, set transmit bit TX9. Can be used as address/data bit. 5. Enable the transmission by setting bit TXEN, which will also set bit TXIF. 6. If 9-bit transmission is selected, the ninth bit should be loaded in bit TX9D. 7. Load data to the TXREG register (starts transmission). If using interrupts, ensure that the GIE and PEIE bits in the INTCON register (INTCON<7:6>) are set. FIGURE 16-2: EUSART TRANSMIT BLOCK DIAGRAM FIGURE 16-3: ASYNCHRONOUS TRANSMISSION TXIF TXIE Interrupt TXEN Baud Rate CLK SPBRG Baud Rate Generator TX9D MSb LSb Data Bus TXREG Register TSR Register (8) 0 TX9 TRMT SPEN RB1/AN5/TX/CK/INT1 pin Pin Buffer and Control 8 • • • BRG16 SPBRGH Word 1 Word 1 Transmit Shift Reg Start bit bit 0 bit 1 bit 7/8 Write to TXREG Word 1 BRG Output (Shift Clock) RB1/AN5/TX/ TXIF bit (Transmit Buffer Reg. Empty Flag) TRMT bit (Transmit Shift Reg. Empty Flag) 1 TCY CK/INT1 (pin) Stop bitPIC18F1220/1320 DS39605F-page 142 © 2007 Microchip Technology Inc. FIGURE 16-4: ASYNCHRONOUS TRANSMISSION (BACK TO BACK) TABLE 16-5: REGISTERS ASSOCIATED WITH ASYNCHRONOUS TRANSMISSION Transmit Shift Reg. Write to TXREG BRG Output (Shift Clock) RB1/AN5/TX/ TXIF bit (Interrupt Reg. Flag) TRMT bit (Transmit Shift Reg. Empty Flag) Word 1 Word 2 Word 1 Word 2 Stop bit Start bit Transmit Shift Reg. Word 1 Word 2 bit 0 bit 1 bit 7/8 bit 0 Note: This timing diagram shows two consecutive transmissions. 1 TCY 1 TCY CK/INT1 (pin) Start bit Name Bit 7 Bit 6 Bit 5 Bit 4 Bit 3 Bit 2 Bit 1 Bit 0 Value on POR, BOR Value on all other Resets INTCON GIE/GIEH PEIE/GIEL TMR0IE INT0IE RBIE TMR0IF INT0IF RBIF 0000 000x 0000 000u PIR1 — ADIF RCIF TXIF — CCP1IF TMR2IF TMR1IF -000 -000 -000 -000 PIE1 — ADIE RCIE TXIE — CCP1IE TMR2IE TMR1IE -000 -000 -000 -000 IPR1 — ADIP RCIP TXIP — CCP1IP TMR2IP TMR1IP -111 -111 -111 -111 RCSTA SPEN RX9 SREN CREN ADDEN FERR OERR RX9D 0000 -00x 0000 -00x TXREG EUSART Transmit Register 0000 0000 0000 0000 TXSTA CSRC TX9 TXEN SYNC SENDB BRGH TRMT TX9D 0000 0010 0000 0010 BAUDCTL — RCIDL — SCKP BRG16 — WUE ABDEN -1-1 0-00 -1-1 0-00 SPBRGH Baud Rate Generator Register High Byte 0000 0000 0000 0000 SPBRG Baud Rate Generator Register Low Byte 0000 0000 0000 0000 Legend: x = unknown, – = unimplemented locations read as ‘0’. Shaded cells are not used for asynchronous transmission.© 2007 Microchip Technology Inc. DS39605F-page 143 PIC18F1220/1320 16.3.2 EUSART ASYNCHRONOUS RECEIVER The receiver block diagram is shown in Figure 16-5. The data is received on the RB4/AN6/RX/DT/KBI0 pin and drives the data recovery block. The data recovery block is actually a high-speed shifter, operating at x16 times the baud rate, whereas the main receive serial shifter operates at the bit rate or at FOSC. This mode would typically be used in RS-232 systems. To set up an Asynchronous Reception: 1. Initialize the SPBRGH:SPBRG registers for the appropriate baud rate. Set or clear the BRGH and BRG16 bits, as required, to achieve the desired baud rate. 2. Enable the asynchronous serial port by clearing bit SYNC and setting bit SPEN. 3. If interrupts are desired, set enable bit RCIE. 4. If 9-bit reception is desired, set bit RX9. 5. Enable the reception by setting bit CREN. 6. Flag bit, RCIF, will be set when reception is complete and an interrupt will be generated if enable bit RCIE was set. 7. Read the RCSTA register to get the 9th bit (if enabled) and determine if any error occurred during reception. 8. Read the 8-bit received data by reading the RCREG register. 9. If any error occurred, clear the error by clearing enable bit CREN. 10. If using interrupts, ensure that the GIE and PEIE bits in the INTCON register (INTCON<7:6>) are set. 16.3.3 SETTING UP 9-BIT MODE WITH ADDRESS DETECT This mode would typically be used in RS-485 systems. To set up an Asynchronous Reception with Address Detect Enable: 1. Initialize the SPBRGH:SPBRG registers for the appropriate baud rate. Set or clear the BRGH and BRG16 bits, as required, to achieve the desired baud rate. 2. Enable the asynchronous serial port by clearing the SYNC bit and setting the SPEN bit. 3. If interrupts are required, set the RCEN bit and select the desired priority level with the RCIP bit. 4. Set the RX9 bit to enable 9-bit reception. 5. Set the ADDEN bit to enable address detect. 6. Enable reception by setting the CREN bit. 7. The RCIF bit will be set when reception is complete. The interrupt will be Acknowledged if the RCIE and GIE bits are set. 8. Read the RCSTA register to determine if any error occurred during reception, as well as read bit 9 of data (if applicable). 9. Read RCREG to determine if the device is being addressed. 10. If any error occurred, clear the CREN bit. 11. If the device has been addressed, clear the ADDEN bit to allow all received data into the receive buffer and interrupt the CPU. FIGURE 16-5: EUSART RECEIVE BLOCK DIAGRAM x64 Baud Rate CLK Baud Rate Generator RB4/AN6/RX/DT/KBI0 Pin Buffer and Control SPEN Data Recovery CREN OERR FERR MSb RSR Register LSb RX9D RCREG Register FIFO Interrupt RCIF RCIE Data Bus 8 ÷ 64 ÷ 16 or Stop (8) 7 1 0 Start RX9 • • • BRG16 SPBRGH SPBRG or ÷ 4PIC18F1220/1320 DS39605F-page 144 © 2007 Microchip Technology Inc. To set up an Asynchronous Transmission: 1. Initialize the SPBRG register for the appropriate baud rate. If a high-speed baud rate is desired, set bit BRGH (see Section 16.2 “EUSART Baud Rate Generator (BRG)”). 2. Enable the asynchronous serial port by clearing bit SYNC and setting bit SPEN. 3. If interrupts are desired, set enable bit TXIE. 4. If 9-bit transmission is desired, set transmit bit TX9. Can be used as address/data bit. 5. Enable the transmission by setting bit TXEN, which will also set bit TXIF. 6. If 9-bit transmission is selected, the ninth bit should be loaded in bit TX9D. 7. Load data to the TXREG register (starts transmission). If using interrupts, ensure that the GIE and PEIE bits in the INTCON register (INTCON<7:6>) are set. FIGURE 16-6: ASYNCHRONOUS RECEPTION TABLE 16-6: REGISTERS ASSOCIATED WITH ASYNCHRONOUS RECEPTION Start bit bit 0 bit 7/8 bit 1 Stop bit 0 bit 7/8 bit Start bit Start bit 7/8 Stop bit bit RX (pin) Reg Rcv Buffer Reg Rcv Shift Read Rcv Buffer Reg RCREG RCIF (Interrupt Flag) OERR bit CREN Word 1 RCREG Word 2 RCREG Stop bit Note: This timing diagram shows three words appearing on the RX input. The RCREG (receive buffer) is read after the third word, causing the OERR (overrun) bit to be set. Name Bit 7 Bit 6 Bit 5 Bit 4 Bit 3 Bit 2 Bit 1 Bit 0 Value on POR, BOR Value on all other Resets INTCON GIE/GIEH PEIE/GIEL TMR0IE INT0IE RBIE TMR0IF INT0IF RBIF 0000 000x 0000 000u PIR1 — ADIF RCIF TXIF — CCP1IF TMR2IF TMR1IF -000 -000 -000 -000 PIE1 — ADIE RCIE TXIE — CCP1IE TMR2IE TMR1IE -000 -000 -000 -000 IPR1 — ADIP RCIP TXIP — CCP1IP TMR2IP TMR1IP -111 -111 -111 -111 RCSTA SPEN RX9 SREN CREN ADDEN FERR OERR RX9D 0000 000x 0000 000x RCREG EUSART Receive Register 0000 0000 0000 0000 TXSTA CSRC TX9 TXEN SYNC SENDB BRGH TRMT TX9D 0000 0010 0000 0010 BAUDCTL — RCIDL — SCKP BRG16 — WUE ABDEN -1-1 0-00 -1-1 0-00 SPBRGH Baud Rate Generator Register High Byte 0000 0000 0000 0000 SPBRG Baud Rate Generator Register Low Byte 0000 0000 0000 0000 Legend: x = unknown, – = unimplemented locations read as ‘0’. Shaded cells are not used for asynchronous reception.© 2007 Microchip Technology Inc. DS39605F-page 145 PIC18F1220/1320 16.3.4 AUTO-WAKE-UP ON SYNC BREAK CHARACTER During Sleep mode, all clocks to the EUSART are suspended. Because of this, the Baud Rate Generator is inactive and a proper byte reception cannot be performed. The auto-wake-up feature allows the controller to wake-up due to activity on the RX/DT line while the EUSART is operating in Asynchronous mode. The auto-wake-up feature is enabled by setting the WUE bit (BAUDCTL<1>). Once set, the typical receive sequence on RX/DT is disabled and the EUSART remains in an Idle state, monitoring for a wake-up event independent of the CPU mode. A wake-up event consists of a high-to-low transition on the RX/DT line. (This coincides with the start of a Sync Break or a Wake-up Signal character for the LIN protocol.) Following a wake-up event, the module generates an RCIF interrupt. The interrupt is generated synchronously to the Q clocks in normal operating modes (Figure 16-7) and asynchronously if the device is in Sleep mode (Figure 16-8). The interrupt condition is cleared by reading the RCREG register. The WUE bit is automatically cleared once a low-to-high transition is observed on the RX line, following the wakeup event. At this point, the EUSART module is in Idle mode and returns to normal operation. This signals to the user that the Sync Break event is over. 16.3.4.1 Special Considerations Using Auto-Wake-up Since auto-wake-up functions by sensing rising edge transitions on RX/DT, information with any state changes before the Stop bit may signal a false end-of-character and cause data or framing errors. To work properly, therefore, the initial character in the transmission must be all ‘0’s. This can be 00h (8 bytes) for standard RS-232 devices, or 000h (12 bits) for LIN bus. Oscillator start-up time must also be considered, especially in applications using oscillators with longer start-up intervals (i.e., LP, XT or HS/PLL mode). The Sync Break (or Wake-up Signal) character must be of sufficient length and be followed by a sufficient period, to allow enough time for the selected oscillator to start and provide proper initialization of the EUSART. 16.3.4.2 Special Considerations Using the WUE Bit The timing of WUE and RCIF events may cause some confusion when it comes to determining the validity of received data. As noted, setting the WUE bit places the EUSART in an Idle mode. The wake-up event causes a receive interrupt by setting the RCIF bit. The WUE bit is cleared after this when a rising edge is seen on RX/ DT. The interrupt condition is then cleared by reading the RCREG register. Ordinarily, the data in RCREG will be dummy data and should be discarded. The fact that the WUE bit has been cleared (or is still set) and the RCIF flag is set should not be used as an indicator of the integrity of the data in RCREG. Users should consider implementing a parallel method in firmware to verify received data integrity. To assure that no actual data is lost, check the RCIDL bit to verify that a receive operation is not in process. If a receive operation is not occurring, the WUE bit may then be set just prior to entering the Sleep mode. FIGURE 16-7: AUTO-WAKE-UP BIT (WUE) TIMINGS DURING NORMAL OPERATION FIGURE 16-8: AUTO-WAKE-UP BIT (WUE) TIMINGS DURING SLEEP Q1 Q2 Q3 Q4 Q1 Q2 Q3 Q4 Q1 Q2 Q3 Q4 Q1 Q2 Q3 Q4 Q1 Q2 Q3 Q4 Q1 Q2 Q3 Q4 Q1 Q2 Q3 Q4 Q1 Q2 Q3 Q4 Q1 Q2 Q3 Q4 Q1 Q2 Q3 Q4 OSC1 WUE bit RX/DT Line RCIF Cleared due to User Read of RCREG Note 1: The EUSART remains in Idle while the WUE bit is set. Bit Set by User Cleared by hardware Q1 Q2 Q3 Q4 Q1 Q2 Q3 Q4 Q1 Q2 Q3 Q4 Q1 Q2 Q3 Q4 Q1 Q2 Q3 Q4 Q1 Q2 Q3 Q4 Q1 Q2 Q3 Q4 Q1 Q2 Q3 Q4 OSC1 WUE bit RX/DT Line RCIF Cleared due to User Read of RCREG Note 1: If the wake-up event requires a long oscillator warm-up time, the WUE bit may be cleared while the primary clock is still starting. 2: The EUSART remains in Idle while the WUE bit is set. Sleep Ends Enters Sleep Bit Set by User Cleared by hardware Note 1PIC18F1220/1320 DS39605F-page 146 © 2007 Microchip Technology Inc. 16.3.5 BREAK CHARACTER SEQUENCE The Enhanced USART module has the capability of sending the special Break character sequences that are required by the LIN bus standard. The Break character transmit consists of a Start bit, followed by twelve ‘0’ bits and a Stop bit. The Frame Break character is sent whenever the SENDB and TXEN bits (TXSTA<3> and TXSTA<5>) are set while the Transmit Shift register is loaded with data. Note that the value of data written to TXREG will be ignored and all ‘0’s will be transmitted. The SENDB bit is automatically reset by hardware after the corresponding Stop bit is sent. This allows the user to preload the transmit FIFO with the next transmit byte following the Break character (typically, the Sync character in the LIN specification). Note that the data value written to the TXREG for the Break character is ignored. The write simply serves the purpose of initiating the proper sequence. The TRMT bit indicates when the transmit operation is active or Idle, just as it does during normal transmission. See Figure 16-9 for the timing of the Break character sequence. 16.3.5.1 Transmitting A Break Signal The Enhanced USART module has the capability of sending the Break signal that is required by the LIN bus standard. The Break signal consists of a Start bit, followed by twelve ‘0’ bits and a Stop bit. The Break signal is sent whenever the SENDB (TXSTA<3>) and TXEN (TXSTA<5>) bits are set and TXREG is loaded with data. The data written to TXREG will be ignored and all ‘0’s will be transmitted. SENDB is automatically cleared by hardware when the Break signal has been sent. This allows the user to preload the transmit FIFO with the next transmit byte following the Break character (typically, the Sync character in the LIN specification). The TRMT bit indicates when the transmit operation is active or Idle, just as it does during normal transmission. To send a Break Signal: 1. Configure the EUSART for asynchronous transmissions (steps 1-5). Initialize the SPBRG register for the appropriate baud rate. If a high-speed baud rate is desired, set bit BRGH (see Section 16.2 “EUSART Baud Rate Generator (BRG)”). 2. Enable the asynchronous serial port by clearing bit SYNC and setting bit SPEN. 3. If interrupts are desired, set enable bit TXIE. 4. If 9-bit transmission is desired, set transmit bit TX9. Can be used as address/data bit. 5. Enable the transmission by setting bit TXEN, which will also set bit TXIF. 6. Set the SENDB bit. 7. Load a byte into TXREG. This triggers sending a Break signal. The Break signal is complete when TRMT is set. SENDB will also be cleared. See Figure 16-9 for the timing of the Break signal sequence. 16.3.6 RECEIVING A BREAK CHARACTER The Enhanced USART module can receive a Break character in two ways. The first method forces configuration of the baud rate at a frequency of 9/13 the typical speed. This allows for the Stop bit transition to be at the correct sampling location (12 bits for Break versus Start bit and 8 data bits for typical data). The second method uses the auto-wake-up feature described in Section 16.3.4 “Auto-Wake-up on Sync Break Character”. By enabling this feature, the EUSART will sample the next two transitions on RX/DT, cause an RCIF interrupt and receive the next data byte followed by another interrupt. Note that following a Break character, the user will typically want to enable the Auto-Baud Rate Detect feature. For both methods, the user can set the ABD bit before placing the EUSART in its Sleep mode. 16.3.6.1 Transmitting a Break Sync The following sequence will send a message frame header made up of a Break, followed by an auto-baud Sync byte. This sequence is typical of a LIN bus master. 1. Configure the EUSART for the desired mode. 2. Set the TXEN and SENDB bits to set up the Break character. 3. Load the TXREG with a dummy character to initiate transmission (the value is ignored). 4. Write ‘55h’ to TXREG to load the Sync character into the transmit FIFO buffer. 5. After the Break has been sent, the SENDB bit is reset by hardware. The Sync character now transmits in the preconfigured mode. When the TXREG becomes empty, as indicated by the TXIF, the next data byte can be written to TXREG.© 2007 Microchip Technology Inc. DS39605F-page 147 PIC18F1220/1320 16.3.6.2 Receiving a Break Sync To receive a Break Sync: 1. Configure the EUSART for asynchronous transmit and receive. TXEN should remain clear. SPBRGH:SPBRG may be left as is. 2. Enable auto-wake-up. Set WUE. 3. Enable RXIF interrupts. Set RCIE, PEIE, GIE. 4. The controller may be placed in any power managed mode. 5. An RCIF will be generated at the beginning of the Break signal. When the interrupt is received, read RCREG to clear RCIF and discard. Allow the controller to return to PRI_RUN mode. 6. Wait for the RX line to go high at the end of the Break signal. Wait for any of the following: WUE to clear automatically (poll), RB4/RX to go high (poll) or for RBIF to be set (poll or interrupt). If RBIF is used, check to be sure that RB4/RX is high before continuing. 7. Enable Auto-Baud Rate Detect. Set ABDEN. 8. Return from the interrupt. Allow the primary clock to start and stabilize (PRI_RUN or PRI_IDLE). 9. When the next RCIF interrupt occurs, the received baud rate has been measured. Read RCREG to clear RCIF and discard. Check SPBRGH:SPBRG for a valid value. The EUSART is ready for normal communications. Return from the interrupt. Allow the primary clock to run (PRI_RUN or PRI_IDLE). 10. Process subsequent RCIF interrupts normally as in asynchronous reception. TXEN should now be set if transmissions are needed. TXIF and TXIE may be set if transmit interrupts are desired. Remain in PRI_RUN or PRI_IDLE until communications are complete. Clear TXEN and return to step 2. FIGURE 16-9: SEND BREAK CHARACTER SEQUENCE Write to TXREG BRG Output (Shift Clock) Start Bit Bit 0 Bit 1 Bit 11 Stop Bit Break TXIF bit TX (pin) TRMT bit SENDB Dummy Write PIC18F1220/1320 DS39605F-page 148 © 2007 Microchip Technology Inc. 16.4 EUSART Synchronous Master Mode The Synchronous Master mode is entered by setting the CSRC bit (TXSTA<7>). In this mode, the data is transmitted in a half-duplex manner (i.e., transmission and reception do not occur at the same time). When transmitting data, the reception is inhibited and vice versa. Synchronous mode is entered by setting bit, SYNC (TXSTA<4>). In addition, enable bit, SPEN (RCSTA<7>), is set in order to configure the RB1/AN5/ TX/CK/INT1 and RB4/AN6/RX/DT/KBI0 I/O pins to CK (clock) and DT (data) lines, respectively. The Master mode indicates that the processor transmits the master clock on the CK line. Clock polarity is selected with the SCKP bit (BAUDCTL<5>); setting SCKP sets the Idle state on CK as high, while clearing the bit sets the Idle state as low. This option is provided to support Microwire devices with this module. 16.4.1 EUSART SYNCHRONOUS MASTER TRANSMISSION The EUSART transmitter block diagram is shown in Figure 16-2. The heart of the transmitter is the Transmit (Serial) Shift Register (TSR). The shift register obtains its data from the Read/Write Transmit Buffer register, TXREG. The TXREG register is loaded with data in software. The TSR register is not loaded until the last bit has been transmitted from the previous load. As soon as the last bit is transmitted, the TSR is loaded with new data from the TXREG (if available). Once the TXREG register transfers the data to the TSR register (occurs in one TCYCLE), the TXREG is empty and interrupt bit, TXIF (PIR1<4>), is set. The interrupt can be enabled/disabled by setting/clearing enable bit, TXIE (PIE1<4>). Flag bit, TXIF, will be set, regardless of the state of enable bit, TXIE and cannot be cleared in software. It will reset only when new data is loaded into the TXREG register. While flag bit, TXIF, indicates the status of the TXREG register, another bit, TRMT (TXSTA<1>), shows the status of the TSR register. TRMT is a read-only bit, which is set when the TSR is empty. No interrupt logic is tied to this bit, so the user has to poll this bit in order to determine if the TSR register is empty. The TSR is not mapped in data memory, so it is not available to the user. To set up a Synchronous Master Transmission: 1. Initialize the SPBRGH:SPBRG registers for the appropriate baud rate. Set or clear the BRGH and BRG16 bits, as required, to achieve the desired baud rate. 2. Enable the synchronous master serial port by setting bits SYNC, SPEN and CSRC. 3. If interrupts are desired, set enable bit TXIE. 4. If 9-bit transmission is desired, set bit TX9. 5. Enable the transmission by setting bit TXEN. 6. If 9-bit transmission is selected, the ninth bit should be loaded in bit TX9D. 7. Start transmission by loading data to the TXREG register. 8. If using interrupts, ensure that the GIE and PEIE bits in the INTCON register (INTCON<7:6>) are set. FIGURE 16-10: SYNCHRONOUS TRANSMISSION bit 0 bit 1 bit 7 Word 1 Q1 Q2 Q3Q4 Q1 Q2 Q3 Q4 Q1 Q2 Q3 Q4 Q1Q2 Q3 Q4 Q1 Q2 Q3 Q4 Q3 Q4 Q1 Q2 Q3Q4 Q1Q2 Q3Q4 Q1 Q2Q3Q4 Q1 Q2Q3 Q4Q1 Q2 Q3 Q4 Q1 Q2 Q3 Q4 bit 2 bit 0 bit 1 bit 7 RB4/AN6/RX/ RB1/AN5/TX/ Write to TXREG Reg TXIF bit (Interrupt Flag) TXEN bit ‘1’ ‘1’ Word 2 TRMT bit Write Word 1 Write Word 2 Note: Sync Master mode, SPBRG = 0, continuous transmission of two 8-bit words. DT/KBI0 pin CK/INT1 pin RB1/AN5/TX/ CK/INT1 pin (SCKP = 0) (SCKP = 1)© 2007 Microchip Technology Inc. DS39605F-page 149 PIC18F1220/1320 FIGURE 16-11: SYNCHRONOUS TRANSMISSION (THROUGH TXEN) TABLE 16-7: REGISTERS ASSOCIATED WITH SYNCHRONOUS MASTER TRANSMISSION RB4/AN6/RX/DT/KBI0 pin RB1/AN5/TX/CK/INT1 pin Write to TXREG reg TXIF bit TRMT bit bit 0 bit 1 bit 2 bit 6 bit 7 TXEN bit Name Bit 7 Bit 6 Bit 5 Bit 4 Bit 3 Bit 2 Bit 1 Bit 0 Value on POR, BOR Value on all other Resets INTCON GIE/GIEH PEIE/GIEL TMR0IE INT0IE RBIE TMR0IF INT0IF RBIF 0000 000x 0000 000u PIR1 — ADIF RCIF TXIF — CCP1IF TMR2IF TMR1IF -000 -000 -000 -000 PIE1 — ADIE RCIE TXIE — CCP1IE TMR2IE TMR1IE -000 -000 -000 -000 IPR1 — ADIP RCIP TXIP — CCP1IP TMR2IP TMR1IP -111 -111 -111 -111 RCSTA SPEN RX9 SREN CREN ADDEN FERR OERR RX9D 0000 -00x 0000 -00x TXREG EUSART Transmit Register 0000 0000 0000 0000 TXSTA CSRC TX9 TXEN SYNC SENDB BRGH TRMT TX9D 0000 0010 0000 0010 BAUDCTL — RCIDL — SCKP BRG16 — WUE ABDEN -1-1 0-00 -1-1 0-00 SPBRGH Baud Rate Generator Register High Byte 0000 0000 0000 0000 SPBRG Baud Rate Generator Register Low Byte 0000 0000 0000 0000 Legend: x = unknown, – = unimplemented, read as ‘0’. Shaded cells are not used for synchronous master transmission.PIC18F1220/1320 DS39605F-page 150 © 2007 Microchip Technology Inc. 16.4.2 EUSART SYNCHRONOUS MASTER RECEPTION Once Synchronous mode is selected, reception is enabled by setting either the Single Receive Enable bit, SREN (RCSTA<5>), or the Continuous Receive Enable bit, CREN (RCSTA<4>). Data is sampled on the RB4/AN6/RX/DT/KBI0 pin on the falling edge of the clock. If enable bit, SREN, is set, only a single word is received. If enable bit, CREN, is set, the reception is continuous until CREN is cleared. If both bits are set, then CREN takes precedence. To set up a Synchronous Master Reception: 1. Initialize the SPBRGH:SPBRG registers for the appropriate baud rate. Set or clear the BRGH and BRG16 bits, as required, to achieve the desired baud rate. 2. Enable the synchronous master serial port by setting bits SYNC, SPEN and CSRC. 3. Ensure bits CREN and SREN are clear. 4. If interrupts are desired, set enable bit RCIE. 5. If 9-bit reception is desired, set bit RX9. 6. If a single reception is required, set bit SREN. For continuous reception, set bit CREN. 7. Interrupt flag bit, RCIF, will be set when reception is complete and an interrupt will be generated if the enable bit, RCIE, was set. 8. Read the RCSTA register to get the 9th bit (if enabled) and determine if any error occurred during reception. 9. Read the 8-bit received data by reading the RCREG register. 10. If any error occurred, clear the error by clearing bit CREN. 11. If using interrupts, ensure that the GIE and PEIE bits in the INTCON register (INTCON<7:6>) are set. FIGURE 16-12: SYNCHRONOUS RECEPTION (MASTER MODE, SREN) CREN bit RB4/AN6/RX/ RB1/AN5/TX/ Write to bit SREN SREN bit RCIF bit (Interrupt) Read RXREG Q2 Q1 Q2 Q3 Q4 Q1 Q2 Q3 Q4 Q1 Q2 Q3 Q4 Q1 Q2 Q3 Q4 Q1Q2 Q3 Q4 Q1 Q2 Q3 Q4 Q1 Q2 Q3 Q4 Q3 Q4 Q1 Q2 Q3 Q4 Q1 Q2 Q3 Q4 ‘0’ bit 0 bit 1 bit 2 bit 3 bit 4 bit 5 bit 6 bit 7 ‘0’ Q1 Q2 Q3 Q4 Note: Timing diagram demonstrates Sync Master mode with bit SREN = 1 and bit BRGH = 0. RB1/AN5/TX/ CK/INT1 pin CK/INT1 pin DT/KBI0 pin (SCKP = 0) (SCKP = 1)© 2007 Microchip Technology Inc. DS39605F-page 151 PIC18F1220/1320 TABLE 16-8: REGISTERS ASSOCIATED WITH SYNCHRONOUS MASTER RECEPTION Name Bit 7 Bit 6 Bit 5 Bit 4 Bit 3 Bit 2 Bit 1 Bit 0 Value on POR, BOR Value on all other Resets INTCON GIE/GIEH PEIE/GIEL TMR0IE INT0IE RBIE TMR0IF INT0IF RBIF 0000 000x 0000 000u PIR1 — ADIF RCIF TXIF — CCP1IF TMR2IF TMR1IF -000 -000 -000 -000 PIE1 — ADIE RCIE TXIE — CCP1IE TMR2IE TMR1IE -000 -000 -000 -000 IPR1 — ADIP RCIP TXIP — CCP1IP TMR2IP TMR1IP -111 -111 -111 -111 RCSTA SPEN RX9 SREN CREN ADDEN FERR OERR RX9D 0000 000x 0000 000x RCREG EUSART Receive Register 0000 0000 0000 0000 TXSTA CSRC TX9 TXEN SYNC SENDB BRGH TRMT TX9D 0000 0010 0000 0010 BAUDCTL — RCIDL — SCKP BRG16 — WUE ABDEN -1-1 0-00 -1-1 0-00 SPBRGH Baud Rate Generator Register High Byte 0000 0000 0000 0000 SPBRG Baud Rate Generator Register Low Byte 0000 0000 0000 0000 Legend: x = unknown, – = unimplemented, read as ‘0’. Shaded cells are not used for synchronous master reception.PIC18F1220/1320 DS39605F-page 152 © 2007 Microchip Technology Inc. 16.5 EUSART Synchronous Slave Mode Synchronous Slave mode is entered by clearing bit, CSRC (TXSTA<7>). This mode differs from the Synchronous Master mode in that the shift clock is supplied externally at the RB1/AN5/TX/CK/INT1 pin (instead of being supplied internally in Master mode). This allows the device to transfer or receive data while in any low-power mode. 16.5.1 EUSART SYNCHRONOUS SLAVE TRANSMIT The operation of the Synchronous Master and Slave modes are identical, except in the case of the Sleep mode. If two words are written to the TXREG and then the SLEEP instruction is executed, the following will occur: a) The first word will immediately transfer to the TSR register and transmit. b) The second word will remain in the TXREG register. c) Flag bit, TXIF, will not be set. d) When the first word has been shifted out of TSR, the TXREG register will transfer the second word to the TSR and flag bit, TXIF, will now be set. e) If enable bit, TXIE, is set, the interrupt will wake the chip from Sleep. If the global interrupt is enabled, the program will branch to the interrupt vector. To set up a Synchronous Slave Transmission: 1. Enable the synchronous slave serial port by setting bits SYNC and SPEN and clearing bit CSRC. 2. Clear bits CREN and SREN. 3. If interrupts are desired, set enable bit TXIE. 4. If 9-bit transmission is desired, set bit TX9. 5. Enable the transmission by setting enable bit TXEN. 6. If 9-bit transmission is selected, the ninth bit should be loaded in bit TX9D. 7. Start transmission by loading data to the TXREG register. 8. If using interrupts, ensure that the GIE and PEIE bits in the INTCON register (INTCON<7:6>) are set. TABLE 16-9: REGISTERS ASSOCIATED WITH SYNCHRONOUS SLAVE TRANSMISSION Name Bit 7 Bit 6 Bit 5 Bit 4 Bit 3 Bit 2 Bit 1 Bit 0 Value on POR, BOR Value on all other Resets INTCON GIE/GIEH PEIE/GIEL TMR0IE INT0IE RBIE TMR0IF INT0IF RBIF 0000 000x 0000 000u PIR1 — ADIF RCIF TXIF — CCP1IF TMR2IF TMR1IF -000 -000 -000 -000 PIE1 — ADIE RCIE TXIE — CCP1IE TMR2IE TMR1IE -000 -000 -000 -000 IPR1 — ADIP RCIP TXIP — CCP1IP TMR2IP TMR1IP -111 -111 -111 -111 RCSTA SPEN RX9 SREN CREN ADDEN FERR OERR RX9D 0000 000x 0000 000x TXREG EUSART Transmit Register 0000 0000 0000 0000 TXSTA CSRC TX9 TXEN SYNC SENDB BRGH TRMT TX9D 0000 0010 0000 0010 BAUDCTL — RCIDL — SCKP BRG16 — WUE ABDEN -1-1 0-00 -1-1 0-00 SPBRGH Baud Rate Generator Register High Byte 0000 0000 0000 0000 SPBRG Baud Rate Generator Register Low Byte 0000 0000 0000 0000 Legend: x = unknown, – = unimplemented, read as ‘0’. Shaded cells are not used for synchronous slave transmission.© 2007 Microchip Technology Inc. DS39605F-page 153 PIC18F1220/1320 16.5.2 EUSART SYNCHRONOUS SLAVE RECEPTION The operation of the Synchronous Master and Slave modes is identical, except in the case of Sleep, or any Idle mode and bit SREN, which is a “don’t care” in Slave mode. If receive is enabled by setting the CREN bit prior to entering Sleep or any Idle mode, then a word may be received while in this low-power mode. Once the word is received, the RSR register will transfer the data to the RCREG register; if the RCIE enable bit is set, the interrupt generated will wake the chip from low-power mode. If the global interrupt is enabled, the program will branch to the interrupt vector. To set up a Synchronous Slave Reception: 1. Enable the synchronous master serial port by setting bits SYNC and SPEN and clearing bit CSRC. 2. If interrupts are desired, set enable bit RCIE. 3. If 9-bit reception is desired, set bit RX9. 4. To enable reception, set enable bit CREN. 5. Flag bit, RCIF, will be set when reception is complete. An interrupt will be generated if enable bit, RCIE, was set. 6. Read the RCSTA register to get the 9th bit (if enabled) and determine if any error occurred during reception. 7. Read the 8-bit received data by reading the RCREG register. 8. If any error occurred, clear the error by clearing bit CREN. 9. If using interrupts, ensure that the GIE and PEIE bits in the INTCON register (INTCON<7:6>) are set. TABLE 16-10: REGISTERS ASSOCIATED WITH SYNCHRONOUS SLAVE RECEPTION Name Bit 7 Bit 6 Bit 5 Bit 4 Bit 3 Bit 2 Bit 1 Bit 0 Value on POR, BOR Value on all other Resets INTCON GIE/GIEH PEIE/GIEL TMR0IE INT0IE RBIE TMR0IF INT0IF RBIF 0000 000x 0000 000u PIR1 — ADIF RCIF TXIF — CCP1IF TMR2IF TMR1IF -000 -000 -000 -000 PIE1 — ADIE RCIE TXIE — CCP1IE TMR2IE TMR1IE -000 -000 -000 -000 IPR1 — ADIP RCIP TXIP — CCP1IP TMR2IP TMR1IP -111 -111 -111 -111 RCSTA SPEN RX9 SREN CREN ADDEN FERR OERR RX9D 0000 000x 0000 000x RCREG EUSART Receive Register 0000 0000 0000 0000 TXSTA CSRC TX9 TXEN SYNC SENDB BRGH TRMT TX9D 0000 0010 0000 0010 BAUDCTL — RCIDL — SCKP BRG16 — WUE ABDEN -1-1 0-00 -1-1 0-00 SPBRGH Baud Rate Generator Register High Byte 0000 0000 0000 0000 SPBRG Baud Rate Generator Register Low Byte 0000 0000 0000 0000 Legend: x = unknown, – = unimplemented, read as ‘0’. Shaded cells are not used for synchronous slave reception.PIC18F1220/1320 DS39605F-page 154 © 2007 Microchip Technology Inc. NOTES:© 2007 Microchip Technology Inc. DS39605F-page 155 PIC18F1220/1320 17.0 10-BIT ANALOG-TO-DIGITAL CONVERTER (A/D) MODULE The Analog-to-Digital (A/D) converter module has seven inputs for the PIC18F1220/1320 devices. This module allows conversion of an analog input signal to a corresponding 10-bit digital number. A new feature for the A/D converter is the addition of programmable acquisition time. This feature allows the user to select a new channel for conversion and to set the GO/DONE bit immediately. When the GO/DONE bit is set, the selected channel is sampled for the programmed acquisition time before a conversion is actually started. This removes the firmware overhead that may have been required to allow for an acquisition (sampling) period (see Register 17-3 and Section 17.3 “Selecting and Configuring Automatic Acquisition Time”). The module has five registers: • A/D Result High Register (ADRESH) • A/D Result Low Register (ADRESL) • A/D Control Register 0 (ADCON0) • A/D Control Register 1 (ADCON1) • A/D Control Register 2 (ADCON2) The ADCON0 register, shown in Register 17-1, controls the operation of the A/D module. The ADCON1 register, shown in Register 17-2, configures the functions of the port pins. The ADCON2 register, shown in Register 17-3, configures the A/D clock source, programmed acquisition time and justification. REGISTER 17-1: ADCON0: A/D CONTROL REGISTER 0 R/W-0 R/W-0 U-0 R/W-0 R/W-0 R/W-0 R/W-0 R/W-0 VCFG1 VCFG0 — CHS2 CHS1 CHS0 GO/DONE ADON bit 7 bit 0 bit 7-6 VCFG<1:0>: Voltage Reference Configuration bits bit 5 Unimplemented: Read as ‘0’ bit 4-2 CHS2:CHS0: Analog Channel Select bits 000 = Channel 0 (AN0) 001 = Channel 1 (AN1) 010 = Channel 2 (AN2) 011 = Channel 3 (AN3) 100 = Channel 4 (AN4) 101 = Channel 5 (AN5) 110 = Channel 6 (AN6) 111 = Unimplemented(1) bit 1 GO/DONE: A/D Conversion Status bit When ADON = 1: 1 = A/D conversion in progress 0 = A/D Idle bit 0 ADON: A/D On bit 1 = A/D converter module is enabled 0 = A/D converter module is disabled Note 1: Performing a conversion on unimplemented channels returns full-scale results. Legend: R = Readable bit W = Writable bit U = Unimplemented bit, read as ‘0’ -n = Value at POR ‘1’ = Bit is set ‘0’ = Bit is cleared x = Bit is unknown A/D VREF+ A/D VREF- 00 AVDD AVSS 01 External VREF+ AVSS 10 AVDD External VREF- 11 External VREF+ External VREF-PIC18F1220/1320 DS39605F-page 156 © 2007 Microchip Technology Inc. REGISTER 17-2: ADCON1: A/D CONTROL REGISTER 1 U-0 R/W-0 R/W-0 R/W-0 R/W-0 R/W-0 R/W-0 R/W-0 — PCFG6 PCFG5 PCFG4 PCFG3 PCFG2 PCFG1 PCFG0 bit 7 bit 0 bit 7 Unimplemented: Read as ‘0’ bit 6 PCFG6: A/D Port Configuration bit – AN6 1 = Pin configured as a digital port 0 = Pin configured as an analog channel – digital input disabled and reads ‘0’ bit 5 PCFG5: A/D Port Configuration bit – AN5 1 = Pin configured as a digital port 0 = Pin configured as an analog channel – digital input disabled and reads ‘0’ bit 4 PCFG4: A/D Port Configuration bit – AN4 1 = Pin configured as a digital port 0 = Pin configured as an analog channel – digital input disabled and reads ‘0’ bit 3 PCFG3: A/D Port Configuration bit – AN3 1 = Pin configured as a digital port 0 = Pin configured as an analog channel – digital input disabled and reads ‘0’ bit 2 PCFG2: A/D Port Configuration bit – AN2 1 = Pin configured as a digital port 0 = Pin configured as an analog channel – digital input disabled and reads ‘0’ bit 1 PCFG1: A/D Port Configuration bit – AN1 1 = Pin configured as a digital port 0 = Pin configured as an analog channel – digital input disabled and reads ‘0’ bit 0 PCFG0: A/D Port Configuration bit – AN0 1 = Pin configured as a digital port 0 = Pin configured as an analog channel – digital input disabled and reads ‘0’ Legend: R = Readable bit W = Writable bit U = Unimplemented bit, read as ‘0’ -n = Value at POR ‘1’ = Bit is set ‘0’ = Bit is cleared x = Bit is unknown© 2007 Microchip Technology Inc. DS39605F-page 157 PIC18F1220/1320 REGISTER 17-3: ADCON2: A/D CONTROL REGISTER 2 R/W-0 U-0 R/W-0 R/W-0 R/W-0 R/W-0 R/W-0 R/W-0 ADFM — ACQT2 ACQT1 ACQT0 ADCS2 ADCS1 ADCS0 bit 7 bit 0 bit 7 ADFM: A/D Result Format Select bit 1 = Right justified 0 = Left justified bit 6 Unimplemented: Read as ‘0’ bit 5-3 ACQT2:ACQT0: A/D Acquisition Time Select bits 000 = 0 TAD(1) 001 = 2 TAD 010 = 4 TAD 011 = 6 TAD 100 = 8 TAD 101 = 12 TAD 110 = 16 TAD 111 = 20 TAD bit 2-0 ADCS2:ADCS0: A/D Conversion Clock Select bits 000 = FOSC/2 001 = FOSC/8 010 = FOSC/32 011 = FRC (clock derived from A/D RC oscillator)(1) 100 = FOSC/4 101 = FOSC/16 110 = FOSC/64 111 = FRC (clock derived from A/D RC oscillator)(1) Note: If the A/D FRC clock source is selected, a delay of one TCY (instruction cycle) is added before the A/D clock starts. This allows the SLEEP instruction to be executed before starting a conversion. Legend: R = Readable bit W = Writable bit U = Unimplemented bit, read as ‘0’ -n = Value at POR ‘1’ = Bit is set ‘0’ = Bit is cleared x = Bit is unknownPIC18F1220/1320 DS39605F-page 158 © 2007 Microchip Technology Inc. The analog reference voltage is software selectable to either the device’s positive and negative supply voltage (AVDD and AVSS), or the voltage level on the RA3/AN3/VREF+ and RA2/AN2/VREF- pins. The A/D converter has a unique feature of being able to operate while the device is in Sleep mode. To operate in Sleep, the A/D conversion clock must be derived from the A/D’s internal RC oscillator. The output of the sample and hold is the input into the converter, which generates the result via successive approximation. A device Reset forces all registers to their Reset state. This forces the A/D module to be turned off and any conversion in progress is aborted. Each port pin associated with the A/D converter can be configured as an analog input, or as a digital I/O. The ADRESH and ADRESL registers contain the result of the A/D conversion. When the A/D conversion is complete, the result is loaded into the ADRESH/ADRESL registers, the GO/DONE bit (ADCON0 register) is cleared and A/D Interrupt Flag bit, ADIF, is set. The block diagram of the A/D module is shown in Figure 17-1. FIGURE 17-1: A/D BLOCK DIAGRAM (Input Voltage) VAIN VREFH Reference Voltage AVDD VCFG1:VCFG0 CHS2:CHS0 AN6(1) AN5 AN4 AN3/VREF+ AN2/VREFAN1 AN0 111 110 101 100 011 010 001 000 10-bit Converter VREFL AVSS A/D Note 1: I/O pins have diode protection to VDD and VSS. 0x 1x x1 x0 AVDD© 2007 Microchip Technology Inc. DS39605F-page 159 PIC18F1220/1320 The value in the ADRESH/ADRESL registers is not modified for a Power-on Reset. The ADRESH/ADRESL registers will contain unknown data after a Power-on Reset. After the A/D module has been configured as desired, the selected channel must be acquired before the conversion is started. The analog input channels must have their corresponding TRIS bits selected as an input. To determine acquisition time, see Section 17.1 “A/D Acquisition Requirements”. After this acquisition time has elapsed, the A/D conversion can be started. An acquisition time can be programmed to occur between setting the GO/DONE bit and the actual start of the conversion. To do an A/D Conversion: 1. Configure the A/D module: • Configure analog pins, voltage reference and digital I/O (ADCON1) • Select A/D input channel (ADCON0) • Select A/D acquisition time (ADCON2) • Select A/D conversion clock (ADCON2) • Turn on A/D module (ADCON0) 2. Configure A/D interrupt (if desired): • Clear ADIF bit • Set ADIE bit • Set GIE bit 3. Wait the required acquisition time (if required). 4. Start conversion: • Set GO/DONE bit (ADCON0 register) 5. Wait for A/D conversion to complete, by either: • Polling for the GO/DONE bit to be cleared OR • Waiting for the A/D interrupt 6. Read A/D Result registers (ADRESH:ADRESL); clear bit, ADIF, if required. 7. For the next conversion, go to step 1 or step 2, as required. The A/D conversion time per bit is defined as TAD. A minimum wait of 2 TAD is required before the next acquisition starts. FIGURE 17-2: ANALOG INPUT MODEL VAIN CPIN Rs ANx 5 pF VDD VT = 0.6V VT = 0.6V ILEAKAGE RIC ≤ 1k Sampling Switch SS RSS CHOLD = 120 pF VSS 6V Sampling Switch 5V 4V 3V 2V 5 6 7 8 9 10 11 (kΩ) VDD ± 500 nA Legend: CPIN = input capacitance VT = threshold voltage ILEAKAGE = leakage current at the pin due to various junctions RIC = interconnect resistance SS = sampling switch CHOLD = sample/hold capacitance (from DAC) RSS = sampling switch resistancePIC18F1220/1320 DS39605F-page 160 © 2007 Microchip Technology Inc. 17.1 A/D Acquisition Requirements For the A/D converter to meet its specified accuracy, the charge holding capacitor (CHOLD) must be allowed to fully charge to the input channel voltage level. The analog input model is shown in Figure 17-2. The source impedance (RS) and the internal sampling switch (RSS) impedance directly affect the time required to charge the capacitor CHOLD. The sampling switch (RSS) impedance varies over the device voltage (VDD). The source impedance affects the offset voltage at the analog input (due to pin leakage current). The maximum recommended impedance for analog sources is 2.5 kΩ. After the analog input channel is selected (changed), the channel must be sampled for at least the minimum acquisition time before starting a conversion. To calculate the minimum acquisition time, Equation 17-1 may be used. This equation assumes that 1/2 LSb error is used (1024 steps for the A/D). The 1/2 LSb error is the maximum error allowed for the A/D to meet its specified resolution. Example 17-1 shows the calculation of the minimum required acquisition time, TACQ. This calculation is based on the following application system assumptions: CHOLD = 120 pF Rs = 2.5 kΩ Conversion Error ≤ 1/2 LSb VDD = 5V → RSS = 7 kΩ Temperature = 50°C (system max.) VHOLD = 0V @ time = 0 17.2 A/D VREF+ and VREF- References If external voltage references are used instead of the internal AVDD and AVSS sources, the source impedance of the VREF+ and VREF- voltage sources must be considered. During acquisition, currents supplied by these sources are insignificant. However, during conversion, the A/D module sinks and sources current through the reference sources. In order to maintain the A/D accuracy, the voltage reference source impedances should be kept low to reduce voltage changes. These voltage changes occur as reference currents flow through the reference source impedance. The maximum recommended impedance of the VREF+ and VREF- external reference voltage sources is 250Ω. EQUATION 17-1: ACQUISITION TIME EQUATION 17-2: A/D MINIMUM CHARGING TIME EXAMPLE 17-1: CALCULATING THE MINIMUM REQUIRED ACQUISITION TIME Note: When the conversion is started, the holding capacitor is disconnected from the input pin. TACQ = Amplifier Settling Time + Holding Capacitor Charging Time + Temperature Coefficient = TAMP + TC + TCOFF VHOLD = (ΔVREF – (ΔVREF/2048)) • (1 – e(-TC/CHOLD(RIC + RSS + RS))) or TC = -(CHOLD)(RIC + RSS + RS) ln(1/2048) TACQ =TAMP + TC + TCOFF TAMP = 5 μs TCOFF = (Temp – 25ºC)(0.05 μs/ºC) (50ºC – 25ºC)(0.05 μs/ºC) 1.25 μs Temperature coefficient is only required for temperatures > 25ºC. Below 25ºC, TCOFF = 0 μs. TC = -(CHOLD)(RIC + RSS + RS) ln(1/2047) μs -(120 pF) (1 kΩ + 7 kΩ + 2.5 kΩ) ln(0.0004883) μs 9.61 μs TACQ = 5 μs + 1.25 μs + 9.61 μs 12.86 μs© 2007 Microchip Technology Inc. DS39605F-page 161 PIC18F1220/1320 17.3 Selecting and Configuring Automatic Acquisition Time The ADCON2 register allows the user to select an acquisition time that occurs each time the GO/DONE bit is set. When the GO/DONE bit is set, sampling is stopped and a conversion begins. The user is responsible for ensuring the required acquisition time has passed between selecting the desired input channel and setting the GO/DONE bit. This occurs when the ACQT2:ACQT0 bits (ADCON2<5:3>) remain in their Reset state (‘000’) and is compatible with devices that do not offer programmable acquisition times. If desired, the ACQT bits can be set to select a programmable acquisition time for the A/D module. When the GO/DONE bit is set, the A/D module continues to sample the input for the selected acquisition time, then automatically begins a conversion. Since the acquisition time is programmed, there may be no need to wait for an acquisition time between selecting a channel and setting the GO/DONE bit. In either case, when the conversion is completed, the GO/DONE bit is cleared, the ADIF flag is set and the A/D begins sampling the currently selected channel again. If an acquisition time is programmed, there is nothing to indicate if the acquisition time has ended or if the conversion has begun. 17.4 Selecting the A/D Conversion Clock The A/D conversion time per bit is defined as TAD. The A/D conversion requires 11 TAD per 10-bit conversion. The source of the A/D conversion clock is software selectable. There are seven possible options for TAD: • 2 TOSC • 4 TOSC • 8 TOSC • 16 TOSC • 32 TOSC • 64 TOSC • Internal RC oscillator For correct A/D conversions, the A/D conversion clock (TAD) must be as short as possible, but greater than the minimum TAD (approximately 2 μs, see parameter 130 for more information). Table 17-1 shows the resultant TAD times derived from the device operating frequencies and the A/D clock source selected. TABLE 17-1: TAD vs. DEVICE OPERATING FREQUENCIES AD Clock Source (TAD) Maximum Device Frequency Operation ADCS2:ADCS0 PIC18F1220/1320 PIC18LF1220/1320(4) 2 TOSC 000 1.25 MHz 666 kHz 4 TOSC 100 2.50 MHz 1.33 MHz 8 TOSC 001 5.00 MHz 2.66 MHz 16 TOSC 101 10.0 MHz 5.33 MHz 32 TOSC 010 20.0 MHz 10.65 MHz 64 TOSC 110 40.0 MHz 21.33 MHz RC(3) x11 1.00 MHz(1) 1.00 MHz(2) Note 1: The RC source has a typical TAD time of 4 μs. 2: The RC source has a typical TAD time of 6 μs. 3: For device frequencies above 1 MHz, the device must be in Sleep for the entire conversion or the A/D accuracy may be out of specification. 4: Low-power devices only.PIC18F1220/1320 DS39605F-page 162 © 2007 Microchip Technology Inc. 17.5 Operation in Low-Power Modes The selection of the automatic acquisition time and the A/D conversion clock is determined, in part, by the lowpower mode clock source and frequency while in a low-power mode. If the A/D is expected to operate while the device is in a low-power mode, the ACQT2:ACQT0 and ADCS2:ADCS0 bits in ADCON2 should be updated in accordance with the low-power mode clock that will be used. After the low-power mode is entered (either of the Run modes), an A/D acquisition or conversion may be started. Once an acquisition or conversion is started, the device should continue to be clocked by the same low-power mode clock source until the conversion has been completed. If desired, the device may be placed into the corresponding low-power (ANY)_IDLE mode during the conversion. If the low-power mode clock frequency is less than 1 MHz, the A/D RC clock source should be selected. Operation in the Low-Power Sleep mode requires the A/D RC clock to be selected. If bits, ACQT2:ACQT0, are set to ‘000’ and a conversion is started, the conversion will be delayed one instruction cycle to allow execution of the SLEEP instruction and entry to Low-Power Sleep mode. The IDLEN and SCS bits in the OSCCON register must have already been cleared prior to starting the conversion. 17.6 Configuring Analog Port Pins The ADCON1, TRISA and TRISB registers all configure the A/D port pins. The port pins needed as analog inputs must have their corresponding TRIS bits set (input). If the TRIS bit is cleared (output), the digital output level (VOH or VOL) will be converted. The A/D operation is independent of the state of the CHS2:CHS0 bits and the TRIS bits. Note 1: When reading the Port register, all pins configured as analog input channels will read as cleared (a low level). Pins configured as digital inputs will convert an analog input. Analog levels on a digitally configured input will be accurately converted. 2: Analog levels on any pin defined as a digital input may cause the digital input buffer to consume current out of the device’s specification limits.© 2007 Microchip Technology Inc. DS39605F-page 163 PIC18F1220/1320 17.7 A/D Conversions Figure 17-3 shows the operation of the A/D converter after the GO bit has been set and the ACQT2:ACQT0 bits are cleared. A conversion is started after the following instruction to allow entry into Low-Power Sleep mode before the conversion begins. Figure 17-4 shows the operation of the A/D converter after the GO bit has been set and the ACQT2:ACQT0 bits are set to ‘010’ and selecting a 4 TAD acquisition time before the conversion starts. Clearing the GO/DONE bit during a conversion will abort the current conversion. The A/D Result register pair will NOT be updated with the partially completed A/D conversion sample. This means the ADRESH:ADRESL registers will continue to contain the value of the last completed conversion (or the last value written to the ADRESH:ADRESL registers). After the A/D conversion is completed or aborted, a 2 TAD wait is required before the next acquisition can be started. After this wait, acquisition on the selected channel is automatically started. FIGURE 17-3: A/D CONVERSION TAD CYCLES (ACQT<2:0> = 000, TACQ = 0) FIGURE 17-4: A/D CONVERSION TAD CYCLES (ACQT<2:0> = 010, TACQ = 4 TAD) Note: The GO/DONE bit should NOT be set in the same instruction that turns on the A/D. TAD1 TAD2 TAD3 TAD4 TAD5 TAD6 TAD7 TAD8 TAD11 Set GO bit Holding capacitor is disconnected from analog input (typically 100 ns) TCY – TAD TAD9 TAD10 Next Q4: ADRESH/ADRESL is loaded, GO bit is cleared, ADIF bit is set, holding capacitor is connected to analog input. Conversion Starts b9 b8 b7 b6 b5 b4 b3 b2 b1 b0 1 2 3 4 5 6 7 8 11 Set GO bit (Holding capacitor is disconnected) 9 10 Next Q4: ADRESH:ADRESL is loaded, GO bit is cleared, ADIF bit is set, holding capacitor is reconnected to analog input. Conversion Starts 1 2 3 4 (Holding capacitor continues acquiring input) TACQT Cycles TAD Cycles Automatic Acquisition Time b9 b8 b7 b6 b5 b4 b3 b2 b1 b0PIC18F1220/1320 DS39605F-page 164 © 2007 Microchip Technology Inc. 17.8 Use of the CCP1 Trigger An A/D conversion can be started by the “special event trigger” of the CCP1 module. This requires that the CCP1M3:CCP1M0 bits (CCP1CON<3:0>) be programmed as ‘1011’ and that the A/D module is enabled (ADON bit is set). When the trigger occurs, the GO/DONE bit will be set, starting the A/D acquisition and conversion and the Timer1 (or Timer3) counter will be reset to zero. Timer1 (or Timer3) is reset to automatically repeat the A/D acquisition period with minimal software overhead (moving ADRESH/ADRESL to the desired location). The appropriate analog input channel must be selected and the minimum acquisition period is either timed by the user, or an appropriate TACQ time selected before the “special event trigger” sets the GO/DONE bit (starts a conversion). If the A/D module is not enabled (ADON is cleared), the “special event trigger” will be ignored by the A/D module, but will still reset the Timer1 (or Timer3) counter. TABLE 17-2: SUMMARY OF A/D REGISTERS Name Bit 7 Bit 6 Bit 5 Bit 4 Bit 3 Bit 2 Bit 1 Bit 0 Value on POR, BOR Value on all other Resets INTCON GIE/ GIEH PEIE/ GIEL TMR0IE INT0IE RBIE TMR0IF INT0IF RBIF 0000 0000 0000 0000 PIR1 — ADIF RCIF TXIF — CCP1IF TMR2IF TMR1IF -000 -000 -000 -000 PIE1 — ADIE RCIE TXIE — CCP1IE TMR2IE TMR1IE -000 -000 -000 -000 IPR1 — ADIP RCIP TXIP — CCP1IP TMR2IP TMR1IP -111 -111 -111 -111 PIR2 OSCFIF — — EEIF — LVDIF TMR3IF — 0--0 -00- 0--0 -00- PIE2 OSCFIE — — EEIE — LVDIE TMR3IE — 0--0 -00- 0--0 -00- IPR2 OSCFIP — — EEIP — LVDIP TMR3IP — 1--1 -11- 1--1 -11- ADRESH A/D Result Register High Byte xxxx xxxx uuuu uuuu ADRESL A/D Result Register Low Byte xxxx xxxx uuuu uuuu ADCON0 VCFG1 VCFG0 — CHS2 CHS1 CHS0 GO/DONE ADON 00-0 0000 00-0 0000 ADCON1 — PCFG6 PCFG5 PCFG4 PCFG3 PCFG2 PCFG1 PCFG0 -000 0000 -000 0000 ADCON2 ADFM — ACQT2 ACQT1 ACQT0 ADCS2 ADCS1 ADCS0 0-00 0000 0-00 0000 PORTA RA7(3) RA6(2) RA5(1) RA4 RA3 RA2 RA1 RA0 qq0x 0000 uu0u 0000 TRISA TRISA7(3) TRISA6(2) — PORTA Data Direction Register qq-1 1111 11-1 1111 PORTB Read PORTB pins, Write LATB Latch xxxx xxxx uuuu uuuu TRISB PORTB Data Direction Register 1111 1111 1111 1111 LATB PORTB Output Data Latch xxxx xxxx uuuu uuuu Legend: x = unknown, u = unchanged, q = depends on CONFIG1H<3:0>, – = unimplemented, read as ‘0’. Shaded cells are not used for A/D conversion. Note 1: RA5 port bit is available only as an input pin when the MCLRE bit in the configuration register is ‘0’. 2: RA6 and TRISA6 are available only when the primary oscillator mode selection offers RA6 as a port pin; otherwise, RA6 always reads ‘0’, TRISA6 always reads ‘1’ and writes to both are ignored (see CONFIG1H<3:0>). 3: RA7 and TRISA7 are available only when the internal RC oscillator is configured as the primary oscillator in CONFIG1H<3:0>; otherwise, RA7 always reads ‘0’, TRISA7 always reads ‘1’ and writes to both are ignored.© 2007 Microchip Technology Inc. DS39605F-page 165 PIC18F1220/1320 18.0 LOW-VOLTAGE DETECT In many applications, the ability to determine if the device voltage (VDD) is below a specified voltage level is a desirable feature. A window of operation for the application can be created, where the application software can do “housekeeping tasks”, before the device voltage exits the valid operating range. This can be done using the Low-Voltage Detect module. This module is a software programmable circuitry, where a device voltage trip point can be specified. When the voltage of the device becomes lower then the specified point, an interrupt flag is set. If the interrupt is enabled, the program execution will branch to the interrupt vector address and the software can then respond to that interrupt source. The Low-Voltage Detect circuitry is completely under software control. This allows the circuitry to be turned off by the software, which minimizes the current consumption for the device. Figure 18-1 shows a possible application voltage curve (typically for batteries). Over time, the device voltage decreases. When the device voltage equals voltage VA, the LVD logic generates an interrupt. This occurs at time TA. The application software then has the time, until the device voltage is no longer in valid operating range, to shut down the system. Voltage point VB is the minimum valid operating voltage specification. This occurs at time TB. The difference, TB – TA, is the total time for shutdown. The block diagram for the LVD module is shown in Figure 18-2 (following page). A comparator uses an internally generated reference voltage as the set point. When the selected tap output of the device voltage crosses the set point (is lower than), the LVDIF bit is set. Each node in the resistor divider represents a “trip point” voltage. The “trip point” voltage is the minimum supply voltage level at which the device can operate before the LVD module asserts an interrupt. When the supply voltage is equal to the trip point, the voltage tapped off of the resistor array is equal to the 1.2V internal reference voltage generated by the voltage reference module. The comparator then generates an interrupt signal setting the LVDIF bit. This voltage is software programmable to any one of 16 values (see Figure 18-2). The trip point is selected by programming the LVDL3:LVDL0 bits (LVDCON<3:0>). FIGURE 18-1: TYPICAL LOW-VOLTAGE DETECT APPLICATION Time Voltage VA VB TA TB Legend: VA = LVD trip point VB = Minimum valid device operating voltagePIC18F1220/1320 DS39605F-page 166 © 2007 Microchip Technology Inc. FIGURE 18-2: LOW-VOLTAGE DETECT (LVD) BLOCK DIAGRAM The LVD module has an additional feature that allows the user to supply the trip voltage to the module from an external source. This mode is enabled when bits, LVDL3:LVDL0, are set to ‘1111’. In this state, the comparator input is multiplexed from the external input pin, LVDIN (Figure 18-3). This gives users flexibility, because it allows them to configure the Low-Voltage Detect interrupt to occur at any voltage in the valid operating range. FIGURE 18-3: LOW-VOLTAGE DETECT (LVD) WITH EXTERNAL INPUT BLOCK DIAGRAM LVDIF VDD 16-to-1 MUX LVDEN LVD Control Register Internally Generated Reference Voltage LVDIN 1.2V LVD EN LVD Control 16-to-1 MUX BGAP BODEN LVDEN VxEN LVDIN Register VDD VDD Externally Generated Trip Point© 2007 Microchip Technology Inc. DS39605F-page 167 PIC18F1220/1320 18.1 Control Register The Low-Voltage Detect Control register controls the operation of the Low-Voltage Detect circuitry. REGISTER 18-1: LVDCON REGISTER U-0 U-0 R-0 R/W-0 R/W-0 R/W-1 R/W-0 R/W-1 — — IRVST LVDEN LVDL3 LVDL2 LVDL1 LVDL0 bit 7 bit 0 bit 7-6 Unimplemented: Read as ‘0’ bit 5 IRVST: Internal Reference Voltage Stable Flag bit 1 = Indicates that the Low-Voltage Detect logic will generate the interrupt flag at the specified voltage range 0 = Indicates that the Low-Voltage Detect logic will not generate the interrupt flag at the specified voltage range and the LVD interrupt should not be enabled bit 4 LVDEN: Low-Voltage Detect Power Enable bit 1 = Enables LVD, powers up LVD circuit 0 = Disables LVD, powers down LVD circuit bit 3-0 LVDL3:LVDL0: Low-Voltage Detection Limit bits 1111 = External analog input is used (input comes from the LVDIN pin) 1110 = 4.04V-5.15V 1101 = 3.76V-4.79V 1100 = 3.58V-4.56V 1011 = 3.41V-4.34V 1010 = 3.23V-4.11V 1001 = 3.14V-4.00V 1000 = 2.96V-3.77V 0111 = 2.70V-3.43V 0110 = 2.53V-3.21V 0101 = 2.43V-3.10V 0100 = 2.25V-2.86V 0011 = 2.16V-2.75V 0010 = 1.99V-2.53V 0001 = Reserved 0000 = Reserved Note: LVDL3:LVDL0 modes, which result in a trip point below the valid operating voltage of the device, are not tested. Legend: R = Readable bit W = Writable bit U = Unimplemented bit, read as ‘0’ -n = Value at POR ‘1’ = Bit is set ‘0’ = Bit is cleared x = Bit is unknownPIC18F1220/1320 DS39605F-page 168 © 2007 Microchip Technology Inc. 18.2 Operation Depending on the power source for the device voltage, the voltage normally decreases relatively slowly. This means that the LVD module does not need to be constantly operating. To decrease the current requirements, the LVD circuitry only needs to be enabled for short periods, where the voltage is checked. After doing the check, the LVD module may be disabled. Each time that the LVD module is enabled, the circuitry requires some time to stabilize. After the circuitry has stabilized, all status flags may be cleared. The module will then indicate the proper state of the system. The following steps are needed to set up the LVD module: 1. Write the value to the LVDL3:LVDL0 bits (LVDCON register), which selects the desired LVD trip point. 2. Ensure that LVD interrupts are disabled (the LVDIE bit is cleared or the GIE bit is cleared). 3. Enable the LVD module (set the LVDEN bit in the LVDCON register). 4. Wait for the LVD module to stabilize (the IRVST bit to become set). 5. Clear the LVD interrupt flag, which may have falsely become set, until the LVD module has stabilized (clear the LVDIF bit). 6. Enable the LVD interrupt (set the LVDIE and the GIE bits). Figure 18-4 shows typical waveforms that the LVD module may be used to detect. FIGURE 18-4: LOW-VOLTAGE DETECT WAVEFORMS VLVD VDD LVDIF VLVD VDD Enable LVD Internally Generated TIVRST LVDIF may not be set. Enable LVD LVDIF LVDIF cleared in software LVDIF cleared in software LVDIF cleared in software, CASE 1: CASE 2: LVDIF remains set since LVD condition still exists Reference Stable Internally Generated Reference Stable TIVRST© 2007 Microchip Technology Inc. DS39605F-page 169 PIC18F1220/1320 18.2.1 REFERENCE VOLTAGE SET POINT The internal reference voltage of the LVD module may be used by other internal circuitry (the programmable Brown-out Reset). If these circuits are disabled (lower current consumption), the reference voltage circuit requires a time to become stable before a low-voltage condition can be reliably detected. This time is invariant of system clock speed. This start-up time is specified in electrical specification parameter 36. The low-voltage interrupt flag will not be enabled until a stable reference voltage is reached. Refer to the waveform in Figure 18-4. 18.2.2 CURRENT CONSUMPTION When the module is enabled, the LVD comparator and voltage divider are enabled and will consume static current. The voltage divider can be tapped from multiple places in the resistor array. Total current consumption, when enabled, is specified in electrical specification parameter D022B. 18.3 Operation During Sleep When enabled, the LVD circuitry continues to operate during Sleep. If the device voltage crosses the trip point, the LVDIF bit will be set and the device will wakeup from Sleep. Device execution will continue from the interrupt vector address if interrupts have been globally enabled. 18.4 Effects of a Reset A device Reset forces all registers to their Reset state. This forces the LVD module to be turned off. PIC18F1220/1320 DS39605F-page 170 © 2007 Microchip Technology Inc. NOTES:© 2007 Microchip Technology Inc. DS39605F-page 171 PIC18F1220/1320 19.0 SPECIAL FEATURES OF THE CPU PIC18F1220/1320 devices include several features intended to maximize system reliability, minimize cost through elimination of external components and offer code protection. These are: • Oscillator Selection • Resets: - Power-on Reset (POR) - Power-up Timer (PWRT) - Oscillator Start-up Timer (OST) - Brown-out Reset (BOR) • Interrupts • Watchdog Timer (WDT) • Fail-Safe Clock Monitor • Two-Speed Start-up • Code Protection • ID Locations • In-Circuit Serial Programming Several oscillator options are available to allow the part to fit the application. The RC oscillator option saves system cost, while the LP crystal option saves power. These are discussed in detail in Section 2.0 “Oscillator Configurations”. A complete discussion of device Resets and interrupts is available in previous sections of this data sheet. In addition to their Power-up and Oscillator Start-up Timers provided for Resets, PIC18F1220/1320 devices have a Watchdog Timer, which is either permanently enabled via the configuration bits, or software controlled (if configured as disabled). The inclusion of an internal RC oscillator also provides the additional benefits of a Fail-Safe Clock Monitor (FSCM) and Two-Speed Start-up. FSCM provides for background monitoring of the peripheral clock and automatic switchover in the event of its failure. TwoSpeed Start-up enables code to be executed almost immediately on start-up, while the primary clock source completes its start-up delays. All of these features are enabled and configured by setting the appropriate configuration register bits. 19.1 Configuration Bits The configuration bits can be programmed (read as ‘0’), or left unprogrammed (read as ‘1’), to select various device configurations. These bits are mapped starting at program memory location 300000h. The user will note that address 300000h is beyond the user program memory space. In fact, it belongs to the configuration memory space (300000h-3FFFFFh), which can only be accessed using table reads and table writes. Programming the configuration registers is done in a manner similar to programming the Flash memory. The EECON1 register WR bit starts a self-timed write to the configuration register. In normal operation mode, a TBLWT instruction, with the TBLPTR pointing to the configuration register, sets up the address and the data for the configuration register write. Setting the WR bit starts a long write to the configuration register. The configuration registers are written a byte at a time. To write or erase a configuration cell, a TBLWT instruction can write a ‘1’ or a ‘0’ into the cell. For additional details on Flash programming, refer to Section 6.5 “Writing to Flash Program Memory”. TABLE 19-1: CONFIGURATION BITS AND DEVICE IDS File Name Bit 7 Bit 6 Bit 5 Bit 4 Bit 3 Bit 2 Bit 1 Bit 0 Default/ Unprogrammed Value 300001h CONFIG1H IESO FSCM — — FOSC3 FOSC2 FOSC1 FOSC0 11-- 1111 300002h CONFIG2L — — — — BORV1 BORV0 BOR PWRTEN ---- 1111 300003h CONFIG2H — — — WDTPS3 WDTPS2 WDTPS1 WDTPS0 WDT ---1 1111 300005h CONFIG3H MCLRE — — — — — — — 1--- ---- 300006h CONFIG4L DEBUG — — — — LVP — STVR 1--- -1-1 300008h CONFIG5L — — — — — — CP1 CP0 ---- --11 300009h CONFIG5H CPD CPB — — — — — — 11-- ---- 30000Ah CONFIG6L — — — — — — WRT1 WRT0 ---- --11 30000Bh CONFIG6H WRTD WRTB WRTC — — — — — 111- ---- 30000Ch CONFIG7L — — — — — — EBTR1 EBTR0 ---- --11 30000Dh CONFIG7H — EBTRB — — — — — — -1-- ---- 3FFFFEh DEVID1(1) DEV2 DEV1 DEV0 REV4 REV3 REV2 REV1 REV0 xxxx xxxx(1) 3FFFFFh DEVID2(1) DEV10 DEV9 DEV8 DEV7 DEV6 DEV5 DEV4 DEV3 0000 0111 Legend: x = unknown, u = unchanged, – = unimplemented. Shaded cells are unimplemented, read as ‘0’. Note 1: See Register 19-14 for DEVID1 values. DEVID registers are read-only and cannot be programmed by the user.PIC18F1220/1320 DS39605F-page 172 © 2007 Microchip Technology Inc. REGISTER 19-1: CONFIG1H: CONFIGURATION REGISTER 1 HIGH (BYTE ADDRESS 300001h) R/P-1 R/P-1 U-0 U-0 R/P-1 R/P-1 R/P-1 R/P-1 IESO FSCM — — FOSC3 FOSC2 FOSC1 FOSC0 bit 7 bit 0 bit 7 IESO: Internal External Switchover bit 1 = Internal External Switchover mode enabled 0 = Internal External Switchover mode disabled bit 6 FSCM: Fail-Safe Clock Monitor Enable bit 1 = Fail-Safe Clock Monitor enabled 0 = Fail-Safe Clock Monitor disabled bit 5-4 Unimplemented: Read as ‘0’ bit 3-0 FOSC<3:0>: Oscillator Selection bits 11xx = External RC oscillator, CLKO function on RA6 1001 = Internal RC oscillator, CLKO function on RA6 and port function on RA7 1000 = Internal RC oscillator, port function on RA6 and port function on RA7 0111 = External RC oscillator, port function on RA6 0110 = HS oscillator, PLL enabled (clock frequency = 4 x FOSC1) 0101 = EC oscillator, port function on RA6 0100 = EC oscillator, CLKO function on RA6 0010 = HS oscillator 0001 = XT oscillator 0000 = LP oscillator Legend: R = Readable bit P = Programmable bit U = Unimplemented bit, read as ‘0’ -n = Value when device is unprogrammed u = Unchanged from programmed state© 2007 Microchip Technology Inc. DS39605F-page 173 PIC18F1220/1320 REGISTER 19-2: CONFIG2L: CONFIGURATION REGISTER 2 LOW (BYTE ADDRESS 300002h) U-0 U-0 U-0 U-0 R/P-1 R/P-1 R/P-1 R/P-1 — — — — BORV1 BORV0 BOR PWRTEN bit 7 bit 0 bit 7-4 Unimplemented: Read as ‘0’ bit 3-2 BORV1:BORV0: Brown-out Reset Voltage bits 11 = Reserved 10 = VBOR set to 2.7V 01 = VBOR set to 4.2V 00 = VBOR set to 4.5V bit 1 BOR: Brown-out Reset Enable bit(1) 1 = Brown-out Reset enabled 0 = Brown-out Reset disabled bit 0 PWRTEN: Power-up Timer Enable bit(1) 1 = PWRT disabled 0 = PWRT enabled Note 1: The Power-up Timer is decoupled from Brown-out Reset, allowing these features to be independently controlled. Legend: R = Readable bit P = Programmable bit U = Unimplemented bit, read as ‘0’ -n = Value when device is unprogrammed u = Unchanged from programmed statePIC18F1220/1320 DS39605F-page 174 © 2007 Microchip Technology Inc. REGISTER 19-3: CONFIG2H: CONFIGURATION REGISTER 2 HIGH (BYTE ADDRESS 300003h) U-0 U-0 U-0 R/P-1 R/P-1 R/P-1 R/P-1 R/P-1 — — — WDTPS3 WDTPS2 WDTPS1 WDTPS0 WDTEN bit 7 bit 0 bit 7-5 Unimplemented: Read as ‘0’ bit 4-1 WDTPS<3:0>: Watchdog Timer Postscale Select bits 1111 = 1:32,768 1110 = 1:16,384 1101 = 1:8,192 1100 = 1:4,096 1011 = 1:2,048 1010 = 1:1,024 1001 = 1:512 1000 = 1:256 0111 = 1:128 0110 = 1:64 0101 = 1:32 0100 = 1:16 0011 = 1:8 0010 = 1:4 0001 = 1:2 0000 = 1:1 bit 0 WDT: Watchdog Timer Enable bit 1 = WDT enabled 0 = WDT disabled (control is placed on the SWDTEN bit) Legend: R = Readable bit P = Programmable bit U = Unimplemented bit, read as ‘0’ -n = Value when device is unprogrammed u = Unchanged from programmed state© 2007 Microchip Technology Inc. DS39605F-page 175 PIC18F1220/1320 REGISTER 19-4: CONFIG3H: CONFIGURATION REGISTER 3 HIGH (BYTE ADDRESS 300005h) REGISTER 19-5: CONFIG4L: CONFIGURATION REGISTER 4 LOW (BYTE ADDRESS 300006h) R/P-1 U-0 U-0 U-0 U-0 U-0 U-0 U-0 MCLRE — — — — — — — bit 7 bit 0 bit 7 MCLRE: MCLR Pin Enable bit 1 = MCLR pin enabled, RA5 input pin disabled 0 = RA5 input pin enabled, MCLR disabled bit 6-0 Unimplemented: Read as ‘0’ Legend: R = Readable bit P = Programmable bit U = Unimplemented bit, read as ‘0’ -n = Value when device is unprogrammed u = Unchanged from programmed state R/P-1 U-0 U-0 U-0 U-0 R/P-1 U-0 R/P-1 DEBUG — — — — LVP — STVR bit 7 bit 0 bit 7 DEBUG: Background Debugger Enable bit (see note) 1 = Background debugger disabled, RB6 and RB7 configured as general purpose I/O pins 0 = Background debugger enabled, RB6 and RB7 are dedicated to In-Circuit Debug bit 6-3 Unimplemented: Read as ‘0’ bit 2 LVP: Low-Voltage ICSP Enable bit 1 = Low-Voltage ICSP enabled 0 = Low-Voltage ICSP disabled bit 1 Unimplemented: Read as ‘0’ bit 0 STVR: Stack Full/Underflow Reset Enable bit 1 = Stack full/underflow will cause Reset 0 = Stack full/underflow will not cause Reset Legend: R = Readable bit C = Clearable bit U = Unimplemented bit, read as ‘0’ -n = Value when device is unprogrammed u = Unchanged from programmed state Note: The Timer1 oscillator shares the T1OSI and T1OSO pins with the PGD and PGC pins used for programming and debugging. When using the Timer1 oscillator, In-Circuit Serial Programming (ICSP) may not function correctly (high voltage or low voltage), or the In-Circuit Debugger (ICD) may not communicate with the controller. As a result of using either ICSP or ICD, the Timer1 crystal may be damaged. If ICSP or ICD operations are required, the crystal should be disconnected from the circuit (disconnect either lead) or installed after programming. The oscillator loading capacitors may remain in-circuit during ICSP or ICD operation. PIC18F1220/1320 DS39605F-page 176 © 2007 Microchip Technology Inc. REGISTER 19-6: CONFIG5L: CONFIGURATION REGISTER 5 LOW (BYTE ADDRESS 300008h) REGISTER 19-7: CONFIG5H: CONFIGURATION REGISTER 5 HIGH (BYTE ADDRESS 300009h) U-0 U-0 U-0 U-0 R/C-1 R/C-1 R/C-1 R/C-1 — — — — — — CP1 CP0 bit 7 bit 0 bit 7-2 Unimplemented: Read as ‘0’ bit 1 CP1: Code Protection bit (PIC18F1320) 1 = Block 1 (001000-001FFFh) not code-protected 0 = Block 1 (001000-001FFFh) code-protected bit 0 CP0: Code Protection bit (PIC18F1320) 1 = Block 0 (00200-000FFFh) not code-protected 0 = Block 0 (00200-000FFFh) code-protected bit 1 CP1: Code Protection bit (PIC18F1220) 1 = Block 1 (000800-000FFFh) not code-protected 0 = Block 1 (000800-000FFFh) code-protected bit 0 CP0: Code Protection bit (PIC18F1220) 1 = Block 0 (000200-0007FFh) not code-protected 0 = Block 0 (000200-0007FFh) code-protected Legend: R = Readable bit C = Clearable bit U = Unimplemented bit, read as ‘0’ -n = Value when device is unprogrammed u = Unchanged from programmed state R/C-1 R/C-1 U-0 U-0 U-0 U-0 U-0 U-0 CPD CPB — — — — — — bit 7 bit 0 bit 7 CPD: Data EEPROM Code Protection bit 1 = Data EEPROM not code-protected 0 = Data EEPROM code-protected bit 6 CPB: Boot Block Code Protection bit 1 = Boot Block (000000-0001FFh) not code-protected 0 = Boot Block (000000-0001FFh) code-protected bit 5-0 Unimplemented: Read as ‘0’ Legend: R = Readable bit C = Clearable bit U = Unimplemented bit, read as ‘0’ -n = Value when device is unprogrammed u = Unchanged from programmed state© 2007 Microchip Technology Inc. DS39605F-page 177 PIC18F1220/1320 REGISTER 19-8: CONFIG6L: CONFIGURATION REGISTER 6 LOW (BYTE ADDRESS 30000Ah) REGISTER 19-9: CONFIG6H: CONFIGURATION REGISTER 6 HIGH (BYTE ADDRESS 30000Bh) U-0 U-0 U-0 U-0 U-0 U-0 R/P-1 R/P-1 — — — — — — WRT1 WRT0 bit 7 bit 0 bit 7-2 Unimplemented: Read as ‘0’ bit 1 WRT1: Write Protection bit (PIC18F1320) 1 = Block 1 (001000-001FFFh) not write-protected 0 = Block 1 (001000-001FFFh) write-protected bit 0 WRT0: Write Protection bit (PIC18F1320) 1 = Block 0 (00200-000FFFh) not write-protected 0 = Block 0 (00200-000FFFh) write-protected bit 1 WRT1: Write Protection bit (PIC18F1220) 1 = Block 1 (000800-000FFFh) not write-protected 0 = Block 1 (000800-000FFFh) write-protected bit 0 WRT0: Write Protection bit (PIC18F1220) 1 = Block 0 (000200-0007FFh) not write-protected 0 = Block 0 (000200-0007FFh) write-protected Legend: R = Readable bit P = Programmable bit U = Unimplemented bit, read as ‘0’ -n = Value when device is unprogrammed u = Unchanged from programmed state R/P-1 R/P-1 R-1 U-0 U-0 U-0 U-0 U-0 WRTD WRTB WRTC — — — — — bit 7 bit 0 bit 7 WRTD: Data EEPROM Write Protection bit 1 = Data EEPROM not write-protected 0 = Data EEPROM write-protected bit 6 WRTB: Boot Block Write Protection bit 1 = Boot Block (000000-0001FFh) not write-protected 0 = Boot Block (000000-0001FFh) write-protected bit 5 WRTC: Configuration Register Write Protection bit 1 = Configuration registers (300000-3000FFh) not write-protected 0 = Configuration registers (300000-3000FFh) write-protected Note: This bit is read-only in normal execution mode; it can be written only in Program mode. bit 4-0 Unimplemented: Read as ‘0’ Legend: R = Readable bit P = Programmable bit U = Unimplemented bit, read as ‘0’ -n = Value when device is unprogrammed u = Unchanged from programmed statePIC18F1220/1320 DS39605F-page 178 © 2007 Microchip Technology Inc. REGISTER 19-10: CONFIG7L: CONFIGURATION REGISTER 7 LOW (BYTE ADDRESS 30000Ch) REGISTER 19-11: CONFIG7H: CONFIGURATION REGISTER 7 HIGH (BYTE ADDRESS 30000Dh) U-0 U-0 U-0 U-0 U-0 U-0 R/P-1 R/P-1 — — — — — — EBTR1 EBTR0 bit 7 bit 0 bit 7-2 Unimplemented: Read as ‘0’ bit 1 EBTR1: Table Read Protection bit (PIC18F1320) 1 = Block 1 (001000-001FFFh) not protected from table reads executed in other blocks 0 = Block 1 (001000-001FFFh) protected from table reads executed in other blocks bit 0 EBTR0: Table Read Protection bit (PIC18F1320) 1 = Block 0 (00200-000FFFh) not protected from table reads executed in other blocks 0 = Block 0 (00200-000FFFh) protected from table reads executed in other blocks bit 1 EBTR1: Table Read Protection bit (PIC18F1220) 1 = Block 1 (000800-000FFFh) not protected from table reads executed in other blocks 0 = Block 1 (000800-000FFFh) protected from table reads executed in other blocks bit 0 EBTR0: Table Read Protection bit (PIC18F1220) 1 = Block 0 (000200-0007FFh) not protected from table reads executed in other blocks 0 = Block 0 (000200-0007FFh) protected from table reads executed in other blocks Legend: R = Readable bit P = Programmable bit U = Unimplemented bit, read as ‘0’ -n = Value when device is unprogrammed u = Unchanged from programmed state U-0 R/P-1 U-0 U-0 U-0 U-0 U-0 U-0 — EBTRB — — — — — — bit 7 bit 0 bit 7 Unimplemented: Read as ‘0’ bit 6 EBTRB: Boot Block Table Read Protection bit 1 = Boot Block (000000-0001FFh) not protected from table reads executed in other blocks 0 = Boot Block (000000-0001FFh) protected from table reads executed in other blocks bit 5-0 Unimplemented: Read as ‘0’ Legend: R = Readable bit P = Programmable bit U = Unimplemented bit, read as ‘0’ -n = Value when device is unprogrammed u = Unchanged from programmed state© 2007 Microchip Technology Inc. DS39605F-page 179 PIC18F1220/1320 REGISTER 19-12: DEVID1: DEVICE ID REGISTER 1 FOR PIC18F1220/1320 DEVICES REGISTER 19-13: DEVID2: DEVICE ID REGISTER 2 FOR PIC18F1220/1320 DEVICES RRRRRRRR DEV2 DEV1 DEV0 REV4 REV3 REV2 REV1 REV0 bit 7 bit 0 bit 7-5 DEV2:DEV0: Device ID bits 111 = PIC18F1220 110 = PIC18F1320 bit 4-0 REV4:REV0: Revision ID bits These bits are used to indicate the device revision. Legend: R = Read-only bit P = Programmable bit U = Unimplemented bit, read as ‘0’ -n = Value when device is unprogrammed u = Unchanged from programmed state RRRRRRRR DEV10 DEV9 DEV8 DEV7 DEV6 DEV5 DEV4 DEV3 bit 7 bit 0 bit 7-0 DEV10:DEV3: Device ID bits These bits are used with the DEV2:DEV0 bits in the Device ID Register 1 to identify the part number. 0000 0111 = PIC18F1220/1320 devices Note: These values for DEV10:DEV3 may be shared with other devices. The specific device is always identified by using the entire DEV10:DEV0 bit sequence. Legend: R = Read-only bit P = Programmable bit U = Unimplemented bit, read as ‘0’ -n = Value when device is unprogrammed u = Unchanged from programmed statePIC18F1220/1320 DS39605F-page 180 © 2007 Microchip Technology Inc. 19.2 Watchdog Timer (WDT) For PIC18F1220/1320 devices, the WDT is driven by the INTRC source. When the WDT is enabled, the clock source is also enabled. The nominal WDT period is 4 ms and has the same stability as the INTRC oscillator. The 4 ms period of the WDT is multiplied by a 16-bit postscaler. Any output of the WDT postscaler is selected by a multiplexer, controlled by bits in Configuration Register 2H. Available periods range from 4 ms to 131.072 seconds (2.18 minutes). The WDT and postscaler are cleared when any of the following events occur: execute a SLEEP or CLRWDT instruction, the IRCF bits (OSCCON<6:4>) are changed or a clock failure has occurred. Adjustments to the internal oscillator clock period using the OSCTUNE register also affect the period of the WDT by the same factor. For example, if the INTRC period is increased by 3%, then the WDT period is increased by 3%. 19.2.1 CONTROL REGISTER Register 19-14 shows the WDTCON register. This is a readable and writable register, which contains a control bit that allows software to override the WDT enable configuration bit, only if the configuration bit has disabled the WDT. FIGURE 19-1: WDT BLOCK DIAGRAM REGISTER 19-14: WDTCON REGISTER Note 1: The CLRWDT and SLEEP instructions clear the WDT and postscaler counts when executed. 2: Changing the setting of the IRCF bits (OSCCON<6:4>) clears the WDT and postscaler counts. 3: When a CLRWDT instruction is executed the postscaler count will be cleared. U-0 U-0 U-0 U-0 U-0 U-0 U-0 R/W-0 — — — — — — — SWDTEN bit 7 bit 0 bit 7-1 Unimplemented: Read as ‘0’ bit 0 SWDTEN: Software Controlled Watchdog Timer Enable bit 1 = Watchdog Timer is on 0 = Watchdog Timer is off Note: This bit has no effect if the configuration bit, WDTEN (CONFIG2H<0>), is enabled. Legend: R = Readable bit W = Writable bit -n = Value at POR U = Unimplemented bit, read as ‘0’ INTRC Oscillator WDT Wake-up Reset WDT WDT Counter (31 kHz) Programmable Postscaler 1:1 to 1:32,768 Enable WDT WDTPS<3:0> SWDTEN WDTEN CLRWDT 4 from Sleep Reset All Device Sleep INTRC Control Resets ÷125© 2007 Microchip Technology Inc. DS39605F-page 181 PIC18F1220/1320 TABLE 19-2: SUMMARY OF WATCHDOG TIMER REGISTERS 19.3 Two-Speed Start-up The Two-Speed Start-up feature helps to minimize the latency period from oscillator start-up to code execution by allowing the microcontroller to use the INTRC oscillator as a clock source until the primary clock source is available. It is enabled by setting the IESO bit in Configuration Register 1H (CONFIG1H<7>). Two-Speed Start-up is available only if the primary oscillator mode is LP, XT, HS or HSPLL (crystal-based modes). Other sources do not require an OST start-up delay; for these, Two-Speed Start-up is disabled. When enabled, Resets and wake-ups from Sleep mode cause the device to configure itself to run from the internal oscillator block as the clock source, following the time-out of the Power-up Timer after a Power-on Reset is enabled. This allows almost immediate code execution while the primary oscillator starts and the OST is running. Once the OST times out, the device automatically switches to PRI_RUN mode. Because the OSCCON register is cleared on Reset events, the INTOSC (or postscaler) clock source is not initially available after a Reset event; the INTRC clock is used directly at its base frequency. To use a higher clock speed on wake-up, the INTOSC or postscaler clock sources can be selected to provide a higher clock speed by setting bits, IFRC2:IFRC0, immediately after Reset. For wake-ups from Sleep, the INTOSC or postscaler clock sources can be selected by setting IFRC2:IFRC0 prior to entering Sleep mode. In all other power managed modes, Two-Speed Start-up is not used. The device will be clocked by the currently selected clock source until the primary clock source becomes available. The setting of the IESO bit is ignored. 19.3.1 SPECIAL CONSIDERATIONS FOR USING TWO-SPEED START-UP While using the INTRC oscillator in Two-Speed Startup, the device still obeys the normal command sequences for entering power managed modes, including serial SLEEP instructions (refer to Section 3.1.3 “Multiple Sleep Commands”). In practice, this means that user code can change the SCS1:SCS0 bit settings and issue SLEEP commands before the OST times out. This would allow an application to briefly wake-up, perform routine “housekeeping” tasks and return to Sleep before the device starts to operate from the primary oscillator. User code can also check if the primary clock source is currently providing the system clocking by checking the status of the OSTS bit (OSCCON<3>). If the bit is set, the primary oscillator is providing the system clock. Otherwise, the internal oscillator block is providing the clock during wake-up from Reset or Sleep mode. FIGURE 19-2: TIMING TRANSITION FOR TWO-SPEED START-UP (INTOSC TO HSPLL) Name Bit 7 Bit 6 Bit 5 Bit 4 Bit 3 Bit 2 Bit 1 Bit 0 CONFIG2H — — — WDTPS3 WDTPS2 WDTPS2 WDTPS0 WDTEN RCON IPEN — — RI TO PD POR BOR WDTCON — — — — — — — SWDTEN Legend: Shaded cells are not used by the Watchdog Timer. Q1 Q3 Q4 OSC1 Peripheral Program PC PC + 2 INTOSC PLL Clock Q1 PC + 6 Q2 Output Q3 Q4 Q1 CPU Clock PC + 4 Clock Counter Q2 Q2 Q3 Q4 Note 1: TOST = 1024 TOSC; TPLL = 2 ms (approx). These intervals are not shown to scale. Wake from Interrupt Event TPLL(1) 12345678 Clock Transition OSTS bit Set Multiplexer TOST(1)PIC18F1220/1320 DS39605F-page 182 © 2007 Microchip Technology Inc. 19.4 Fail-Safe Clock Monitor The Fail-Safe Clock Monitor (FSCM) allows the microcontroller to continue operation, in the event of an external oscillator failure, by automatically switching the system clock to the internal oscillator block. The FSCM function is enabled by setting the Fail-Safe Clock Monitor Enable bit, FSCM (CONFIG1H<6>). When FSCM is enabled, the INTRC oscillator runs at all times to monitor clocks to peripherals and provide an instant backup clock in the event of a clock failure. Clock monitoring (shown in Figure 19-3) is accomplished by creating a sample clock signal, which is the INTRC output divided by 64. This allows ample time between FSCM sample clocks for a peripheral clock edge to occur. The peripheral system clock and the sample clock are presented as inputs to the Clock Monitor latch (CM). The CM is set on the falling edge of the system clock source, but cleared on the rising edge of the sample clock. FIGURE 19-3: FSCM BLOCK DIAGRAM Clock failure is tested for on the falling edge of the sample clock. If a sample clock falling edge occurs while CM is still set, a clock failure has been detected (Figure 19-4). This causes the following: • the FSCM generates an oscillator fail interrupt by setting bit, OSCFIF (PIR2<7>); • the system clock source is switched to the internal oscillator block (OSCCON is not updated to show the current clock source – this is the Fail-Safe condition); and • the WDT is reset. Since the postscaler frequency from the internal oscillator block may not be sufficiently stable, it may be desirable to select another clock configuration and enter an alternate power managed mode (see Section 19.3.1 “Special Considerations for Using Two-Speed Start-up” and Section 3.1.3 “Multiple Sleep Commands” for more details). This can be done to attempt a partial recovery, or execute a controlled shutdown. To use a higher clock speed on wake-up, the INTOSC or postscaler clock sources can be selected to provide a higher clock speed by setting bits, IFRC2:IFRC0, immediately after Reset. For wake-ups from Sleep, the INTOSC or postscaler clock sources can be selected by setting IFRC2:IFRC0 prior to entering Sleep mode. Adjustments to the internal oscillator block, using the OSCTUNE register, also affect the period of the FSCM by the same factor. This can usually be neglected, as the clock frequency being monitored is generally much higher than the sample clock frequency. The FSCM will detect failures of the primary or secondary clock sources only. If the internal oscillator block fails, no failure would be detected, nor would any action be possible. 19.4.1 FSCM AND THE WATCHDOG TIMER Both the FSCM and the WDT are clocked by the INTRC oscillator. Since the WDT operates with a separate divider and counter, disabling the WDT has no effect on the operation of the INTRC oscillator when the FSCM is enabled. As already noted, the clock source is switched to the INTOSC clock when a clock failure is detected. Depending on the frequency selected by the IRCF2:IRCF0 bits, this may mean a substantial change in the speed of code execution. If the WDT is enabled with a small prescale value, a decrease in clock speed allows a WDT time-out to occur and a subsequent device Reset. For this reason, Fail-Safe Clock events also reset the WDT and postscaler, allowing it to start timing from when execution speed was changed and decreasing the likelihood of an erroneous time-out. Peripheral INTRC ÷ 64 S C Q (32 μs) 488 Hz (2.048 ms) Clock Monitor Latch (CM) (edge-triggered) Clock Failure Detected Source Clock Q© 2007 Microchip Technology Inc. DS39605F-page 183 PIC18F1220/1320 19.4.2 EXITING FAIL-SAFE OPERATION The Fail-Safe condition is terminated by either a device Reset, or by entering a power managed mode. On Reset, the controller starts the primary clock source specified in Configuration Register 1H (with any required start-up delays that are required for the oscillator mode, such as OST or PLL timer). The INTOSC multiplexer provides the system clock until the primary clock source becomes ready (similar to a TwoSpeed Start-up). The clock system source is then switched to the primary clock (indicated by the OSTS bit in the OSCCON register becoming set). The FailSafe Clock Monitor then resumes monitoring the peripheral clock. The primary clock source may never become ready during start-up. In this case, operation is clocked by the INTOSC multiplexer. The OSCCON register will remain in its Reset state until a power managed mode is entered. Entering a power managed mode by loading the OSCCON register and executing a SLEEP instruction will clear the Fail-Safe condition. When the Fail-Safe condition is cleared, the clock monitor will resume monitoring the peripheral clock. 19.4.3 FSCM INTERRUPTS IN POWER MANAGED MODES As previously mentioned, entering a power managed mode clears the Fail-Safe condition. By entering a power managed mode, the clock multiplexer selects the clock source selected by the OSCCON register. Fail-Safe monitoring of the power managed clock source resumes in the power managed mode. If an oscillator failure occurs during power managed operation, the subsequent events depend on whether or not the oscillator failure interrupt is enabled. If enabled (OSCFIF = 1), code execution will be clocked by the INTOSC multiplexer. An automatic transition back to the failed clock source will not occur. If the interrupt is disabled, the device will not exit the power managed mode on oscillator failure. Instead, the device will continue to operate as before, but clocked by the INTOSC multiplexer. While in Idle mode, subsequent interrupts will cause the CPU to begin executing instructions while being clocked by the INTOSC multiplexer. The device will not transition to a different clock source until the Fail-Safe condition is cleared. FIGURE 19-4: FSCM TIMING DIAGRAM OSCFIF CM Output System Clock Output Sample Clock Failure Detected Oscillator Failure Note: The system clock is normally at a much higher frequency than the sample clock. The relative frequencies in this example have been chosen for clarity. (Q) CM Test CM Test CM TestPIC18F1220/1320 DS39605F-page 184 © 2007 Microchip Technology Inc. 19.4.4 POR OR WAKE FROM SLEEP The FSCM is designed to detect oscillator failure at any point after the device has exited Power-on Reset (POR) or Low-Power Sleep mode. When the primary system clock is EC, RC or INTRC modes, monitoring can begin immediately following these events. For oscillator modes involving a crystal or resonator (HS, HSPLL, LP or XT), the situation is somewhat different. Since the oscillator may require a start-up time considerably longer than the FCSM sample clock time, a false clock failure may be detected. To prevent this, the internal oscillator block is automatically configured as the system clock and functions until the primary clock is stable (the OST and PLL timers have timed out). This is identical to Two-Speed Start-up mode. Once the primary clock is stable, the INTRC returns to its role as the FSCM source As noted in Section 19.3.1 “Special Considerations for Using Two-Speed Start-up”, it is also possible to select another clock configuration and enter an alternate power managed mode while waiting for the primary system clock to become stable. When the new powered managed mode is selected, the primary clock is disabled. Note: The same logic that prevents false oscillator failure interrupts on POR or wake from Sleep will also prevent the detection of the oscillator’s failure to start at all following these events. This can be avoided by monitoring the OSTS bit and using a timing routine to determine if the oscillator is taking too long to start. Even so, no oscillator failure interrupt will be flagged. © 2007 Microchip Technology Inc. DS39605F-page 185 PIC18F1220/1320 19.5 Program Verification and Code Protection The overall structure of the code protection on the PIC18 Flash devices differs significantly from other PIC devices. The user program memory is divided into three blocks. One of these is a boot block of 512 bytes. The remainder of the memory is divided into two blocks on binary boundaries. Each of the three blocks has three protection bits associated with them. They are: • Code-Protect bit (CPn) • Write-Protect bit (WRTn) • External Block Table Read bit (EBTRn) Figure 19-5 shows the program memory organization for 4 and 8-Kbyte devices and the specific code protection bit associated with each block. The actual locations of the bits are summarized in Table 19-3. FIGURE 19-5: CODE-PROTECTED PROGRAM MEMORY FOR PIC18F1220/1320 TABLE 19-3: SUMMARY OF CODE PROTECTION REGISTERS Block Code Protection Controlled By: MEMORY SIZE/DEVICE Block Code Protection Controlled By: Address Range 4 Kbytes (PIC18F1220) 8 Kbytes (PIC18F1320) Address Range CPB, WRTB, EBTRB 000000h 0001FFh Boot Block Boot Block 000000h 0001FFh CPB, WRTB, EBTRB CP0, WRT0, EBTR0 000200h 0007FFh Block 0 Block 0 000200h CP0, WRT0, EBTR0 CP1, WRT1, EBTR1 000800h 000FFFh Block 1 000FFFh (Unimplemented Memory Space) 001000h Unimplemented Read ‘0’s Block 1 001000h CP1, WRT1, EBTR1 001FFFh 1FFFFFh Unimplemented Read ‘0’s 002000h 1FFFFFh (Unimplemented Memory Space) File Name Bit 7 Bit 6 Bit 5 Bit 4 Bit 3 Bit 2 Bit 1 Bit 0 300008h CONFIG5L — — — — — — CP1 CP0 300009h CONFIG5H CPD CPB — — — — — — 30000Ah CONFIG6L — — — — — — WRT1 WRT0 30000Bh CONFIG6H WRTD WRTB WRTC — — — — — 30000Ch CONFIG7L — — — — — — EBTR1 EBTR0 30000Dh CONFIG7H — EBTRB — — — — — — Legend: Shaded cells are unimplemented.PIC18F1220/1320 DS39605F-page 186 © 2007 Microchip Technology Inc. 19.5.1 PROGRAM MEMORY CODE PROTECTION The program memory may be read to, or written from, any location using the table read and table write instructions. The device ID may be read with table reads. The configuration registers may be read and written with the table read and table write instructions. In normal execution mode, the CPn bits have no direct effect. CPn bits inhibit external reads and writes. A block of user memory may be protected from table writes if the WRTn configuration bit is ‘0’. The EBTRn bits control table reads. For a block of user memory with the EBTRn bit set to ‘0’, a table read instruction that executes from within that block is allowed to read. A table read instruction that executes from a location outside of that block is not allowed to read and will result in reading ‘0’s. Figures 19-6 through 19-8 illustrate table write and table read protection. FIGURE 19-6: TABLE WRITE (WRTn) DISALLOWED: PIC18F1320 Note: Code protection bits may only be written to a ‘0’ from a ‘1’ state. It is not possible to write a ‘1’ to a bit in the ‘0’ state. Code protection bits are only set to ‘1’ by a full Chip Erase or Block Erase function. The full Chip Erase and Block Erase functions can only be initiated via ICSP or an external programmer. 000000h 0001FFh 000200h 000FFFh 001000h 001FFFh WRTB, EBTRB = 11 WRT0, EBTR0 = 01 TBLWT * TBLPTR = 0002FFh PC = 0007FEh PC = 0017FEh TBLWT * Register Values Program Memory Configuration Bit Settings Results: All table writes disabled to Blockn whenever WRTn = 0. WRT1, EBTR1 = 11© 2007 Microchip Technology Inc. DS39605F-page 187 PIC18F1220/1320 FIGURE 19-7: EXTERNAL BLOCK TABLE READ (EBTRn) DISALLOWED: PIC18F1320 FIGURE 19-8: EXTERNAL BLOCK TABLE READ (EBTRn) ALLOWED: PIC18F1320 000000h 0001FFh 000200h 000FFFh 001000h 001FFFh WRTB, EBTRB = 11 WRT0, EBTR0 = 10 WRT1, EBTR1 = 11 TBLPTR = 0002FFh Register Values Program Memory Configuration Bit Settings PC = 001FFEh TBLRD * Results: All table reads from external blocks to Blockn are disabled whenever EBTRn = 0. TABLAT register returns a value of ‘0’. 000000h 0001FFh 000200h 000FFFh 001000h 001FFFh WRTB, EBTRB = 11 WRT0, EBTR0 = 10 WRT1, EBTR1 = 11 TBLRD * TBLPTR = 0002FFh PC = 0007FEh Register Values Program Memory Configuration Bit Settings Results: Table reads permitted within Blockn, even when EBTRBn = 0. TABLAT register returns the value of the data at the location TBLPTR.PIC18F1220/1320 DS39605F-page 188 © 2007 Microchip Technology Inc. 19.5.2 DATA EEPROM CODE PROTECTION The entire data EEPROM is protected from external reads and writes by two bits: CPD and WRTD. CPD inhibits external reads and writes of data EEPROM. WRTD inhibits external writes to data EEPROM. The CPU can continue to read and write data EEPROM, regardless of the protection bit settings. 19.5.3 CONFIGURATION REGISTER PROTECTION The configuration registers can be write-protected. The WRTC bit controls protection of the configuration registers. In normal execution mode, the WRTC bit is readable only. WRTC can only be written via ICSP or an external programmer. 19.6 ID Locations Eight memory locations (200000h-200007h) are designated as ID locations, where the user can store checksum or other code identification numbers. These locations are both readable and writable during normal execution through the TBLRD and TBLWT instructions, or during program/verify. The ID locations can be read when the device is code-protected. 19.7 In-Circuit Serial Programming PIC18F1220/1320 microcontrollers can be serially programmed while in the end application circuit. This is simply done with two lines for clock and data and three other lines for power, ground and the programming voltage. This allows customers to manufacture boards with unprogrammed devices and then program the microcontroller just before shipping the product. This also allows the most recent firmware or a custom firmware to be programmed (see Table 19-4). 19.8 In-Circuit Debugger When the DEBUG bit in configuration register, CONFIG4L, is programmed to a ‘0’, the In-Circuit Debugger functionality is enabled. This function allows simple debugging functions when used with MPLAB® IDE. When the microcontroller has this feature enabled, some resources are not available for general use. Table 19-5 shows which resources are required by the background debugger. TABLE 19-5: DEBUGGER RESOURCES To use the In-Circuit Debugger function of the microcontroller, the design must implement In-Circuit Serial Programming connections to MCLR/VPP, VDD, VSS, RB7 and RB6. This will interface to the In-Circuit Debugger module available from Microchip, or one of the third party development tool companies (see the note following Section 19.7 “In-Circuit Serial Programming” for more information). Note: The Timer1 oscillator shares the T1OSI and T1OSO pins with the PGD and PGC pins used for programming and debugging. When using the Timer1 oscillator, In-Circuit Serial Programming (ICSP) may not function correctly (high voltage or low voltage), or the In-Circuit Debugger (ICD) may not communicate with the controller. As a result of using either ICSP or ICD, the Timer1 crystal may be damaged. If ICSP or ICD operations are required, the crystal should be disconnected from the circuit (disconnect either lead), or installed after programming. The oscillator loading capacitors may remain in-circuit during ICSP or ICD operation. TABLE 19-4: ICSP/ICD CONNECTIONS Signal Pin Notes PGD RB7/PGD/T1OSI/ P1D/KBI3 Shared with T1OSC – protect crystal PGC RB6/PGC/T1OSO/ T13CKI/P1C/KBI2 Shared with T1OSC – protect crystal MCLR MCLR/VPP/RA5 VDD VDD VSS VSS PGM RB5/PGM/KBI1 Optional – pull RB5 low is LVP enabled I/O pins: RB6, RB7 Stack: 2 levels Program Memory: 512 bytes Data Memory: 10 bytes© 2007 Microchip Technology Inc. DS39605F-page 189 PIC18F1220/1320 19.9 Low-Voltage ICSP Programming The LVP bit in configuration register, CONFIG4L, enables Low-Voltage Programming (LVP). When LVP is enabled, the microcontroller can be programmed without requiring high voltage being applied to the MCLR/VPP/RA5 pin, but the RB5/PGM/KBI1 pin is then dedicated to controlling Program mode entry and is not available as a general purpose I/O pin. LVP is enabled in erased devices. While programming using LVP, VDD is applied to the MCLR/VPP/RA5 pin as in normal execution mode. To enter Programming mode, VDD is applied to the PGM pin. If Low-Voltage Programming mode will not be used, the LVP bit can be cleared and RB5/PGM/KBI1 becomes available as the digital I/O pin RB5. The LVP bit may be set or cleared only when using standard high-voltage programming (VIHH applied to the MCLR/VPP/RA5 pin). Once LVP has been disabled, only the standard highvoltage programming is available and must be used to program the device. Memory that is not code-protected can be erased, using either a Block Erase, or erased row by row, then written at any specified VDD. If code-protected memory is to be erased, a Block Erase is required. If a Block Erase is to be performed when using Low-Voltage Programming, the device must be supplied with VDD of 4.5V to 5.5V. Note 1: High-voltage programming is always available, regardless of the state of the LVP bit or the PGM pin, by applying VIHH to the MCLR pin. 2: When Low-Voltage Programming is enabled, the RB5 pin can no longer be used as a general purpose I/O pin. 3: When LVP is enabled, externally pull the PGM pin to VSS to allow normal program execution.PIC18F1220/1320 DS39605F-page 190 © 2007 Microchip Technology Inc. NOTES:© 2007 Microchip Technology Inc. DS39605F-page 191 PIC18F1220/1320 20.0 INSTRUCTION SET SUMMARY The PIC18 instruction set adds many enhancements to the previous PIC instruction sets, while maintaining an easy migration from these PIC instruction sets. Most instructions are a single program memory word (16 bits), but there are three instructions that require two program memory locations. Each single-word instruction is a 16-bit word divided into an opcode, which specifies the instruction type and one or more operands, which further specify the operation of the instruction. The instruction set is highly orthogonal and is grouped into four basic categories: • Byte-oriented operations • Bit-oriented operations • Literal operations • Control operations The PIC18 instruction set summary in Table 20-1 lists byte-oriented, bit-oriented, literal and control operations. Table 20-1 shows the opcode field descriptions. Most byte-oriented instructions have three operands: 1. The file register (specified by ‘f’) 2. The destination of the result (specified by ‘d’) 3. The accessed memory (specified by ‘a’) The file register designator ‘f’ specifies which file register is to be used by the instruction. The destination designator ‘d’ specifies where the result of the operation is to be placed. If ‘d’ is zero, the result is placed in the WREG register. If ‘d’ is one, the result is placed in the file register specified in the instruction. All bit-oriented instructions have three operands: 1. The file register (specified by ‘f’) 2. The bit in the file register (specified by ‘b’) 3. The accessed memory (specified by ‘a’) The bit field designator ‘b’ selects the number of the bit affected by the operation, while the file register designator ‘f’ represents the number of the file in which the bit is located. The literal instructions may use some of the following operands: • A literal value to be loaded into a file register (specified by ‘k’) • The desired FSR register to load the literal value into (specified by ‘f’) • No operand required (specified by ‘—’) The control instructions may use some of the following operands: • A program memory address (specified by ‘n’) • The mode of the CALL or RETURN instructions (specified by ‘s’) • The mode of the table read and table write instructions (specified by ‘m’) • No operand required (specified by ‘—’) All instructions are a single word, except for three double-word instructions. These three instructions were made double-word instructions so that all the required information is available in these 32 bits. In the second word, the 4 MSbs are ‘1’s. If this second word is executed as an instruction (by itself), it will execute as a NOP. All single-word instructions are executed in a single instruction cycle, unless a conditional test is true, or the program counter is changed as a result of the instruction. In these cases, the execution takes two instruction cycles, with the additional instruction cycle(s) executed as a NOP. The double-word instructions execute in two instruction cycles. One instruction cycle consists of four oscillator periods. Thus, for an oscillator frequency of 4 MHz, the normal instruction execution time is 1 μs. If a conditional test is true, or the program counter is changed as a result of an instruction, the instruction execution time is 2 μs. Two-word branch instructions (if true) would take 3 μs. Figure 20-1 shows the general formats that the instructions can have. All examples use the format ‘nnh’ to represent a hexadecimal number, where ‘h’ signifies a hexadecimal digit. The Instruction Set Summary, shown in Table 20-1, lists the instructions recognized by the Microchip Assembler (MPASMTM). Section 20.2 “Instruction Set” provides a description of each instruction. 20.1 Read-Modify-Write Operations Any instruction that specifies a file register as part of the instruction performs a Read-Modify-Write (R-M-W) operation. The register is read, the data is modified and the result is stored according to either the instruction or the destination designator ‘d’. A read operation is performed on a register even if the instruction writes to that register. For example, a “BCF PORTB,1” instruction will read PORTB, clear bit 1 of the data, then write the result back to PORTB. The read operation would have the unintended result that any condition that sets the RBIF flag would be cleared. The R-M-W operation may also copy the level of an input pin to its corresponding output latch.PIC18F1220/1320 DS39605F-page 192 © 2007 Microchip Technology Inc. TABLE 20-1: OPCODE FIELD DESCRIPTIONS Field Description a RAM access bit a = 0: RAM location in Access RAM (BSR register is ignored) a = 1: RAM bank is specified by BSR register bbb Bit address within an 8-bit file register (0 to 7). BSR Bank Select Register. Used to select the current RAM bank. d Destination select bit d = 0: store result in WREG d = 1: store result in file register f dest Destination either the WREG register or the specified register file location. f 8-bit register file address (0x00 to 0xFF). fs 12-bit register file address (0x000 to 0xFFF). This is the source address. fd 12-bit register file address (0x000 to 0xFFF). This is the destination address. k Literal field, constant data or label (may be either an 8-bit, 12-bit or a 20-bit value). label Label name. mm The mode of the TBLPTR register for the table read and table write instructions. Only used with table read and table write instructions: * No change to register (such as TBLPTR with table reads and writes) *+ Post-Increment register (such as TBLPTR with table reads and writes) *- Post-Decrement register (such as TBLPTR with table reads and writes) +* Pre-Increment register (such as TBLPTR with table reads and writes) n The relative address (2’s complement number) for relative branch instructions, or the direct address for call/branch and return instructions. PRODH Product of Multiply High Byte. PRODL Product of Multiply Low Byte. s Fast Call/Return mode select bit s = 0: do not update into/from shadow registers s = 1: certain registers loaded into/from shadow registers (Fast mode) u Unused or unchanged. WREG Working register (accumulator). x Don’t care (‘0’ or ‘1’). The assembler will generate code with x = 0. It is the recommended form of use for compatibility with all Microchip software tools. TBLPTR 21-bit Table Pointer (points to a program memory location). TABLAT 8-bit Table Latch. TOS Top-of-Stack. PC Program Counter. PCL Program Counter Low Byte. PCH Program Counter High Byte. PCLATH Program Counter High Byte Latch. PCLATU Program Counter Upper Byte Latch. GIE Global Interrupt Enable bit. WDT Watchdog Timer. TO Time-out bit. PD Power-down bit. C, DC, Z, OV, N ALU Status bits: Carry, Digit Carry, Zero, Overflow, Negative. [ ] Optional. ( ) Contents. → Assigned to. < > Register bit field. ∈ In the set of. italics User defined term (font is Courier).© 2007 Microchip Technology Inc. DS39605F-page 193 PIC18F1220/1320 FIGURE 20-1: GENERAL FORMAT FOR INSTRUCTIONS Byte-oriented file register operations 15 10 9 8 7 0 d = 0 for result destination to be WREG register OPCODE d a f (FILE #) d = 1 for result destination to be file register (f) a = 0 to force Access Bank Bit-oriented file register operations 15 12 11 9 8 7 0 OPCODE b (BIT #) a f (FILE #) b = 3-bit position of bit in file register (f) Literal operations 15 8 7 0 OPCODE k (literal) k = 8-bit immediate value Byte to Byte move operations (2-word) 15 12 11 0 OPCODE f (Source FILE #) CALL, GOTO and Branch operations 15 8 7 0 OPCODE n<7:0> (literal) n = 20-bit immediate value a = 1 for BSR to select bank f = 8-bit file register address a = 0 to force Access Bank a = 1 for BSR to select bank f = 8-bit file register address 15 12 11 0 1111 n<19:8> (literal) 15 12 11 0 1111 f (Destination FILE #) f = 12-bit file register address Control operations Example Instruction ADDWF MYREG, W, B MOVFF MYREG1, MYREG2 BSF MYREG, bit, B MOVLW 0x7F GOTO Label 15 8 7 0 OPCODE n<7:0> (literal) 15 12 11 0 n<19:8> (literal) CALL MYFUNC 15 11 10 0 OPCODE n<10:0> (literal) S = Fast bit BRA MYFUNC 15 8 7 0 OPCODE n<7:0> (literal) BC MYFUNC SPIC18F1220/1320 DS39605F-page 194 © 2007 Microchip Technology Inc. TABLE 20-1: PIC18FXXXX INSTRUCTION SET Mnemonic, Operands Description Cycles 16-Bit Instruction Word Status Affected Notes MSb LSb BYTE-ORIENTED FILE REGISTER OPERATIONS ADDWF ADDWFC ANDWF CLRF COMF CPFSEQ CPFSGT CPFSLT DECF DECFSZ DCFSNZ INCF INCFSZ INFSNZ IORWF MOVF MOVFF MOVWF MULWF NEGF RLCF RLNCF RRCF RRNCF SETF SUBFWB SUBWF SUBWFB SWAPF TSTFSZ XORWF f, d, a f, d, a f, d, a f, a f, d, a f, a f, a f, a f, d, a f, d, a f, d, a f, d, a f, d, a f, d, a f, d, a f, d, a fs, fd f, a f, a f, a f, d, a f, d, a f, d, a f, d, a f, a f, d, a f, d, a f, d, a f, d, a f, a f, d, a Add WREG and f Add WREG and Carry bit to f AND WREG with f Clear f Complement f Compare f with WREG, skip = Compare f with WREG, skip > Compare f with WREG, skip < Decrement f Decrement f, Skip if 0 Decrement f, Skip if Not 0 Increment f Increment f, Skip if 0 Increment f, Skip if Not 0 Inclusive OR WREG with f Move f Move fs (source) to 1st word fd (destination) 2nd word Move WREG to f Multiply WREG with f Negate f Rotate Left f through Carry Rotate Left f (No Carry) Rotate Right f through Carry Rotate Right f (No Carry) Set f Subtract f from WREG with borrow Subtract WREG from f Subtract WREG from f with borrow Swap nibbles in f Test f, skip if 0 Exclusive OR WREG with f 1 1 1 1 1 1 (2 or 3) 1 (2 or 3) 1 (2 or 3) 1 1 (2 or 3) 1 (2 or 3) 1 1 (2 or 3) 1 (2 or 3) 1 1 2 1 1 1 1 1 1 1 1 1 1 1 1 1 (2 or 3) 1 0010 0010 0001 0110 0001 0110 0110 0110 0000 0010 0100 0010 0011 0100 0001 0101 1100 1111 0110 0000 0110 0011 0100 0011 0100 0110 0101 0101 0101 0011 0110 0001 01da 00da 01da 101a 11da 001a 010a 000a 01da 11da 11da 10da 11da 10da 00da 00da ffff ffff 111a 001a 110a 01da 01da 00da 00da 100a 01da 11da 10da 10da 011a 10da ffff ffff ffff ffff ffff ffff ffff ffff ffff ffff ffff ffff ffff ffff ffff ffff ffff ffff ffff ffff ffff ffff ffff ffff ffff ffff ffff ffff ffff ffff ffff ffff ffff ffff ffff ffff ffff ffff ffff ffff ffff ffff ffff ffff ffff ffff ffff ffff ffff ffff ffff ffff ffff ffff ffff ffff ffff ffff ffff ffff ffff ffff ffff ffff C, DC, Z, OV, N C, DC, Z, OV, N Z, N Z Z, N None None None C, DC, Z, OV, N None None C, DC, Z, OV, N None None Z, N Z, N None None None C, DC, Z, OV, N C, Z, N Z, N C, Z, N Z, N None C, DC, Z, OV, N C, DC, Z, OV, N C, DC, Z, OV, N None None Z, N 1, 2 1, 2 1,2 2 1, 2 4 4 1, 2 1, 2, 3, 4 1, 2, 3, 4 1, 2 1, 2, 3, 4 4 1, 2 1, 2 1 1, 2 1, 2 1, 2 1, 2 4 1, 2 BIT-ORIENTED FILE REGISTER OPERATIONS BCF BSF BTFSC BTFSS BTG f, b, a f, b, a f, b, a f, b, a f, d, a Bit Clear f Bit Set f Bit Test f, Skip if Clear Bit Test f, Skip if Set Bit Toggle f 1 1 1 (2 or 3) 1 (2 or 3) 1 1001 1000 1011 1010 0111 bbba bbba bbba bbba bbba ffff ffff ffff ffff ffff ffff ffff ffff ffff ffff None None None None None 1, 2 1, 2 3, 4 3, 4 1, 2 Note 1: When a Port register is modified as a function of itself (e.g., MOVF PORTB, 1, 0), the value used will be that value present on the pins themselves. For example, if the data latch is ‘1’ for a pin configured as input and is driven low by an external device, the data will be written back with a ‘0’. 2: If this instruction is executed on the TMR0 register (and where applicable, d = 1), the prescaler will be cleared if assigned. 3: If Program Counter (PC) is modified or a conditional test is true, the instruction requires two cycles. The second cycle is executed as a NOP. 4: Some instructions are 2-word instructions. The second word of these instructions will be executed as a NOP, unless the first word of the instruction retrieves the information embedded in these 16 bits. This ensures that all program memory locations have a valid instruction. 5: If the table write starts the write cycle to internal memory, the write will continue until terminated.© 2007 Microchip Technology Inc. DS39605F-page 195 PIC18F1220/1320 CONTROL OPERATIONS BC BN BNC BNN BNOV BNZ BOV BRA BZ CALL CLRWDT DAW GOTO NOP NOP POP PUSH RCALL RESET RETFIE RETLW RETURN SLEEP n n n n n n n n n n, s — — n — — — — n s k s — Branch if Carry Branch if Negative Branch if Not Carry Branch if Not Negative Branch if Not Overflow Branch if Not Zero Branch if Overflow Branch Unconditionally Branch if Zero Call subroutine 1st word 2nd word Clear Watchdog Timer Decimal Adjust WREG Go to address 1st word 2nd word No Operation No Operation Pop top of return stack (TOS) Push top of return stack (TOS) Relative Call Software device Reset Return from interrupt enable Return with literal in WREG Return from Subroutine Go into Standby mode 1 (2) 1 (2) 1 (2) 1 (2) 1 (2) 1 (2) 1 (2) 2 1 (2) 2 1 1 2 1 1 1 1 2 1 2 2 2 1 1110 1110 1110 1110 1110 1110 1110 1101 1110 1110 1111 0000 0000 1110 1111 0000 1111 0000 0000 1101 0000 0000 0000 0000 0000 0010 0110 0011 0111 0101 0001 0100 0nnn 0000 110s kkkk 0000 0000 1111 kkkk 0000 xxxx 0000 0000 1nnn 0000 0000 1100 0000 0000 nnnn nnnn nnnn nnnn nnnn nnnn nnnn nnnn nnnn kkkk kkkk 0000 0000 kkkk kkkk 0000 xxxx 0000 0000 nnnn 1111 0001 kkkk 0001 0000 nnnn nnnn nnnn nnnn nnnn nnnn nnnn nnnn nnnn kkkk kkkk 0100 0111 kkkk kkkk 0000 xxxx 0110 0101 nnnn 1111 000s kkkk 001s 0011 None None None None None None None None None None TO, PD C None None None None None None All GIE/GIEH, PEIE/GIEL None None TO, PD 4 TABLE 20-1: PIC18FXXXX INSTRUCTION SET (CONTINUED) Mnemonic, Operands Description Cycles 16-Bit Instruction Word Status Affected Notes MSb LSb Note 1: When a Port register is modified as a function of itself (e.g., MOVF PORTB, 1, 0), the value used will be that value present on the pins themselves. For example, if the data latch is ‘1’ for a pin configured as input and is driven low by an external device, the data will be written back with a ‘0’. 2: If this instruction is executed on the TMR0 register (and where applicable, d = 1), the prescaler will be cleared if assigned. 3: If Program Counter (PC) is modified or a conditional test is true, the instruction requires two cycles. The second cycle is executed as a NOP. 4: Some instructions are 2-word instructions. The second word of these instructions will be executed as a NOP, unless the first word of the instruction retrieves the information embedded in these 16 bits. This ensures that all program memory locations have a valid instruction. 5: If the table write starts the write cycle to internal memory, the write will continue until terminated.PIC18F1220/1320 DS39605F-page 196 © 2007 Microchip Technology Inc. LITERAL OPERATIONS ADDLW ANDLW IORLW LFSR MOVLB MOVLW MULLW RETLW SUBLW XORLW k k k f, k k k k k k k Add literal and WREG AND literal with WREG Inclusive OR literal with WREG Move literal (12-bit) 2nd word to FSRx 1st word Move literal to BSR<3:0> Move literal to WREG Multiply literal with WREG Return with literal in WREG Subtract WREG from literal Exclusive OR literal with WREG 1 1 1 2 1 1 1 2 1 1 0000 0000 0000 1110 1111 0000 0000 0000 0000 0000 0000 1111 1011 1001 1110 0000 0001 1110 1101 1100 1000 1010 kkkk kkkk kkkk 00ff kkkk 0000 kkkk kkkk kkkk kkkk kkkk kkkk kkkk kkkk kkkk kkkk kkkk kkkk kkkk kkkk kkkk kkkk C, DC, Z, OV, N Z, N Z, N None None None None None C, DC, Z, OV, N Z, N DATA MEMORY ↔ PROGRAM MEMORY OPERATIONS TBLRD* TBLRD*+ TBLRD*- TBLRD+* TBLWT* TBLWT*+ TBLWT*- TBLWT+* Table read Table read with post-increment Table read with post-decrement Table read with pre-increment Table write Table write with post-increment Table write with post-decrement Table write with pre-increment 2 2 (5) 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 1000 1001 1010 1011 1100 1101 1110 1111 None None None None None None None None TABLE 20-1: PIC18FXXXX INSTRUCTION SET (CONTINUED) Mnemonic, Operands Description Cycles 16-Bit Instruction Word Status Affected Notes MSb LSb Note 1: When a Port register is modified as a function of itself (e.g., MOVF PORTB, 1, 0), the value used will be that value present on the pins themselves. For example, if the data latch is ‘1’ for a pin configured as input and is driven low by an external device, the data will be written back with a ‘0’. 2: If this instruction is executed on the TMR0 register (and where applicable, d = 1), the prescaler will be cleared if assigned. 3: If Program Counter (PC) is modified or a conditional test is true, the instruction requires two cycles. The second cycle is executed as a NOP. 4: Some instructions are 2-word instructions. The second word of these instructions will be executed as a NOP, unless the first word of the instruction retrieves the information embedded in these 16 bits. This ensures that all program memory locations have a valid instruction. 5: If the table write starts the write cycle to internal memory, the write will continue until terminated.© 2007 Microchip Technology Inc. DS39605F-page 197 PIC18F1220/1320 20.2 Instruction Set ADDLW ADD literal to W Syntax: [ label ] ADDLW k Operands: 0 ≤ k ≤ 255 Operation: (W) + k → W Status Affected: N, OV, C, DC, Z Encoding: 0000 1111 kkkk kkkk Description: The contents of W are added to the 8-bit literal ‘k’ and the result is placed in W. Words: 1 Cycles: 1 Q Cycle Activity: Q1 Q2 Q3 Q4 Decode Read literal ‘k’ Process Data Write to W Example: ADDLW 0x15 Before Instruction W = 0x10 After Instruction W = 0x25 ADDWF ADD W to f Syntax: [ label ] ADDWF f [,d [,a]] Operands: 0 ≤ f ≤ 255 d ∈ [0,1] a ∈ [0,1] Operation: (W) + (f) → dest Status Affected: N, OV, C, DC, Z Encoding: 0010 01da ffff ffff Description: Add W to register ‘f’. If ‘d’ is ‘0’, the result is stored in W. If ‘d’ is ‘1’, the result is stored back in register ‘f’ (default). If ‘a’ is ‘0’, the Access Bank will be selected. If ‘a’ is ‘1’, the BSR is used. Words: 1 Cycles: 1 Q Cycle Activity: Q1 Q2 Q3 Q4 Decode Read register ‘f’ Process Data Write to destination Example: ADDWF REG, W Before Instruction W = 0x17 REG = 0xC2 After Instruction W = 0xD9 REG = 0xC2PIC18F1220/1320 DS39605F-page 198 © 2007 Microchip Technology Inc. ADDWFC ADD W and Carry bit to f Syntax: [ label ] ADDWFC f [,d [,a]] Operands: 0 ≤ f ≤ 255 d ∈ [0,1] a ∈ [0,1] Operation: (W) + (f) + (C) → dest Status Affected: N, OV, C, DC, Z Encoding: 0010 00da ffff ffff Description: Add W, the Carry flag and data memory location ‘f’. If ‘d’ is ‘0’, the result is placed in W. If ‘d’ is ‘1’, the result is placed in data memory location ‘f’. If ‘a’ is ‘0’, the Access Bank will be selected. If ‘a’ is ‘1’, the BSR will not be overridden. Words: 1 Cycles: 1 Q Cycle Activity: Q1 Q2 Q3 Q4 Decode Read register ‘f’ Process Data Write to destination Example: ADDWFC REG, W Before Instruction Carry bit = 1 REG = 0x02 W = 0x4D After Instruction Carry bit = 0 REG = 0x02 W = 0x50 ANDLW AND literal with W Syntax: [ label ] ANDLW k Operands: 0 ≤ k ≤ 255 Operation: (W) .AND. k → W Status Affected: N, Z Encoding: 0000 1011 kkkk kkkk Description: The contents of W are AND’ed with the 8-bit literal ‘k’. The result is placed in W. Words: 1 Cycles: 1 Q Cycle Activity: Q1 Q2 Q3 Q4 Decode Read literal ‘k’ Process Data Write to W Example: ANDLW 0x5F Before Instruction W = 0xA3 After Instruction W = 0x03© 2007 Microchip Technology Inc. DS39605F-page 199 PIC18F1220/1320 ANDWF AND W with f Syntax: [ label ] ANDWF f [,d [,a]] Operands: 0 ≤ f ≤ 255 d ∈ [0,1] a ∈ [0,1] Operation: (W) .AND. (f) → dest Status Affected: N, Z Encoding: 0001 01da ffff ffff Description: The contents of W are AND’ed with register ‘f’. If ‘d’ is ‘0’, the result is stored in W. If ‘d’ is ‘1’, the result is stored back in register ‘f’ (default). If ‘a’ is ‘0’, the Access Bank will be selected. If ‘a’ is ‘1’, the BSR will not be overridden (default). Words: 1 Cycles: 1 Q Cycle Activity: Q1 Q2 Q3 Q4 Decode Read register ‘f’ Process Data Write to destination Example: ANDWF REG, W Before Instruction W = 0x17 REG = 0xC2 After Instruction W = 0x02 REG = 0xC2 BC Branch if Carry Syntax: [ label ] BC n Operands: -128 ≤ n ≤ 127 Operation: if Carry bit is ‘1’ (PC) + 2 + 2n → PC Status Affected: None Encoding: 1110 0010 nnnn nnnn Description: If the Carry bit is ‘1’, then the program will branch. The 2’s complement number ‘2n’ is added to the PC. Since the PC will have incremented to fetch the next instruction, the new address will be PC + 2 + 2n. This instruction is then a two-cycle instruction. Words: 1 Cycles: 1(2) Q Cycle Activity: If Jump: Q1 Q2 Q3 Q4 Decode Read literal ‘n’ Process Data Write to PC No operation No operation No operation No operation If No Jump: Q1 Q2 Q3 Q4 Decode Read literal ‘n’ Process Data No operation Example: HERE BC JUMP Before Instruction PC = address (HERE) After Instruction If Carry = 1; PC = address (JUMP) If Carry = 0; PC = address (HERE + 2)PIC18F1220/1320 DS39605F-page 200 © 2007 Microchip Technology Inc. BCF Bit Clear f Syntax: [ label ] BCF f,b[,a] Operands: 0 ≤ f ≤ 255 0 ≤ b ≤ 7 a ∈ [0,1] Operation: 0 → f Status Affected: None Encoding: 1001 bbba ffff ffff Description: Bit ‘b’ in register ‘f’ is cleared. If ‘a’ is ‘0’, the Access Bank will be selected, overriding the BSR value. If ‘a’ = 1, then the bank will be selected as per the BSR value (default). Words: 1 Cycles: 1 Q Cycle Activity: Q1 Q2 Q3 Q4 Decode Read register ‘f’ Process Data Write register ‘f’ Example: BCF FLAG_REG, 7 Before Instruction FLAG_REG = 0xC7 After Instruction FLAG_REG = 0x47 BN Branch if Negative Syntax: [ label ] BN n Operands: -128 ≤ n ≤ 127 Operation: if Negative bit is ‘1’ (PC) + 2 + 2n → PC Status Affected: None Encoding: 1110 0110 nnnn nnnn Description: If the Negative bit is ‘1’, then the program will branch. The 2’s complement number ‘2n’ is added to the PC. Since the PC will have incremented to fetch the next instruction, the new address will be PC + 2 + 2n. This instruction is then a two-cycle instruction. Words: 1 Cycles: 1(2) Q Cycle Activity: If Jump: Q1 Q2 Q3 Q4 Decode Read literal ‘n’ Process Data Write to PC No operation No operation No operation No operation If No Jump: Q1 Q2 Q3 Q4 Decode Read literal ‘n’ Process Data No operation Example: HERE BN Jump Before Instruction PC = address (HERE) After Instruction If Negative = 1; PC = address (Jump) If Negative = 0; PC = address (HERE + 2)© 2007 Microchip Technology Inc. DS39605F-page 201 PIC18F1220/1320 BNC Branch if Not Carry Syntax: [ label ] BNC n Operands: -128 ≤ n ≤ 127 Operation: if Carry bit is ‘0’ (PC) + 2 + 2n → PC Status Affected: None Encoding: 1110 0011 nnnn nnnn Description: If the Carry bit is ‘0’, then the program will branch. The 2’s complement number ‘2n’ is added to the PC. Since the PC will have incremented to fetch the next instruction, the new address will be PC + 2 + 2n. This instruction is then a two-cycle instruction. Words: 1 Cycles: 1(2) Q Cycle Activity: If Jump: Q1 Q2 Q3 Q4 Decode Read literal ‘n’ Process Data Write to PC No operation No operation No operation No operation If No Jump: Q1 Q2 Q3 Q4 Decode Read literal ‘n’ Process Data No operation Example: HERE BNC Jump Before Instruction PC = address (HERE) After Instruction If Carry = 0; PC = address (Jump) If Carry = 1; PC = address (HERE + 2) BNN Branch if Not Negative Syntax: [ label ] BNN n Operands: -128 ≤ n ≤ 127 Operation: if Negative bit is ‘0’ (PC) + 2 + 2n → PC Status Affected: None Encoding: 1110 0111 nnnn nnnn Description: If the Negative bit is ‘0’, then the program will branch. The 2’s complement number ‘2n’ is added to the PC. Since the PC will have incremented to fetch the next instruction, the new address will be PC + 2 + 2n. This instruction is then a two-cycle instruction. Words: 1 Cycles: 1(2) Q Cycle Activity: If Jump: Q1 Q2 Q3 Q4 Decode Read literal ‘n’ Process Data Write to PC No operation No operation No operation No operation If No Jump: Q1 Q2 Q3 Q4 Decode Read literal ‘n’ Process Data No operation Example: HERE BNN Jump Before Instruction PC = address (HERE) After Instruction If Negative = 0; PC = address (Jump) If Negative = 1; PC = address (HERE + 2)PIC18F1220/1320 DS39605F-page 202 © 2007 Microchip Technology Inc. BNOV Branch if Not Overflow Syntax: [ label ] BNOV n Operands: -128 ≤ n ≤ 127 Operation: if Overflow bit is ‘0’ (PC) + 2 + 2n → PC Status Affected: None Encoding: 1110 0101 nnnn nnnn Description: If the Overflow bit is ‘0’, then the program will branch. The 2’s complement number ‘2n’ is added to the PC. Since the PC will have incremented to fetch the next instruction, the new address will be PC + 2 + 2n. This instruction is then a two-cycle instruction. Words: 1 Cycles: 1(2) Q Cycle Activity: If Jump: Q1 Q2 Q3 Q4 Decode Read literal ‘n’ Process Data Write to PC No operation No operation No operation No operation If No Jump: Q1 Q2 Q3 Q4 Decode Read literal ‘n’ Process Data No operation Example: HERE BNOV Jump Before Instruction PC = address (HERE) After Instruction If Overflow = 0; PC = address (Jump) If Overflow = 1; PC = address (HERE + 2) BNZ Branch if Not Zero Syntax: [ label ] BNZ n Operands: -128 ≤ n ≤ 127 Operation: if Zero bit is ‘0’ (PC) + 2 + 2n → PC Status Affected: None Encoding: 1110 0001 nnnn nnnn Description: If the Zero bit is ‘0’, then the program will branch. The 2’s complement number ‘2n’ is added to the PC. Since the PC will have incremented to fetch the next instruction, the new address will be PC + 2 + 2n. This instruction is then a two-cycle instruction. Words: 1 Cycles: 1(2) Q Cycle Activity: If Jump: Q1 Q2 Q3 Q4 Decode Read literal ‘n’ Process Data Write to PC No operation No operation No operation No operation If No Jump: Q1 Q2 Q3 Q4 Decode Read literal ‘n’ Process Data No operation Example: HERE BNZ Jump Before Instruction PC = address (HERE) After Instruction If Zero = 0; PC = address (Jump) If Zero = 1; PC = address (HERE + 2)© 2007 Microchip Technology Inc. DS39605F-page 203 PIC18F1220/1320 BRA Unconditional Branch Syntax: [ label ] BRA n Operands: -1024 ≤ n ≤ 1023 Operation: (PC) + 2 + 2n → PC Status Affected: None Encoding: 1101 0nnn nnnn nnnn Description: Add the 2’s complement number ‘2n’ to the PC. Since the PC will have incremented to fetch the next instruction, the new address will be PC + 2 + 2n. This instruction is a two-cycle instruction. Words: 1 Cycles: 2 Q Cycle Activity: Q1 Q2 Q3 Q4 Decode Read literal ‘n’ Process Data Write to PC No operation No operation No operation No operation Example: HERE BRA Jump Before Instruction PC = address (HERE) After Instruction PC = address (Jump) BSF Bit Set f Syntax: [ label ] BSF f,b[,a] Operands: 0 ≤ f ≤ 255 0 ≤ b ≤ 7 a ∈ [0,1] Operation: 1 → f Status Affected: None Encoding: 1000 bbba ffff ffff Description: Bit ‘b’ in register ‘f’ is set. If ‘a’ is ‘0’, the Access Bank will be selected, overriding the BSR value. If ‘a’ = 1, then the bank will be selected as per the BSR value. Words: 1 Cycles: 1 Q Cycle Activity: Q1 Q2 Q3 Q4 Decode Read register ‘f’ Process Data Write register ‘f’ Example: BSF FLAG_REG, 7 Before Instruction FLAG_REG = 0x0A After Instruction FLAG_REG = 0x8APIC18F1220/1320 DS39605F-page 204 © 2007 Microchip Technology Inc. BTFSC Bit Test File, Skip if Clear Syntax: [ label ] BTFSC f,b[,a] Operands: 0 ≤ f ≤ 255 0 ≤ b ≤ 7 a ∈ [0,1] Operation: skip if (f) = 0 Status Affected: None Encoding: 1011 bbba ffff ffff Description: If bit ‘b’ in register ‘f’ is ‘0’, then the next instruction is skipped. If bit ‘b’ is ‘0’, then the next instruction fetched during the current instruction execution is discarded and a NOP is executed instead, making this a two-cycle instruction. If ‘a’ is ‘0’, the Access Bank will be selected, overriding the BSR value. If ‘a’ = 1, then the bank will be selected as per the BSR value (default). Words: 1 Cycles: 1(2) Note: 3 cycles if skip and followed by a 2-word instruction. Q Cycle Activity: Q1 Q2 Q3 Q4 Decode Read register ‘f’ Process Data No operation If skip: Q1 Q2 Q3 Q4 No operation No operation No operation No operation If skip and followed by 2-word instruction: Q1 Q2 Q3 Q4 No operation No operation No operation No operation No operation No operation No operation No operation Example: HERE FALSE TRUE BTFSC : : FLAG, 1 Before Instruction PC = address (HERE) After Instruction If FLAG<1> = 0; PC = address (TRUE) If FLAG<1> = 1; PC = address (FALSE) BTFSS Bit Test File, Skip if Set Syntax: [ label ] BTFSS f,b[,a] Operands: 0 ≤ f ≤ 255 0 ≤ b < 7 a ∈ [0,1] Operation: skip if (f) = 1 Status Affected: None Encoding: 1010 bbba ffff ffff Description: If bit ‘b’ in register ‘f’ is ‘1’, then the next instruction is skipped. If bit ‘b’ is ‘1’, then the next instruction fetched during the current instruction execution is discarded and a NOP is executed instead, making this a two-cycle instruction. If ‘a’ is ‘0’, the Access Bank will be selected, overriding the BSR value. If ‘a’ = 1, then the bank will be selected as per the BSR value (default). Words: 1 Cycles: 1(2) Note: 3 cycles if skip and followed by a 2-word instruction. Q Cycle Activity: Q1 Q2 Q3 Q4 Decode Read register ‘f’ Process Data No operation If skip: Q1 Q2 Q3 Q4 No operation No operation No operation No operation If skip and followed by 2-word instruction: Q1 Q2 Q3 Q4 No operation No operation No operation No operation No operation No operation No operation No operation Example: HERE FALSE TRUE BTFSS : : FLAG, 1 Before Instruction PC = address (HERE) After Instruction If FLAG<1> = 0; PC = address (FALSE) If FLAG<1> = 1; PC = address (TRUE)© 2007 Microchip Technology Inc. DS39605F-page 205 PIC18F1220/1320 BTG Bit Toggle f Syntax: [ label ] BTG f,b[,a] Operands: 0 ≤ f ≤ 255 0 ≤ b < 7 a ∈ [0,1] Operation: (f) → f Status Affected: None Encoding: 0111 bbba ffff ffff Description: Bit ‘b’ in data memory location ‘f’ is inverted. If ‘a’ is ‘0’, the Access Bank will be selected, overriding the BSR value. If ‘a’ = 1, then the bank will be selected as per the BSR value (default). Words: 1 Cycles: 1 Q Cycle Activity: Q1 Q2 Q3 Q4 Decode Read register ‘f’ Process Data Write register ‘f’ Example: BTG PORTB, 4 Before Instruction: PORTB = 0111 0101 [0x75] After Instruction: PORTB = 0110 0101 [0x65] BOV Branch if Overflow Syntax: [ label ] BOV n Operands: -128 ≤ n ≤ 127 Operation: if Overflow bit is ‘1’ (PC) + 2 + 2n → PC Status Affected: None Encoding: 1110 0100 nnnn nnnn Description: If the Overflow bit is ‘1’, then the program will branch. The 2’s complement number ‘2n’ is added to the PC. Since the PC will have incremented to fetch the next instruction, the new address will be PC + 2 + 2n. This instruction is then a two-cycle instruction. Words: 1 Cycles: 1(2) Q Cycle Activity: If Jump: Q1 Q2 Q3 Q4 Decode Read literal ‘n’ Process Data Write to PC No operation No operation No operation No operation If No Jump: Q1 Q2 Q3 Q4 Decode Read literal ‘n’ Process Data No operation Example: HERE BOV JUMP Before Instruction PC = address (HERE) After Instruction If Overflow = 1; PC = address (JUMP) If Overflow = 0; PC = address (HERE + 2)PIC18F1220/1320 DS39605F-page 206 © 2007 Microchip Technology Inc. BZ Branch if Zero Syntax: [ label ] BZ n Operands: -128 ≤ n ≤ 127 Operation: if Zero bit is ‘1’ (PC) + 2 + 2n → PC Status Affected: None Encoding: 1110 0000 nnnn nnnn Description: If the Zero bit is ‘1’, then the program will branch. The 2’s complement number ‘2n’ is added to the PC. Since the PC will have incremented to fetch the next instruction, the new address will be PC + 2 + 2n. This instruction is then a two-cycle instruction. Words: 1 Cycles: 1(2) Q Cycle Activity: If Jump: Q1 Q2 Q3 Q4 Decode Read literal ‘n’ Process Data Write to PC No operation No operation No operation No operation If No Jump: Q1 Q2 Q3 Q4 Decode Read literal ‘n’ Process Data No operation Example: HERE BZ Jump Before Instruction PC = address (HERE) After Instruction If Zero = 1; PC = address (Jump) If Zero = 0; PC = address (HERE + 2) CALL Subroutine Call Syntax: [ label ] CALL k [,s] Operands: 0 ≤ k ≤ 1048575 s ∈ [0,1] Operation: (PC) + 4 → TOS, k → PC<20:1>, if s = 1 (W) → WS, (Status) → STATUSS, (BSR) → BSRS Status Affected: None Encoding: 1st word (k<7:0>) 2nd word(k<19:8>) 1110 1111 110s k19kkk k7kkk kkkk kkkk0 kkkk8 Description: Subroutine call of entire 2-Mbyte memory range. First, return address (PC + 4) is pushed onto the return stack. If ‘s’ = 1, the W, Status and BSR registers are also pushed into their respective shadow registers, WS, STATUSS and BSRS. If ‘s’ = 0, no update occurs (default). Then, the 20-bit value ‘k’ is loaded into PC<20:1>. CALL is a two-cycle instruction. Words: 2 Cycles: 2 Q Cycle Activity: Q1 Q2 Q3 Q4 Decode Read literal ‘k’<7:0>, Push PC to stack Read literal ‘k’<19:8>, Write to PC No operation No operation No operation No operation Example: HERE CALL THERE, FAST Before Instruction PC = address (HERE) After Instruction PC = address (THERE) TOS = address (HERE + 4) WS = W BSRS = BSR STATUSS = Status© 2007 Microchip Technology Inc. DS39605F-page 207 PIC18F1220/1320 CLRF Clear f Syntax: [ label ] CLRF f [,a] Operands: 0 ≤ f ≤ 255 a ∈ [0,1] Operation: 000h → f 1 → Z Status Affected: Z Encoding: 0110 101a ffff ffff Description: Clears the contents of the specified register. If ‘a’ is ‘0’, the Access Bank will be selected, overriding the BSR value. If ‘a’ = 1, then the bank will be selected as per the BSR value (default). Words: 1 Cycles: 1 Q Cycle Activity: Q1 Q2 Q3 Q4 Decode Read register ‘f’ Process Data Write register ‘f’ Example: CLRF FLAG_REG Before Instruction FLAG_REG = 0x5A After Instruction FLAG_REG = 0x00 CLRWDT Clear Watchdog Timer Syntax: [ label ] CLRWDT Operands: None Operation: 000h → WDT, 000h → WDT postscaler, 1 → TO, 1 → PD Status Affected: TO, PD Encoding: 0000 0000 0000 0100 Description: CLRWDT instruction resets the Watchdog Timer. It also resets the postscaler of the WDT. Status bits, TO and PD, are set. Words: 1 Cycles: 1 Q Cycle Activity: Q1 Q2 Q3 Q4 Decode No operation Process Data No operation Example: CLRWDT Before Instruction WDT Counter = ? After Instruction WDT Counter = 0x00 WDT Postscaler = 0 TO = 1 PD = 1PIC18F1220/1320 DS39605F-page 208 © 2007 Microchip Technology Inc. COMF Complement f Syntax: [ label ] COMF f [,d [,a]] Operands: 0 ≤ f ≤ 255 d ∈ [0,1] a ∈ [0,1] Operation: (f) → dest Status Affected: N, Z Encoding: 0001 11da ffff ffff Description: The contents of register ‘f’ are complemented. If ‘d’ is ‘0’, the result is stored in W. If ‘d’ is ‘1’, the result is stored back in register ‘f’ (default). If ‘a’ is ‘0’, the Access Bank will be selected, overriding the BSR value. If ‘a’ = 1, then the bank will be selected as per the BSR value (default). Words: 1 Cycles: 1 Q Cycle Activity: Q1 Q2 Q3 Q4 Decode Read register ‘f’ Process Data Write to destination Example: COMF REG, W Before Instruction REG = 0x13 After Instruction REG = 0x13 W = 0xEC CPFSEQ Compare f with W, skip if f = W Syntax: [ label ] CPFSEQ f [,a] Operands: 0 ≤ f ≤ 255 a ∈ [0,1] Operation: (f) – (W), skip if (f) = (W) (unsigned comparison) Status Affected: None Encoding: 0110 001a ffff ffff Description: Compares the contents of data memory location ‘f’ to the contents of W by performing an unsigned subtraction. If ‘f’ = W, then the fetched instruction is discarded and a NOP is executed instead, making this a two-cycle instruction. If ‘a’ is ‘0’, the Access Bank will be selected, overriding the BSR value. If ‘a’ = 1, then the bank will be selected as per the BSR value (default). Words: 1 Cycles: 1(2) Note: 3 cycles if skip and followed by a 2-word instruction. Q Cycle Activity: Q1 Q2 Q3 Q4 Decode Read register ‘f’ Process Data No operation If skip: Q1 Q2 Q3 Q4 No operation No operation No operation No operation If skip and followed by 2-word instruction: Q1 Q2 Q3 Q4 No operation No operation No operation No operation No operation No operation No operation No operation Example: HERE CPFSEQ REG NEQUAL : EQUAL : Before Instruction PC Address = HERE W =? REG = ? After Instruction If REG = W; PC = Address (EQUAL) If REG ≠ W; PC = Address (NEQUAL)© 2007 Microchip Technology Inc. DS39605F-page 209 PIC18F1220/1320 CPFSGT Compare f with W, skip if f > W Syntax: [ label ] CPFSGT f [,a] Operands: 0 ≤ f ≤ 255 a ∈ [0,1] Operation: (f) – (W), skip if (f) > (W) (unsigned comparison) Status Affected: None Encoding: 0110 010a ffff ffff Description: Compares the contents of data memory location ‘f’ to the contents of W by performing an unsigned subtraction. If the contents of ‘f’ are greater than the contents of WREG, then the fetched instruction is discarded and a NOP is executed instead, making this a two-cycle instruction. If ‘a’ is ‘0’, the Access Bank will be selected, overriding the BSR value. If ‘a’ = 1, then the bank will be selected as per the BSR value (default). Words: 1 Cycles: 1(2) Note: 3 cycles if skip and followed by a 2-word instruction. Q Cycle Activity: Q1 Q2 Q3 Q4 Decode Read register ‘f’ Process Data No operation If skip: Q1 Q2 Q3 Q4 No operation No operation No operation No operation If skip and followed by 2-word instruction: Q1 Q2 Q3 Q4 No operation No operation No operation No operation No operation No operation No operation No operation Example: HERE CPFSGT REG NGREATER : GREATER : Before Instruction PC = Address (HERE) W = ? After Instruction If REG > W; PC = Address (GREATER) If REG ≤ W; PC = Address (NGREATER) CPFSLT Compare f with W, skip if f < W Syntax: [ label ] CPFSLT f [,a] Operands: 0 ≤ f ≤ 255 a ∈ [0,1] Operation: (f) – (W), skip if (f) < (W) (unsigned comparison) Status Affected: None Encoding: 0110 000a ffff ffff Description: Compares the contents of data memory location ‘f’ to the contents of W by performing an unsigned subtraction. If the contents of ‘f’ are less than the contents of W, then the fetched instruction is discarded and a NOP is executed instead, making this a two-cycle instruction. If ‘a’ is ‘0’, the Access Bank will be selected. If ‘a’ is ‘1’, the BSR will not be overridden (default). Words: 1 Cycles: 1(2) Note: 3 cycles if skip and followed by a 2-word instruction. Q Cycle Activity: Q1 Q2 Q3 Q4 Decode Read register ‘f’ Process Data No operation If skip: Q1 Q2 Q3 Q4 No operation No operation No operation No operation If skip and followed by 2-word instruction: Q1 Q2 Q3 Q4 No operation No operation No operation No operation No operation No operation No operation No operation Example: HERE CPFSLT REG NLESS : LESS : Before Instruction PC = Address (HERE) W = ? After Instruction If REG < W; PC = Address (LESS) If REG ≥ W; PC = Address (NLESS)PIC18F1220/1320 DS39605F-page 210 © 2007 Microchip Technology Inc. DAW Decimal Adjust W Register Syntax: [ label ] DAW Operands: None Operation: If [W<3:0> > 9] or [DC = 1] then (W<3:0>) + 6 → W<3:0>; else (W<3:0>) → W<3:0>; If [W<7:4> > 9] or [C = 1] then (W<7:4>) + 6 → W<7:4>; else (W<7:4>) → W<7:4>; Status Affected: C, DC Encoding: 0000 0000 0000 0111 Description: DAW adjusts the eight-bit value in W, resulting from the earlier addition of two variables (each in packed BCD format) and produces a correct packed BCD result. The Carry bit may be set by DAW regardless of its setting prior to the DAW instruction. Words: 1 Cycles: 1 Q Cycle Activity: Q1 Q2 Q3 Q4 Decode Read register W Process Data Write W Example 1: DAW Before Instruction W = 0xA5 C =0 DC = 0 After Instruction W = 0x05 C =1 DC = 0 Example 2: Before Instruction W = 0xCE C =0 DC = 0 After Instruction W = 0x34 C =1 DC = 0 DECF Decrement f Syntax: [ label ] DECF f [,d [,a]] Operands: 0 ≤ f ≤ 255 d ∈ [0,1] a ∈ [0,1] Operation: (f) – 1 → dest Status Affected: C, DC, N, OV, Z Encoding: 0000 01da ffff ffff Description: Decrement register ‘f’. If ‘d’ is ‘0’, the result is stored in W. If ‘d’ is ‘1’, the result is stored back in register ‘f’ (default). If ‘a’ is ‘0’, the Access Bank will be selected, overriding the BSR value. If ‘a’ = 1, then the bank will be selected as per the BSR value (default). Words: 1 Cycles: 1 Q Cycle Activity: Q1 Q2 Q3 Q4 Decode Read register ‘f’ Process Data Write to destination Example: DECF CNT Before Instruction CNT = 0x01 Z =0 After Instruction CNT = 0x00 Z =1© 2007 Microchip Technology Inc. DS39605F-page 211 PIC18F1220/1320 DECFSZ Decrement f, skip if 0 Syntax: [ label ] DECFSZ f [,d [,a]] Operands: 0 ≤ f ≤ 255 d ∈ [0,1] a ∈ [0,1] Operation: (f) – 1 → dest, skip if result = 0 Status Affected: None Encoding: 0010 11da ffff ffff Description: The contents of register ‘f’ are decremented. If ‘d’ is ‘0’, the result is placed in W. If ‘d’ is ‘1’, the result is placed back in register ‘f’ (default). If the result is ‘0’, the next instruction, which is already fetched, is discarded and a NOP is executed instead, making it a two-cycle instruction. If ‘a’ is ‘0’, the Access Bank will be selected, overriding the BSR value. If ‘a’ = 1, then the bank will be selected as per the BSR value (default). Words: 1 Cycles: 1(2) Note: 3 cycles if skip and followed by a 2-word instruction. Q Cycle Activity: Q1 Q2 Q3 Q4 Decode Read register ‘f’ Process Data Write to destination If skip: Q1 Q2 Q3 Q4 No operation No operation No operation No operation If skip and followed by 2-word instruction: Q1 Q2 Q3 Q4 No operation No operation No operation No operation No operation No operation No operation No operation Example: HERE DECFSZ CNT GOTO LOOP CONTINUE Before Instruction PC = Address (HERE) After Instruction CNT = CNT – 1 If CNT = 0; PC = Address (CONTINUE) If CNT ≠ 0; PC = Address (HERE + 2) DCFSNZ Decrement f, skip if not 0 Syntax: [ label ] DCFSNZ f [,d [,a]] Operands: 0 ≤ f ≤ 255 d ∈ [0,1] a ∈ [0,1] Operation: (f) – 1 → dest, skip if result ≠ 0 Status Affected: None Encoding: 0100 11da ffff ffff Description: The contents of register ‘f’ are decremented. If ‘d’ is ‘0’, the result is placed in W. If ‘d’ is ‘1’, the result is placed back in register ‘f’ (default). If the result is not ‘0’, the next instruction, which is already fetched, is discarded and a NOP is executed instead, making it a twocycle instruction. If ‘a’ is ‘0’, the Access Bank will be selected, overriding the BSR value. If ‘a’ = 1, then the bank will be selected as per the BSR value (default). Words: 1 Cycles: 1(2) Note: 3 cycles if skip and followed by a 2-word instruction. Q Cycle Activity: Q1 Q2 Q3 Q4 Decode Read register ‘f’ Process Data Write to destination If skip: Q1 Q2 Q3 Q4 No operation No operation No operation No operation If skip and followed by 2-word instruction: Q1 Q2 Q3 Q4 No operation No operation No operation No operation No operation No operation No operation No operation Example: HERE DCFSNZ TEMP ZERO : NZERO : Before Instruction TEMP = ? After Instruction TEMP = TEMP – 1, If TEMP = 0; PC = Address (ZERO) If TEMP ≠ 0; PC = Address (NZERO)PIC18F1220/1320 DS39605F-page 212 © 2007 Microchip Technology Inc. GOTO Unconditional Branch Syntax: [ label ] GOTO k Operands: 0 ≤ k ≤ 1048575 Operation: k → PC<20:1> Status Affected: None Encoding: 1st word (k<7:0>) 2nd word(k<19:8>) 1110 1111 1111 k19kkk k7kkk kkkk kkkk0 kkkk8 Description: GOTO allows an unconditional branch anywhere within the entire 2-Mbyte memory range. The 20-bit value ‘k’ is loaded into PC<20:1>. GOTO is always a two-cycle instruction. Words: 2 Cycles: 2 Q Cycle Activity: Q1 Q2 Q3 Q4 Decode Read literal ‘k’<7:0>, No operation Read literal ‘k’<19:8>, Write to PC No operation No operation No operation No operation Example: GOTO THERE After Instruction PC = Address (THERE) INCF Increment f Syntax: [ label ] INCF f [,d [,a]] Operands: 0 ≤ f ≤ 255 d ∈ [0,1] a ∈ [0,1] Operation: (f) + 1 → dest Status Affected: C, DC, N, OV, Z Encoding: 0010 10da ffff ffff Description: The contents of register ‘f’ are incremented. If ‘d’ is ‘0’, the result is placed in W. If ‘d’ is ‘1’, the result is placed back in register ‘f’ (default). If ‘a’ is ‘0’, the Access Bank will be selected, overriding the BSR value. If ‘a’ = 1, then the bank will be selected as per the BSR value (default). Words: 1 Cycles: 1 Q Cycle Activity: Q1 Q2 Q3 Q4 Decode Read register ‘f’ Process Data Write to destination Example: INCF CNT Before Instruction CNT = 0xFF Z =0 C =? DC = ? After Instruction CNT = 0x00 Z =1 C =1 DC = 1© 2007 Microchip Technology Inc. DS39605F-page 213 PIC18F1220/1320 INCFSZ Increment f, skip if 0 Syntax: [ label ] INCFSZ f [,d [,a]] Operands: 0 ≤ f ≤ 255 d ∈ [0,1] a ∈ [0,1] Operation: (f) + 1 → dest, skip if result = 0 Status Affected: None Encoding: 0011 11da ffff ffff Description: The contents of register ‘f’ are incremented. If ‘d’ is ‘0’, the result is placed in W. If ‘d’ is ‘1’, the result is placed back in register ‘f’ (default). If the result is ‘0’, the next instruction, which is already fetched, is discarded and a NOP is executed instead, making it a two-cycle instruction. If ‘a’ is ‘0’, the Access Bank will be selected, overriding the BSR value. If ‘a’ = 1, then the bank will be selected as per the BSR value (default). Words: 1 Cycles: 1(2) Note: 3 cycles if skip and followed by a 2-word instruction. Q Cycle Activity: Q1 Q2 Q3 Q4 Decode Read register ‘f’ Process Data Write to destination If skip: Q1 Q2 Q3 Q4 No operation No operation No operation No operation If skip and followed by 2-word instruction: Q1 Q2 Q3 Q4 No operation No operation No operation No operation No operation No operation No operation No operation Example: HERE INCFSZ CNT NZERO : ZERO : Before Instruction PC = Address (HERE) After Instruction CNT = CNT + 1 If CNT = 0; PC = Address (ZERO) If CNT ≠ 0; PC = Address (NZERO) INFSNZ Increment f, skip if not 0 Syntax: [ label ] INFSNZ f [,d [,a]] Operands: 0 ≤ f ≤ 255 d ∈ [0,1] a ∈ [0,1] Operation: (f) + 1 → dest, skip if result ≠ 0 Status Affected: None Encoding: 0100 10da ffff ffff Description: The contents of register ‘f’ are incremented. If ‘d’ is ‘0’, the result is placed in W. If ‘d’ is ‘1’, the result is placed back in register ‘f’ (default). If the result is not ‘0’, the next instruction, which is already fetched, is discarded and a NOP is executed instead, making it a two-cycle instruction. If ‘a’ is ‘0’, the Access Bank will be selected, overriding the BSR value. If ‘a’ = 1, then the bank will be selected as per the BSR value (default). Words: 1 Cycles: 1(2) Note: 3 cycles if skip and followed by a 2-word instruction. Q Cycle Activity: Q1 Q2 Q3 Q4 Decode Read register ‘f’ Process Data Write to destination If skip: Q1 Q2 Q3 Q4 No operation No operation No operation No operation If skip and followed by 2-word instruction: Q1 Q2 Q3 Q4 No operation No operation No operation No operation No operation No operation No operation No operation Example: HERE INFSNZ REG ZERO NZERO Before Instruction PC = Address (HERE) After Instruction REG = REG + 1 If REG ≠ 0; PC = Address (NZERO) If REG = 0; PC = Address (ZERO)PIC18F1220/1320 DS39605F-page 214 © 2007 Microchip Technology Inc. IORLW Inclusive OR literal with W Syntax: [ label ] IORLW k Operands: 0 ≤ k ≤ 255 Operation: (W) .OR. k → W Status Affected: N, Z Encoding: 0000 1001 kkkk kkkk Description: The contents of W are OR’ed with the eight-bit literal ‘k’. The result is placed in W. Words: 1 Cycles: 1 Q Cycle Activity: Q1 Q2 Q3 Q4 Decode Read literal ‘k’ Process Data Write to W Example: IORLW 0x35 Before Instruction W = 0x9A After Instruction W = 0xBF IORWF Inclusive OR W with f Syntax: [ label ] IORWF f [,d [,a]] Operands: 0 ≤ f ≤ 255 d ∈ [0,1] a ∈ [0,1] Operation: (W) .OR. (f) → dest Status Affected: N, Z Encoding: 0001 00da ffff ffff Description: Inclusive OR W with register ‘f’. If ‘d’ is ‘0’, the result is placed in W. If ‘d’ is ‘1’, the result is placed back in register ‘f’ (default). If ‘a’ is ‘0’, the Access Bank will be selected, overriding the BSR value. If ‘a’ = 1, then the bank will be selected as per the BSR value (default). Words: 1 Cycles: 1 Q Cycle Activity: Q1 Q2 Q3 Q4 Decode Read register ‘f’ Process Data Write to destination Example: IORWF RESULT, W Before Instruction RESULT = 0x13 W = 0x91 After Instruction RESULT = 0x13 W = 0x93© 2007 Microchip Technology Inc. DS39605F-page 215 PIC18F1220/1320 LFSR Load FSR Syntax: [ label ] LFSR f,k Operands: 0 ≤ f ≤ 2 0 ≤ k ≤ 4095 Operation: k → FSRf Status Affected: None Encoding: 1110 1111 1110 0000 00ff k7kkk k11kkk kkkk Description: The 12-bit literal ‘k’ is loaded into the file select register pointed to by ‘f’. Words: 2 Cycles: 2 Q Cycle Activity: Q1 Q2 Q3 Q4 Decode Read literal ‘k’ MSB Process Data Write literal ‘k’ MSB to FSRfH Decode Read literal ‘k’ LSB Process Data Write literal ‘k’ to FSRfL Example: LFSR 2, 0x3AB After Instruction FSR2H = 0x03 FSR2L = 0xAB MOVF Move f Syntax: [ label ] MOVF f [,d [,a]] Operands: 0 ≤ f ≤ 255 d ∈ [0,1] a ∈ [0,1] Operation: f → dest Status Affected: N, Z Encoding: 0101 00da ffff ffff Description: The contents of register ‘f’ are moved to a destination dependent upon the status of ‘d’. If ‘d’ is ‘f’, the result is placed in W. If ‘d’ is ‘f’, the result is placed back in register ‘f’ (default). Location ‘f’ can be anywhere in the 256-byte bank. If ‘a’ is ‘0’, the Access Bank will be selected, overriding the BSR value. If ‘a’ = 1, then the bank will be selected as per the BSR value (default). Words: 1 Cycles: 1 Q Cycle Activity: Q1 Q2 Q3 Q4 Decode Read register ‘f’ Process Data Write W Example: MOVF REG, W Before Instruction REG = 0x22 W = 0xFF After Instruction REG = 0x22 W = 0x22PIC18F1220/1320 DS39605F-page 216 © 2007 Microchip Technology Inc. MOVFF Move f to f Syntax: [ label ] MOVFF fs,fd Operands: 0 ≤ fs ≤ 4095 0 ≤ fd ≤ 4095 Operation: (fs) → fd Status Affected: None Encoding: 1st word (source) 2nd word (destin.) 1100 1111 ffff ffff ffff ffff ffffs ffffd Description: The contents of source register ‘fs’ are moved to destination register ‘fd’. Location of source ‘fs’ can be anywhere in the 4096-byte data space (000h to FFFh) and location of destination ‘fd’ can also be anywhere from 000h to FFFh. Either source or destination can be W (a useful special situation). MOVFF is particularly useful for transferring a data memory location to a peripheral register (such as the transmit buffer or an I/O port). The MOVFF instruction cannot use the PCL, TOSU, TOSH or TOSL as the destination register. The MOVFF instruction should not be used to modify interrupt settings while any interrupt is enabled (see page 73). Words: 2 Cycles: 2 (3) Q Cycle Activity: Q1 Q2 Q3 Q4 Decode Read register ‘f’ (src) Process Data No operation Decode No operation No dummy read No operation Write register ‘f’ (dest) Example: MOVFF REG1, REG2 Before Instruction REG1 = 0x33 REG2 = 0x11 After Instruction REG1 = 0x33, REG2 = 0x33 MOVLB Move literal to low nibble in BSR Syntax: [ label ] MOVLB k Operands: 0 ≤ k ≤ 255 Operation: k → BSR Status Affected: None Encoding: 0000 0001 kkkk kkkk Description: The 8-bit literal ‘k’ is loaded into the Bank Select Register (BSR). Words: 1 Cycles: 1 Q Cycle Activity: Q1 Q2 Q3 Q4 Decode Read literal ‘k’ Process Data Write literal ‘k’ to BSR Example: MOVLB 5 Before Instruction BSR register = 0x02 After Instruction BSR register = 0x05© 2007 Microchip Technology Inc. DS39605F-page 217 PIC18F1220/1320 MOVLW Move literal to W Syntax: [ label ] MOVLW k Operands: 0 ≤ k ≤ 255 Operation: k → W Status Affected: None Encoding: 0000 1110 kkkk kkkk Description: The eight-bit literal ‘k’ is loaded into W. Words: 1 Cycles: 1 Q Cycle Activity: Q1 Q2 Q3 Q4 Decode Read literal ‘k’ Process Data Write to W Example: MOVLW 0x5A After Instruction W = 0x5A MOVWF Move W to f Syntax: [ label ] MOVWF f [,a] Operands: 0 ≤ f ≤ 255 a ∈ [0,1] Operation: (W) → f Status Affected: None Encoding: 0110 111a ffff ffff Description: Move data from W to register ‘f’. Location ‘f’ can be anywhere in the 256-byte bank. If ‘a’ is ‘0’, the Access Bank will be selected, overriding the BSR value. If ‘a’ = 1, then the bank will be selected as per the BSR value (default). Words: 1 Cycles: 1 Q Cycle Activity: Q1 Q2 Q3 Q4 Decode Read register ‘f’ Process Data Write register ‘f’ Example: MOVWF REG Before Instruction W = 0x4F REG = 0xFF After Instruction W = 0x4F REG = 0x4FPIC18F1220/1320 DS39605F-page 218 © 2007 Microchip Technology Inc. MULLW Multiply Literal with W Syntax: [ label ] MULLW k Operands: 0 ≤ k ≤ 255 Operation: (W) x k → PRODH:PRODL Status Affected: None Encoding: 0000 1101 kkkk kkkk Description: An unsigned multiplication is carried out between the contents of W and the 8-bit literal ‘k’. The 16-bit result is placed in the PRODH:PRODL register pair. PRODH contains the high byte. W is unchanged. None of the Status flags are affected. Note that neither Overflow nor Carry is possible in this operation. A Zero result is possible but not detected. Words: 1 Cycles: 1 Q Cycle Activity: Q1 Q2 Q3 Q4 Decode Read literal ‘k’ Process Data Write registers PRODH: PRODL Example: MULLW 0xC4 Before Instruction W = 0xE2 PRODH = ? PRODL = ? After Instruction W = 0xE2 PRODH = 0xAD PRODL = 0x08 MULWF Multiply W with f Syntax: [ label ] MULWF f [,a] Operands: 0 ≤ f ≤ 255 a ∈ [0,1] Operation: (W) x (f) → PRODH:PRODL Status Affected: None Encoding: 0000 001a ffff ffff Description: An unsigned multiplication is carried out between the contents of W and the register file location ‘f’. The 16-bit result is stored in the PRODH:PRODL register pair. PRODH contains the high byte. Both W and ‘f’ are unchanged. None of the Status flags are affected. Note that neither Overflow nor Carry is possible in this operation. A Zero result is possible, but not detected. If ‘a’ is ‘0’, the Access Bank will be selected, overriding the BSR value. If ‘a’ = 1, then the bank will be selected as per the BSR value (default). Words: 1 Cycles: 1 Q Cycle Activity: Q1 Q2 Q3 Q4 Decode Read register ‘f’ Process Data Write registers PRODH: PRODL Example: MULWF REG Before Instruction W = 0xC4 REG = 0xB5 PRODH = ? PRODL = ? After Instruction W = 0xC4 REG = 0xB5 PRODH = 0x8A PRODL = 0x94© 2007 Microchip Technology Inc. DS39605F-page 219 PIC18F1220/1320 NEGF Negate f Syntax: [ label ] NEGF f [,a] Operands: 0 ≤ f ≤ 255 a ∈ [0,1] Operation: (f) + 1 → f Status Affected: N, OV, C, DC, Z Encoding: 0110 110a ffff ffff Description: Location ‘f’ is negated using two’s complement. The result is placed in the data memory location ‘f’. If ‘a’ is ‘0’, the Access Bank will be selected, overriding the BSR value. If ‘a’ = 1, then the bank will be selected as per the BSR value. Words: 1 Cycles: 1 Q Cycle Activity: Q1 Q2 Q3 Q4 Decode Read register ‘f’ Process Data Write register ‘f’ Example: NEGF REG, 1 Before Instruction REG = 0011 1010 [0x3A] After Instruction REG = 1100 0110 [0xC6] NOP No Operation Syntax: [ label ] NOP Operands: None Operation: No operation Status Affected: None Encoding: 0000 1111 0000 xxxx 0000 xxxx 0000 xxxx Description: No operation. Words: 1 Cycles: 1 Q Cycle Activity: Q1 Q2 Q3 Q4 Decode No operation No operation No operation Example: None.PIC18F1220/1320 DS39605F-page 220 © 2007 Microchip Technology Inc. POP Pop Top of Return Stack Syntax: [ label ] POP Operands: None Operation: (TOS) → bit bucket Status Affected: None Encoding: 0000 0000 0000 0110 Description: The TOS value is pulled off the return stack and is discarded. The TOS value then becomes the previous value that was pushed onto the return stack. This instruction is provided to enable the user to properly manage the return stack to incorporate a software stack. Words: 1 Cycles: 1 Q Cycle Activity: Q1 Q2 Q3 Q4 Decode No operation Pop TOS value No operation Example: POP GOTO NEW Before Instruction TOS = 0x0031A2 Stack (1 level down) = 0x014332 After Instruction TOS = 0x014332 PC = NEW PUSH Push Top of Return Stack Syntax: [ label ] PUSH Operands: None Operation: (PC + 2) → TOS Status Affected: None Encoding: 0000 0000 0000 0101 Description: The PC + 2 is pushed onto the top of the return stack. The previous TOS value is pushed down on the stack. This instruction allows implementing a software stack by modifying TOS and then pushing it onto the return stack. Words: 1 Cycles: 1 Q Cycle Activity: Q1 Q2 Q3 Q4 Decode Push PC + 2 onto return stack No operation No operation Example: PUSH Before Instruction TOS = 0x00345A PC = 0x000124 After Instruction PC = 0x000126 TOS = 0x000126 Stack (1 level down) = 0x00345A© 2007 Microchip Technology Inc. DS39605F-page 221 PIC18F1220/1320 RCALL Relative Call Syntax: [ label ] RCALL n Operands: -1024 ≤ n ≤ 1023 Operation: (PC) + 2 → TOS, (PC) + 2 + 2n → PC Status Affected: None Encoding: 1101 1nnn nnnn nnnn Description: Subroutine call with a jump up to 1K from the current location. First, return address (PC + 2) is pushed onto the stack. Then, add the 2’s complement number ‘2n’ to the PC. Since the PC will have incremented to fetch the next instruction, the new address will be PC + 2 + 2n. This instruction is a two-cycle instruction. Words: 1 Cycles: 2 Q Cycle Activity: Q1 Q2 Q3 Q4 Decode Read literal ‘n’ Push PC to stack Process Data Write to PC No operation No operation No operation No operation Example: HERE RCALL Jump Before Instruction PC = Address (HERE) After Instruction PC = Address (Jump) TOS = Address (HERE + 2) RESET Reset Syntax: [ label ] RESET Operands: None Operation: Reset all registers and flags that are affected by a MCLR Reset. Status Affected: All Encoding: 0000 0000 1111 1111 Description: This instruction provides a way to execute a MCLR Reset in software. Words: 1 Cycles: 1 Q Cycle Activity: Q1 Q2 Q3 Q4 Decode Start Reset No operation No operation Example: RESET After Instruction Registers = Reset Value Flags* = Reset ValuePIC18F1220/1320 DS39605F-page 222 © 2007 Microchip Technology Inc. RETFIE Return from Interrupt Syntax: [ label ] RETFIE [s] Operands: s ∈ [0,1] Operation: (TOS) → PC, 1 → GIE/GIEH or PEIE/GIEL, if s = 1 (WS) → W, (STATUSS) → Status, (BSRS) → BSR, PCLATU, PCLATH are unchanged. Status Affected: GIE/GIEH, PEIE/GIEL. Encoding: 0000 0000 0001 000s Description: Return from interrupt. Stack is popped and Top-of-Stack (TOS) is loaded into the PC. Interrupts are enabled by setting either the high or low priority global interrupt enable bit. If ‘s’ = 1, the contents of the shadow registers, WS, STATUSS and BSRS, are loaded into their corresponding registers, W, Status and BSR. If ‘s’ = 0, no update of these registers occurs (default). Words: 1 Cycles: 2 Q Cycle Activity: Q1 Q2 Q3 Q4 Decode No operation No operation Pop PC from stack Set GIEH or GIEL No operation No operation No operation No operation Example: RETFIE 1 After Interrupt PC = TOS W = WS BSR = BSRS Status = STATUSS GIE/GIEH, PEIE/GIEL = 1 RETLW Return Literal to W Syntax: [ label ] RETLW k Operands: 0 ≤ k ≤ 255 Operation: k → W, (TOS) → PC, PCLATU, PCLATH are unchanged Status Affected: None Encoding: 0000 1100 kkkk kkkk Description: W is loaded with the eight-bit literal ‘k’. The program counter is loaded from the top of the stack (the return address). The high address latch (PCLATH) remains unchanged. Words: 1 Cycles: 2 Q Cycle Activity: Q1 Q2 Q3 Q4 Decode Read literal ‘k’ Process Data Pop PC from stack, Write to W No operation No operation No operation No operation Example: CALL TABLE ; W contains table ; offset value ; W now has ; table value : TABLE ADDWF PCL ; W = offset RETLW k0 ; Begin table RETLW k1 ; : : RETLW kn ; End of table Before Instruction W = 0x07 After Instruction W = value of kn© 2007 Microchip Technology Inc. DS39605F-page 223 PIC18F1220/1320 RETURN Return from Subroutine Syntax: [ label ] RETURN [s] Operands: s ∈ [0,1] Operation: (TOS) → PC, if s = 1 (WS) → W, (STATUSS) → Status, (BSRS) → BSR, PCLATU, PCLATH are unchanged Status Affected: None Encoding: 0000 0000 0001 001s Description: Return from subroutine. The stack is popped and the top of the stack is loaded into the program counter. If ‘s’= 1, the contents of the shadow registers, WS, STATUSS and BSRS, are loaded into their corresponding registers, W, Status and BSR. If ‘s’ = 0, no update of these registers occurs (default). Words: 1 Cycles: 2 Q Cycle Activity: Q1 Q2 Q3 Q4 Decode No operation Process Data Pop PC from stack No operation No operation No operation No operation Example: RETURN After Interrupt PC = TOS RLCF Rotate Left f through Carry Syntax: [ label ] RLCF f [,d [,a]] Operands: 0 ≤ f ≤ 255 d ∈ [0,1] a ∈ [0,1] Operation: (f) → dest, (f<7>) → C, (C) → dest<0> Status Affected: C, N, Z Encoding: 0011 01da ffff ffff Description: The contents of register ‘f’ are rotated one bit to the left through the Carry flag. If ‘d’ is ‘0’, the result is placed in W. If ‘d’ is ‘1’, the result is stored back in register ‘f’ (default). If ‘a’ is ‘0’, the Access Bank will be selected, overriding the BSR value. If ‘a’ = 1, then the bank will be selected as per the BSR value (default). Words: 1 Cycles: 1 Q Cycle Activity: Q1 Q2 Q3 Q4 Decode Read register ‘f’ Process Data Write to destination Example: RLCF REG, W Before Instruction REG = 1110 0110 C =0 After Instruction REG = 1110 0110 W = 1100 1100 C =1 C register fPIC18F1220/1320 DS39605F-page 224 © 2007 Microchip Technology Inc. RLNCF Rotate Left f (no carry) Syntax: [ label ] RLNCF f [,d [,a]] Operands: 0 ≤ f ≤ 255 d ∈ [0,1] a ∈ [0,1] Operation: (f) → dest, (f<7>) → dest<0> Status Affected: N, Z Encoding: 0100 01da ffff ffff Description: The contents of register ‘f’ are rotated one bit to the left. If ‘d’ is ‘0’, the result is placed in W. If ‘d’ is ‘1’, the result is stored back in register ‘f’ (default). If ‘a’ is ‘0’, the Access Bank will be selected, overriding the BSR value. If ‘a’ is ‘1’, then the bank will be selected as per the BSR value (default). Words: 1 Cycles: 1 Q Cycle Activity: Q1 Q2 Q3 Q4 Decode Read register ‘f’ Process Data Write to destination Example: RLNCF REG Before Instruction REG = 1010 1011 After Instruction REG = 0101 0111 register f RRCF Rotate Right f through Carry Syntax: [ label ] RRCF f [,d [,a]] Operands: 0 ≤ f ≤ 255 d ∈ [0,1] a ∈ [0,1] Operation: (f) → dest, (f<0>) → C, (C) → dest<7> Status Affected: C, N, Z Encoding: 0011 00da ffff ffff Description: The contents of register ‘f’ are rotated one bit to the right through the Carry flag. If ‘d’ is ‘0’, the result is placed in W. If ‘d’ is ‘1’, the result is placed back in register ‘f’ (default). If ‘a’ is ‘0’, the Access Bank will be selected, overriding the BSR value. If ‘a’ is ‘1’, then the bank will be selected as per the BSR value (default). Words: 1 Cycles: 1 Q Cycle Activity: Q1 Q2 Q3 Q4 Decode Read register ‘f’ Process Data Write to destination Example: RRCF REG, W Before Instruction REG = 1110 0110 C =0 After Instruction REG = 1110 0110 W = 0111 0011 C =0 C register f© 2007 Microchip Technology Inc. DS39605F-page 225 PIC18F1220/1320 RRNCF Rotate Right f (no carry) Syntax: [ label ] RRNCF f [,d [,a]] Operands: 0 ≤ f ≤ 255 d ∈ [0,1] a ∈ [0,1] Operation: (f) → dest, (f<0>) → dest<7> Status Affected: N, Z Encoding: 0100 00da ffff ffff Description: The contents of register ‘f’ are rotated one bit to the right. If ‘d’ is ‘0’, the result is placed in W. If ‘d’ is ‘1’, the result is placed back in register ‘f’ (default). If ‘a’ is ‘0’, the Access Bank will be selected, overriding the BSR value. If ‘a’ is ‘1’, then the bank will be selected as per the BSR value (default). Words: 1 Cycles: 1 Q Cycle Activity: Q1 Q2 Q3 Q4 Decode Read register ‘f’ Process Data Write to destination Example 1: RRNCF REG, 1, 0 Before Instruction REG = 1101 0111 After Instruction REG = 1110 1011 Example 2: RRNCF REG, W Before Instruction W =? REG = 1101 0111 After Instruction W = 1110 1011 REG = 1101 0111 register f SETF Set f Syntax: [ label ] SETF f [,a] Operands: 0 ≤ f ≤ 255 a ∈ [0,1] Operation: FFh → f Status Affected: None Encoding: 0110 100a ffff ffff Description: The contents of the specified register are set to FFh. If ‘a’ is ‘0’, the Access Bank will be selected, overriding the BSR value. If ‘a’ is ‘1’, then the bank will be selected as per the BSR value (default). Words: 1 Cycles: 1 Q Cycle Activity: Q1 Q2 Q3 Q4 Decode Read register ‘f’ Process Data Write register ‘f’ Example: SETF REG Before Instruction REG = 0x5A After Instruction REG = 0xFFPIC18F1220/1320 DS39605F-page 226 © 2007 Microchip Technology Inc. SLEEP Enter Sleep mode Syntax: [ label ] SLEEP Operands: None Operation: 00h → WDT, 0 → WDT postscaler, 1 → TO, 0 → PD Status Affected: TO, PD Encoding: 0000 0000 0000 0011 Description: The Power-down status bit (PD) is cleared. The Time-out status bit (TO) is set. The Watchdog Timer and its postscaler are cleared. The processor is put into Sleep mode with the oscillator stopped. Words: 1 Cycles: 1 Q Cycle Activity: Q1 Q2 Q3 Q4 Decode No operation Process Data Go to Sleep Example: SLEEP Before Instruction TO = ? PD = ? After Instruction TO = 1 † PD = 0 † If WDT causes wake-up, this bit is cleared. SUBFWB Subtract f from W with borrow Syntax: [ label ] SUBFWB f [,d [,a]] Operands: 0 ≤ f ≤ 255 d ∈ [0,1] a ∈ [0,1] Operation: (W) – (f) – (C) → dest Status Affected: N, OV, C, DC, Z Encoding: 0101 01da ffff ffff Description: Subtract register ‘f’ and Carry flag (borrow) from W (2’s complement method). If ‘d’ is ‘0’, the result is stored in W. If ‘d’ is ‘1’, the result is stored in register ‘f’ (default). If ‘a’ is ‘0’, the Access Bank will be selected, overriding the BSR value. If ‘a’ is ‘1’, then the bank will be selected as per the BSR value (default). Words: 1 Cycles: 1 Q Cycle Activity: Q1 Q2 Q3 Q4 Decode Read register ‘f’ Process Data Write to destination Example 1: SUBFWB REG Before Instruction REG = 0x03 W = 0x02 C = 0x01 After Instruction REG = 0xFF W = 0x02 C = 0x00 Z = 0x00 N = 0x01 ; result is negative Example 2: SUBFWB REG, 0, 0 Before Instruction REG = 2 W =5 C =1 After Instruction REG = 2 W =3 C =1 Z =0 N = 0 ; result is positive Example 3: SUBFWB REG, 1, 0 Before Instruction REG = 1 W =2 C =0 After Instruction REG = 0 W =2 C =1 Z = 1 ; result is zero N =0© 2007 Microchip Technology Inc. DS39605F-page 227 PIC18F1220/1320 SUBLW Subtract W from literal Syntax: [ label ] SUBLW k Operands: 0 ≤ k ≤ 255 Operation: k – (W) → W Status Affected: N, OV, C, DC, Z Encoding: 0000 1000 kkkk kkkk Description: W is subtracted from the eight-bit literal ‘k’. The result is placed in W. Words: 1 Cycles: 1 Q Cycle Activity: Q1 Q2 Q3 Q4 Decode Read literal ‘k’ Process Data Write to W Example 1: SUBLW 0x02 Before Instruction W =1 C =? After Instruction W =1 C = 1 ; result is positive Z =0 N =0 Example 2: SUBLW 0x02 Before Instruction W =2 C =? After Instruction W =0 C = 1 ; result is zero Z =1 N =0 Example 3: SUBLW 0x02 Before Instruction W =3 C =? After Instruction W = FF ; (2’s complement) C = 0 ; result is negative Z =0 N =1 SUBWF Subtract W from f Syntax: [ label ] SUBWF f [,d [,a]] Operands: 0 ≤ f ≤ 255 d ∈ [0,1] a ∈ [0,1] Operation: (f) – (W) → dest Status Affected: N, OV, C, DC, Z Encoding: 0101 11da ffff ffff Description: Subtract W from register ‘f’ (2’s complement method). If ‘d’ is ‘0’, the result is stored in W. If ‘d’ is ‘1’, the result is stored back in register ‘f’ (default). If ‘a’ is ‘0’, the Access Bank will be selected, overriding the BSR value. If ‘a’ is ‘1’, then the bank will be selected as per the BSR value (default). Words: 1 Cycles: 1 Q Cycle Activity: Q1 Q2 Q3 Q4 Decode Read register ‘f’ Process Data Write to destination Example 1: SUBWF REG Before Instruction REG = 3 W =2 C =? After Instruction REG = 1 W =2 C = 1 ; result is positive Z =0 N =0 Example 2: SUBWF REG, W Before Instruction REG = 2 W =2 C =? After Instruction REG = 2 W =0 C = 1 ; result is zero Z =1 N =0 Example 3: SUBWF REG Before Instruction REG = 0x01 W = 0x02 C =? After Instruction REG = 0xFFh ;(2’s complement) W = 0x02 C = 0x00 ;result is negative Z = 0x00 N = 0x01PIC18F1220/1320 DS39605F-page 228 © 2007 Microchip Technology Inc. SUBWFB Subtract W from f with Borrow Syntax: [ label ] SUBWFB f [,d [,a]] Operands: 0 ≤ f ≤ 255 d ∈ [0,1] a ∈ [0,1] Operation: (f) – (W) – (C) → dest Status Affected: N, OV, C, DC, Z Encoding: 0101 10da ffff ffff Description: Subtract W and the Carry flag (borrow) from register ‘f’ (2’s complement method). If ‘d’ is ‘0’, the result is stored in W. If ‘d’ is ‘1’, the result is stored back in register ‘f’ (default). If ‘a’ is ‘0’, the Access Bank will be selected, overriding the BSR value. If ‘a’ is ‘1’, then the bank will be selected as per the BSR value (default). Words: 1 Cycles: 1 Q Cycle Activity: Q1 Q2 Q3 Q4 Decode Read register ‘f’ Process Data Write to destination Example 1: SUBWFB REG, 1, 0 Before Instruction REG = 0x19 (0001 1001) W = 0x0D (0000 1101) C = 0x01 After Instruction REG = 0x0C (0000 1011) W = 0x0D (0000 1101) C = 0x01 Z = 0x00 N = 0x00 ; result is positive Example 2: SUBWFB REG, 0, 0 Before Instruction REG = 0x1B (0001 1011) W = 0x1A (0001 1010) C = 0x00 After Instruction REG = 0x1B (0001 1011) W = 0x00 C = 0x01 Z = 0x01 ; result is zero N = 0x00 Example 3: SUBWFB REG, 1, 0 Before Instruction REG = 0x03 (0000 0011) W = 0x0E (0000 1101) C = 0x01 After Instruction REG = 0xF5 (1111 0100) ; [2’s comp] W = 0x0E (0000 1101) C = 0x00 Z = 0x00 N = 0x01 ; result is negative SWAPF Swap f Syntax: [ label ] SWAPF f [,d [,a]] Operands: 0 ≤ f ≤ 255 d ∈ [0,1] a ∈ [0,1] Operation: (f<3:0>) → dest<7:4>, (f<7:4>) → dest<3:0> Status Affected: None Encoding: 0011 10da ffff ffff Description: The upper and lower nibbles of register ‘f’ are exchanged. If ‘d’ is ‘0’, the result is placed in W. If ‘d’ is ‘1’, the result is placed in register ‘f’ (default). If ‘a’ is ‘0’, the Access Bank will be selected, overriding the BSR value. If ‘a’ is ‘1’, then the bank will be selected as per the BSR value (default). Words: 1 Cycles: 1 Q Cycle Activity: Q1 Q2 Q3 Q4 Decode Read register ‘f’ Process Data Write to destination Example: SWAPF REG Before Instruction REG = 0x53 After Instruction REG = 0x35© 2007 Microchip Technology Inc. DS39605F-page 229 PIC18F1220/1320 TBLRD Table Read Syntax: [ label ] TBLRD ( *; *+; *-; +*) Operands: None Operation: if TBLRD *, (Prog Mem (TBLPTR)) → TABLAT; TBLPTR – No Change; if TBLRD *+, (Prog Mem (TBLPTR)) → TABLAT; (TBLPTR) + 1 → TBLPTR; if TBLRD *-, (Prog Mem (TBLPTR)) → TABLAT; (TBLPTR) – 1 → TBLPTR; if TBLRD +*, (TBLPTR) + 1 → TBLPTR; (Prog Mem (TBLPTR)) → TABLAT; Status Affected: None Encoding: 0000 0000 0000 10nn nn = 0* = 1*+ = 2*- = 3+* Description: This instruction is used to read the contents of Program Memory (P.M.). To address the program memory, a pointer called Table Pointer (TBLPTR) is used. The TBLPTR (a 21-bit pointer) points to each byte in the program memory. TBLPTR has a 2-Mbyte address range. TBLPTR[0] = 0: Least Significant Byte of Program Memory Word TBLPTR[0] = 1: Most Significant Byte of Program Memory Word The TBLRD instruction can modify the value of TBLPTR as follows: • no change • post-increment • post-decrement • pre-increment Words: 1 Cycles: 2 Q Cycle Activity: Q1 Q2 Q3 Q4 Decode No operation No operation No operation No operation No operation (Read Program Memory) No operation No operation (Write TABLAT) TBLRD Table Read (Continued) Example 1: TBLRD *+ ; Before Instruction TABLAT = 0x55 TBLPTR = 0x00A356 MEMORY(0x00A356) = 0x34 After Instruction TABLAT = 0x34 TBLPTR = 0x00A357 Example 2: TBLRD +* ; Before Instruction TABLAT = 0xAA TBLPTR = 0x01A357 MEMORY(0x01A357) = 0x12 MEMORY(0x01A358) = 0x34 After Instruction TABLAT = 0x34 TBLPTR = 0x01A358PIC18F1220/1320 DS39605F-page 230 © 2007 Microchip Technology Inc. TBLWT Table Write Syntax: [ label ] TBLWT ( *; *+; *-; +*) Operands: None Operation: if TBLWT*, (TABLAT) → Holding Register; TBLPTR – No Change; if TBLWT*+, (TABLAT) → Holding Register; (TBLPTR) + 1 → TBLPTR; if TBLWT*-, (TABLAT) → Holding Register; (TBLPTR) – 1 → TBLPTR; if TBLWT+*, (TBLPTR) + 1 → TBLPTR; (TABLAT) → Holding Register; Status Affected: None Encoding: 0000 0000 0000 11nn nn = 0* = 1*+ = 2*- = 3+* Description: This instruction uses the 3 LSBs of TBLPTR to determine which of the 8 holding registers the TABLAT is written to. The holding registers are used to program the contents of Program Memory (P.M.). (Refer to Section 6.0 “Flash Program Memory” for additional details on programming Flash memory.) The TBLPTR (a 21-bit pointer) points to each byte in the program memory. TBLPTR has a 2-Mbyte address range. The LSb of the TBLPTR selects which byte of the program memory location to access. TBLPTR[0] = 0:Least Significant Byte of Program Memory Word TBLPTR[0] = 1:Most Significant Byte of Program Memory Word The TBLWT instruction can modify the value of TBLPTR as follows: • no change • post-increment • post-decrement • pre-increment TBLWT Table Write (Continued) Words: 1 Cycles: 2 Q Cycle Activity: Q1 Q2 Q3 Q4 Decode No operation No operation No operation No operation No operation (Read TABLAT) No operation No operation (Write to Holding Register) Example 1: TBLWT *+; Before Instruction TABLAT = 0x55 TBLPTR = 0x00A356 HOLDING REGISTER (0x00A356) = 0xFF After Instructions (table write completion) TABLAT = 0x55 TBLPTR = 0x00A357 HOLDING REGISTER (0x00A356) = 0x55 Example 2: TBLWT +*; Before Instruction TABLAT = 0x34 TBLPTR = 0x01389A HOLDING REGISTER (0x01389A) = 0xFF HOLDING REGISTER (0x01389B) = 0xFF After Instruction (table write completion) TABLAT = 0x34 TBLPTR = 0x01389B HOLDING REGISTER (0x01389A) = 0xFF HOLDING REGISTER (0x01389B) = 0x34© 2007 Microchip Technology Inc. DS39605F-page 231 PIC18F1220/1320 TSTFSZ Test f, skip if 0 Syntax: [ label ] TSTFSZ f [,a] Operands: 0 ≤ f ≤ 255 a ∈ [0,1] Operation: skip if f = 0 Status Affected: None Encoding: 0110 011a ffff ffff Description: If ‘f’ = 0, the next instruction, fetched during the current instruction execution is discarded and a NOP is executed, making this a two-cycle instruction. If ‘a’ is ‘0’, the Access Bank will be selected, overriding the BSR value. If ‘a’ is ‘1’, then the bank will be selected as per the BSR value (default). Words: 1 Cycles: 1(2) Note: 3 cycles if skip and followed by a 2-word instruction. Q Cycle Activity: Q1 Q2 Q3 Q4 Decode Read register ‘f’ Process Data No operation If skip: Q1 Q2 Q3 Q4 No operation No operation No operation No operation If skip and followed by 2-word instruction: Q1 Q2 Q3 Q4 No operation No operation No operation No operation No operation No operation No operation No operation Example: HERE TSTFSZ CNT NZERO : ZERO : Before Instruction PC = Address (HERE) After Instruction If CNT = 0x00, PC = Address (ZERO) If CNT ≠ 0x00, PC = Address (NZERO) XORLW Exclusive OR literal with W Syntax: [ label ] XORLW k Operands: 0 ≤ k ≤ 255 Operation: (W) .XOR. k → W Status Affected: N, Z Encoding: 0000 1010 kkkk kkkk Description: The contents of W are XOR’ed with the 8-bit literal ‘k’. The result is placed in W. Words: 1 Cycles: 1 Q Cycle Activity: Q1 Q2 Q3 Q4 Decode Read literal ‘k’ Process Data Write to W Example: XORLW 0xAF Before Instruction W = 0xB5 After Instruction W = 0x1APIC18F1220/1320 DS39605F-page 232 © 2007 Microchip Technology Inc. XORWF Exclusive OR W with f Syntax: [ label ] XORWF f [,d [,a]] Operands: 0 ≤ f ≤ 255 d ∈ [0,1] a ∈ [0,1] Operation: (W) .XOR. (f) → dest Status Affected: N, Z Encoding: 0001 10da ffff ffff Description: Exclusive OR the contents of W with register ‘f’. If ‘d’ is ‘0’, the result is stored in W. If ‘d’ is ‘1’, the result is stored back in the register ‘f’ (default). If ‘a’ is ‘0’, the Access Bank will be selected, overriding the BSR value. If ‘a’ is ‘1’, then the bank will be selected as per the BSR value (default). Words: 1 Cycles: 1 Q Cycle Activity: Q1 Q2 Q3 Q4 Decode Read register ‘f’ Process Data Write to destination Example: XORWF REG Before Instruction REG = 0xAF W = 0xB5 After Instruction REG = 0x1A W = 0xB5© 2007 Microchip Technology Inc. DS39605F-page 233 PIC18F1220/1320 21.0 DEVELOPMENT SUPPORT The PIC® microcontrollers are supported with a full range of hardware and software development tools: • Integrated Development Environment - MPLAB® IDE Software • Assemblers/Compilers/Linkers - MPASMTM Assembler - MPLAB C18 and MPLAB C30 C Compilers - MPLINKTM Object Linker/ MPLIBTM Object Librarian - MPLAB ASM30 Assembler/Linker/Library • Simulators - MPLAB SIM Software Simulator • Emulators - MPLAB ICE 2000 In-Circuit Emulator - MPLAB REAL ICE™ In-Circuit Emulator • In-Circuit Debugger - MPLAB ICD 2 • Device Programmers - PICSTART® Plus Development Programmer - MPLAB PM3 Device Programmer - PICkit™ 2 Development Programmer • Low-Cost Demonstration and Development Boards and Evaluation Kits 21.1 MPLAB Integrated Development Environment Software The MPLAB IDE software brings an ease of software development previously unseen in the 8/16-bit microcontroller market. The MPLAB IDE is a Windows® operating system-based application that contains: • A single graphical interface to all debugging tools - Simulator - Programmer (sold separately) - Emulator (sold separately) - In-Circuit Debugger (sold separately) • A full-featured editor with color-coded context • A multiple project manager • Customizable data windows with direct edit of contents • High-level source code debugging • Visual device initializer for easy register initialization • Mouse over variable inspection • Drag and drop variables from source to watch windows • Extensive on-line help • Integration of select third party tools, such as HI-TECH Software C Compilers and IAR C Compilers The MPLAB IDE allows you to: • Edit your source files (either assembly or C) • One touch assemble (or compile) and download to PIC MCU emulator and simulator tools (automatically updates all project information) • Debug using: - Source files (assembly or C) - Mixed assembly and C - Machine code MPLAB IDE supports multiple debugging tools in a single development paradigm, from the cost-effective simulators, through low-cost in-circuit debuggers, to full-featured emulators. This eliminates the learning curve when upgrading to tools with increased flexibility and power.PIC18F1220/1320 DS39605F-page 234 © 2007 Microchip Technology Inc. 21.2 MPASM Assembler The MPASM Assembler is a full-featured, universal macro assembler for all PIC MCUs. The MPASM Assembler generates relocatable object files for the MPLINK Object Linker, Intel® standard HEX files, MAP files to detail memory usage and symbol reference, absolute LST files that contain source lines and generated machine code and COFF files for debugging. The MPASM Assembler features include: • Integration into MPLAB IDE projects • User-defined macros to streamline assembly code • Conditional assembly for multi-purpose source files • Directives that allow complete control over the assembly process 21.3 MPLAB C18 and MPLAB C30 C Compilers The MPLAB C18 and MPLAB C30 Code Development Systems are complete ANSI C compilers for Microchip’s PIC18 family of microcontrollers and the dsPIC30, dsPIC33 and PIC24 family of digital signal controllers. These compilers provide powerful integration capabilities, superior code optimization and ease of use not found with other compilers. For easy source level debugging, the compilers provide symbol information that is optimized to the MPLAB IDE debugger. 21.4 MPLINK Object Linker/ MPLIB Object Librarian The MPLINK Object Linker combines relocatable objects created by the MPASM Assembler and the MPLAB C18 C Compiler. It can link relocatable objects from precompiled libraries, using directives from a linker script. The MPLIB Object Librarian manages the creation and modification of library files of precompiled code. When a routine from a library is called from a source file, only the modules that contain that routine will be linked in with the application. This allows large libraries to be used efficiently in many different applications. The object linker/library features include: • Efficient linking of single libraries instead of many smaller files • Enhanced code maintainability by grouping related modules together • Flexible creation of libraries with easy module listing, replacement, deletion and extraction 21.5 MPLAB ASM30 Assembler, Linker and Librarian MPLAB ASM30 Assembler produces relocatable machine code from symbolic assembly language for dsPIC30F devices. MPLAB C30 C Compiler uses the assembler to produce its object file. The assembler generates relocatable object files that can then be archived or linked with other relocatable object files and archives to create an executable file. Notable features of the assembler include: • Support for the entire dsPIC30F instruction set • Support for fixed-point and floating-point data • Command line interface • Rich directive set • Flexible macro language • MPLAB IDE compatibility 21.6 MPLAB SIM Software Simulator The MPLAB SIM Software Simulator allows code development in a PC-hosted environment by simulating the PIC MCUs and dsPIC® DSCs on an instruction level. On any given instruction, the data areas can be examined or modified and stimuli can be applied from a comprehensive stimulus controller. Registers can be logged to files for further run-time analysis. The trace buffer and logic analyzer display extend the power of the simulator to record and track program execution, actions on I/O, most peripherals and internal registers. The MPLAB SIM Software Simulator fully supports symbolic debugging using the MPLAB C18 and MPLAB C30 C Compilers, and the MPASM and MPLAB ASM30 Assemblers. The software simulator offers the flexibility to develop and debug code outside of the hardware laboratory environment, making it an excellent, economical software development tool. © 2007 Microchip Technology Inc. DS39605F-page 235 PIC18F1220/1320 21.7 MPLAB ICE 2000 High-Performance In-Circuit Emulator The MPLAB ICE 2000 In-Circuit Emulator is intended to provide the product development engineer with a complete microcontroller design tool set for PIC microcontrollers. Software control of the MPLAB ICE 2000 In-Circuit Emulator is advanced by the MPLAB Integrated Development Environment, which allows editing, building, downloading and source debugging from a single environment. The MPLAB ICE 2000 is a full-featured emulator system with enhanced trace, trigger and data monitoring features. Interchangeable processor modules allow the system to be easily reconfigured for emulation of different processors. The architecture of the MPLAB ICE 2000 In-Circuit Emulator allows expansion to support new PIC microcontrollers. The MPLAB ICE 2000 In-Circuit Emulator system has been designed as a real-time emulation system with advanced features that are typically found on more expensive development tools. The PC platform and Microsoft® Windows® 32-bit operating system were chosen to best make these features available in a simple, unified application. 21.8 MPLAB REAL ICE In-Circuit Emulator System MPLAB REAL ICE In-Circuit Emulator System is Microchip’s next generation high-speed emulator for Microchip Flash DSC® and MCU devices. It debugs and programs PIC® and dsPIC® Flash microcontrollers with the easy-to-use, powerful graphical user interface of the MPLAB Integrated Development Environment (IDE), included with each kit. The MPLAB REAL ICE probe is connected to the design engineer’s PC using a high-speed USB 2.0 interface and is connected to the target with either a connector compatible with the popular MPLAB ICD 2 system (RJ11) or with the new high speed, noise tolerant, lowvoltage differential signal (LVDS) interconnection (CAT5). MPLAB REAL ICE is field upgradeable through future firmware downloads in MPLAB IDE. In upcoming releases of MPLAB IDE, new devices will be supported, and new features will be added, such as software breakpoints and assembly code trace. MPLAB REAL ICE offers significant advantages over competitive emulators including low-cost, full-speed emulation, real-time variable watches, trace analysis, complex breakpoints, a ruggedized probe interface and long (up to three meters) interconnection cables. 21.9 MPLAB ICD 2 In-Circuit Debugger Microchip’s In-Circuit Debugger, MPLAB ICD 2, is a powerful, low-cost, run-time development tool, connecting to the host PC via an RS-232 or high-speed USB interface. This tool is based on the Flash PIC MCUs and can be used to develop for these and other PIC MCUs and dsPIC DSCs. The MPLAB ICD 2 utilizes the in-circuit debugging capability built into the Flash devices. This feature, along with Microchip’s In-Circuit Serial ProgrammingTM (ICSPTM) protocol, offers costeffective, in-circuit Flash debugging from the graphical user interface of the MPLAB Integrated Development Environment. This enables a designer to develop and debug source code by setting breakpoints, single stepping and watching variables, and CPU status and peripheral registers. Running at full speed enables testing hardware and applications in real time. MPLAB ICD 2 also serves as a development programmer for selected PIC devices. 21.10 MPLAB PM3 Device Programmer The MPLAB PM3 Device Programmer is a universal, CE compliant device programmer with programmable voltage verification at VDDMIN and VDDMAX for maximum reliability. It features a large LCD display (128 x 64) for menus and error messages and a modular, detachable socket assembly to support various package types. The ICSP™ cable assembly is included as a standard item. In Stand-Alone mode, the MPLAB PM3 Device Programmer can read, verify and program PIC devices without a PC connection. It can also set code protection in this mode. The MPLAB PM3 connects to the host PC via an RS-232 or USB cable. The MPLAB PM3 has high-speed communications and optimized algorithms for quick programming of large memory devices and incorporates an SD/MMC card for file storage and secure data applications.PIC18F1220/1320 DS39605F-page 236 © 2007 Microchip Technology Inc. 21.11 PICSTART Plus Development Programmer The PICSTART Plus Development Programmer is an easy-to-use, low-cost, prototype programmer. It connects to the PC via a COM (RS-232) port. MPLAB Integrated Development Environment software makes using the programmer simple and efficient. The PICSTART Plus Development Programmer supports most PIC devices in DIP packages up to 40 pins. Larger pin count devices, such as the PIC16C92X and PIC17C76X, may be supported with an adapter socket. The PICSTART Plus Development Programmer is CE compliant. 21.12 PICkit 2 Development Programmer The PICkit™ 2 Development Programmer is a low-cost programmer and selected Flash device debugger with an easy-to-use interface for programming many of Microchip’s baseline, mid-range and PIC18F families of Flash memory microcontrollers. The PICkit 2 Starter Kit includes a prototyping development board, twelve sequential lessons, software and HI-TECH’s PICC™ Lite C compiler, and is designed to help get up to speed quickly using PIC® microcontrollers. The kit provides everything needed to program, evaluate and develop applications using Microchip’s powerful, mid-range Flash memory family of microcontrollers. 21.13 Demonstration, Development and Evaluation Boards A wide variety of demonstration, development and evaluation boards for various PIC MCUs and dsPIC DSCs allows quick application development on fully functional systems. Most boards include prototyping areas for adding custom circuitry and provide application firmware and source code for examination and modification. The boards support a variety of features, including LEDs, temperature sensors, switches, speakers, RS-232 interfaces, LCD displays, potentiometers and additional EEPROM memory. The demonstration and development boards can be used in teaching environments, for prototyping custom circuits and for learning about various microcontroller applications. In addition to the PICDEM™ and dsPICDEM™ demonstration/development board series of circuits, Microchip has a line of evaluation kits and demonstration software for analog filter design, KEELOQ® security ICs, CAN, IrDA®, PowerSmart® battery management, SEEVAL® evaluation system, Sigma-Delta ADC, flow rate sensing, plus many more. Check the Microchip web page (www.microchip.com) and the latest “Product Selector Guide” (DS00148) for the complete list of demonstration, development and evaluation kits.© 2007 Microchip Technology Inc. DS39605F-page 237 PIC18F1220/1320 22.0 ELECTRICAL CHARACTERISTICS Absolute Maximum Ratings(†) Ambient temperature under bias.............................................................................................................-40°C to +125°C Storage temperature .............................................................................................................................. -65°C to +150°C Voltage on any pin with respect to VSS (except VDD, MCLR and RA4) .......................................... -0.3V to (VDD + 0.3V) Voltage on VDD with respect to VSS ......................................................................................................... -0.3V to +5.5V Voltage on MCLR with respect to VSS (Note 2) ......................................................................................... 0V to +13.25V Voltage on RA4 with respect to Vss............................................................................................................... 0V to +8.5V Total power dissipation (Note 1) ...............................................................................................................................1.0W Maximum current out of VSS pin ...........................................................................................................................300 mA Maximum current into VDD pin ..............................................................................................................................250 mA Input clamp current, IIK (VI < 0 or VI > VDD)...................................................................................................................... ±20 mA Output clamp current, IOK (VO < 0 or VO > VDD) .............................................................................................................. ±20 mA Maximum output current sunk by any I/O pin..........................................................................................................25 mA Maximum output current sourced by any I/O pin ....................................................................................................25 mA Maximum current sunk by all ports .......................................................................................................................200 mA Maximum current sourced by all ports ..................................................................................................................200 mA Note 1: Power dissipation is calculated as follows: Pdis = VDD x {IDD – ∑ IOH} + ∑ {(VDD – VOH) x IOH} + ∑(VOL x IOL) 2: Voltage spikes below VSS at the MCLR/VPP pin, inducing currents greater than 80 mA, may cause latch-up. Thus, a series resistor of 50-100Ω should be used when applying a “low” level to the MCLR/VPP pin, rather than pulling this pin directly to VSS. † NOTICE: Stresses above those listed under “Absolute Maximum Ratings” may cause permanent damage to the device. This is a stress rating only and functional operation of the device at those or any other conditions above those indicated in the operation listings of this specification is not implied. Exposure to maximum rating conditions for extended periods may affect device reliability.PIC18F1220/1320 DS39605F-page 238 © 2007 Microchip Technology Inc. FIGURE 22-1: PIC18F1220/1320 VOLTAGE-FREQUENCY GRAPH (INDUSTRIAL) FIGURE 22-2: PIC18LF1220/1320 VOLTAGE-FREQUENCY GRAPH (INDUSTRIAL) Frequency Voltage 6.0V 5.5V 4.5V 4.0V 2.0V 40 MHz 5.0V 3.5V 3.0V 2.5V PIC18F1X20 4.2V Frequency Voltage 6.0V 5.5V 4.5V 4.0V 2.0V 40 MHz 5.0V 3.5V 3.0V 2.5V FMAX = (16.36 MHz/V) (VDDAPPMIN – 2.0V) + 4 MHz Note: VDDAPPMIN is the minimum voltage of the PIC® device in the application. 4 MHz 4.2V PIC18LF1X20© 2007 Microchip Technology Inc. DS39605F-page 239 PIC18F1220/1320 FIGURE 22-3: PIC18F1220/1320 VOLTAGE-FREQUENCY GRAPH (EXTENDED) Frequency Voltage 6.0V 5.5V 4.5V 4.0V 2.0V 25 MHz 5.0V 3.5V 3.0V 2.5V PIC18F1X20-E 4.2VPIC18F1220/1320 DS39605F-page 240 © 2007 Microchip Technology Inc. 22.1 DC Characteristics: Supply Voltage PIC18F1220/1320 (Industrial) PIC18LF1220/1320 (Industrial) PIC18LF1220/1320 (Industrial) Standard Operating Conditions (unless otherwise stated) Operating temperature -40°C ≤ TA ≤ +85°C for industrial PIC18F1220/1320 (Industrial, Extended) Standard Operating Conditions (unless otherwise stated) Operating temperature -40°C ≤ TA ≤ +85°C for industrial -40°C ≤ TA ≤ +125°C for extended Param No. Symbol Characteristic Min Typ Max Units Conditions VDD Supply Voltage D001 PIC18LF1220/1320 2.0 — 5.5 V HS, XT, RC and LP Oscillator mode PIC18F1220/1320 4.2 — 5.5 V D002 VDR RAM Data Retention Voltage(1) 1.5 — — V D003 VPOR VDD Start Voltage to ensure internal Power-on Reset signal — — 0.7 V See Section 4.1 “Power-on Reset (POR)” for details. D004 SVDD VDD Rise Rate to ensure internal Power-on Reset signal 0.05 — — V/ms See Section 4.1 “Power-on Reset (POR)” for details. VBOR Brown-out Reset Voltage D005D PIC18LF1220/1320 Industrial Low Voltage (-10°C to +85°C) BORV1:BORV0 = 11 N/A N/A N/A V Reserved BORV1:BORV0 = 10 2.50 2.72 2.94 V BORV1:BORV0 = 01 3.88 4.22 4.56 V (Note 2) BORV1:BORV0 = 00 4.18 4.54 4.90 V (Note 2) D005F PIC18LF1220/1320 Industrial Low Voltage (-40°C to -10°C) BORV1:BORV0 = 11 N/A N/A N/A V Reserved BORV1:BORV0 = 10 2.34 2.72 3.10 V BORV1:BORV0 = 01 3.63 4.22 4.81 V (Note 2) BORV1:BORV0 = 00 3.90 4.54 5.18 V (Note 2) D005G PIC18F1220/1320 Industrial (-10°C to +85°C) BORV1:BORV0 = 1x N/A N/A N/A V Reserved BORV1:BORV0 = 01 3.88 4.22 4.56 V (Note 2) BORV1:BORV0 = 00 4.18 4.54 4.90 V (Note 2) D005H PIC18F1220/1320 Industrial (-40°C to -10°C) BORV1:BORV0 = 1x N/A N/A N/A V Reserved BORV1:BORV0 = 01 N/A N/A N/A V Reserved BORV1:BORV0 = 00 3.90 4.54 5.18 V (Note 2) D005J PIC18F1220/1320 Extended (-10°C to +85°C) BORV1:BORV0 = 1x N/A N/A N/A V Reserved BORV1:BORV0 = 01 3.88 4.22 4.56 V (Note 3) BORV1:BORV0 = 00 4.18 4.54 4.90 V (Note 3) D005K PIC18F1220/1320 Extended (-40°C to -10°C, +85°C to +125°C) BORV1:BORV0 = 1x N/A N/A N/A V Reserved BORV1:BORV0 = 01 N/A N/A N/A V Reserved BORV1:BORV0 = 00 3.90 4.54 5.18 V (Note 3) Legend: Shading of rows is to assist in readability of the table. Note 1: This is the limit to which VDD can be lowered in Sleep mode, or during a device Reset, without losing RAM data. 2: When BOR is on and BORV<1:0> = 0x, the device will operate correctly at 40 MHz for any VDD at which the BOR allows execution (low-voltage and industrial devices only). 3: When BOR is on and BORV<1:0> = 0x, the device will operate correctly at 25 MHz for any VDD at which the BOR allows execution (extended devices only).© 2007 Microchip Technology Inc. DS39605F-page 241 PIC18F1220/1320 22.2 DC Characteristics: Power-Down and Supply Current PIC18F1220/1320 (Industrial) PIC18LF1220/1320 (Industrial) PIC18LF1220/1320 (Industrial) Standard Operating Conditions (unless otherwise stated) Operating temperature -40°C ≤ TA ≤ +85°C for industrial PIC18F1220/1320 (Industrial, Extended) Standard Operating Conditions (unless otherwise stated) Operating temperature -40°C ≤ TA ≤ +85°C for industrial -40°C ≤ TA ≤ +125°C for extended Param No. Device Typ Max Units Conditions Power-Down Current (IPD) (1) PIC18LF1220/1320 0.1 0.5 μA -40°C VDD = 2.0V, (Sleep mode) 0.1 0.5 μA +25°C 0.2 1.9 μA +85°C PIC18LF1220/1320 0.1 0.5 μA -40°C VDD = 3.0V, (Sleep mode) 0.1 0.5 μA + 25°C 0.3 1.9 μA +85°C All devices 0.1 2.0 μA -40°C VDD = 5.0V, (Sleep mode) 0.1 2.0 μA +25°C 0.4 6.5 μA +85°C Extended devices 11.2 50 μA +125°C Supply Current (IDD) (2,3) PIC18LF1220/1320 8 40 μA -40°C FOSC = 31 kHz (RC_RUN mode, Internal oscillator source) 9 40 μA +25°C VDD = 2.0V 11 40 μA +85°C PIC18LF1220/1320 25 68 μA -40°C 25 68 μA +25°C VDD = 3.0V 20 68 μA +85°C All devices 55 80 μA -40°C VDD = 5.0V 55 80 μA +25°C 50 80 μA +85°C Extended devices 50 80 μA +125°C Legend: Shading of rows is to assist in readability of the table. Note 1: The power-down current in Sleep mode does not depend on the oscillator type. Power-down current is measured with the part in Sleep mode, with all I/O pins in high-impedance state and tied to VDD or VSS and all features that add delta current disabled (such as WDT, Timer1 Oscillator, BOR, etc.). 2: The supply current is mainly a function of operating voltage, frequency and mode. Other factors, such as I/O pin loading and switching rate, oscillator type and circuit, internal code execution pattern and temperature, also have an impact on the current consumption. The test conditions for all IDD measurements in active operation mode are: OSC1 = external square wave, from rail-to-rail; all I/O pins tri-stated, pulled to VDD; MCLR = VDD; WDT enabled/disabled as specified. 3: For RC oscillator configurations, current through REXT is not included. The current through the resistor can be estimated by the formula Ir = VDD/2REXT (mA) with REXT in kΩ. 4: Standard low-cost 32 kHz crystals have an operating temperature range of -10°C to +70°C. Extended temperature crystals are available at a much higher cost.PIC18F1220/1320 DS39605F-page 242 © 2007 Microchip Technology Inc. Supply Current (IDD) (2,3) PIC18LF1220/1320 140 220 μA -40°C FOSC = 1 MHz (RC_RUN mode, Internal oscillator source) 145 220 μA +25°C VDD = 2.0V 155 220 μA +85°C PIC18LF1220/1320 215 330 μA -40°C 225 330 μA +25°C VDD = 3.0V 235 330 μA +85°C All devices 385 550 μA -40°C VDD = 5.0V 390 550 μA +25°C 405 550 μA +85°C Extended devices 410 650 μA +125°C PIC18LF1220/1320 410 600 μA -40°C FOSC = 4 MHz (RC_RUN mode, Internal oscillator source) 425 600 μA +25°C VDD = 2.0V 435 600 μA +85°C PIC18LF1220/1320 650 900 μA -40°C 670 900 μA +25°C VDD = 3.0V 680 900 μA +85°C All devices 1.2 1.8 mA -40°C VDD = 5.0V 1.2 1.8 mA +25°C 1.2 1.8 mA +85°C Extended devices 1.2 1.8 mA +125°C 22.2 DC Characteristics: Power-Down and Supply Current PIC18F1220/1320 (Industrial) PIC18LF1220/1320 (Industrial) (Continued) PIC18LF1220/1320 (Industrial) Standard Operating Conditions (unless otherwise stated) Operating temperature -40°C ≤ TA ≤ +85°C for industrial PIC18F1220/1320 (Industrial, Extended) Standard Operating Conditions (unless otherwise stated) Operating temperature -40°C ≤ TA ≤ +85°C for industrial -40°C ≤ TA ≤ +125°C for extended Param No. Device Typ Max Units Conditions Legend: Shading of rows is to assist in readability of the table. Note 1: The power-down current in Sleep mode does not depend on the oscillator type. Power-down current is measured with the part in Sleep mode, with all I/O pins in high-impedance state and tied to VDD or VSS and all features that add delta current disabled (such as WDT, Timer1 Oscillator, BOR, etc.). 2: The supply current is mainly a function of operating voltage, frequency and mode. Other factors, such as I/O pin loading and switching rate, oscillator type and circuit, internal code execution pattern and temperature, also have an impact on the current consumption. The test conditions for all IDD measurements in active operation mode are: OSC1 = external square wave, from rail-to-rail; all I/O pins tri-stated, pulled to VDD; MCLR = VDD; WDT enabled/disabled as specified. 3: For RC oscillator configurations, current through REXT is not included. The current through the resistor can be estimated by the formula Ir = VDD/2REXT (mA) with REXT in kΩ. 4: Standard low-cost 32 kHz crystals have an operating temperature range of -10°C to +70°C. Extended temperature crystals are available at a much higher cost.© 2007 Microchip Technology Inc. DS39605F-page 243 PIC18F1220/1320 Supply Current (IDD) (2,3) PIC18LF1220/1320 4.7 8 μA -40°C FOSC = 31 kHz (RC_IDLE mode, Internal oscillator source) 5.0 8 μA +25°C VDD = 2.0V 5.8 11 μA +85°C PIC18LF1220/1320 7.0 11 μA -40°C 7.8 11 μA +25°C VDD = 3.0V 8.7 15 μA +85°C All devices 12 16 μA -40°C VDD = 5.0V 14 16 μA +25°C 14 22 μA +85°C Extended devices 25 75 μA +125°C PIC18LF1220/1320 75 150 μA -40°C FOSC = 1 MHz (RC_IDLE mode, Internal oscillator source) 85 150 μA +25°C VDD = 2.0V 95 150 μA +85°C PIC18LF1220/1320 110 180 μA -40°C 125 180 μA +25°C VDD = 3.0V 135 180 μA +85°C All devices 180 380 μA -40°C VDD = 5.0V 195 380 μA +25°C 200 380 μA +85°C Extended devices 350 435 μA +125°C 22.2 DC Characteristics: Power-Down and Supply Current PIC18F1220/1320 (Industrial) PIC18LF1220/1320 (Industrial) (Continued) PIC18LF1220/1320 (Industrial) Standard Operating Conditions (unless otherwise stated) Operating temperature -40°C ≤ TA ≤ +85°C for industrial PIC18F1220/1320 (Industrial, Extended) Standard Operating Conditions (unless otherwise stated) Operating temperature -40°C ≤ TA ≤ +85°C for industrial -40°C ≤ TA ≤ +125°C for extended Param No. Device Typ Max Units Conditions Legend: Shading of rows is to assist in readability of the table. Note 1: The power-down current in Sleep mode does not depend on the oscillator type. Power-down current is measured with the part in Sleep mode, with all I/O pins in high-impedance state and tied to VDD or VSS and all features that add delta current disabled (such as WDT, Timer1 Oscillator, BOR, etc.). 2: The supply current is mainly a function of operating voltage, frequency and mode. Other factors, such as I/O pin loading and switching rate, oscillator type and circuit, internal code execution pattern and temperature, also have an impact on the current consumption. The test conditions for all IDD measurements in active operation mode are: OSC1 = external square wave, from rail-to-rail; all I/O pins tri-stated, pulled to VDD; MCLR = VDD; WDT enabled/disabled as specified. 3: For RC oscillator configurations, current through REXT is not included. The current through the resistor can be estimated by the formula Ir = VDD/2REXT (mA) with REXT in kΩ. 4: Standard low-cost 32 kHz crystals have an operating temperature range of -10°C to +70°C. Extended temperature crystals are available at a much higher cost.PIC18F1220/1320 DS39605F-page 244 © 2007 Microchip Technology Inc. Supply Current (IDD) (2,3) PIC18LF1220/1320 140 275 μA -40°C FOSC = 4 MHz (RC_IDLE mode, Internal oscillator source) 140 275 μA +25°C VDD = 2.0V 150 275 μA +85°C PIC18LF1220/1320 220 375 μA -40°C 220 375 μA +25°C VDD = 3.0V 220 375 μA +85°C All devices 390 800 μA -40°C VDD = 5.0V 400 800 μA +25°C 380 800 μA +85°C Extended devices 410 800 μA +125°C PIC18LF1220/1320 150 250 μA -40°C FOSC = 1 MHZ (PRI_RUN mode, EC oscillator) 150 250 μA +25°C VDD = 2.0V 160 250 μA +85°C PIC18LF1220/1320 340 350 μA -40°C 300 350 μA +25°C VDD = 3.0V 280 350 μA +85°C All devices 0.72 1.0 mA -40°C VDD = 5.0V 0.63 1.0 mA +25°C 0.58 1.0 mA +85°C Extended devices 0.53 1.0 mA +125°C 22.2 DC Characteristics: Power-Down and Supply Current PIC18F1220/1320 (Industrial) PIC18LF1220/1320 (Industrial) (Continued) PIC18LF1220/1320 (Industrial) Standard Operating Conditions (unless otherwise stated) Operating temperature -40°C ≤ TA ≤ +85°C for industrial PIC18F1220/1320 (Industrial, Extended) Standard Operating Conditions (unless otherwise stated) Operating temperature -40°C ≤ TA ≤ +85°C for industrial -40°C ≤ TA ≤ +125°C for extended Param No. Device Typ Max Units Conditions Legend: Shading of rows is to assist in readability of the table. Note 1: The power-down current in Sleep mode does not depend on the oscillator type. Power-down current is measured with the part in Sleep mode, with all I/O pins in high-impedance state and tied to VDD or VSS and all features that add delta current disabled (such as WDT, Timer1 Oscillator, BOR, etc.). 2: The supply current is mainly a function of operating voltage, frequency and mode. Other factors, such as I/O pin loading and switching rate, oscillator type and circuit, internal code execution pattern and temperature, also have an impact on the current consumption. The test conditions for all IDD measurements in active operation mode are: OSC1 = external square wave, from rail-to-rail; all I/O pins tri-stated, pulled to VDD; MCLR = VDD; WDT enabled/disabled as specified. 3: For RC oscillator configurations, current through REXT is not included. The current through the resistor can be estimated by the formula Ir = VDD/2REXT (mA) with REXT in kΩ. 4: Standard low-cost 32 kHz crystals have an operating temperature range of -10°C to +70°C. Extended temperature crystals are available at a much higher cost.© 2007 Microchip Technology Inc. DS39605F-page 245 PIC18F1220/1320 Supply Current (IDD) (2,3) PIC18LF1220/1320 415 600 μA -40°C FOSC = 4 MHz (PRI_RUN mode, EC oscillator) 425 600 μA +25°C VDD = 2.0V 435 600 μA +85°C PIC18LF1220/1320 0.87 1.0 mA -40°C 0.75 1.0 mA +25°C VDD = 3.0V 0.75 1.0 mA +85°C All devices 1.6 2.0 mA -40°C VDD = 5.0V 1.6 2.0 mA +25°C 1.5 2.0 mA +85°C Extended devices 1.5 2.0 mA +125°C Extended devices 6.3 9.0 mA +125°C VDD = 4.2V FOSC = 25 MHz (PRI_RUN mode, EC oscillator) 9.7 10.0 mA +125°C VDD = 5.0V All devices 9.4 12 mA -40°C FOSC = 40 MHZ (PRI_RUN mode, EC oscillator) 9.5 12 mA +25°C VDD = 4.2V 9.6 12 mA +85°C All devices 11.9 15 mA -40°C 12.1 15 mA +25°C VDD = 5.0V 12.2 15 mA +85°C 22.2 DC Characteristics: Power-Down and Supply Current PIC18F1220/1320 (Industrial) PIC18LF1220/1320 (Industrial) (Continued) PIC18LF1220/1320 (Industrial) Standard Operating Conditions (unless otherwise stated) Operating temperature -40°C ≤ TA ≤ +85°C for industrial PIC18F1220/1320 (Industrial, Extended) Standard Operating Conditions (unless otherwise stated) Operating temperature -40°C ≤ TA ≤ +85°C for industrial -40°C ≤ TA ≤ +125°C for extended Param No. Device Typ Max Units Conditions Legend: Shading of rows is to assist in readability of the table. Note 1: The power-down current in Sleep mode does not depend on the oscillator type. Power-down current is measured with the part in Sleep mode, with all I/O pins in high-impedance state and tied to VDD or VSS and all features that add delta current disabled (such as WDT, Timer1 Oscillator, BOR, etc.). 2: The supply current is mainly a function of operating voltage, frequency and mode. Other factors, such as I/O pin loading and switching rate, oscillator type and circuit, internal code execution pattern and temperature, also have an impact on the current consumption. The test conditions for all IDD measurements in active operation mode are: OSC1 = external square wave, from rail-to-rail; all I/O pins tri-stated, pulled to VDD; MCLR = VDD; WDT enabled/disabled as specified. 3: For RC oscillator configurations, current through REXT is not included. The current through the resistor can be estimated by the formula Ir = VDD/2REXT (mA) with REXT in kΩ. 4: Standard low-cost 32 kHz crystals have an operating temperature range of -10°C to +70°C. Extended temperature crystals are available at a much higher cost.PIC18F1220/1320 DS39605F-page 246 © 2007 Microchip Technology Inc. Supply Current (IDD) (2,3) PIC18LF1220/1320 35 50 μA -40°C FOSC = 1 MHz (PRI_IDLE mode, EC oscillator) 35 50 μA +25°C VDD = 2.0V 35 60 μA +85°C PIC18LF1220/1320 55 80 μA -40°C 50 80 μA +25°C VDD = 3.0V 60 100 μA +85°C All devices 105 150 μA -40°C VDD = 5.0V 110 150 μA +25°C 115 150 μA +85°C Extended devices 125 300 μA +125°C PIC18LF1220/1320 135 180 μA -40°C FOSC = 4 MHz (PRI_IDLE mode, EC oscillator) 140 180 μA +25°C VDD = 2.0V 140 180 μA +85°C PIC18LF1220/1320 215 280 μA -40°C 225 280 μA +25°C VDD = 3.0V 230 280 μA +85°C All devices 410 525 μA -40°C VDD = 5.0V 420 525 μA +25°C 430 525 μA +85°C Extended devices 450 800 μA +125°C Extended devices 2.2 3.0 mA +125°C VDD = 4.2V FOSC = 25 MHz (PRI_IDLE mode, EC oscillator) 2.7 3.5 mA +125°C VDD = 5.0V 22.2 DC Characteristics: Power-Down and Supply Current PIC18F1220/1320 (Industrial) PIC18LF1220/1320 (Industrial) (Continued) PIC18LF1220/1320 (Industrial) Standard Operating Conditions (unless otherwise stated) Operating temperature -40°C ≤ TA ≤ +85°C for industrial PIC18F1220/1320 (Industrial, Extended) Standard Operating Conditions (unless otherwise stated) Operating temperature -40°C ≤ TA ≤ +85°C for industrial -40°C ≤ TA ≤ +125°C for extended Param No. Device Typ Max Units Conditions Legend: Shading of rows is to assist in readability of the table. Note 1: The power-down current in Sleep mode does not depend on the oscillator type. Power-down current is measured with the part in Sleep mode, with all I/O pins in high-impedance state and tied to VDD or VSS and all features that add delta current disabled (such as WDT, Timer1 Oscillator, BOR, etc.). 2: The supply current is mainly a function of operating voltage, frequency and mode. Other factors, such as I/O pin loading and switching rate, oscillator type and circuit, internal code execution pattern and temperature, also have an impact on the current consumption. The test conditions for all IDD measurements in active operation mode are: OSC1 = external square wave, from rail-to-rail; all I/O pins tri-stated, pulled to VDD; MCLR = VDD; WDT enabled/disabled as specified. 3: For RC oscillator configurations, current through REXT is not included. The current through the resistor can be estimated by the formula Ir = VDD/2REXT (mA) with REXT in kΩ. 4: Standard low-cost 32 kHz crystals have an operating temperature range of -10°C to +70°C. Extended temperature crystals are available at a much higher cost.© 2007 Microchip Technology Inc. DS39605F-page 247 PIC18F1220/1320 Supply Current (IDD) (2,3) All devices 3.2 4.1 mA -40°C FOSC = 40 MHz (PRI_IDLE mode, EC oscillator) 3.2 4.1 mA +25°C VDD = 4.2 V 3.3 4.1 mA +85°C All devices 4.0 5.1 mA -40°C 4.1 5.1 mA +25°C VDD = 5.0V 4.1 5.1 mA +85°C PIC18LF1220/1320 5.1 9 μA -10°C FOSC = 32 kHz(4) (SEC_RUN mode, Timer1 as clock) 5.8 9 μA +25°C VDD = 2.0V 7.9 11 μA +70°C PIC18LF1220/1320 7.9 12 μA -10°C 8.9 12 μA +25°C VDD = 3.0V 10.5 14 μA +70°C All devices 12.5 20 μA -10°C 16.3 20 μA +25°C VDD = 5.0V 18.4 25 μA +70°C 22.2 DC Characteristics: Power-Down and Supply Current PIC18F1220/1320 (Industrial) PIC18LF1220/1320 (Industrial) (Continued) PIC18LF1220/1320 (Industrial) Standard Operating Conditions (unless otherwise stated) Operating temperature -40°C ≤ TA ≤ +85°C for industrial PIC18F1220/1320 (Industrial, Extended) Standard Operating Conditions (unless otherwise stated) Operating temperature -40°C ≤ TA ≤ +85°C for industrial -40°C ≤ TA ≤ +125°C for extended Param No. Device Typ Max Units Conditions Legend: Shading of rows is to assist in readability of the table. Note 1: The power-down current in Sleep mode does not depend on the oscillator type. Power-down current is measured with the part in Sleep mode, with all I/O pins in high-impedance state and tied to VDD or VSS and all features that add delta current disabled (such as WDT, Timer1 Oscillator, BOR, etc.). 2: The supply current is mainly a function of operating voltage, frequency and mode. Other factors, such as I/O pin loading and switching rate, oscillator type and circuit, internal code execution pattern and temperature, also have an impact on the current consumption. The test conditions for all IDD measurements in active operation mode are: OSC1 = external square wave, from rail-to-rail; all I/O pins tri-stated, pulled to VDD; MCLR = VDD; WDT enabled/disabled as specified. 3: For RC oscillator configurations, current through REXT is not included. The current through the resistor can be estimated by the formula Ir = VDD/2REXT (mA) with REXT in kΩ. 4: Standard low-cost 32 kHz crystals have an operating temperature range of -10°C to +70°C. Extended temperature crystals are available at a much higher cost.PIC18F1220/1320 DS39605F-page 248 © 2007 Microchip Technology Inc. Supply Current (IDD) (2,3) PIC18LF1220/1320 9.2 15 μA -10°C FOSC = 32 kHz(4) (SEC_IDLE mode, Timer1 as clock) 9.6 15 μA +25°C VDD = 2.0V 12.7 18 μA +70°C PIC18LF1220/1320 22 30 μA -10°C 21 30 μA +25°C VDD = 3.0V 20 35 μA +70°C All devices 50 80 μA -10°C 45 80 μA +25°C VDD = 5.0V 45 80 μA +70°C 22.2 DC Characteristics: Power-Down and Supply Current PIC18F1220/1320 (Industrial) PIC18LF1220/1320 (Industrial) (Continued) PIC18LF1220/1320 (Industrial) Standard Operating Conditions (unless otherwise stated) Operating temperature -40°C ≤ TA ≤ +85°C for industrial PIC18F1220/1320 (Industrial, Extended) Standard Operating Conditions (unless otherwise stated) Operating temperature -40°C ≤ TA ≤ +85°C for industrial -40°C ≤ TA ≤ +125°C for extended Param No. Device Typ Max Units Conditions Legend: Shading of rows is to assist in readability of the table. Note 1: The power-down current in Sleep mode does not depend on the oscillator type. Power-down current is measured with the part in Sleep mode, with all I/O pins in high-impedance state and tied to VDD or VSS and all features that add delta current disabled (such as WDT, Timer1 Oscillator, BOR, etc.). 2: The supply current is mainly a function of operating voltage, frequency and mode. Other factors, such as I/O pin loading and switching rate, oscillator type and circuit, internal code execution pattern and temperature, also have an impact on the current consumption. The test conditions for all IDD measurements in active operation mode are: OSC1 = external square wave, from rail-to-rail; all I/O pins tri-stated, pulled to VDD; MCLR = VDD; WDT enabled/disabled as specified. 3: For RC oscillator configurations, current through REXT is not included. The current through the resistor can be estimated by the formula Ir = VDD/2REXT (mA) with REXT in kΩ. 4: Standard low-cost 32 kHz crystals have an operating temperature range of -10°C to +70°C. Extended temperature crystals are available at a much higher cost.© 2007 Microchip Technology Inc. DS39605F-page 249 PIC18F1220/1320 Module Differential Currents (ΔIWDT, ΔIBOR, ΔILVD, ΔIOSCB, ΔIAD) D022 (ΔIWDT) Watchdog Timer 1.5 4.0 μA -40°C 2.2 4.0 μA +25°C VDD = 2.0V 3.1 5.0 μA +85°C 2.5 6.0 μA -40°C 3.3 6.0 μA +25°C VDD = 3.0V 4.7 7.0 μA +85°C 3.7 10.0 μA -40°C 4.5 10.0 μA +25°C VDD = 5.0V 6.1 13.0 μA +85°C D022A (ΔIBOR) Brown-out Reset 19 35.0 μA -40°C to +85°C VDD = 3.0V 24 45.0 μA -40°C to +85°C VDD = 5.0V D022B (ΔILVD) Low-Voltage Detect 8.5 25.0 μA -40°C to +85°C VDD = 2.0V 16 35.0 μA -40°C to +85°C VDD = 3.0V 20 45.0 μA -40°C to +85°C VDD = 5.0V D025 (ΔIOSCB) Timer1 Oscillator 1.7 3.5 μA -40°C 1.8 3.5 μA +25°C VDD = 2.0V 32 kHz on Timer1(4) 2.1 4.5 μA +85°C 2.2 4.5 μA -40°C 2.6 4.5 μA +25°C VDD = 3.0V 32 kHz on Timer1(4) 2.8 5.5 μA +85°C 3.0 6.0 μA -40°C 3.3 6.0 μA +25°C VDD = 5.0V 32 kHz on Timer1(4) 3.6 7.0 μA +85°C D026 (ΔIAD) A/D Converter 1.0 3.0 μA -40°C to +85°C VDD = 2.0V A/D on, not converting 1.0 4.0 μA -40°C to +85°C VDD = 3.0V 2.0 10.0 μA -40°C to +85°C VDD = 5.0V 1.0 8.0 μA -40°C to +125°C VDD = 5.0V 22.2 DC Characteristics: Power-Down and Supply Current PIC18F1220/1320 (Industrial) PIC18LF1220/1320 (Industrial) (Continued) PIC18LF1220/1320 (Industrial) Standard Operating Conditions (unless otherwise stated) Operating temperature -40°C ≤ TA ≤ +85°C for industrial PIC18F1220/1320 (Industrial, Extended) Standard Operating Conditions (unless otherwise stated) Operating temperature -40°C ≤ TA ≤ +85°C for industrial -40°C ≤ TA ≤ +125°C for extended Param No. Device Typ Max Units Conditions Legend: Shading of rows is to assist in readability of the table. Note 1: The power-down current in Sleep mode does not depend on the oscillator type. Power-down current is measured with the part in Sleep mode, with all I/O pins in high-impedance state and tied to VDD or VSS and all features that add delta current disabled (such as WDT, Timer1 Oscillator, BOR, etc.). 2: The supply current is mainly a function of operating voltage, frequency and mode. Other factors, such as I/O pin loading and switching rate, oscillator type and circuit, internal code execution pattern and temperature, also have an impact on the current consumption. The test conditions for all IDD measurements in active operation mode are: OSC1 = external square wave, from rail-to-rail; all I/O pins tri-stated, pulled to VDD; MCLR = VDD; WDT enabled/disabled as specified. 3: For RC oscillator configurations, current through REXT is not included. The current through the resistor can be estimated by the formula Ir = VDD/2REXT (mA) with REXT in kΩ. 4: Standard low-cost 32 kHz crystals have an operating temperature range of -10°C to +70°C. Extended temperature crystals are available at a much higher cost.PIC18F1220/1320 DS39605F-page 250 © 2007 Microchip Technology Inc. 22.3 DC Characteristics: PIC18F1220/1320 (Industrial) PIC18LF1220/1320 (Industrial) DC CHARACTERISTICS Standard Operating Conditions (unless otherwise stated) Operating temperature -40°C ≤ TA ≤ +85°C for industrial -40°C ≤ TA ≤ +125°C for extended Param No. Symbol Characteristic Min Max Units Conditions VIL Input Low Voltage I/O ports: D030 with TTL buffer VSS 0.15 VDD V VDD < 4.5V D030A — 0.8 V 4.5V ≤ VDD ≤ 5.5V D031 with Schmitt Trigger buffer VSS 0.2 VDD V D032 MCLR VSS 0.2 VDD V D032A OSC1 (in XT, HS and LP modes) and T1OSI VSS 0.3 VDD V D033 OSC1 (in RC and EC mode)(1) VSS 0.2 VDD V VIH Input High Voltage I/O ports: D040 with TTL buffer 0.25 VDD + 0.8V VDD V VDD < 4.5V D040A 2.0 VDD V 4.5V ≤ VDD ≤ 5.5V D041 with Schmitt Trigger buffer 0.8 VDD VDD V D042 MCLR, OSC1 (EC mode) 0.8 VDD VDD V D042A OSC1 (in XT, HS and LP modes) and T1OSI 1.6 VDD VDD V D043 OSC1 (RC mode)(1) 0.9 VDD VDD V IIL Input Leakage Current(2,3) D060 I/O ports — ±1 μA VSS ≤ VPIN ≤ VDD, Pin at high-impedance D061 MCLR — ±5 μA VSS ≤ VPIN ≤ VDD D063 OSC1 — ±5 μA VSS ≤ VPIN ≤ VDD IPU Weak Pull-up Current D070 IPURB PORTB weak pull-up current 50 400 μA VDD = 5V, VPIN = VSS Note 1: In RC oscillator configuration, the OSC1/CLKI pin is a Schmitt Trigger input. It is not recommended that the PIC® device be driven with an external clock while in RC mode. 2: The leakage current on the MCLR pin is strongly dependent on the applied voltage level. The specified levels represent normal operating conditions. Higher leakage current may be measured at different input voltages. 3: Negative current is defined as current sourced by the pin. 4: Parameter is characterized but not tested.© 2007 Microchip Technology Inc. DS39605F-page 251 PIC18F1220/1320 VOL Output Low Voltage D080 I/O ports — 0.6 V IOL = 8.5 mA, VDD = 4.5V, -40°C to +85°C D083 OSC2/CLKO (RC mode) — 0.6 V IOL = 1.6 mA, VDD = 4.5V, -40°C to +85°C VOH Output High Voltage(3) D090 I/O ports VDD – 0.7 — V IOH = -3.0 mA, VDD = 4.5V, -40°C to +85°C D092 OSC2/CLKO (RC mode) VDD – 0.7 — V IOH = -1.3 mA, VDD = 4.5V, -40°C to +85°C D150 VOD Open-Drain High Voltage — 8.5 V RA4 pin Capacitive Loading Specs on Output Pins D100(4) COSC2 OSC2 pin — 15 pF In XT, HS and LP modes when external clock is used to drive OSC1 D101 CIO All I/O pins and OSC2 (in RC mode) — 50 pF To meet the AC timing specifications D102 CB SCL, SDA — 400 pF In I2C mode 22.3 DC Characteristics: PIC18F1220/1320 (Industrial) PIC18LF1220/1320 (Industrial) (Continued) DC CHARACTERISTICS Standard Operating Conditions (unless otherwise stated) Operating temperature -40°C ≤ TA ≤ +85°C for industrial -40°C ≤ TA ≤ +125°C for extended Param No. Symbol Characteristic Min Max Units Conditions Note 1: In RC oscillator configuration, the OSC1/CLKI pin is a Schmitt Trigger input. It is not recommended that the PIC® device be driven with an external clock while in RC mode. 2: The leakage current on the MCLR pin is strongly dependent on the applied voltage level. The specified levels represent normal operating conditions. Higher leakage current may be measured at different input voltages. 3: Negative current is defined as current sourced by the pin. 4: Parameter is characterized but not tested.PIC18F1220/1320 DS39605F-page 252 © 2007 Microchip Technology Inc. TABLE 22-1: MEMORY PROGRAMMING REQUIREMENTS DC CHARACTERISTICS Standard Operating Conditions (unless otherwise stated) Operating temperature -40°C ≤ TA ≤ +85°C for industrial Param No. Sym Characteristic Min Typ† Max Units Conditions Internal Program Memory Programming Specifications(1) D110 VPP Voltage on MCLR/VPP pin 9.00 — 13.25 V (Note 2) D112 IPP Current into MCLR/VPP pin — — 5 μA D113 IDDP Supply Current during Programming — — 10 mA Data EEPROM Memory D120 ED Byte Endurance 100K 1M — E/W -40°C to +85°C D121 VDRW VDD for Read/Write VMIN — 5.5 V Using EECON to read/write VMIN = Minimum operating voltage D122 TDEW Erase/Write Cycle Time — 4 — ms D123 TRETD Characteristic Retention 40 — — Year Provided no other specifications are violated D124 TREF Number of Total Erase/Write Cycles before Refresh(3) 1M 10M — E/W -40°C to +85°C Program Flash Memory D130 EP Cell Endurance 10K 100K — E/W -40°C to +85°C D131 VPR VDD for Read VMIN — 5.5 V VMIN = Minimum operating voltage D132 VIE VDD for Block Erase 4.5 — 5.5 V Using ICSP port D132A VIW VDD for Externally Timed Erase or Write 4.5 — 5.5 V Using ICSP port D132B VPEW VDD for Self-Timed Write VMIN — 5.5 V VMIN = Minimum operating voltage D133 TIE ICSP™ Block Erase Cycle Time — 4 — ms VDD > 4.5V D133A TIW ICSP Erase or Write Cycle Time (externally timed) 1 — — ms VDD > 4.5V D133A TIW Self-Timed Write Cycle Time — 2 — ms D134 TRETD Characteristic Retention 40 — — Year Provided no other specifications are violated † Data in “Typ” column is at 5.0V, 25°C unless otherwise stated. These parameters are for design guidance only and are not tested. Note 1: These specifications are for programming the on-chip program memory through the use of table write instructions. 2: The pin may be kept in this range at times other than programming, but it is not recommended. 3: Refer to Section 7.8 “Using the Data EEPROM” for a more detailed discussion on data EEPROM endurance.© 2007 Microchip Technology Inc. DS39605F-page 253 PIC18F1220/1320 FIGURE 22-4: LOW-VOLTAGE DETECT CHARACTERISTICS VLVD LVDIF VDD (LVDIF set by hardware) (LVDIF can be cleared in software) TABLE 22-2: LOW-VOLTAGE DETECT CHARACTERISTICS PIC18LF1220/1320 (Industrial) Standard Operating Conditions (unless otherwise stated) Operating temperature -40°C ≤ TA ≤ +85°C for industrial PIC18F1220/1320 (Industrial, Extended) Standard Operating Conditions (unless otherwise stated) Operating temperature -40°C ≤ TA ≤ +85°C for industrial -40°C ≤ TA ≤ +125°C for extended Param No. Symbol Characteristic Min Typ† Max Units Conditions D420D LVD Voltage on VDD Transition High-to-Low Industrial Low Voltage (-10°C to +85°C) PIC18LF1220/1320 LVDL<3:0> = 0000 N/A N/A N/A V Reserved LVDL<3:0> = 0001 N/A N/A N/A V Reserved LVDL<3:0> = 0010 2.08 2.26 2.44 V LVDL<3:0> = 0011 2.26 2.45 2.65 V LVDL<3:0> = 0100 2.35 2.55 2.76 V LVDL<3:0> = 0101 2.55 2.77 2.99 V LVDL<3:0> = 0110 2.64 2.87 3.10 V LVDL<3:0> = 0111 2.82 3.07 3.31 V LVDL<3:0> = 1000 3.09 3.36 3.63 V LVDL<3:0> = 1001 3.29 3.57 3.86 V LVDL<3:0> = 1010 3.38 3.67 3.96 V LVDL<3:0> = 1011 3.56 3.87 4.18 V LVDL<3:0> = 1100 3.75 4.07 4.40 V LVDL<3:0> = 1101 3.93 4.28 4.62 V LVDL<3:0> = 1110 4.23 4.60 4.96 V Legend: Shading of rows is to assist in readability of the table. † Production tested at TAMB = 25°C. Specifications over temperature limits ensured by characterization.PIC18F1220/1320 DS39605F-page 254 © 2007 Microchip Technology Inc. D420F LVD Voltage on VDD Transition High-to-Low Industrial Low Voltage (-40°C to -10°C) PIC18LF1220/1320 LVDL<3:0> = 0000 N/A N/A N/A V Reserved LVDL<3:0> = 0001 N/A N/A N/A V Reserved LVDL<3:0> = 0010 1.99 2.26 2.53 V LVDL<3:0> = 0011 2.16 2.45 2.75 V LVDL<3:0> = 0100 2.25 2.55 2.86 V LVDL<3:0> = 0101 2.43 2.77 3.10 V LVDL<3:0> = 0110 2.53 2.87 3.21 V LVDL<3:0> = 0111 2.70 3.07 3.43 V LVDL<3:0> = 1000 2.96 3.36 3.77 V LVDL<3:0> = 1001 3.14 3.57 4.00 V LVDL<3:0> = 1010 3.23 3.67 4.11 V LVDL<3:0> = 1011 3.41 3.87 4.34 V LVDL<3:0> = 1100 3.58 4.07 4.56 V LVDL<3:0> = 1101 3.76 4.28 4.79 V LVDL<3:0> = 1110 4.04 4.60 5.15 V LVD Voltage on VDD Transition High-to-Low Industrial (-10°C to +85°C) D420G PIC18F1220/1320 LVDL<3:0> = 1101 3.93 4.28 4.62 V LVDL<3:0> = 1110 4.23 4.60 4.96 V LVD Voltage on VDD Transition High-to-Low Industrial (-40°C to -10°C) D420H PIC18F1220/1320 LVDL<3:0> = 1101 3.76 4.28 4.79 V LVDL<3:0> = 1110 4.04 4.60 5.15 V LVD Voltage on VDD Transition High-to-Low Extended (-10°C to +85°C) D420J PIC18F1220/1320 LVDL<3:0> = 1101 3.94 4.28 4.62 V LVDL<3:0> = 1110 4.23 4.60 4.96 V LVD Voltage on VDD Transition High-to-Low Extended (-40°C to -10°C, +85°C to +125°C) D420K PIC18F1220/1320 LVDL<3:0> = 1101 3.77 4.28 4.79 V LVDL<3:0> = 1110 4.05 4.60 5.15 V TABLE 22-2: LOW-VOLTAGE DETECT CHARACTERISTICS (CONTINUED) PIC18LF1220/1320 (Industrial) Standard Operating Conditions (unless otherwise stated) Operating temperature -40°C ≤ TA ≤ +85°C for industrial PIC18F1220/1320 (Industrial, Extended) Standard Operating Conditions (unless otherwise stated) Operating temperature -40°C ≤ TA ≤ +85°C for industrial -40°C ≤ TA ≤ +125°C for extended Param No. Symbol Characteristic Min Typ† Max Units Conditions Legend: Shading of rows is to assist in readability of the table. † Production tested at TAMB = 25°C. Specifications over temperature limits ensured by characterization.© 2007 Microchip Technology Inc. DS39605F-page 255 PIC18F1220/1320 22.4 AC (Timing) Characteristics 22.4.1 TIMING PARAMETER SYMBOLOGY The timing parameter symbols have been created following one of the following formats: 1. TppS2ppS 3. TCC:ST (I2C specifications only) 2. TppS 4. Ts (I2C specifications only) T F Frequency T Time Lowercase letters (pp) and their meanings: pp cc CCP1 osc OSC1 ck CLKO rd RD cs CS rw RD or WR di SDI sc SCK do SDO ss SS dt Data in t0 T0CKI io I/O port t1 T13CKI mc MCLR wr WR Uppercase letters and their meanings: S F Fall P Period H High R Rise I Invalid (High-Impedance) V Valid L Low Z High-Impedance I 2C only AA output access High High BUF Bus free Low Low TCC:ST (I2C specifications only) CC HD Hold SU Setup ST DAT DATA input hold STO Stop condition STA Start conditionPIC18F1220/1320 DS39605F-page 256 © 2007 Microchip Technology Inc. 22.4.2 TIMING CONDITIONS The temperature and voltages specified in Table 22-3 apply to all timing specifications unless otherwise noted. Figure 22-5 specifies the load conditions for the timing specifications. TABLE 22-3: TEMPERATURE AND VOLTAGE SPECIFICATIONS – AC FIGURE 22-5: LOAD CONDITIONS FOR DEVICE TIMING SPECIFICATIONS AC CHARACTERISTICS Standard Operating Conditions (unless otherwise stated) Operating temperature -40°C ≤ TA ≤ +85°C for industrial -40°C ≤ TA ≤ +125°C for extended Operating voltage VDD range as described in DC spec Section 22.1 and Section 22.3. LF parts operate for industrial temperatures only. VDD/2 CL RL pin Pin VSS VSS CL RL = 464Ω CL = 50 pF for all pins except OSC2/CLKO Load Condition 1 Load Condition 2© 2007 Microchip Technology Inc. DS39605F-page 257 PIC18F1220/1320 22.4.3 TIMING DIAGRAMS AND SPECIFICATIONS FIGURE 22-6: EXTERNAL CLOCK TIMING (ALL MODES EXCEPT PLL) TABLE 22-4: EXTERNAL CLOCK TIMING REQUIREMENTS OSC1 CLKO Q4 Q1 Q2 Q3 Q4 Q1 1 2 3 3 4 4 Param. No. Symbol Characteristic Min Max Units Conditions 1A FOSC External CLKI Frequency(1) DC 40 MHz EC, ECIO (LF and Industrial) DC 25 MHz EC, ECIO (Extended) Oscillator Frequency(1) DC 4 MHz RC oscillator DC 1 MHz XT oscillator DC 25 MHz HS oscillator 1 10 MHz HS + PLL oscillator DC 33 kHz LP Oscillator mode 1 TOSC External CLKI Period(1) 25 — ns EC, ECIO (LF and Industrial) 40 — ns EC, ECIO (Extended) Oscillator Period(1) 250 — ns RC oscillator 1000 — ns XT oscillator 25 100 — 1000 ns ns HS oscillator HS + PLL oscillator 30 — μs LP oscillator 2 TCY Instruction Cycle Time(1) 100 — ns TCY = 4/FOSC 3 TosL, TosH External Clock in (OSC1) High or Low Time 30 — ns XT oscillator 2.5 — μs LP oscillator 10 — ns HS oscillator 4 TosR, TosF External Clock in (OSC1) Rise or Fall Time — 20 ns XT oscillator — 50 ns LP oscillator — 7.5 ns HS oscillator Note 1: Instruction cycle period (TCY) equals four times the input oscillator time base period for all configurations except PLL. All specified values are based on characterization data for that particular oscillator type under standard operating conditions, with the device executing code. Exceeding these specified limits may result in an unstable oscillator operation and/or higher than expected current consumption. All devices are tested to operate at “min.” values with an external clock applied to the OSC1/CLKI pin. When an external clock input is used, the “max.” cycle time limit is “DC” (no clock) for all devices.PIC18F1220/1320 DS39605F-page 258 © 2007 Microchip Technology Inc. TABLE 22-5: PLL CLOCK TIMING SPECIFICATIONS, HS/HSPLL MODE (VDD = 4.2V TO 5.5V) Param No. Sym Characteristic Min Typ† Max Units Conditions F10 FOSC Oscillator Frequency Range 4 — 10 MHz HS and HSPLL mode only F11 FSYS On-Chip VCO System Frequency 16 — 40 MHz HSPLL mode only F12 TPLL PLL Start-up Time (Lock Time) — — 2 ms HSPLL mode only F13 ΔCLK CLKO Stability (Jitter) -2 — +2 % HSPLL mode only † Data in “Typ” column is at 5V, 25°C unless otherwise stated. These parameters are for design guidance only and are not tested. TABLE 22-6: INTERNAL RC ACCURACY: PIC18F1220/1320 (INDUSTRIAL) PIC18LF1220/1320 (INDUSTRIAL) PIC18LF1220/1320 (Industrial) Standard Operating Conditions (unless otherwise stated) Operating temperature -40°C ≤ TA ≤ +85°C for industrial PIC18F1220/1320 (Industrial) Standard Operating Conditions (unless otherwise stated) Operating temperature -40°C ≤ TA ≤ +85°C for industrial -40°C ≤ TA ≤ +125°C for extended Param No. Device Min Typ Max Units Conditions INTOSC Accuracy @ Freq = 8 MHz, 4 MHz, 2 MHz, 1 MHz, 500 kHz, 250 kHz, 125 kHz(1) PIC18LF1220/1320 -2 +/-1 2 % +25°C VDD = 2.7-3.3V -5 — 5 % -10°C to +85°C VDD = 2.7-3.3V -10 — 10 % -40°C to +85°C VDD = 2.7-3.3V PIC18F1220/1320PIC18F 1220/1320 -2 +/-1 2 % +25°C VDD = 4.5-5.5V -5 — 5 % -10°C to +85°C VDD = 4.5-5.5V -10 — 10 % -40°C to +85°C VDD = 4.5-5.5V INTRC Accuracy @ Freq = 31 kHz(2) PIC18LF1220/1320 26.562 — 35.938 kHz -40°C to +85°C VDD = 2.7-3.3V PIC18F1220/1320PIC18F 1220/1320 26.562 — 35.938 kHz -40°C to +85°C VDD = 4.5-5.5V Legend: Shading of rows is to assist in readability of the table. Note 1: Frequency calibrated at 25°C. OSCTUNE register can be used to compensate for temperature and VDD drift. 2: INTRC frequency after calibration. 3: Change of INTRC frequency as VDD changes.© 2007 Microchip Technology Inc. DS39605F-page 259 PIC18F1220/1320 FIGURE 22-7: CLKO AND I/O TIMING TABLE 22-7: CLKO AND I/O TIMING REQUIREMENTS Note: Refer to Figure 22-5 for load conditions. OSC1 CLKO I/O pin (Input) I/O pin (Output) Q4 Q1 Q2 Q3 10 13 14 17 20, 21 19 18 15 11 12 16 Old Value New Value Param. No. Symbol Characteristic Min Typ Max Units Conditions 10 TosH2ckL OSC1↑ to CLKO↓ — 75 200 ns (Note 1) 11 TosH2ckH OSC1↑ to CLKO↑ — 75 200 ns (Note 1) 12 TckR CLKO Rise Time — 35 100 ns (Note 1) 13 TckF CLKO Fall Time — 35 100 ns (Note 1) 14 TckL2ioV CLKO↓ to Port Out Valid — — 0.5 TCY + 20 ns (Note 1) 15 TioV2ckH Port In Valid before CLKO↑ 0.25 TCY + 25 — — ns (Note 1) 16 TckH2ioI Port In Hold after CLKO↑ 0 — — ns (Note 1) 17 TosH2ioV OSC1↑ (Q1 cycle) to Port Out Valid — 50 150 ns 18 TosH2ioI OSC1↑ (Q2 cycle) to Port Input Invalid (I/O in hold time) PIC18F1X20 100 — — ns 18A PIC18LF1X20 200 — — ns 19 TioV2osH Port Input Valid to OSC1↑ (I/O in setup time) 0 — — ns 20 TioR Port Output Rise Time PIC18F1X20 — 10 25 ns 20A PIC18LF1X20 — — 60 ns 21 TioF Port Output Fall Time PIC18F1X20 — 10 25 ns 21A PIC18LF1X20 — — 60 ns Note 1: Measurements are taken in RC mode, where CLKO output is 4 x TOSC.PIC18F1220/1320 DS39605F-page 260 © 2007 Microchip Technology Inc. FIGURE 22-8: RESET, WATCHDOG TIMER, OSCILLATOR START-UP TIMER AND POWER-UP TIMER TIMING FIGURE 22-9: BROWN-OUT RESET TIMING VDD MCLR Internal POR PWRT Time-out OSC Time-out Internal Reset Watchdog Timer Reset 33 32 30 31 34 I/O pins 34 Note: Refer to Figure 22-5 for load conditions. VDD BVDD 35 VBGAP = 1.2V VIRVST Enable Internal Internal Reference 36 Reference Voltage Voltage Stable© 2007 Microchip Technology Inc. DS39605F-page 261 PIC18F1220/1320 TABLE 22-8: RESET, WATCHDOG TIMER, OSCILLATOR START-UP TIMER, POWER-UP TIMER AND BROWN-OUT RESET REQUIREMENTS FIGURE 22-10: TIMER0 AND TIMER1 EXTERNAL CLOCK TIMINGS Param. No. Symbol Characteristic Min Typ Max Units Conditions 30 TmcL MCLR Pulse Width (low) 2 — — μs 31 TWDT Watchdog Timer Time-out Period (No postscaler) 3.48 4.00 4.71 ms 32 TOST Oscillation Start-up Timer Period 1024 TOSC — 1024 TOSC — TOSC = OSC1 period 33 TPWRT Power-up Timer Period — 65.5 132 ms 34 TIOZ I/O High-Impedance from MCLR Low or Watchdog Timer Reset —2— μs 35 TBOR Brown-out Reset Pulse Width 200 — — μs VDD ≤ BVDD (see D005) 36 TIVRST Time for Internal Reference Voltage to become stable — 20 50 μs 37 TLVD Low-Voltage Detect Pulse Width 200 — — μs VDD ≤ VLVD Note: Refer to Figure 22-5 for load conditions. 46 47 45 48 41 42 40 T0CKI T1OSO/T13CKI TMR0 or TMR1PIC18F1220/1320 DS39605F-page 262 © 2007 Microchip Technology Inc. TABLE 22-9: TIMER0 AND TIMER1 EXTERNAL CLOCK REQUIREMENTS FIGURE 22-11: CAPTURE/COMPARE/PWM TIMINGS (ALL CCP MODULES) Param No. Symbol Characteristic Min Max Units Conditions 40 Tt0H T0CKI High Pulse Width No prescaler 0.5 TCY + 20 — ns With prescaler 10 — ns 41 Tt0L T0CKI Low Pulse Width No prescaler 0.5 TCY + 20 — ns With prescaler 10 — ns 42 Tt0P T0CKI Period No prescaler TCY + 10 — ns With prescaler Greater of: 20 ns or TCY + 40 N — ns N = prescale value (1, 2, 4,..., 256) 45 Tt1H T13CKI High Time Synchronous, no prescaler 0.5 TCY + 20 — ns Synchronous, with prescaler PIC18F1X20 10 — ns PIC18LF1X20 25 — ns Asynchronous PIC18F1X20 30 — ns PIC18LF1X20 50 — ns 46 Tt1L T13CKI Low Time Synchronous, no prescaler 0.5 TCY + 5 — ns Synchronous, with prescaler PIC18F1X20 10 — ns PIC18LF1X20 25 — ns Asynchronous PIC18F1X20 30 — ns PIC18LF1X20 50 — ns 47 Tt1P T13CKI Input Period Synchronous Greater of: 20 ns or TCY + 40 N — ns N = prescale value (1, 2, 4, 8) Asynchronous 60 — ns Ft1 T13CKI Oscillator Input Frequency Range DC 50 kHz 48 Tcke2tmrI Delay from External T13CKI Clock Edge to Timer Increment 2 TOSC 7 TOSC — Note: Refer to Figure 22-5 for load conditions. CCPx (Capture Mode) 50 51 52 CCPx 53 54 (Compare or PWM Mode)© 2007 Microchip Technology Inc. DS39605F-page 263 PIC18F1220/1320 TABLE 22-10: CAPTURE/COMPARE/PWM REQUIREMENTS (ALL CCP MODULES) FIGURE 22-12: EUSART SYNCHRONOUS TRANSMISSION (MASTER/SLAVE) TIMING TABLE 22-11: EUSART SYNCHRONOUS TRANSMISSION REQUIREMENTS Param. No. Symbol Characteristic Min Max Units Conditions 50 TccL CCPx Input Low Time No prescaler 0.5 TCY + 20 — ns With prescaler PIC18F1X20 10 — ns PIC18LF1X20 20 — ns 51 TccH CCPx Input High Time No prescaler 0.5 TCY + 20 — ns With prescaler PIC18F1X20 10 — ns PIC18LF1X20 20 — ns 52 TccP CCPx Input Period 3 TCY + 40 N — ns N = prescale value (1, 4 or 16) 53 TccR CCPx Output Fall Time PIC18F1X20 — 25 ns PIC18LF1X20 — 45 ns 54 TccF CCPx Output Fall Time PIC18F1X20 — 25 ns PIC18LF1X20 — 45 ns 121 121 120 122 RB1/AN5/TX/ RB4/AN6/RX/ DT/KBI0 pin CK/INT1 pin Note: Refer to Figure 22-5 for load conditions. Param. No. Symbol Characteristic Min Max Units Conditions 120 TckH2dtV SYNC XMIT (MASTER & SLAVE) Clock High to Data Out Valid PIC18F1X20 — 40 ns PIC18LF1X20 — 100 ns 121 Tckrf Clock Out Rise Time and Fall Time (Master mode) PIC18F1X20 — 20 ns PIC18LF1X20 — 50 ns 122 Tdtrf Data Out Rise Time and Fall Time PIC18F1X20 — 20 ns PIC18LF1X20 — 50 nsPIC18F1220/1320 DS39605F-page 264 © 2007 Microchip Technology Inc. FIGURE 22-13: EUSART SYNCHRONOUS RECEIVE (MASTER/SLAVE) TIMING TABLE 22-12: EUSART SYNCHRONOUS RECEIVE REQUIREMENTS TABLE 22-13: A/D CONVERTER CHARACTERISTICS: PIC18F1220/1320 (INDUSTRIAL) PIC18LF1220/1320 (INDUSTRIAL) Param. No. Symbol Characteristic Min Max Units Conditions 125 TdtV2ckl SYNC RCV (MASTER & SLAVE) Data Hold before CK↓ (DT hold time) 10 — ns 126 TckL2dtl Data Hold after CK↓ (DT hold time) 15 — ns Param No. Symbol Characteristic Min Typ Max Units Conditions A01 NR Resolution — — 10 bit ΔVREF ≥ 3.0V A03 EIL Integral Linearity Error — — <±1 LSb ΔVREF ≥ 3.0V A04 EDL Differential Linearity Error — — <±1 LSb ΔVREF ≥ 3.0V A06 EOFF Offset Error — — <±1 LSb ΔVREF ≥ 3.0V A07 EGN Gain Error — — <±1 LSb ΔVREF ≥ 3.0V A10 — Monotonicity guaranteed(2) — A20 ΔVREF Reference Voltage Range (VREFH – VREFL) 3 — AVDD – AVSS V For 10-bit resolution A21 VREFH Reference Voltage High AVSS + 3.0V — AVDD + 0.3V V For 10-bit resolution A22 VREFL Reference Voltage Low AVSS – 0.3V — AVDD – 3.0V V For 10-bit resolution A25 VAIN Analog Input Voltage VREFL — VREFH V A28 AVDD Analog Supply Voltage VDD – 0.3 — VDD + 0.3 V A29 AVSS Analog Supply Voltage VSS – 0.3 — VSS + 0.3 V A30 ZAIN Recommended Impedance of Analog Voltage Source — — 2.5 kΩ A40 IAD A/D Conversion Current (VDD) PIC18F1X20 — 180 — μA Average current consumption when A/D is on (Note 1) PIC18LF1X20 — 90 — μA A50 IREF VREF Input Current (Note 3) — — — — ±5 ±150 μA μA During VAIN acquisition. During A/D conversion cycle. Note 1: When A/D is off, it will not consume any current other than minor leakage current. The power-down current specification includes any such leakage from the A/D module. 2: The A/D conversion result never decreases with an increase in the input voltage and has no missing codes. 3: VREFH current is from RA3/AN3/VREF+ pin or AVDD, whichever is selected as the VREFH source. VREFL current is from RA2/AN2/VREF- pin or AVSS, whichever is selected as the VREFL source. 125 126 Note: Refer to Figure 22-5 for load conditions. RB1/AN5/TX/ RB4/AN6/RX/ DT/KBI0 pin CK/INT1 pin© 2007 Microchip Technology Inc. DS39605F-page 265 PIC18F1220/1320 FIGURE 22-14: A/D CONVERSION TIMING TABLE 22-14: A/D CONVERSION REQUIREMENTS 131 130 132 BSF ADCON0, GO Q4 A/D CLK(1) A/D DATA ADRES ADIF GO SAMPLE OLD_DATA Sampling Stopped DONE NEW_DATA (Note 2) 9 87 2 1 0 Note 1: If the A/D clock source is selected as RC, a time of TCY is added before the A/D clock starts. This allows the SLEEP instruction to be executed. 2: This is a minimal RC delay (typically 100 ns), which also disconnects the holding capacitor from the analog input. . . . . . . TCY Param No. Symbol Characteristic Min Max Units Conditions 130 TAD A/D Clock Period PIC18F1X20 1.6 20(5) μs TOSC based, VREF ≥ 3.0V PIC18LF1X20 3.0 20(5) μs TOSC based, VREF full range PIC18F1X20 2.0 6.0 μs A/D RC mode PIC18LF1X20 3.0 9.0 μs A/D RC mode 131 TCNV Conversion Time (not including acquisition time) (Note 1) 11 12 TAD 132 TACQ Acquisition Time (Note 3) 15 10 — — μs μs -40°C ≤ Temp ≤ +125°C 0°C ≤ Temp ≤ +125°C 135 TSWC Switching Time from Convert → Sample — (Note 4) 136 TAMP Amplifier Settling Time (Note 2) 1 — μs This may be used if the “new” input voltage has not changed by more than 1 LSb (i.e., 5 mV @ 5.12V) from the last sampled voltage (as stated on CHOLD). Note 1: ADRES register may be read on the following TCY cycle. 2: See Section 17.0 “10-Bit Analog-to-Digital Converter (A/D) Module” for minimum conditions when input voltage has changed more than 1 LSb. 3: The time for the holding capacitor to acquire the “New” input voltage, when the voltage changes full scale after the conversion (AVDD to AVSS, or AVSS to AVDD). The source impedance (RS) on the input channels is 50Ω. 4: On the next Q4 cycle of the device clock. 5: The time of the A/D clock period is dependent on the device frequency and the TAD clock divider. PIC18F1220/1320 DS39605F-page 266 © 2007 Microchip Technology Inc. NOTES:© 2007 Microchip Technology Inc. DS39605F-page 267 PIC18F1220/1320 23.0 DC AND AC CHARACTERISTICS GRAPHS AND TABLES “Typical” represents the mean of the distribution at 25°C. “Maximum” or “minimum” represents (mean + 3σ) or (mean – 3σ) respectively, where σ is a standard deviation, over the whole temperature range. FIGURE 23-1: TYPICAL IDD vs. FOSC OVER VDD PRI_RUN, EC MODE, +25°C FIGURE 23-2: MAXIMUM IDD vs. FOSC OVER VDD PRI_RUN, EC MODE, -40°C TO +85°C Note: The graphs and tables provided following this note are a statistical summary based on a limited number of samples and are provided for informational purposes only. The performance characteristics listed herein are not tested or guaranteed. In some graphs or tables, the data presented may be outside the specified operating range (e.g., outside specified power supply range) and therefore, outside the warranted range. 0.0 0.1 0.2 0.3 0.4 0.5 0.00 0.02 0.04 0.06 0.08 0.10 0.12 0.14 0.16 0.18 0.20 FOSC (MHz) IDD (mA) 5.0V 5.5V 4.0V 4.5V 3.0V 3.5V 2.0V 2.5V Typical: statistical mean @ 25°C Maximum: mean + 3σ (-40°C to +125°C) Minimum: mean – 3σ (-40°C to +125°C) 0.0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.00 0.02 0.04 0.06 0.08 0.10 0.12 0.14 0.16 0.18 0.20 FOSC (MHz) IDD (mA) 5.0V 5.5V 4.0V 4.5V 3.0V 3.5V 2.0V 2.5V Typical: statistical mean @ 25°C Maximum: mean + 3σ (-40°C to +125°C) Minimum: mean – 3σ (-40°C to +125°C)PIC18F1220/1320 DS39605F-page 268 © 2007 Microchip Technology Inc. FIGURE 23-3: MAXIMUM IDD vs. FOSC OVER VDD PRI_RUN, EC MODE, -40°C TO +125°C FIGURE 23-4: TYPICAL IDD vs. FOSC OVER VDD PRI_RUN, EC MODE, +25°C 0.0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.00 0.02 0.04 0.06 0.08 0.10 0.12 0.14 0.16 0.18 0.20 FOSC (MHz) IDD (mA) 5.0V 5.5V 4.0V 4.5V 3.0V 3.5V 2.0V 2.5V Typical: statistical mean @ 25°C Maximum: mean + 3σ (-40°C to +125°C) Minimum: mean – 3σ (-40°C to +125°C) 0.0 0.2 0.4 0.6 0.8 1.0 1.2 1.4 1.6 1.8 2.0 1.0 1.5 2.0 2.5 3.0 3.5 4.0 FOSC (MHz) IDD (mA) 5.0V 5.5V 4.0V 4.5V 3.0V 3.5V 2.0V 2.5V Typical: statistical mean @ 25°C Maximum: mean + 3σ (-40°C to +125°C) Minimum: mean – 3σ (-40°C to +125°C)© 2007 Microchip Technology Inc. DS39605F-page 269 PIC18F1220/1320 FIGURE 23-5: MAXIMUM IDD vs. FOSC OVER VDD PRI_RUN, EC MODE, -40°C TO +125°C FIGURE 23-6: TYPICAL IDD vs. FOSC OVER VDD PRI_RUN, EC MODE, +25°C 0.0 0.5 1.0 1.5 2.0 2.5 1.0 1.5 2.0 2.5 3.0 3.5 4.0 FOSC (MHz) IDD (mA) 5.0V 5.5V 4.0V 4.5V 3.0V 3.5V 2.0V 2.5V Typical: statistical mean @ 25°C Maximum: mean + 3σ (-40°C to +125°C) Minimum: mean – 3σ (-40°C to +125°C) 0 2 4 6 8 10 12 14 16 4 8 12 16 20 24 28 32 36 40 FOSC (MHz) IDD (mA) 5.0V 5.5V 4.0V 4.5V 3.0V 3.5V 2.0V 2.5V Typical: statistical mean @ 25°C Maximum: mean + 3σ (-40°C to +125°C) Minimum: mean – 3σ (-40°C to +125°C)PIC18F1220/1320 DS39605F-page 270 © 2007 Microchip Technology Inc. FIGURE 23-7: MAXIMUM IDD vs. FOSC OVER VDD PRI_RUN, EC MODE, -40°C TO +125°C FIGURE 23-8: TYPICAL IDD vs. FOSC OVER VDD PRI_IDLE, EC MODE, +25°C 0 2 4 6 8 10 12 14 16 4 8 12 16 20 24 28 32 36 40 FOSC (MHz) IDD (mA) 5.0V 5.5V 4.0V 4.5V 3.0V 3.5V 2.0V 2.5V Typical: statistical mean @ 25°C Maximum: mean + 3σ (-40°C to +125°C) Minimum: mean – 3σ (-40°C to +125°C) 0.000 0.005 0.010 0.015 0.020 0.025 0.030 0.035 0.00 0.02 0.04 0.06 0.08 0.10 0.12 0.14 0.16 0.18 0.20 FOSC (MHz) IDD (mA) 4.0V 4.5V 3.0V 3.5V 2.0V 2.5V 5.0V 5.5V Typical: statistical mean @ 25°C Maximum: mean + 3σ (-40°C to +125°C) Minimum: mean – 3σ (-40°C to +125°C)© 2007 Microchip Technology Inc. DS39605F-page 271 PIC18F1220/1320 FIGURE 23-9: MAXIMUM IDD vs. FOSC OVER VDD PRI_IDLE, EC MODE, -40°C TO +85°C FIGURE 23-10: MAXIMUM IDD vs. FOSC OVER VDD PRI_IDLE, EC MODE, -40°C TO +125°C 0.000 0.005 0.010 0.015 0.020 0.025 0.030 0.035 0.040 0.045 0.00 0.02 0.04 0.06 0.08 0.10 0.12 0.14 0.16 0.18 0.20 FOSC (MHz) IDD (mA) 4.0V 4.5V 3.0V 3.5V 2.0V 2.5V 5.0V 5.5V Typical: statistical mean @ 25°C Maximum: mean + 3σ (-40°C to +125°C) Minimum: mean – 3σ (-40°C to +125°C) 0.000 0.010 0.020 0.030 0.040 0.050 0.060 0.070 0.080 0.090 0.100 0.00 0.02 0.04 0.06 0.08 0.10 0.12 0.14 0.16 0.18 0.20 FOSC (MHz) IDD (mA) 4.0V 4.5V 3.0V 3.5V 2.0V 2.5V 5.0V 5.5V Typical: statistical mean @ 25°C Maximum: mean + 3σ (-40°C to +125°C) Minimum: mean – 3σ (-40°C to +125°C)PIC18F1220/1320 DS39605F-page 272 © 2007 Microchip Technology Inc. FIGURE 23-11: TYPICAL IDD vs. FOSC OVER VDD PRI_IDLE, EC MODE, +25°C FIGURE 23-12: MAXIMUM IDD vs. FOSC OVER VDD PRI_IDLE, EC MODE, -40°C TO +125°C Typical I vs F over V PRI_IDLE, EC mode, +25°C 0 100 200 300 400 500 600 1.0 1.5 2.0 2.5 3.0 3.5 4.0 FOSC (MHz) IDD (μA) 4.0V 4.5V 3.0V 3.5V 2.0V 2.5V 5.0V 5.5V Typical: statistical mean @ 25°C Maximum: mean + 3σ (-40°C to +125°C) Minimum: mean – 3σ (-40°C to +125°C) 0 100 200 300 400 500 600 1.0 1.5 2.0 2.5 3.0 3.5 4.0 FOSC (MHz) IDD (μA) 4.0V 4.5V 3.0V 3.5V 2.0V 2.5V 5.0V 5.5V Typical: statistical mean @ 25°C Maximum: mean + 3σ (-40°C to +125°C) Minimum: mean – 3σ (-40°C to +125°C)© 2007 Microchip Technology Inc. DS39605F-page 273 PIC18F1220/1320 FIGURE 23-13: TYPICAL IDD vs. FOSC OVER VDD PRI_IDLE, EC MODE, +25°C FIGURE 23-14: MAXIMUM IDD vs. FOSC OVER VDD PRI_IDLE, EC MODE, -40°C TO +125°C 0.0 0.5 1.0 1.5 2.0 2.5 3.0 3.5 4.0 4.5 5.0 5.5 6.0 4 8 12 16 20 24 28 32 36 40 FOSC (MHz) IDD (mA) 4.0V 4.5V 3.0V 3.5V 2.0V 2.5V 5.0V 5.5V Typical: statistical mean @ 25°C Maximum: mean + 3σ (-40°C to +125°C) Minimum: mean – 3σ (-40°C to +125°C) 0.0 0.5 1.0 1.5 2.0 2.5 3.0 3.5 4.0 4.5 5.0 5.5 6.0 4 8 12 16 20 24 28 32 36 40 FOSC (MHz) IDD (mA) 4.0V 4.5V 3.0V 3.5V 2.0V 2.5V 5.0V 5.5V Typical: statistical mean @ 25°C Maximum: mean + 3σ (-40°C to +125°C) Minimum: mean – 3σ (-40°C to +125°C)PIC18F1220/1320 DS39605F-page 274 © 2007 Microchip Technology Inc. FIGURE 23-15: TYPICAL IPD vs. VDD (+25°C), 125 kHz TO 8 MHz RC_RUN MODE, ALL PERIPHERALS DISABLED FIGURE 23-16: MAXIMUM IPD vs. VDD (-40°C TO +125°C), 125 kHz TO 8 MHz RC_RUN MODE, ALL PERIPHERALS DISABLED 0 500 1000 1500 2000 2500 3000 2.0 2.5 3.0 3.5 4.0 4.5 5.0 5.5 VDD (V) IPD (μA) 8 MHz 125 kHz 4 MHz 2 MHz 1 MHz 250 kHz and 500 kHz curves are bounded by 125 kHz and 1 MHz curves. Typical: statistical mean @ 25°C Maximum: mean + 3σ (-40°C to +125°C) Minimum: mean – 3σ (-40°C to +125°C) 0 500 1000 1500 2000 2500 3000 3500 2.0 2.5 3.0 3.5 4.0 4.5 5.0 5.5 VDD (V) IPD (μA) 8 MHz 125 kHz 4 MHz 2 MHz 1 MHz 250 kHz and 500 kHz curves are bounded by 125 kHz and 1 MHz curves. Typical: statistical mean @ 25°C Maximum: mean + 3σ (-40°C to +125°C) Minimum: mean – 3σ (-40°C to +125°C)© 2007 Microchip Technology Inc. DS39605F-page 275 PIC18F1220/1320 FIGURE 23-17: TYPICAL AND MAXIMUM IPD vs. VDD (-40°C TO +125°C), 31.25 kHz RC_RUN MODE, ALL PERIPHERALS DISABLED FIGURE 23-18: TYPICAL IPD vs. VDD (+25°C), 125 kHz TO 8 MHz RC_IDLE MODE, ALL PERIPHERALS DISABLED 1 10 100 2.0 2.5 3.0 3.5 4.0 4.5 5.0 5.5 VDD (V) IPD (μA) Typ (+25°C) Max (+85°C) Max (+125°C) Typical: statistical mean @ 25°C Maximum: mean + 3σ (-40°C to +125°C) Minimum: mean – 3σ (-40°C to +125°C) 100 150 200 250 300 350 400 450 500 550 600 650 700 750 800 2.0 2.5 3.0 3.5 4.0 4.5 5.0 5.5 VDD (V) IPD (μA) 8 MHz 125 kHz 4 MHz 2 MHz 1 MHz 250 kHz and 500 kHz curves are bounded by 125 kHz and 1 MHz curves. Typical: statistical mean @ 25°C Maximum: mean + 3σ (-40°C to +125°C) Minimum: mean – 3σ (-40°C to +125°C)PIC18F1220/1320 DS39605F-page 276 © 2007 Microchip Technology Inc. FIGURE 23-19: MAXIMUM IPD vs. VDD (-40°C TO +125°C), 125 kHz TO 8 MHz RC_IDLE MODE, ALL PERIPHERALS DISABLED FIGURE 23-20: TYPICAL AND MAXIMUM IPD vs. VDD (-40°C TO +125°C), 31.25 kHz RC_IDLE MODE, ALL PERIPHERALS DISABLED 100 150 200 250 300 350 400 450 500 550 600 650 700 750 800 2.0 2.5 3.0 3.5 4.0 4.5 5.0 5.5 VDD (V) IPD (μA) 8 MHz 125 kHz 4 MHz 2 MHz 1 MHz 250 kHz and 500 kHz curves are bounded by 125 kHz and 1 MHz curves. Typical: statistical mean @ 25°C Maximum: mean + 3σ (-40°C to +125°C) Minimum: mean – 3σ (-40°C to +125°C) 1 10 100 2.0 2.5 3.0 3.5 4.0 4.5 5.0 5.5 VDD (V) IPD (μA) Typ (+25°C) Max (+85°C) Max (+125°C) Typical: statistical mean @ 25°C Maximum: mean + 3σ (-40°C to +125°C) Minimum: mean – 3σ (-40°C to +125°C)© 2007 Microchip Technology Inc. DS39605F-page 277 PIC18F1220/1320 FIGURE 23-21: IPD SEC_RUN MODE, -10°C TO +70°C, 32.768 kHz XTAL, 2 x 22 pF, ALL PERIPHERALS DISABLED FIGURE 23-22: IPD SEC_IDLE MODE, -10°C TO +70°C, 32.768 kHz, 2 x 22 pF, ALL PERIPHERALS DISABLED 0 10 20 30 40 50 60 70 80 2.0 2.5 3.0 3.5 4.0 4.5 5.0 5.5 VDD (V) IPD (μA) Typ (+25°C) Max (+70°C) Typical: statistical mean @ 25°C Maximum: mean + 3σ (-40°C to +125°C) Minimum: mean – 3σ (-40°C to +125°C) 0 2 4 6 8 10 12 14 16 18 20 2.0 2.5 3.0 3.5 4.0 4.5 5.0 5.5 VDD (V) IPD (μA) Typ (+25°C) Max (+70°C) Typical: statistical mean @ 25°C Maximum: mean + 3σ (-40°C to +125°C) Minimum: mean – 3σ (-40°C to +125°C)PIC18F1220/1320 DS39605F-page 278 © 2007 Microchip Technology Inc. FIGURE 23-23: TOTAL IPD, -40°C TO +125°C SLEEP MODE, ALL PERIPHERALS DISABLED FIGURE 23-24: VOH vs. IOH OVER TEMPERATURE (-40°C TO +125°C), VDD = 3.0V 0.001 0.01 0.1 1 10 100 2.0 2.5 3.0 3.5 4.0 4.5 5.0 5.5 VDD (V) IPD (μA) Max (+85°C) Max (+125°C) Typ (+25°C) Typical: statistical mean @ 25°C Maximum: mean + 3σ (-40°C to +125°C) Minimum: mean – 3σ (-40°C to +125°C) 0.0 0.5 1.0 1.5 2.0 2.5 3.0 0 5 10 15 20 25 IOH (-mA) VOH (V) Max (+125°C) Min (+125°C) Typ (+25°C)© 2007 Microchip Technology Inc. DS39605F-page 279 PIC18F1220/1320 FIGURE 23-25: VOH vs. IOH OVER TEMPERATURE (-40°C TO +125°C), VDD = 5.0V FIGURE 23-26: VOL vs. IOL OVER TEMPERATURE (-40°C TO +125°C), VDD = 3.0V 0.0 0.5 1.0 1.5 2.0 2.5 3.0 3.5 4.0 4.5 5.0 0 5 10 15 20 25 IOH (-mA) VOH (V) Max (+125°C) Min (+125°C) Typ (+25°C) V vs I over Temp (-40°C to +125°C) V = 3.0V 0.0 0.5 1.0 1.5 2.0 2.5 3.0 0 5 10 15 20 25 IOL (-mA) VOL (V) Max (+125°C) Max (+85°C) Typ (+25°C) Min (+125°C)PIC18F1220/1320 DS39605F-page 280 © 2007 Microchip Technology Inc. FIGURE 23-27: VOL vs. IOL OVER TEMPERATURE (-40°C TO +125°C), VDD = 5.0V FIGURE 23-28: ΔIPD TIMER1 OSCILLATOR, -10°C TO +70°C SLEEP MODE, TMR1 COUNTER DISABLED 0.0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1.0 0 5 10 15 20 25 IOL (-mA) VOL (V) Max (+125°C) Max (+85°C) Typ (+25°C) Min (+125°C) IPD Timer1 Oscillator, -10°C to +70°C SLEEP mode, TMR1 counter disabled 0.0 0.5 1.0 1.5 2.0 2.5 3.0 3.5 4.0 4.5 5.0 2.0 2.5 3.0 3.5 4.0 4.5 5.0 5.5 VDD (V) IPD (μA) Typ (+25°C) Max (-10°C to +70°C) Typical: statistical mean @ 25°C Maximum: mean + 3σ (-40°C to +125°C) Minimum: mean – 3σ (-40°C to +125°C)© 2007 Microchip Technology Inc. DS39605F-page 281 PIC18F1220/1320 FIGURE 23-29: ΔIPD FSCM vs. VDD OVER TEMPERATURE PRI_IDLE MODE, EC OSCILLATOR AT 32 kHz, -40°C TO +125°C FIGURE 23-30: ΔIPD WDT, -40°C TO +125°C SLEEP MODE, ALL PERIPHERALS DISABLED 0.0 0.5 1.0 1.5 2.0 2.5 3.0 3.5 4.0 4.5 2.0 2.5 3.0 3.5 4.0 4.5 5.0 5.5 VDD (V) ΔIPD (μA) Typ (+25°C) Max (-40°C) Typical: statistical mean @ 25°C Maximum: mean + 3σ (-40°C to +125°C) Minimum: mean – 3σ (-40°C to +125°C) 0 2 4 6 8 10 12 14 2.0 2.5 3.0 3.5 4.0 4.5 5.0 5.5 VDD (V) ΔIPD (μA) Typ (+25°C) Max (+85°C) Max (+125°C) Typical: statistical mean @ 25°C Maximum: mean + 3σ (-40°C to +125°C) Minimum: mean – 3σ (-40°C to +125°C)PIC18F1220/1320 DS39605F-page 282 © 2007 Microchip Technology Inc. FIGURE 23-31: ΔIPD LVD vs. VDD SLEEP MODE, LVDL3:LVDL0 = 0001 (2V) FIGURE 23-32: ΔIPD BOR vs. VDD, -40°C TO +125°C SLEEP MODE, BORV1:BORV0 = 11 (2V) 0 5 10 15 20 25 30 35 40 45 50 2.0 2.5 3.0 3.5 4.0 4.5 5.0 5.5 VDD (V) IPD (μA) Typ (+25°C) Max (+85°C) Max (+125°C) Low-Voltage Detection Range Normal Operating Range Typical: statistical mean @ 25°C Maximum: mean + 3σ (-40°C to +125°C) Minimum: mean – 3σ (-40°C to +125°C) 0 5 10 15 20 25 30 35 40 2.0 2.5 3.0 3.5 4.0 4.5 5.0 5.5 VDD (V) IPD (μA) Max (+125°C) Typ (+25°C) Device may be in Reset Device is Operating Typical: statistical mean @ 25°C Maximum: mean + 3σ (-40°C to +125°C) Minimum: mean – 3σ (-40°C to +125°C)© 2007 Microchip Technology Inc. DS39605F-page 283 PIC18F1220/1320 FIGURE 23-33: ΔIPD A/D, -40°C TO +125°C SLEEP MODE, A/D ENABLED (NOT CONVERTING) FIGURE 23-34: AVERAGE FOSC vs. VDD FOR VARIOUS R’s EXTERNAL RC MODE, C = 20 pF, TEMPERATURE = +25°C 0.001 0.01 0.1 1 10 2.0 2.5 3.0 3.5 4.0 4.5 5.0 5.5 VDD (V) IPD (μA) Max (+125°C) Max (+85°C) Typ (+25°C) Typical: statistical mean @ 25°C Maximum: mean + 3σ (-40°C to +125°C) Minimum: mean – 3σ (-40°C to +125°C) 0.0 0.5 1.0 1.5 2.0 2.5 3.0 3.5 4.0 4.5 5.0 2.0 2.5 3.0 3.5 4.0 4.5 5.0 5.5 VDD (V) Freq (MHz) 5.1K 10K 33K 100K Operation above 4 MHz is not recomendedPIC18F1220/1320 DS39605F-page 284 © 2007 Microchip Technology Inc. FIGURE 23-35: AVERAGE FOSC vs. VDD FOR VARIOUS R’s EXTERNAL RC MODE, C = 100 pF, TEMPERATURE = +25°C FIGURE 23-36: AVERAGE FOSC vs. VDD FOR VARIOUS R’s EXTERNAL RC MODE, C = 300 pF, TEMPERATURE = +25°C 0.0 0.2 0.4 0.6 0.8 1.0 1.2 1.4 1.6 1.8 2.0 2.0 2.5 3.0 3.5 4.0 4.5 5.0 5.5 VDD (V) Freq (MHz) 5.1K 10K 33K 100K 0.0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 2.0 2.5 3.0 3.5 4.0 4.5 5.0 5.5 VDD (V) Freq (MHz) 5.1K 10K 33K 100K© 2007 Microchip Technology Inc. DS39605F-page 285 PIC18F1220/1320 24.0 PACKAGING INFORMATION 24.1 Package Marking Information 18-Lead PDIP XXXXXXXXXXXXXXXXX XXXXXXXXXXXXXXXXX YYWWNNN Example PIC18F1320-I/P 0710017 18-Lead SOIC XXXXXXXXXXXX XXXXXXXXXXXX XXXXXXXXXXXX YYWWNNN Example PIC18F1220- E/SO 0710017 20-Lead SSOP XXXXXXXXXXX XXXXXXXXXXX YYWWNNN Example PIC18F1220- E/SS 0710017 28-Lead QFN XXXXXXXX XXXXXXXX YYWWNNN Example 18F1320 -I/ML 0710017 Legend: XX...X Customer-specific information Y Year code (last digit of calendar year) YY Year code (last 2 digits of calendar year) WW Week code (week of January 1 is week ‘01’) NNN Alphanumeric traceability code Pb-free JEDEC designator for Matte Tin (Sn) * This package is Pb-free. The Pb-free JEDEC designator ( ) can be found on the outer packaging for this package. Note: In the event the full Microchip part number cannot be marked on one line, it will be carried over to the next line, thus limiting the number of available characters for customer-specific information. e3 e3 e3 e3 e3 e3PIC18F1220/1320 DS39605F-page 286 © 2007 Microchip Technology Inc. 24.2 Package Details The following sections give the technical details of the packages. 18-Lead Plastic Dual In-Line (P) – 300 mil Body [PDIP] Notes: 1. Pin 1 visual index feature may vary, but must be located within the hatched area. 2. § Significant Characteristic. 3. Dimensions D and E1 do not include mold flash or protrusions. Mold flash or protrusions shall not exceed .010" per side. 4. Dimensioning and tolerancing per ASME Y14.5M. BSC: Basic Dimension. Theoretically exact value shown without tolerances. Note: For the most current package drawings, please see the Microchip Packaging Specification located at http://www.microchip.com/packaging Units INCHES Dimension Limits MIN NOM MAX Number of Pins N 18 Pitch e .100 BSC Top to Seating Plane A – – .210 Molded Package Thickness A2 .115 .130 .195 Base to Seating Plane A1 .015 – – Shoulder to Shoulder Width E .300 .310 .325 Molded Package Width E1 .240 .250 .280 Overall Length D .880 .900 .920 Tip to Seating Plane L .115 .130 .150 Lead Thickness c .008 .010 .014 Upper Lead Width b1 .045 .060 .070 Lower Lead Width b .014 .018 .022 Overall Row Spacing § eB – – .430 NOTE 1 N E1 D 1 2 3 A A1 A2 L E eB c e b1 b Microchip Technology Drawing C04-007B© 2007 Microchip Technology Inc. DS39605F-page 287 PIC18F1220/1320 18-Lead Plastic Small Outline (SO) – Wide, 7.50 mm Body [SOIC] Notes: 1. Pin 1 visual index feature may vary, but must be located within the hatched area. 2. § Significant Characteristic. 3. Dimensions D and E1 do not include mold flash or protrusions. Mold flash or protrusions shall not exceed 0.15 mm per side. 4. Dimensioning and tolerancing per ASME Y14.5M. BSC: Basic Dimension. Theoretically exact value shown without tolerances. REF: Reference Dimension, usually without tolerance, for information purposes only. Note: For the most current package drawings, please see the Microchip Packaging Specification located at http://www.microchip.com/packaging Units MILLIMETERS Dimension Limits MIN NOM MAX Number of Pins N 18 Pitch e 1.27 BSC Overall Height A – – 2.65 Molded Package Thickness A2 2.05 – – Standoff § A1 0.10 – 0.30 Overall Width E 10.30 BSC Molded Package Width E1 7.50 BSC Overall Length D 11.55 BSC Chamfer (optional) h 0.25 – 0.75 Foot Length L 0.40 – 1.27 Footprint L1 1.40 REF Foot Angle φ 0° – 8° Lead Thickness c 0.20 – 0.33 Lead Width b 0.31 – 0.51 Mold Draft Angle Top α 5° – 15° Mold Draft Angle Bottom β 5° – 15° NOTE 1 D N E E1 e b 1 2 3 A A1 A2 L L1 h h c β φ α Microchip Technology Drawing C04-051BPIC18F1220/1320 DS39605F-page 288 © 2007 Microchip Technology Inc. 20-Lead Plastic Shrink Small Outline (SS) – 5.30 mm Body [SSOP] Notes: 1. Pin 1 visual index feature may vary, but must be located within the hatched area. 2. Dimensions D and E1 do not include mold flash or protrusions. Mold flash or protrusions shall not exceed 0.20 mm per side. 3. Dimensioning and tolerancing per ASME Y14.5M. BSC: Basic Dimension. Theoretically exact value shown without tolerances. REF: Reference Dimension, usually without tolerance, for information purposes only. Note: For the most current package drawings, please see the Microchip Packaging Specification located at http://www.microchip.com/packaging Units MILLIMETERS Dimension Limits MIN NOM MAX Number of Pins N 20 Pitch e 0.65 BSC Overall Height A – – 2.00 Molded Package Thickness A2 1.65 1.75 1.85 Standoff A1 0.05 – – Overall Width E 7.40 7.80 8.20 Molded Package Width E1 5.00 5.30 5.60 Overall Length D 6.90 7.20 7.50 Foot Length L 0.55 0.75 0.95 Footprint L1 1.25 REF Lead Thickness c 0.09 – 0.25 Foot Angle φ 0° 4° 8° Lead Width b 0.22 – 0.38 φ L1 L A2 c e b A1 A 1 2 NOTE 1 E1 E D N Microchip Technology Drawing C04-072B© 2007 Microchip Technology Inc. DS39605F-page 289 PIC18F1220/1320 28-Lead Plastic Quad Flat, No Lead Package (ML) – 6x6 mm Body [QFN] with 0.55 mm Contact Length Notes: 1. Pin 1 visual index feature may vary, but must be located within the hatched area. 2. Package is saw singulated. 3. Dimensioning and tolerancing per ASME Y14.5M. BSC: Basic Dimension. Theoretically exact value shown without tolerances. REF: Reference Dimension, usually without tolerance, for information purposes only. Note: For the most current package drawings, please see the Microchip Packaging Specification located at http://www.microchip.com/packaging Units MILLIMETERS Dimension Limits MIN NOM MAX Number of Pins N 28 Pitch e 0.65 BSC Overall Height A 0.80 0.90 1.00 Standoff A1 0.00 0.02 0.05 Contact Thickness A3 0.20 REF Overall Width E 6.00 BSC Exposed Pad Width E2 3.65 3.70 4.20 Overall Length D 6.00 BSC Exposed Pad Length D2 3.65 3.70 4.20 Contact Width b 0.23 0.30 0.35 Contact Length L 0.50 0.55 0.70 Contact-to-Exposed Pad K 0.20 – – D EXPOSED D2 e b K E2 E L N NOTE 1 1 2 2 1 N A A3 A1 TOP VIEW BOTTOM VIEW PAD Microchip Technology Drawing C04-105BPIC18F1220/1320 DS39605F-page 290 © 2007 Microchip Technology Inc. NOTES:© 2007 Microchip Technology Inc. DS39605F-page 291 PIC18F1220/1320 APPENDIX A: REVISION HISTORY Revision A (August 2002) Original data sheet for PIC18F1220/1320 devices. Revision B (November 2002) This revision includes significant changes to Section 2.0, Section 3.0 and Section 19.0, as well as updates to the Electrical Specifications in Section 22.0 and includes minor corrections to the data sheet text. Revision C (May 2004) This revision includes updates to the Electrical Specifications in Section 22.0, the DC and AC Characteristics Graphs and Tables in Section 23.0 and includes minor corrections to the data sheet text. Revision D (October 2006) This revision includes updates to the packaging diagrams. Revision E (January 2007) This revision includes updates to the packaging diagrams. Revision F (February 2007) This revision includes updates to the packaging diagrams. APPENDIX B: DEVICE DIFFERENCES The differences between the devices listed in this data sheet are shown in Table B-1. TABLE B-1: DEVICE DIFFERENCES Features PIC18F1220 PIC18F1320 Program Memory (Bytes) 4096 8192 Program Memory (Instructions) 2048 4096 Interrupt Sources 15 15 I/O Ports Ports A, B Ports A, B Enhanced Capture/Compare/PWM Modules 1 1 10-bit Analog-to-Digital Module 7 input channels 7 input channels Packages 18-pin SDIP 18-pin SOIC 20-pin SSOP 28-pin QFN 18-pin SDIP 18-pin SOIC 20-pin SSOP 28-pin QFNPIC18F1220/1320 DS39605F-page 292 © 2007 Microchip Technology Inc. APPENDIX C: CONVERSION CONSIDERATIONS This appendix discusses the considerations for converting from previous versions of a device to the ones listed in this data sheet. Typically, these changes are due to the differences in the process technology used. An example of this type of conversion is from a PIC16C74A to a PIC16C74B. Not Applicable APPENDIX D: MIGRATION FROM BASELINE TO ENHANCED DEVICES This section discusses how to migrate from a baseline device (i.e., PIC16C5X) to an enhanced MCU device (i.e., PIC18FXXX). The following are the list of modifications over the PIC16C5X microcontroller family: Not Currently Available© 2007 Microchip Technology Inc. DS39605F-page 293 PIC18F1220/1320 APPENDIX E: MIGRATION FROM MID-RANGE TO ENHANCED DEVICES A detailed discussion of the differences between the mid-range MCU devices (i.e., PIC16CXXX) and the enhanced devices (i.e., PIC18FXXX) is provided in AN716, “Migrating Designs from PIC16C74A/74B to PIC18C442”. The changes discussed, while device specific, are generally applicable to all mid-range to enhanced device migrations. This Application Note is available as Literature Number DS00716. APPENDIX F: MIGRATION FROM HIGH-END TO ENHANCED DEVICES A detailed discussion of the migration pathway and differences between the high-end MCU devices (i.e., PIC17CXXX) and the enhanced devices (i.e., PIC18FXXX) is provided in AN726, “PIC17CXXX to PIC18CXXX Migration”. This Application Note is available as Literature Number DS00726.PIC18F1220/1320 DS39605F-page 294 © 2007 Microchip Technology Inc. NOTES:© 2007 Microchip Technology Inc. DS39605F-page 295 PIC18F1220/1320 INDEX A A/D ................................................................................... 155 A/D Converter Interrupt, Configuring ....................... 159 Acquisition Requirements ........................................ 160 ADCON0 Register .................................................... 155 ADCON1 Register .................................................... 155 ADCON2 Register .................................................... 155 ADRESH Register .................................................... 155 ADRESH/ADRESL Registers .................................. 158 ADRESL Register .................................................... 155 Analog Port Pins, Configuring .................................. 162 Associated Registers ............................................... 164 Configuring the Module ............................................ 159 Conversion Clock (Tad) ........................................... 161 Conversion Requirements ....................................... 265 Conversion Status (GO/DONE Bit) .......................... 158 Conversions ............................................................. 163 Converter Characteristics ........................................ 264 Operation in Low-Power Modes ............................... 162 Selecting, Configuring Automatic Acquisition Time ............................................... 161 Special Event Trigger (CCP) .................................... 117 Special Event Trigger (CCP1) .................................. 164 Use of the CCP1 Trigger .......................................... 164 Vref+ and Vref- References ..................................... 160 Absolute Maximum Ratings ............................................. 237 AC (Timing) Characteristics ............................................. 255 Conditions ................................................................ 256 Load Conditions for Device Timing Specifications ....................................... 256 Parameter Symbology ............................................. 255 Temperature and Voltage Specifications ................. 256 ADCON0 Register ............................................................ 155 GO/DONE Bit ........................................................... 158 ADCON1 Register ............................................................ 155 ADCON2 Register ............................................................ 155 ADDLW ............................................................................ 197 ADDWF ............................................................................ 197 ADDWFC ......................................................................... 198 ADRESH Register ............................................................ 155 ADRESH/ADRESL Registers ........................................... 158 ADRESL Register ............................................................ 155 Analog-to-Digital Converter. See A/D. ANDLW ............................................................................ 198 ANDWF ............................................................................ 199 Assembler MPASM Assembler .................................................. 234 Auto-Wake-up on Sync Break Character ......................... 145 B BC .................................................................................... 199 BCF .................................................................................. 200 Block Diagrams A/D ........................................................................... 158 Analog Input Model .................................................. 159 Capture Mode Operation ......................................... 117 Compare Mode Operation ....................................... 118 Enhanced PWM ....................................................... 120 EUSART Receive .................................................... 143 EUSART Transmit ................................................... 141 Fail-Safe Clock Monitor ............................................ 182 Generic I/O Port Operation ........................................ 87 Low-Voltage Detect (LVD) ....................................... 166 Low-Voltage Detect (LVD) with External Input ........ 166 MCLR/VPP/RA5 Pin ................................................... 89 On-Chip Reset Circuit ................................................ 33 OSC1/CLKI/RA7 Pin .................................................. 88 OSC2/CLKO/RA6 Pin ................................................ 88 PIC18F1220/1320 ....................................................... 7 PLL ............................................................................ 12 RA3:RA0 Pins ............................................................ 88 RA4/T0CKI Pin .......................................................... 88 RB0/AN4/INT0 Pin ..................................................... 90 RB1/AN5/TX/CK/INT1 Pin ......................................... 91 RB2/P1B/INT2 Pin ..................................................... 92 RB3/CCP1/P1A Pin ................................................... 93 RB4/AN6/RX/DT/KBI0 Pin ......................................... 94 RB5/PGM/KBI1 Pin .................................................... 95 RB6/PGC/T1OSO/T13CKI/P1C/KBI2 Pin .................. 96 RB7/PGD/T1OSI/P1D/KBI3 Pin ................................. 97 Reads from Flash Program Memory .......................... 61 System Clock ............................................................. 16 Table Read Operation ............................................... 57 Table Write Operation ................................................ 58 Table Writes to Flash Program Memory .................... 63 Timer0 in 16-Bit Mode ............................................. 100 Timer0 in 8-Bit Mode ............................................... 100 Timer1 ..................................................................... 104 Timer1 (16-Bit Read/Write Mode) ............................ 104 Timer2 ..................................................................... 110 Timer3 ..................................................................... 112 Timer3 (16-bit Read/Write Mode) ............................ 112 WDT ........................................................................ 180 BN .................................................................................... 200 BNC ................................................................................. 201 BNN ................................................................................. 201 BNOV ............................................................................... 202 BNZ .................................................................................. 202 BOR. See Brown-out Reset. BOV ................................................................................. 205 BRA ................................................................................. 203 Break Character (12-bit) Transmit and Receive .............. 146 Brown-out Reset (BOR) ..............................................34, 171 BSF .................................................................................. 203 BTFSC ............................................................................. 204 BTFSS ............................................................................. 204 BTG ................................................................................. 205 BZ .................................................................................... 206 C C Compilers MPLAB C18 ............................................................. 234 MPLAB C30 ............................................................. 234 CALL ................................................................................ 206 Capture (CCP Module) .................................................... 116 CCP Pin Configuration ............................................. 116 CCPR1H:CCPR1L Registers ................................... 116 Software Interrupt .................................................... 116 Timer1/Timer3 Mode Selection ................................ 116 Capture, Compare, Timer1 and Timer3 Associated Registers ............................................... 118PIC18F1220/1320 DS39605F-page 296 © 2007 Microchip Technology Inc. Capture/Compare/PWM (CCP) Capture Mode. See Capture. CCP1 ........................................................................116 CCPR1H Register ............................................ 116 CCPR1L Register ............................................ 116 Compare Mode. See Compare. Timer Resources ...................................................... 116 Clock Sources .................................................................... 15 Selection Using OSCCON Register ........................... 16 Clocking Scheme ............................................................... 45 CLRF ................................................................................ 207 CLRWDT .......................................................................... 207 Code Examples 16 x 16 Signed Multiply Routine ................................. 72 16 x 16 Unsigned Multiply Routine ............................. 72 8 x 8 Signed Multiply Routine ..................................... 71 8 x 8 Unsigned Multiply Routine ................................. 71 Changing Between Capture Prescalers ................... 117 Computed GOTO Using an Offset Value ................... 47 Data EEPROM Read .................................................69 Data EEPROM Refresh Routine ................................70 Data EEPROM Write .................................................. 69 Erasing a Flash Program Memory Row ..................... 62 Fast Register Stack .................................................... 44 How to Clear RAM (Bank 1) Using Indirect Addressing ............................................ 53 Implementing a Real-Time Clock Using a Timer1 Interrupt Service .................................. 107 Initializing PORTA ...................................................... 87 Initializing PORTB ...................................................... 90 Reading a Flash Program Memory Word ................... 61 Saving Status, WREG and BSR Registers in RAM ....................................... 85 Writing to Flash Program Memory ....................... 64–65 Code Protection ............................................................... 171 COMF ............................................................................... 208 Compare (CCP Module) ...................................................117 CCP Pin Configuration ............................................. 117 CCPR1 Register ....................................................... 117 Software Interrupt ..................................................... 117 Special Event Trigger ....................................... 113, 117 Timer1/Timer3 Mode Selection ................................ 117 Compare (CCP1 Module) Special Event Trigger ...............................................164 Computed GOTO ............................................................... 47 Configuration Bits ............................................................. 171 Context Saving During Interrupts ....................................... 85 Conversion Considerations .............................................. 292 CPFSEQ .......................................................................... 208 CPFSGT ........................................................................... 209 CPFSLT ........................................................................... 209 Customer Change Notification Service ............................302 Customer Notification Service .......................................... 302 Customer Support ............................................................ 302 D Data EEPROM Memory .....................................................67 Associated Registers .................................................70 EEADR Register ........................................................ 67 EECON1 Register ...................................................... 67 EECON2 Register ...................................................... 67 Operation During Code-Protect .................................. 70 Protection Against Spurious Write ............................. 69 Reading ......................................................................69 Using ..........................................................................70 Write Verify ................................................................. 69 Writing ........................................................................69 Data Memory ..................................................................... 47 General Purpose Registers ....................................... 47 Map for PIC18F1220/1320 Devices ........................... 48 Special Function Registers ........................................ 49 DAW ................................................................................ 210 DC and AC Characteristics Graphs and Tables .................................................. 267 DC Characteristics ........................................................... 250 Power-Down and Supply Current ............................ 241 Supply Voltage ......................................................... 240 DCFSNZ .......................................................................... 211 DECF ............................................................................... 210 DECFSZ .......................................................................... 211 Details on Individual Family Members ................................. 6 Development Support ...................................................... 233 Device Differences ........................................................... 291 Direct Addressing ............................................................... 54 E Effects of Power Managed Modes on Various Clock Sources .............................................. 18 Electrical Characteristics .................................................. 237 Enhanced Capture/Compare/PWM (ECCP) .................... 115 Outputs .................................................................... 116 PWM Mode. See PWM (ECCP Module). Enhanced PWM Mode. See PWM (ECCP Module). ........ 119 Enhanced Universal Synchronous Asynchronous Receiver Transmitter (EUSART) ............................. 131 Equations 16 x 16 Signed Multiplication Algorithm ..................... 72 16 x 16 Unsigned Multiplication Algorithm ................. 72 A/D Minimum Charging Time ................................... 160 Acquisition Time ...................................................... 160 Errata ................................................................................... 4 EUSART Asynchronous Mode ................................................ 140 12-bit Break Transmit and Receive ................. 146 Associated Registers, Receive ........................ 144 Associated Registers, Transmit ....................... 142 Auto-Wake-up on Sync Break ......................... 145 Receiver .......................................................... 143 Setting up 9-bit Mode with Address Detect ........................................ 143 Transmitter ....................................................... 140 Baud Rate Generator (BRG) ................................... 135 Associated Registers ....................................... 136 Auto-Baud Rate Detect .................................... 139 Baud Rate Error, Calculating ........................... 135 Baud Rates, Asynchronous Modes ................. 136 High Baud Rate Select (BRGH Bit) ................. 135 Power Managed Mode Operation .................... 135 Sampling .......................................................... 135 Serial Port Enable (SPEN Bit) ................................. 131 Synchronous Master Mode ...................................... 148 Associated Registers, Reception ..................... 151 Associated Registers, Transmit ....................... 149 Reception ........................................................ 150 Transmission ................................................... 148 Synchronous Slave Mode ........................................ 152 Associated Registers, Receive ........................ 153 Associated Registers, Transmit ....................... 152 Reception ........................................................ 153 Transmission ................................................... 152© 2007 Microchip Technology Inc. DS39605F-page 297 PIC18F1220/1320 F Fail-Safe Clock Monitor .................................................... 171 Exiting Operation ..................................................... 183 Interrupts in Power Managed Modes ....................... 183 POR or Wake from Sleep ........................................ 184 WDT During Oscillator Failure ................................. 182 Fail-Safe Clock Monitor (FSCM) ...................................... 182 Fast Register Stack ............................................................ 44 Firmware Instructions ....................................................... 191 Flash Program Memory ...................................................... 57 Associated Registers ................................................. 65 Control Registers ....................................................... 58 Erase Sequence ........................................................ 62 Erasing ....................................................................... 62 Operation During Code-Protect ................................. 65 Reading ...................................................................... 61 Table Latch ................................................................ 60 Table Pointer .............................................................. 60 Boundaries Based on Operation ........................ 60 Table Pointer Boundaries .......................................... 60 Table Reads and Table Writes .................................. 57 Write Sequence ......................................................... 63 Writing to .................................................................... 63 Unexpected Termination .................................... 65 Write Verify ........................................................ 65 G GOTO ............................................................................... 212 H Hardware Multiplier ............................................................ 71 Introduction ................................................................ 71 Operation ................................................................... 71 Performance Comparison .......................................... 71 I I/O Ports ............................................................................. 87 ID Locations ............................................................. 171, 188 INCF ................................................................................. 212 INCFSZ ............................................................................ 213 In-Circuit Debugger .......................................................... 188 In-Circuit Serial Programming (ICSP) ...................... 171, 188 Indirect Addressing ............................................................ 54 INDF and FSR Registers ........................................... 53 Operation ................................................................... 53 Indirect Addressing Operation ............................................ 54 Indirect File Operand .......................................................... 47 INFSNZ ............................................................................ 213 Initialization Conditions for All Registers ...................... 36–38 Instruction Cycle ................................................................. 45 Instruction Flow/Pipelining ................................................. 45 Instruction Set .................................................................. 191 ADDLW .................................................................... 197 ADDWF .................................................................... 197 ADDWFC ................................................................. 198 ANDLW .................................................................... 198 ANDWF .................................................................... 199 BC ............................................................................ 199 BCF .......................................................................... 200 BN ............................................................................ 200 BNC ......................................................................... 201 BNN ......................................................................... 201 BNOV ....................................................................... 202 BNZ .......................................................................... 202 BOV ......................................................................... 205 BRA ......................................................................... 203 BSF .......................................................................... 203 BTFSC ..................................................................... 204 BTFSS ..................................................................... 204 BTG ......................................................................... 205 BZ ............................................................................ 206 CALL ........................................................................ 206 CLRF ....................................................................... 207 CLRWDT ................................................................. 207 COMF ...................................................................... 208 CPFSEQ .................................................................. 208 CPFSGT .................................................................. 209 CPFSLT ................................................................... 209 DAW ........................................................................ 210 DCFSNZ .................................................................. 211 DECF ....................................................................... 210 DECFSZ .................................................................. 211 General Format ........................................................ 193 GOTO ...................................................................... 212 INCF ........................................................................ 212 INCFSZ .................................................................... 213 INFSNZ .................................................................... 213 IORLW ..................................................................... 214 IORWF ..................................................................... 214 LFSR ....................................................................... 215 MOVF ...................................................................... 215 MOVFF .................................................................... 216 MOVLB .................................................................... 216 MOVLW ................................................................... 217 MOVWF ................................................................... 217 MULLW .................................................................... 218 MULWF .................................................................... 218 NEGF ....................................................................... 219 NOP ......................................................................... 219 POP ......................................................................... 220 PUSH ....................................................................... 220 RCALL ..................................................................... 221 RESET ..................................................................... 221 RETFIE .................................................................... 222 RETLW .................................................................... 222 RETURN .................................................................. 223 RLCF ....................................................................... 223 RLNCF ..................................................................... 224 RRCF ....................................................................... 224 RRNCF .................................................................... 225 SETF ....................................................................... 225 SLEEP ..................................................................... 226 SUBFWB ................................................................. 226 SUBLW .................................................................... 227 SUBWF .................................................................... 227 SUBWFB ................................................................. 228 SWAPF .................................................................... 228 TBLRD ..................................................................... 229 TBLWT .................................................................... 230 TSTFSZ ................................................................... 231 XORLW ................................................................... 231 XORWF ................................................................... 232 Summary Table ....................................................... 194 INTCON Register RBIF Bit ..................................................................... 90 INTCON Registers ............................................................. 75PIC18F1220/1320 DS39605F-page 298 © 2007 Microchip Technology Inc. Internal Oscillator Block .....................................................14 Adjustment ................................................................. 14 INTIO Modes .............................................................. 14 INTRC Output Frequency .......................................... 14 OSCTUNE Register ...................................................14 Internal RC Oscillator Use with WDT .......................................................... 180 Internet Address ............................................................... 302 Interrupt Sources .............................................................. 171 A/D Conversion Complete ........................................ 159 Capture Complete (CCP) ......................................... 116 Compare Complete (CCP) ....................................... 117 Interrupt-on-Change (RB7:RB4) ................................90 INTn Pin ..................................................................... 85 PORTB, Interrupt-on-Change .................................... 85 TMR0 ......................................................................... 85 TMR0 Overflow ........................................................ 101 TMR1 Overflow ........................................................ 103 TMR2 to PR2 Match .................................................110 TMR2 to PR2 Match (PWM) ............................ 109, 119 TMR3 Overflow ................................................ 111, 113 Interrupts ............................................................................ 73 Enable Bits (CCP1IE Bit) .................................................... 116 Flag Bits CCP1 Flag (CCP1IF Bit) .................................. 116 CCP1IF Flag (CCP1IF Bit) ............................... 117 Interrupt-on-Change (RB7:RB4) Flag (RBIF Bit) ........................................... 90 Logic ........................................................................... 74 INTOSC Frequency Drift .................................................... 30 IORLW ............................................................................. 214 IORWF ............................................................................. 214 IPR Registers ..................................................................... 82 L LFSR ................................................................................ 215 Low-Voltage Detect .......................................................... 165 Characteristics ......................................................... 253 Effects of a Reset ..................................................... 169 Operation ................................................................. 168 Current Consumption ....................................... 169 Reference Voltage Set Point ............................169 Operation During Sleep ............................................ 169 LVD. See Low-Voltage Detect. ........................................ 165 M Memory Organization ......................................................... 41 Data Memory .............................................................. 47 Program Memory ....................................................... 41 Memory Programming Requirements ..............................252 Microchip Internet Web Site ............................................. 302 Migration from Baseline to Enhanced Devices ................ 292 Migration from High-End to Enhanced Devices ............... 293 Migration from Mid-Range to Enhanced Devices ............. 293 MOVF ............................................................................... 215 MOVFF ............................................................................. 216 MOVLB ............................................................................. 216 MOVLW ............................................................................ 217 MOVWF ........................................................................... 217 MPLAB ASM30 Assembler, Linker, Librarian .................. 234 MPLAB ICD 2 In-Circuit Debugger ................................... 235 MPLAB ICE 2000 High-Performance Universal In-Circuit Emulator ................................... 235 MPLAB Integrated Development Environment Software .............................................. 233 MPLAB PM3 Device Programmer ................................... 235 MPLAB REAL ICE In-Circuit Emulator System ................ 235 MPLINK Object Linker/MPLIB Object Librarian ............... 234 MULLW ............................................................................ 218 MULWF ............................................................................ 218 N NEGF ............................................................................... 219 New Core Features Multiple Oscillator Options and Features ..................... 5 nanoWatt Technology .................................................. 5 NOP ................................................................................. 219 O Opcode Field Descriptions ............................................... 192 OPTION_REG Register PSA Bit .................................................................... 101 T0CS Bit .................................................................. 101 T0PS2:T0PS0 Bits ................................................... 101 T0SE Bit ................................................................... 101 Oscillator Configuration ...................................................... 11 Crystal/Ceramic Resonator ........................................ 11 EC .............................................................................. 11 ECIO .......................................................................... 11 External Clock Input ................................................... 13 HS .............................................................................. 11 HSPLL ..................................................................11, 12 INTIO1 ....................................................................... 11 INTIO2 ....................................................................... 11 LP .............................................................................. 11 RC .........................................................................11, 13 RCIO .......................................................................... 11 XT .............................................................................. 11 Oscillator Selection .......................................................... 171 Oscillator Start-up Timer (OST) ............................18, 34, 171 Oscillator Switching ............................................................ 15 Oscillator Transitions ......................................................... 18 Oscillator, Timer1 ......................................................103, 113 Oscillator, Timer3 ............................................................. 111 Other Special Features ........................................................ 5 P Packaging ........................................................................ 285 Details ...................................................................... 286 Marking Information ................................................. 285 PICSTART Plus Development Programmer .................... 236 PIE Registers ..................................................................... 80 Pin Functions MCLR/Vpp/RA5 ........................................................... 8 OSC1/CLKI/RA7 .......................................................... 8 OSC2/CLKO/RA6 ........................................................ 8 RA0/AN0 ...................................................................... 8 RA1/AN1/LVDIN .......................................................... 8 RA2/AN2/Vref- ............................................................. 8 RA3/AN3/VREF+ ........................................................... 8 RA4/T0CKI ................................................................... 8 RB0/AN4/INT0 ............................................................. 9 RB1/AN5/TX/CK/INT1 ................................................. 9 RB2/P1B/INT2 ............................................................. 9 RB3/CCP1/P1A ........................................................... 9 RB4/AN6/RX/DT/KBI0 ................................................. 9 RB5/PGM/KBI1 ............................................................ 9 RB6/PGC/T1OSO/T13CKI/P1C/KBI2 .......................... 9 RB7/PGD/T1OSI/P1D/KBI3 ......................................... 9 Vdd .............................................................................. 9 Vss ............................................................................... 9© 2007 Microchip Technology Inc. DS39605F-page 299 PIC18F1220/1320 Pinout I/O Descriptions PIC18F1220/1320 ........................................................ 8 PIR Registers ..................................................................... 78 PLL Lock Time-out ............................................................. 34 Pointer, FSR ....................................................................... 53 POP .................................................................................. 220 POR. See Power-on Reset. PORTA Associated Registers ................................................. 89 Functions ................................................................... 89 LATA Register ............................................................ 87 PORTA Register ........................................................ 87 TRISA Register .......................................................... 87 PORTB Associated Registers ................................................. 98 Functions ................................................................... 98 LATB Register ............................................................ 90 PORTB Register ........................................................ 90 RB7:RB4 Interrupt-on-Change Flag (RBIF Bit) ........................................................... 90 TRISB Register .......................................................... 90 Postscaler Timer2 ...................................................................... 109 WDT Assignment (PSA Bit) ...................................... 101 Rate Select (T0PS2:T0PS0 Bits) ..................... 101 Power Managed Modes ..................................................... 19 Comparison between Run and Idle Modes ................ 20 Entering ...................................................................... 20 Idle Modes ................................................................. 21 Multiple Sleep Commands ......................................... 20 Run Modes ................................................................. 26 Selecting .................................................................... 19 Sleep Mode ................................................................ 21 Summary (table) ........................................................ 19 Wake from .................................................................. 28 Power-on Reset (POR) .............................................. 34, 171 Power-up Delays ................................................................ 18 Power-up Timer (PWRT) .......................................18, 34, 171 Prescaler Capture .................................................................... 117 Timer0 ...................................................................... 101 Assignment (PSA Bit) ...................................... 101 Rate Select (T0PS2:T0PS0 Bits) ..................... 101 Timer2 ...................................................................... 119 Product Identification System ........................................... 304 Program Counter PCL Register .............................................................. 44 PCLATH Register ...................................................... 44 PCLATU Register ...................................................... 44 Program Memory Instructions in ............................................................. 46 Interrupt Vector .......................................................... 41 Map and Stack for PIC18F1220 ................................. 41 Map and Stack for PIC18F1320 ................................. 41 Reset Vector .............................................................. 41 Program Verification and Code Protection ....................... 185 Associated Registers ............................................... 185 Configuration Register ............................................. 188 Data EEPROM ......................................................... 188 Program Memory ..................................................... 186 Programming, Device Instructions ................................... 191 PUSH ............................................................................... 220 PUSH and POP Instructions .............................................. 43 PWM (CCP Module) CCPR1H:CCPR1L Registers ................................... 119 Duty Cycle ............................................................... 119 Example Frequencies/Resolutions .......................... 119 Period ...................................................................... 119 TMR2 to PR2 Match .........................................109, 119 PWM (ECCP Module) ...................................................... 119 Associated Registers ............................................... 130 Direction Change in Full-Bridge Output Mode ......... 124 Effects of a Reset .................................................... 129 Enhanced PWM Auto-Shutdown ............................. 126 Full-Bridge Application Example .............................. 124 Full-Bridge PWM Output (Active-High) Diagram ..... 123 Half-Bridge Output (Active-High) Diagram ............... 122 Half-Bridge Output Mode Applications Example ...... 122 Operation in Low-Power Modes .............................. 129 Output Configurations .............................................. 119 Output Relationships (Active-High) .......................... 120 Output Relationships (Active-Low) .......................... 121 Programmable Dead-Band Delay ............................ 126 PWM Direction Change (Active-High) Diagram ....... 125 PWM Direction Change at Near 100% Duty Cycle (Active-High) Diagram ......... 125 Setup for PWM Operation ........................................ 129 Start-up Considerations ........................................... 128 Q Q Clock ............................................................................ 119 R RAM. See Data Memory. RCALL ............................................................................. 221 RCIO Oscillator .................................................................. 13 RCON Register Bit Status During Initialization .................................... 35 RCSTA Register SPEN Bit .................................................................. 131 Reader Response ............................................................ 303 Register File ....................................................................... 47 Register File Summary .................................................50–51 Registers ADCON0 (A/D Control 0) ......................................... 155 ADCON1 (A/D Control 1) ......................................... 156 ADCON2 (A/D Control 2) ......................................... 157 BAUDCTL (Baud Rate Control) ............................... 134 CCP1CON (Enhanced CCP1 Control) .................... 115 CONFIG1H (Configuration 1 High) .......................... 172 CONFIG2H (Configuration 2 High) .......................... 174 CONFIG2L (Configuration 2 Low) ........................... 173 CONFIG3H (Configuration 3 High) .......................... 175 CONFIG4L (Configuration 4 Low) ........................... 175 CONFIG5H (Configuration 5 High) .......................... 176 CONFIG5L (Configuration 5 Low) ........................... 176 CONFIG6H (Configuration 6 High) .......................... 177 CONFIG6L (Configuration 6 Low) ........................... 177 CONFIG7H (Configuration 7 High) .......................... 178 CONFIG7L (Configuration 7 Low) ........................... 178 DEVID1 (Device ID 1) .............................................. 179 DEVID2 (Device ID 2) .............................................. 179 ECCPAS (ECCP Auto-Shutdown Control) .............. 127 EECON1 (Data EEPROM Control 1) ....................59, 68 INTCON (Interrupt Control) ........................................ 75 INTCON2 (Interrupt Control 2) ................................... 76 INTCON3 (Interrupt Control 3) ................................... 77 IPR1 (Peripheral Interrupt Priority 1) ......................... 82 IPR2 (Peripheral Interrupt Priority 2) ......................... 83 LVDCON (LVD Control) ........................................... 167 OSCCON (Oscillator Control) .................................... 17PIC18F1220/1320 DS39605F-page 300 © 2007 Microchip Technology Inc. OSCTUNE (Oscillator Tuning) ................................... 15 PIE1 (Peripheral Interrupt Enable 1) .......................... 80 PIE2 (Peripheral Interrupt Enable 2) .......................... 81 PIR1 (Peripheral Interrupt Request (Flag) 1) ............. 78 PIR2 (Peripheral Interrupt Request (Flag) 2) ............. 79 PWM1CON (PWM Configuration) ............................126 RCON (Reset Control) ......................................... 56, 84 RCSTA (Receive Status and Control) ...................... 133 Status ......................................................................... 55 STKPTR (Stack Pointer) ............................................ 43 T0CON (Timer0 Control) ............................................ 99 T1CON (Timer 1 Control) ......................................... 103 T2CON (Timer 2 Control) ......................................... 109 T3CON (Timer3 Control) .......................................... 111 TXSTA (Transmit Status and Control) ..................... 132 WDTCON (Watchdog Timer Control) ....................... 180 RESET ............................................................................. 221 Reset .......................................................................... 33, 171 RETFIE ............................................................................ 222 RETLW ............................................................................. 222 RETURN .......................................................................... 223 Return Address Stack ........................................................ 42 and Associated Registers .......................................... 42 Return Stack Pointer (STKPTR) ........................................ 42 Revision History ............................................................... 291 RLCF ................................................................................ 223 RLNCF ............................................................................. 224 RRCF ............................................................................... 224 RRNCF ............................................................................. 225 S SETF ................................................................................ 225 SLEEP .............................................................................. 226 Sleep OSC1 and OSC2 Pin States ...................................... 18 Software Simulator (MPLAB SIM) .................................... 234 Special Event Trigger. See Compare Special Features of the CPU ............................................ 171 Configuration Registers .................................... 172–178 Special Function Registers ................................................ 49 Map ............................................................................ 49 Stack Full/Underflow Resets .............................................. 43 SUBFWB .......................................................................... 226 SUBLW ............................................................................ 227 SUBWF ............................................................................ 227 SUBWFB .......................................................................... 228 SWAPF ............................................................................ 228 T TABLAT Register ............................................................... 60 Table Pointer Operations (table) ........................................ 60 TBLPTR Register ............................................................... 60 TBLRD ............................................................................. 229 TBLWT ............................................................................. 230 Time-out Sequence ............................................................ 34 Timer0 ................................................................................ 99 16-Bit Mode Timer Reads and Writes ...................... 101 Associated Registers ...............................................101 Clock Source Edge Select (T0SE Bit) ...................... 101 Clock Source Select (T0CS Bit) ............................... 101 Operation ................................................................. 101 Overflow Interrupt ..................................................... 101 Prescaler. See Prescaler, Timer0. Switching Prescaler Assignment ..............................101 Timer1 .............................................................................. 103 16-Bit Read/Write Mode .......................................... 106 Associated Registers ............................................... 108 Interrupt ................................................................... 106 Operation ................................................................. 104 Oscillator ...........................................................103, 105 Layout Considerations ..................................... 106 Overflow Interrupt .................................................... 103 Resetting, Using a Special Event Trigger Output (CCP) ................................................... 106 Special Event Trigger (CCP) ................................... 117 TMR1H Register ...................................................... 103 TMR1L Register ....................................................... 103 Use as a Real-Time Clock ....................................... 107 Timer2 .............................................................................. 109 Associated Registers ............................................... 110 Operation ................................................................. 109 Output ...................................................................... 110 Postscaler. See Postscaler, Timer2. PR2 Register ....................................................109, 119 Prescaler. See Prescaler, Timer2. TMR2 Register ......................................................... 109 TMR2 to PR2 Match Interrupt ...................109, 110, 119 Timer3 .............................................................................. 111 Associated Registers ............................................... 113 Operation ................................................................. 112 Oscillator ...........................................................111, 113 Overflow Interrupt .............................................111, 113 Special Event Trigger (CCP) ................................... 113 TMR3H Register ...................................................... 111 TMR3L Register ....................................................... 111 Timing Diagrams A/D Conversion ........................................................ 265 Asynchronous Reception ......................................... 144 Asynchronous Transmission .................................... 141 Asynchronous Transmission (Back to Back) ........... 142 Auto-Wake-up Bit (WUE) During Normal Operation ............................................ 145 Auto-Wake-up Bit (WUE) During Sleep ................... 145 Brown-out Reset (BOR) ........................................... 260 Capture/Compare/PWM (All CCP Modules) ............ 262 CLKO and I/O .......................................................... 259 Clock/Instruction Cycle .............................................. 45 EUSART Synchronous Receive (Master/Slave) ................................................. 264 EUSART SynchronousTransmission (Master/Slave) ................................................. 263 External Clock (All Modes Except PLL) ................... 257 Fail-Safe Clock Monitor ........................................... 183 Low-Voltage Detect ................................................. 168 Low-Voltage Detect Characteristics ......................... 253 PWM Auto-Shutdown (PRSEN = 0, Auto-Restart Disabled) .................................... 128 PWM Auto-Shutdown (PRSEN = 1, Auto-Restart Enabled) ..................................... 128 Reset, Watchdog Timer (WDT), Oscillator Start-up Timer (OST) and Power-up Timer (PWRT) ..... 260 Send Break Character Sequence ............................ 147 Slow Rise Time (MCLR Tied to VDD, VDD Rise > TPWRT) ............................................ 40 Synchronous Reception (Master Mode, SREN) ..................................... 150 Synchronous Transmission ..................................... 148 Synchronous Transmission (Through TXEN) .......... 149© 2007 Microchip Technology Inc. DS39605F-page 301 PIC18F1220/1320 Time-out Sequence on POR w/PLL Enabled (MCLR Tied to VDD) ........................................... 40 Time-out Sequence on Power-up (MCLR Not Tied to Vdd), Case 1 ....................... 39 Time-out Sequence on Power-up (MCLR Not Tied to Vdd), Case 2 ....................... 39 Time-out Sequence on Power-up (MCLR Tied to Vdd, Vdd Rise pwrt) ................... 39 Timer0 and Timer1 External Clock .......................... 261 Transition for Entry to SEC_IDLE Mode .................... 24 Transition for Entry to SEC_RUN Mode .................... 26 Transition for Entry to Sleep Mode ............................ 22 Transition for Two-Speed Start-up (INTOSC to HSPLL) ......................................... 181 Transition for Wake from PRI_IDLE Mode ................. 23 Transition for Wake from RC_RUN Mode (RC_RUN to PRI_RUN) ..................................... 25 Transition for Wake from SEC_RUN Mode (HSPLL) ............................................................. 24 Transition for Wake from Sleep (HSPLL) ................... 22 Transition to PRI_IDLE Mode .................................... 23 Transition to RC_IDLE Mode ..................................... 25 Transition to RC_RUN Mode ..................................... 27 Timing Diagrams and Specifications ................................ 257 Capture/Compare/PWM Requirements (All CCP Modules) ........................................... 263 CLKO and I/O Requirements ................................... 259 EUSART Synchronous Receive Requirements ....... 264 EUSART Synchronous Transmission Requirements ............................ 263 External Clock Requirements .................................. 257 Internal RC Accuracy ............................................... 258 PLL Clock, HS/HSPLL Mode (VDD = 4.2V to 5.5V) ........................................ 258 Reset, Watchdog Timer, Oscillator Start-up Timer, Power-up Timer and Brown-out Reset Requirements ....................... 261 Timer0 and Timer1 External Clock Requirements ................................................... 262 Top-of-Stack Access .......................................................... 42 TSTFSZ ........................................................................... 231 Two-Speed Start-up ..................................................171, 181 Two-Word Instructions ....................................................... 46 Example Cases .......................................................... 46 TXSTA Register BRGH Bit ................................................................. 135 W Watchdog Timer (WDT) ............................................171, 180 Associated Registers ............................................... 181 Control Register ....................................................... 180 During Oscillator Failure .......................................... 182 Programming Considerations .................................. 180 WWW Address ................................................................ 302 WWW, On-Line Support ...................................................... 4 X XORLW ............................................................................ 231 XORWF ........................................................................... 232PIC18F1220/1320 DS39605F-page 302 © 2007 Microchip Technology Inc. NOTES:© 2007 Microchip Technology Inc. DS39605F-page 303 PIC18F1220/1320 THE MICROCHIP WEB SITE Microchip provides online support via our WWW site at www.microchip.com. This web site is used as a means to make files and information easily available to customers. Accessible by using your favorite Internet browser, the web site contains the following information: • Product Support – Data sheets and errata, application notes and sample programs, design resources, user’s guides and hardware support documents, latest software releases and archived software • General Technical Support – Frequently Asked Questions (FAQ), technical support requests, online discussion groups, Microchip consultant program member listing • Business of Microchip – Product selector and ordering guides, latest Microchip press releases, listing of seminars and events, listings of Microchip sales offices, distributors and factory representatives CUSTOMER CHANGE NOTIFICATION SERVICE Microchip’s customer notification service helps keep customers current on Microchip products. Subscribers will receive e-mail notification whenever there are changes, updates, revisions or errata related to a specified product family or development tool of interest. To register, access the Microchip web site at www.microchip.com, click on Customer Change Notification and follow the registration instructions. CUSTOMER SUPPORT Users of Microchip products can receive assistance through several channels: • Distributor or Representative • Local Sales Office • Field Application Engineer (FAE) • Technical Support • Development Systems Information Line Customers should contact their distributor, representative or field application engineer (FAE) for support. Local sales offices are also available to help customers. A listing of sales offices and locations is included in the back of this document. Technical support is available through the web site at: http://support.microchip.comPIC18F1220/1320 DS39605F-page 304 © 2007 Microchip Technology Inc. READER RESPONSE It is our intention to provide you with the best documentation possible to ensure successful use of your Microchip product. If you wish to provide your comments on organization, clarity, subject matter, and ways in which our documentation can better serve you, please FAX your comments to the Technical Publications Manager at (480) 792-4150. Please list the following information, and use this outline to provide us with your comments about this document. To: Technical Publications Manager RE: Reader Response Total Pages Sent ________ From: Name Company Address City / State / ZIP / Country Telephone: (_______) _________ - _________ Application (optional): Would you like a reply? Y N Device: Literature Number: Questions: FAX: (______) _________ - _________ PIC18F1220/1320 DS39605F 1. What are the best features of this document? 2. How does this document meet your hardware and software development needs? 3. Do you find the organization of this document easy to follow? If not, why? 4. What additions to the document do you think would enhance the structure and subject? 5. What deletions from the document could be made without affecting the overall usefulness? 6. Is there any incorrect or misleading information (what and where)? 7. How would you improve this document?© 2007 Microchip Technology Inc. DS39605F-page 305 PIC18F1220/1320 PIC18F1220/1320 PRODUCT IDENTIFICATION SYSTEM To order or obtain information, e.g., on pricing or delivery, refer to the factory or the listed sales office. PART NO. − X /XX XXX Temperature Package Pattern Range Device Device PIC18F1220/1320(1), PIC18F1220/1320T(2); VDD range 4.2V to 5.5V PIC18LF1220/1320(1), PIC18LF1220/1320T(2); VDD range 2.5V to 5.5V Temperature Range I = -40°C to +85°C (Industrial) E = -40°C to +125°C (Extended) Package SO = SOIC SS = SSOP P = PDIP ML = QFN Pattern QTP, SQTP, Code or Special Requirements (blank otherwise) Examples: a) PIC18LF1320-I/P 301 = Industrial temp., PDIP package, Extended VDD limits, QTP pattern #301. b) PIC18LF1220-I/SO = Industrial temp., SOIC package, Extended VDD limits. Note 1: F = Standard Voltage range LF = Wide Voltage Range 2: T = in tape and reel – SOIC package onlyDS39605F-page 306 © 2007 Microchip Technology Inc. AMERICAS Corporate Office 2355 West Chandler Blvd. Chandler, AZ 85224-6199 Tel: 480-792-7200 Fax: 480-792-7277 Technical Support: http://support.microchip.com Web Address: www.microchip.com Atlanta Duluth, GA Tel: 678-957-9614 Fax: 678-957-1455 Boston Westborough, MA Tel: 774-760-0087 Fax: 774-760-0088 Chicago Itasca, IL Tel: 630-285-0071 Fax: 630-285-0075 Dallas Addison, TX Tel: 972-818-7423 Fax: 972-818-2924 Detroit Farmington Hills, MI Tel: 248-538-2250 Fax: 248-538-2260 Kokomo Kokomo, IN Tel: 765-864-8360 Fax: 765-864-8387 Los Angeles Mission Viejo, CA Tel: 949-462-9523 Fax: 949-462-9608 Santa Clara Santa Clara, CA Tel: 408-961-6444 Fax: 408-961-6445 Toronto Mississauga, Ontario, Canada Tel: 905-673-0699 Fax: 905-673-6509 ASIA/PACIFIC Asia Pacific Office Suites 3707-14, 37th Floor Tower 6, The Gateway Habour City, Kowloon Hong Kong Tel: 852-2401-1200 Fax: 852-2401-3431 Australia - Sydney Tel: 61-2-9868-6733 Fax: 61-2-9868-6755 China - Beijing Tel: 86-10-8528-2100 Fax: 86-10-8528-2104 China - Chengdu Tel: 86-28-8665-5511 Fax: 86-28-8665-7889 China - Fuzhou Tel: 86-591-8750-3506 Fax: 86-591-8750-3521 China - Hong Kong SAR Tel: 852-2401-1200 Fax: 852-2401-3431 China - Qingdao Tel: 86-532-8502-7355 Fax: 86-532-8502-7205 China - Shanghai Tel: 86-21-5407-5533 Fax: 86-21-5407-5066 China - Shenyang Tel: 86-24-2334-2829 Fax: 86-24-2334-2393 China - Shenzhen Tel: 86-755-8203-2660 Fax: 86-755-8203-1760 China - Shunde Tel: 86-757-2839-5507 Fax: 86-757-2839-5571 China - Wuhan Tel: 86-27-5980-5300 Fax: 86-27-5980-5118 China - Xian Tel: 86-29-8833-7250 Fax: 86-29-8833-7256 ASIA/PACIFIC India - Bangalore Tel: 91-80-4182-8400 Fax: 91-80-4182-8422 India - New Delhi Tel: 91-11-4160-8631 Fax: 91-11-4160-8632 India - Pune Tel: 91-20-2566-1512 Fax: 91-20-2566-1513 Japan - Yokohama Tel: 81-45-471- 6166 Fax: 81-45-471-6122 Korea - Gumi Tel: 82-54-473-4301 Fax: 82-54-473-4302 Korea - Seoul Tel: 82-2-554-7200 Fax: 82-2-558-5932 or 82-2-558-5934 Malaysia - Penang Tel: 60-4-646-8870 Fax: 60-4-646-5086 Philippines - Manila Tel: 63-2-634-9065 Fax: 63-2-634-9069 Singapore Tel: 65-6334-8870 Fax: 65-6334-8850 Taiwan - Hsin Chu Tel: 886-3-572-9526 Fax: 886-3-572-6459 Taiwan - Kaohsiung Tel: 886-7-536-4818 Fax: 886-7-536-4803 Taiwan - Taipei Tel: 886-2-2500-6610 Fax: 886-2-2508-0102 Thailand - Bangkok Tel: 66-2-694-1351 Fax: 66-2-694-1350 EUROPE Austria - Wels Tel: 43-7242-2244-39 Fax: 43-7242-2244-393 Denmark - Copenhagen Tel: 45-4450-2828 Fax: 45-4485-2829 France - Paris Tel: 33-1-69-53-63-20 Fax: 33-1-69-30-90-79 Germany - Munich Tel: 49-89-627-144-0 Fax: 49-89-627-144-44 Italy - Milan Tel: 39-0331-742611 Fax: 39-0331-466781 Netherlands - Drunen Tel: 31-416-690399 Fax: 31-416-690340 Spain - Madrid Tel: 34-91-708-08-90 Fax: 34-91-708-08-91 UK - Wokingham Tel: 44-118-921-5869 Fax: 44-118-921-5820 WORLDWIDE SALES AND SERVICE 12/08/06 2586QS–AVR–08/2013 Features • High Performance, Low Power AVR® 8-Bit Microcontroller • Advanced RISC Architecture – 120 Powerful Instructions – Most Single Clock Cycle Execution – 32 x 8 General Purpose Working Registers – Fully Static Operation • Non-volatile Program and Data Memories – 2/4/8K Bytes of In-System Programmable Program Memory Flash • Endurance: 10,000 Write/Erase Cycles – 128/256/512 Bytes In-System Programmable EEPROM • Endurance: 100,000 Write/Erase Cycles – 128/256/512 Bytes Internal SRAM – Programming Lock for Self-Programming Flash Program and EEPROM Data Security • Peripheral Features – 8-bit Timer/Counter with Prescaler and Two PWM Channels – 8-bit High Speed Timer/Counter with Separate Prescaler • 2 High Frequency PWM Outputs with Separate Output Compare Registers • Programmable Dead Time Generator – USI – Universal Serial Interface with Start Condition Detector – 10-bit ADC • 4 Single Ended Channels • 2 Differential ADC Channel Pairs with Programmable Gain (1x, 20x) • Temperature Measurement – Programmable Watchdog Timer with Separate On-chip Oscillator – On-chip Analog Comparator • Special Microcontroller Features – debugWIRE On-chip Debug System – In-System Programmable via SPI Port – External and Internal Interrupt Sources – Low Power Idle, ADC Noise Reduction, and Power-down Modes – Enhanced Power-on Reset Circuit – Programmable Brown-out Detection Circuit – Internal Calibrated Oscillator • I/O and Packages – Six Programmable I/O Lines – 8-pin PDIP, 8-pin SOIC, 20-pad QFN/MLF, and 8-pin TSSOP (only ATtiny45/V) • Operating Voltage – 1.8 - 5.5V for ATtiny25V/45V/85V – 2.7 - 5.5V for ATtiny25/45/85 • Speed Grade – ATtiny25V/45V/85V: 0 – 4 MHz @ 1.8 - 5.5V, 0 - 10 MHz @ 2.7 - 5.5V – ATtiny25/45/85: 0 – 10 MHz @ 2.7 - 5.5V, 0 - 20 MHz @ 4.5 - 5.5V • Industrial Temperature Range • Low Power Consumption – Active Mode: • 1 MHz, 1.8V: 300 µA – Power-down Mode: • 0.1 µA at 1.8V Atmel 8-bit AVR Microcontroller with 2/4/8K Bytes In-System Programmable Flash ATtiny25/V / ATtiny45/V / ATtiny85/V Summary Rev. 2586QS–AVR–08/2013ATtiny25/45/85 [DATASHEET] 2 2586QS–AVR–08/2013 1. Pin Configurations Figure 1-1. Pinout ATtiny25/45/85 1.1 Pin Descriptions 1.1.1 VCC Supply voltage. 1.1.2 GND Ground. 1.1.3 Port B (PB5:PB0) Port B is a 6-bit bi-directional I/O port with internal pull-up resistors (selected for each bit). The Port B output buffers have symmetrical drive characteristics with both high sink and source capability. As inputs, Port B pins that are externally pulled low will source current if the pull-up resistors are activated. The Port B pins are tri-stated when a reset condition becomes active, even if the clock is not running. 1 2 3 4 8 7 6 5 (PCINT5/RESET/ADC0/dW) PB5 (PCINT3/XTAL1/CLKI/OC1B/ADC3) PB3 (PCINT4/XTAL2/CLKO/OC1B/ADC2) PB4 GND VCC PB2 (SCK/USCK/SCL/ADC1/T0/INT0/PCINT2) PB1 (MISO/DO/AIN1/OC0B/OC1A/PCINT1) PB0 (MOSI/DI/SDA/AIN0/OC0A/OC1A/AREF/PCINT0) PDIP/SOIC/TSSOP 1 2 3 4 5 QFN/MLF 15 14 13 12 11 20 19 18 17 16 6 7 8 9 10 DNC DNC GND DNC DNC DNC DNC DNC DNC DNC NOTE: Bottom pad should be soldered to ground. DNC: Do Not Connect NOTE: TSSOP only for ATtiny45/V (PCINT5/RESET/ADC0/dW) PB5 (PCINT3/XTAL1/CLKI/OC1B/ADC3) PB3 DNC DNC (PCINT4/XTAL2/CLKO/OC1B/ADC2) PB4 VCC PB2 (SCK/USCK/SCL/ADC1/T0/INT0/PCINT2) DNC PB1 (MISO/DO/AIN1/OC0B/OC1A/PCINT1) PB0 (MOSI/DI/SDA/AIN0/OC0A/OC1A/AREF/PCINT0)ATtiny25/45/85 [DATASHEET] 3 2586QS–AVR–08/2013 Port B also serves the functions of various special features of the ATtiny25/45/85 as listed in “Alternate Functions of Port B” on page 60. On ATtiny25, the programmable I/O ports PB3 and PB4 (pins 2 and 3) are exchanged in ATtiny15 Compatibility Mode for supporting the backward compatibility with ATtiny15. 1.1.4 RESET Reset input. A low level on this pin for longer than the minimum pulse length will generate a reset, even if the clock is not running and provided the reset pin has not been disabled. The minimum pulse length is given in Table 21-4 on page 165. Shorter pulses are not guaranteed to generate a reset. The reset pin can also be used as a (weak) I/O pin.ATtiny25/45/85 [DATASHEET] 4 2586QS–AVR–08/2013 2. Overview The ATtiny25/45/85 is a low-power CMOS 8-bit microcontroller based on the AVR enhanced RISC architecture. By executing powerful instructions in a single clock cycle, the ATtiny25/45/85 achieves throughputs approaching 1 MIPS per MHz allowing the system designer to optimize power consumption versus processing speed. 2.1 Block Diagram Figure 2-1. Block Diagram The AVR core combines a rich instruction set with 32 general purpose working registers. All 32 registers are directly connected to the Arithmetic Logic Unit (ALU), allowing two independent registers to be accessed in one single instruction executed in one clock cycle. The resulting architecture is more code efficient while achieving throughputs up to ten times faster than conventional CISC microcontrollers. PROGRAM COUNTER CALIBRATED INTERNAL OSCILLATOR WATCHDOG TIMER STACK POINTER PROGRAM FLASH SRAM MCU CONTROL REGISTER GENERAL PURPOSE REGISTERS INSTRUCTION REGISTER TIMER/ COUNTER0 SERIAL UNIVERSAL INTERFACE TIMER/ COUNTER1 INSTRUCTION DECODER DATA DIR. REG.PORT B DATA REGISTER PORT B PROGRAMMING LOGIC TIMING AND CONTROL MCU STATUS REGISTER STATUS REGISTER ALU PORT B DRIVERS PB[0:5] VCC GND CONTROL LINES 8-BIT DATABUS Z ADC / ANALOG COMPARATOR INTERRUPT UNIT DATA EEPROM OSCILLATORS Y X RESETATtiny25/45/85 [DATASHEET] 5 2586QS–AVR–08/2013 The ATtiny25/45/85 provides the following features: 2/4/8K bytes of In-System Programmable Flash, 128/256/512 bytes EEPROM, 128/256/256 bytes SRAM, 6 general purpose I/O lines, 32 general purpose working registers, one 8-bit Timer/Counter with compare modes, one 8-bit high speed Timer/Counter, Universal Serial Interface, Internal and External Interrupts, a 4-channel, 10-bit ADC, a programmable Watchdog Timer with internal Oscillator, and three software selectable power saving modes. Idle mode stops the CPU while allowing the SRAM, Timer/Counter, ADC, Analog Comparator, and Interrupt system to continue functioning. Power-down mode saves the register contents, disabling all chip functions until the next Interrupt or Hardware Reset. ADC Noise Reduction mode stops the CPU and all I/O modules except ADC, to minimize switching noise during ADC conversions. The device is manufactured using Atmel’s high density non-volatile memory technology. The On-chip ISP Flash allows the Program memory to be re-programmed In-System through an SPI serial interface, by a conventional non-volatile memory programmer or by an On-chip boot code running on the AVR core. The ATtiny25/45/85 AVR is supported with a full suite of program and system development tools including: C Compilers, Macro Assemblers, Program Debugger/Simulators and Evaluation kits.ATtiny25/45/85 [DATASHEET] 6 2586QS–AVR–08/2013 3. About 3.1 Resources A comprehensive set of development tools, application notes and datasheets are available for download on http://www.atmel.com/avr. 3.2 Code Examples This documentation contains simple code examples that briefly show how to use various parts of the device. These code examples assume that the part specific header file is included before compilation. Be aware that not all C compiler vendors include bit definitions in the header files and interrupt handling in C is compiler dependent. Please confirm with the C compiler documentation for more details. For I/O Registers located in the extended I/O map, “IN”, “OUT”, “SBIS”, “SBIC”, “CBI”, and “SBI” instructions must be replaced with instructions that allow access to extended I/O. Typically, this means “LDS” and “STS” combined with “SBRS”, “SBRC”, “SBR”, and “CBR”. Note that not all AVR devices include an extended I/O map. 3.3 Capacitive Touch Sensing Atmel QTouch Library provides a simple to use solution for touch sensitive interfaces on Atmel AVR microcontrollers. The QTouch Library includes support for QTouch® and QMatrix® acquisition methods. Touch sensing is easily added to any application by linking the QTouch Library and using the Application Programming Interface (API) of the library to define the touch channels and sensors. The application then calls the API to retrieve channel information and determine the state of the touch sensor. The QTouch Library is free and can be downloaded from the Atmel website. For more information and details of implementation, refer to the QTouch Library User Guide – also available from the Atmel website. 3.4 Data Retention Reliability Qualification results show that the projected data retention failure rate is much less than 1 PPM over 20 years at 85°C or 100 years at 25°C.ATtiny25/45/85 [DATASHEET] 7 2586QS–AVR–08/2013 4. Register Summary Note: 1. For compatibility with future devices, reserved bits should be written to zero if accessed. Reserved I/O memory addresses Address Name Bit 7 Bit 6 Bit 5 Bit 4 Bit 3 Bit 2 Bit 1 Bit 0 Page 0x3F SREG I T H S V N Z C page 8 0x3E SPH – – – – – – SP9 SP8 page 11 0x3D SPL SP7 SP6 SP5 SP4 SP3 SP2 SP1 SP0 page 11 0x3C Reserved – 0x3B GIMSK – INT0 PCIE – – – – – page 51 0x3A GIFR – INTF0 PCIF – – – – – page 52 0x39 TIMSK – OCIE1A OCIE1B OCIE0A OCIE0B TOIE1 TOIE0 – pages 81, 102 0x38 TIFR – OCF1A OCF1B OCF0A OCF0B TOV1 TOV0 – page 81 0x37 SPMCSR – – RSIG CTPB RFLB PGWRT PGERS SPMEN page 145 0x36 Reserved – 0x35 MCUCR BODS PUD SE SM1 SM0 BODSE ISC01 ISC00 pages 37, 51, 64 0x34 MCUSR – – – – WDRF BORF EXTRF PORF page 44, 0x33 TCCR0B FOC0A FOC0B – – WGM02 CS02 CS01 CS00 page 79 0x32 TCNT0 Timer/Counter0 page 80 0x31 OSCCAL Oscillator Calibration Register page 31 0x30 TCCR1 CTC1 PWM1A COM1A1 COM1A0 CS13 CS12 CS11 CS10 pages 89, 100 0x2F TCNT1 Timer/Counter1 pages 91, 102 0x2E OCR1A Timer/Counter1 Output Compare Register A pages 91, 102 0x2D OCR1C Timer/Counter1 Output Compare Register C pages 91, 102 0x2C GTCCR TSM PWM1B COM1B1 COM1B0 FOC1B FOC1A PSR1 PSR0 pages 77, 90, 101 0x2B OCR1B Timer/Counter1 Output Compare Register B page 92 0x2A TCCR0A COM0A1 COM0A0 COM0B1 COM0B0 – WGM01 WGM00 page 77 0x29 OCR0A Timer/Counter0 – Output Compare Register A page 80 0x28 OCR0B Timer/Counter0 – Output Compare Register B page 81 0x27 PLLCSR LSM – – – – PCKE PLLE PLOCK pages 94, 103 0x26 CLKPR CLKPCE – – – CLKPS3 CLKPS2 CLKPS1 CLKPS0 page 32 0x25 DT1A DT1AH3 DT1AH2 DT1AH1 DT1AH0 DT1AL3 DT1AL2 DT1AL1 DT1AL0 page 107 0x24 DT1B DT1BH3 DT1BH2 DT1BH1 DT1BH0 DT1BL3 DT1BL2 DT1BL1 DT1BL0 page 107 0x23 DTPS1 - - - - - - DTPS11 DTPS10 page 106 0x22 DWDR DWDR[7:0] page 140 0x21 WDTCR WDIF WDIE WDP3 WDCE WDE WDP2 WDP1 WDP0 page 45 0x20 PRR – PRTIM1 PRTIM0 PRUSI PRADC page 36 0x1F EEARH EEAR8 page 20 0x1E EEARL EEAR7 EEAR6 EEAR5 EEAR4 EEAR3 EEAR2 EEAR1 EEAR0 page 21 0x1D EEDR EEPROM Data Register page 21 0x1C EECR – – EEPM1 EEPM0 EERIE EEMPE EEPE EERE page 21 0x1B Reserved – 0x1A Reserved – 0x19 Reserved – 0x18 PORTB – – PORTB5 PORTB4 PORTB3 PORTB2 PORTB1 PORTB0 page 64 0x17 DDRB – – DDB5 DDB4 DDB3 DDB2 DDB1 DDB0 page 64 0x16 PINB – – PINB5 PINB4 PINB3 PINB2 PINB1 PINB0 page 64 0x15 PCMSK – – PCINT5 PCINT4 PCINT3 PCINT2 PCINT1 PCINT0 page 52 0x14 DIDR0 – – ADC0D ADC2D ADC3D ADC1D AIN1D AIN0D pages 121, 138 0x13 GPIOR2 General Purpose I/O Register 2 page 10 0x12 GPIOR1 General Purpose I/O Register 1 page 10 0x11 GPIOR0 General Purpose I/O Register 0 page 10 0x10 USIBR USI Buffer Register page 115 0x0F USIDR USI Data Register page 115 0x0E USISR USISIF USIOIF USIPF USIDC USICNT3 USICNT2 USICNT1 USICNT0 page 115 0x0D USICR USISIE USIOIE USIWM1 USIWM0 USICS1 USICS0 USICLK USITC page 116 0x0C Reserved – 0x0B Reserved – 0x0A Reserved – 0x09 Reserved – 0x08 ACSR ACD ACBG ACO ACI ACIE – ACIS1 ACIS0 page 120 0x07 ADMUX REFS1 REFS0 ADLAR REFS2 MUX3 MUX2 MUX1 MUX0 page 134 0x06 ADCSRA ADEN ADSC ADATE ADIF ADIE ADPS2 ADPS1 ADPS0 page 136 0x05 ADCH ADC Data Register High Byte page 137 0x04 ADCL ADC Data Register Low Byte page 137 0x03 ADCSRB BIN ACME IPR – – ADTS2 ADTS1 ADTS0 pages 120, 137 0x02 Reserved – 0x01 Reserved – 0x00 Reserved –ATtiny25/45/85 [DATASHEET] 8 2586QS–AVR–08/2013 should never be written. 2. I/O Registers within the address range 0x00 - 0x1F are directly bit-accessible using the SBI and CBI instructions. In these registers, the value of single bits can be checked by using the SBIS and SBIC instructions. 3. Some of the Status Flags are cleared by writing a logical one to them. Note that, unlike most other AVRs, the CBI and SBI instructions will only operation the specified bit, and can therefore be used on registers containing such Status Flags. The CBI and SBI instructions work with registers 0x00 to 0x1F only.ATtiny25/45/85 [DATASHEET] 9 2586QS–AVR–08/2013 5. Instruction Set Summary Mnemonics Operands Description Operation Flags #Clocks ARITHMETIC AND LOGIC INSTRUCTIONS ADD Rd, Rr Add two Registers Rd  Rd + Rr Z,C,N,V,H 1 ADC Rd, Rr Add with Carry two Registers Rd  Rd + Rr + C Z,C,N,V,H 1 ADIW Rdl,K Add Immediate to Word Rdh:Rdl  Rdh:Rdl + K Z,C,N,V,S 2 SUB Rd, Rr Subtract two Registers Rd  Rd - Rr Z,C,N,V,H 1 SUBI Rd, K Subtract Constant from Register Rd  Rd - K Z,C,N,V,H 1 SBC Rd, Rr Subtract with Carry two Registers Rd  Rd - Rr - C Z,C,N,V,H 1 SBCI Rd, K Subtract with Carry Constant from Reg. Rd  Rd - K - C Z,C,N,V,H 1 SBIW Rdl,K Subtract Immediate from Word Rdh:Rdl  Rdh:Rdl - K Z,C,N,V,S 2 AND Rd, Rr Logical AND Registers Rd Rd  Rr Z,N,V 1 ANDI Rd, K Logical AND Register and Constant Rd  Rd K Z,N,V 1 OR Rd, Rr Logical OR Registers Rd  Rd v Rr Z,N,V 1 ORI Rd, K Logical OR Register and Constant Rd Rd v K Z,N,V 1 EOR Rd, Rr Exclusive OR Registers Rd  Rd  Rr Z,N,V 1 COM Rd One’s Complement Rd  0xFF  Rd Z,C,N,V 1 NEG Rd Two’s Complement Rd  0x00  Rd Z,C,N,V,H 1 SBR Rd,K Set Bit(s) in Register Rd  Rd v K Z,N,V 1 CBR Rd,K Clear Bit(s) in Register Rd  Rd  (0xFF - K) Z,N,V 1 INC Rd Increment Rd  Rd + 1 Z,N,V 1 DEC Rd Decrement Rd  Rd  1 Z,N,V 1 TST Rd Test for Zero or Minus Rd  Rd  Rd Z,N,V 1 CLR Rd Clear Register Rd  Rd  Rd Z,N,V 1 SER Rd Set Register Rd  0xFF None 1 BRANCH INSTRUCTIONS RJMP k Relative Jump PC PC + k + 1 None 2 IJMP Indirect Jump to (Z) PC  Z None 2 RCALL k Relative Subroutine Call PC  PC + k + 1 None 3 ICALL Indirect Call to (Z) PC  Z None 3 RET Subroutine Return PC  STACK None 4 RETI Interrupt Return PC  STACK I 4 CPSE Rd,Rr Compare, Skip if Equal if (Rd = Rr) PC PC + 2 or 3 None 1/2/3 CP Rd,Rr Compare Rd  Rr Z, N,V,C,H 1 CPC Rd,Rr Compare with Carry Rd  Rr  C Z, N,V,C,H 1 CPI Rd,K Compare Register with Immediate Rd  K Z, N,V,C,H 1 SBRC Rr, b Skip if Bit in Register Cleared if (Rr(b)=0) PC  PC + 2 or 3 None 1/2/3 SBRS Rr, b Skip if Bit in Register is Set if (Rr(b)=1) PC  PC + 2 or 3 None 1/2/3 SBIC P, b Skip if Bit in I/O Register Cleared if (P(b)=0) PC  PC + 2 or 3 None 1/2/3 SBIS P, b Skip if Bit in I/O Register is Set if (P(b)=1) PC  PC + 2 or 3 None 1/2/3 BRBS s, k Branch if Status Flag Set if (SREG(s) = 1) then PCPC+k + 1 None 1/2 BRBC s, k Branch if Status Flag Cleared if (SREG(s) = 0) then PCPC+k + 1 None 1/2 BREQ k Branch if Equal if (Z = 1) then PC  PC + k + 1 None 1/2 BRNE k Branch if Not Equal if (Z = 0) then PC  PC + k + 1 None 1/2 BRCS k Branch if Carry Set if (C = 1) then PC  PC + k + 1 None 1/2 BRCC k Branch if Carry Cleared if (C = 0) then PC  PC + k + 1 None 1/2 BRSH k Branch if Same or Higher if (C = 0) then PC  PC + k + 1 None 1/2 BRLO k Branch if Lower if (C = 1) then PC  PC + k + 1 None 1/2 BRMI k Branch if Minus if (N = 1) then PC  PC + k + 1 None 1/2 BRPL k Branch if Plus if (N = 0) then PC  PC + k + 1 None 1/2 BRGE k Branch if Greater or Equal, Signed if (N  V= 0) then PC  PC + k + 1 None 1/2 BRLT k Branch if Less Than Zero, Signed if (N  V= 1) then PC  PC + k + 1 None 1/2 BRHS k Branch if Half Carry Flag Set if (H = 1) then PC  PC + k + 1 None 1/2 BRHC k Branch if Half Carry Flag Cleared if (H = 0) then PC  PC + k + 1 None 1/2 BRTS k Branch if T Flag Set if (T = 1) then PC  PC + k + 1 None 1/2 BRTC k Branch if T Flag Cleared if (T = 0) then PC  PC + k + 1 None 1/2 BRVS k Branch if Overflow Flag is Set if (V = 1) then PC  PC + k + 1 None 1/2 BRVC k Branch if Overflow Flag is Cleared if (V = 0) then PC  PC + k + 1 None 1/2 BRIE k Branch if Interrupt Enabled if ( I = 1) then PC  PC + k + 1 None 1/2 BRID k Branch if Interrupt Disabled if ( I = 0) then PC  PC + k + 1 None 1/2 BIT AND BIT-TEST INSTRUCTIONS SBI P,b Set Bit in I/O Register I/O(P,b)  1 None 2 CBI P,b Clear Bit in I/O Register I/O(P,b)  0 None 2 LSL Rd Logical Shift Left Rd(n+1)  Rd(n), Rd(0)  0 Z,C,N,V 1 LSR Rd Logical Shift Right Rd(n)  Rd(n+1), Rd(7)  0 Z,C,N,V 1 ROL Rd Rotate Left Through Carry Rd(0)C,Rd(n+1) Rd(n),CRd(7) Z,C,N,V 1 ROR Rd Rotate Right Through Carry Rd(7)C,Rd(n) Rd(n+1),CRd(0) Z,C,N,V 1 ASR Rd Arithmetic Shift Right Rd(n)  Rd(n+1), n=0..6 Z,C,N,V 1ATtiny25/45/85 [DATASHEET] 10 2586QS–AVR–08/2013 SWAP Rd Swap Nibbles Rd(3..0)Rd(7..4),Rd(7..4)Rd(3..0) None 1 BSET s Flag Set SREG(s)  1 SREG(s) 1 BCLR s Flag Clear SREG(s)  0 SREG(s) 1 BST Rr, b Bit Store from Register to T T  Rr(b) T 1 BLD Rd, b Bit load from T to Register Rd(b)  T None 1 SEC Set Carry C  1 C1 CLC Clear Carry C  0 C 1 SEN Set Negative Flag N  1 N1 CLN Clear Negative Flag N  0 N 1 SEZ Set Zero Flag Z  1 Z1 CLZ Clear Zero Flag Z  0 Z 1 SEI Global Interrupt Enable I  1 I1 CLI Global Interrupt Disable I 0 I 1 SES Set Signed Test Flag S  1 S1 CLS Clear Signed Test Flag S  0 S 1 SEV Set Twos Complement Overflow. V  1 V1 CLV Clear Twos Complement Overflow V  0 V 1 SET Set T in SREG T  1 T1 CLT Clear T in SREG T  0 T 1 SEH Set Half Carry Flag in SREG H  1 H1 CLH Clear Half Carry Flag in SREG H  0 H 1 DATA TRANSFER INSTRUCTIONS MOV Rd, Rr Move Between Registers Rd  Rr None 1 MOVW Rd, Rr Copy Register Word Rd+1:Rd  Rr+1:Rr None 1 LDI Rd, K Load Immediate Rd  K None 1 LD Rd, X Load Indirect Rd  (X) None 2 LD Rd, X+ Load Indirect and Post-Inc. Rd  (X), X  X + 1 None 2 LD Rd, - X Load Indirect and Pre-Dec. X  X - 1, Rd  (X) None 2 LD Rd, Y Load Indirect Rd  (Y) None 2 LD Rd, Y+ Load Indirect and Post-Inc. Rd  (Y), Y  Y + 1 None 2 LD Rd, - Y Load Indirect and Pre-Dec. Y  Y - 1, Rd  (Y) None 2 LDD Rd,Y+q Load Indirect with Displacement Rd  (Y + q) None 2 LD Rd, Z Load Indirect Rd  (Z) None 2 LD Rd, Z+ Load Indirect and Post-Inc. Rd  (Z), Z  Z+1 None 2 LD Rd, -Z Load Indirect and Pre-Dec. Z  Z - 1, Rd  (Z) None 2 LDD Rd, Z+q Load Indirect with Displacement Rd  (Z + q) None 2 LDS Rd, k Load Direct from SRAM Rd  (k) None 2 ST X, Rr Store Indirect (X) Rr None 2 ST X+, Rr Store Indirect and Post-Inc. (X) Rr, X  X + 1 None 2 ST - X, Rr Store Indirect and Pre-Dec. X  X - 1, (X)  Rr None 2 ST Y, Rr Store Indirect (Y)  Rr None 2 ST Y+, Rr Store Indirect and Post-Inc. (Y)  Rr, Y  Y + 1 None 2 ST - Y, Rr Store Indirect and Pre-Dec. Y  Y - 1, (Y)  Rr None 2 STD Y+q,Rr Store Indirect with Displacement (Y + q)  Rr None 2 ST Z, Rr Store Indirect (Z)  Rr None 2 ST Z+, Rr Store Indirect and Post-Inc. (Z)  Rr, Z  Z + 1 None 2 ST -Z, Rr Store Indirect and Pre-Dec. Z  Z - 1, (Z)  Rr None 2 STD Z+q,Rr Store Indirect with Displacement (Z + q)  Rr None 2 STS k, Rr Store Direct to SRAM (k)  Rr None 2 LPM Load Program Memory R0  (Z) None 3 LPM Rd, Z Load Program Memory Rd  (Z) None 3 LPM Rd, Z+ Load Program Memory and Post-Inc Rd  (Z), Z  Z+1 None 3 SPM Store Program Memory (z)  R1:R0 None IN Rd, P In Port Rd  P None 1 OUT P, Rr Out Port P  Rr None 1 PUSH Rr Push Register on Stack STACK  Rr None 2 POP Rd Pop Register from Stack Rd  STACK None 2 MCU CONTROL INSTRUCTIONS NOP No Operation None 1 SLEEP Sleep (see specific descr. for Sleep function) None 1 WDR Watchdog Reset (see specific descr. for WDR/Timer) None 1 BREAK Break For On-chip Debug Only None N/A Mnemonics Operands Description Operation Flags #ClocksATtiny25/45/85 [DATASHEET] 11 2586QS–AVR–08/2013 6. Ordering Information Notes: 1. For speed vs. supply voltage, see section 21.3 “Speed” on page 163. 2. All Pb-free, halide-free, fully green, and comply with European directive for Restriction of Hazardous Substances (RoHS). 3. Code indicators: H = NiPdAu lead finish, U/N = matte tin, R = tape & reel. 4. Can also be supplied in wafer form. Contact your local Atmel sales office for ordering information and minimum quantities. 5. For characteristics, see “Appendix A – Specification at 105C”. 6. For characteristics, see “Appendix B – Specification at 125C”. 6.1 ATtiny25 Speed (MHz) (1) Supply Voltage (V) Temperature Range Package (2) Ordering Code (3) 10 1.8 – 5.5 Industrial (-40C to +85C) (4) 8P3 ATtiny25V-10PU 8S2 ATtiny25V-10SU ATtiny25V-10SUR ATtiny25V-10SH ATtiny25V-10SHR S8S1 ATtiny25V-10SSU ATtiny25V-10SSUR ATtiny25V-10SSH ATtiny25V-10SSHR 20M1 ATtiny25V-10MU ATtiny25V-10MUR Industrial (-40C to +105C) (5) 8S2 ATtiny25V-10SN ATtiny25V-10SNR S8S1 ATtiny25V-10SSN ATtiny25V-10SSNR Industrial (-40C to +125C) (6) 20M1 ATtiny25V-10MF ATtiny25V-10MFR 20 2.7 – 5.5 Industrial (-40C to +85C) (4) 8P3 ATtiny25-20PU 8S2 ATtiny25-20SU ATtiny25-20SUR ATtiny25-20SH ATtiny25-20SHR S8S1 ATtiny25-20SSU ATtiny25-20SSUR ATtiny25-20SSH ATtiny25-20SSHR 20M1 ATtiny25-20MU ATtiny25-20MUR Industrial (-40C to +105C) (5) 8S2 ATtiny25-20SN ATtiny25-20SNR S8S1 ATtiny25-20SSN ATtiny25-20SSNR Industrial (-40C to +125C) (6) 20M1 ATtiny25-20MF ATtiny25-20MFR Package Types 8P3 8-lead, 0.300" Wide, Plastic Dual Inline Package (PDIP) 8S2 8-lead, 0.208" Wide, Plastic Gull-Wing Small Outline (EIAJ SOIC) S8S1 8-lead, 0.150" Wide, Plastic Gull-Wing Small Outline (JEDEC SOIC) 20M1 20-pad, 4 x 4 x 0.8 mm Body, Quad Flat No-Lead/Micro Lead Frame Package (QFN/MLF)ATtiny25/45/85 [DATASHEET] 12 2586QS–AVR–08/2013 Notes: 1. For speed vs. supply voltage, see section 21.3 “Speed” on page 163. 2. All packages are Pb-free, halide-free and fully green and they comply with the European directive for Restriction of Hazardous Substances (RoHS). 3. Code indicators: – H: NiPdAu lead finish – U: matte tin – R: tape & reel 4. These devices can also be supplied in wafer form. Please contact your local Atmel sales office for detailed ordering information and minimum quantities. 6.2 ATtiny45 Speed (MHz) (1) Supply Voltage (V) Temperature Range Package (2) Ordering Code (3) 10 1.8 – 5.5 Industrial (-40C to +85C) (4) 8P3 ATtiny45V-10PU 8S2 ATtiny45V-10SU ATtiny45V-10SUR ATtiny45V-10SH ATtiny45V-10SHR 8X ATtiny45V-10XU ATtiny45V-10XUR 20M1 ATtiny45V-10MU ATtiny45V-10MUR 20 2.7 – 5.5 Industrial (-40C to +85C) (4) 8P3 ATtiny45-20PU 8S2 ATtiny45-20SU ATtiny45-20SUR ATtiny45-20SH ATtiny45-20SHR 8X ATtiny45-20XU ATtiny45-20XUR 20M1 ATtiny45-20MU ATtiny45-20MUR Package Types 8P3 8-lead, 0.300" Wide, Plastic Dual Inline Package (PDIP) 8S2 8-lead, 0.208" Wide, Plastic Gull-Wing Small Outline (EIAJ SOIC) 8X 8-lead, 4.4 mm Wide, Plastic Thin Shrink Small Outline Package (TSSOP) 20M1 20-pad, 4 x 4 x 0.8 mm Body, Quad Flat No-Lead/Micro Lead Frame Package (QFN/MLF)ATtiny25/45/85 [DATASHEET] 13 2586QS–AVR–08/2013 Notes: 1. For speed vs. supply voltage, see section 21.3 “Speed” on page 163. 2. All packages are Pb-free, halide-free and fully green and they comply with the European directive for Restriction of Hazardous Substances (RoHS). 3. Code indicators: – H: NiPdAu lead finish – U: matte tin – R: tape & reel 4. These devices can also be supplied in wafer form. Please contact your local Atmel sales office for detailed ordering information and minimum quantities. 6.3 ATtiny85 Speed (MHz) (1) Supply Voltage (V) Temperature Range Package (2) Ordering Code (3) 10 1.8 – 5.5 Industrial (-40C to +85C) (4) 8P3 ATtiny85V-10PU 8S2 ATtiny85V-10SU ATtiny85V-10SUR ATtiny85V-10SH ATtiny85V-10SHR 20M1 ATtiny85V-10MU ATtiny85V-10MUR 20 2.7 – 5.5 Industrial (-40C to +85C) (4) 8P3 ATtiny85-20PU 8S2 ATtiny85-20SU ATtiny85-20SUR ATtiny85-20SH ATtiny85-20SHR 20M1 ATtiny85-20MU ATtiny85-20MUR Package Types 8P3 8-lead, 0.300" Wide, Plastic Dual Inline Package (PDIP) 8S2 8-lead, 0.208" Wide, Plastic Gull-Wing Small Outline (EIAJ SOIC) 20M1 20-pad, 4 x 4 x 0.8 mm Body, Quad Flat No-Lead/Micro Lead Frame Package (QFN/MLF)ATtiny25/45/85 [DATASHEET] 14 2586QS–AVR–08/2013 7. Packaging Information 7.1 8P3 2325 Orchard Parkway San Jose, CA 95131 TITLE DRAWING NO. R REV. 8P3, 8-lead, 0.300" Wide Body, Plastic Dual In-line Package (PDIP) 01/09/02 8P3 B D D1 E E1 e b2 L b A2 A 1 N eA c b3 4 PLCS Top View Side View End View COMMON DIMENSIONS (Unit of Measure = inches) SYMBOL MIN NOM MAX NOTE Notes: 1. This drawing is for general information only; refer to JEDEC Drawing MS-001, Variation BA for additional information. 2. Dimensions A and L are measured with the package seated in JEDEC seating plane Gauge GS-3. 3. D, D1 and E1 dimensions do not include mold Flash or protrusions. Mold Flash or protrusions shall not exceed 0.010 inch. 4. E and eA measured with the leads constrained to be perpendicular to datum. 5. Pointed or rounded lead tips are preferred to ease insertion. 6. b2 and b3 maximum dimensions do not include Dambar protrusions. Dambar protrusions shall not exceed 0.010 (0.25 mm). A 0.210 2 A2 0.115 0.130 0.195 b 0.014 0.018 0.022 5 b2 0.045 0.060 0.070 6 b3 0.030 0.039 0.045 6 c 0.008 0.010 0.014 D 0.355 0.365 0.400 3 D1 0.005 3 E 0.300 0.310 0.325 4 E1 0.240 0.250 0.280 3 e 0.100 BSC eA 0.300 BSC 4 L 0.115 0.130 0.150 2ATtiny25/45/85 [DATASHEET] 15 2586QS–AVR–08/2013 7.2 8S2 TITLE GPC DRAWING NO. REV. Package Drawing Contact: packagedrawings@atmel.com STN F 8S2 8S2, 8-lead, 0.208” Body, Plastic Small Outline Package (EIAJ) 4/15/08 COMMON DIMENSIONS (Unit of Measure = mm) SYMBOL MIN NOM MAX NOTE Notes: 1. This drawing is for general information only; refer to EIAJ Drawing EDR-7320 for additional information. 2. Mismatch of the upper and lower dies and resin burrs aren't included. 3. Determines the true geometric position. 4. Values b,C apply to plated terminal. The standard thickness of the plating layer shall measure between 0.007 to .021 mm. A 1.70 2.16 A1 0.05 0.25 b 0.35 0.48 4 C 0.15 0.35 4 D 5.13 5.35 E1 5.18 5.40 2 E 7.70 8.26 L 0.51 0.85 θ 0° 8° e 1.27 BSC 3 θ 1 N E TOP VIEW TOP VIEW C E1 END VIEW END VIEW A b L A1 e D SIDE VIEW SIDE VIEWATtiny25/45/85 [DATASHEET] 16 2586QS–AVR–08/2013 7.3 S8S1 2325 Orchard Parkway San Jose, CA 95131 TITLE DRAWING NO. R REV. S8S1, 8-lead, 0.150" Wide Body, Plastic Gull Wing Small Outline (JEDEC SOIC) 7/28/03 S8S1 A COMMON DIMENSIONS (Unit of Measure = mm) SYMBOL MIN NOM MAX NOTE Notes: 1. This drawing is for general information only; refer to JEDEC Drawing MS-012 for proper dimensions, tolerances, datums,etc. E 5.79 6.20 E1 3.81 3.99 A 1.35 1.75 A1 0.1 0.25 D 4.80 4.98 C 0.17 0.25 b 0.31 0.51 L 0.4 1.27 e 1.27 BSC 0o 8o Top View Side View End View 1 N C A A1 b L e D E1 EATtiny25/45/85 [DATASHEET] 17 2586QS–AVR–08/2013 7.4 8X TITLE DRAWING NO. R REV. Note: These drawings are for general information only. Refer to JEDEC Drawing MO-153AC. 2325 Orchard Parkway San Jose, CA 95131 4/14/05 8X, 8-lead, 4.4 mm Body Width, Plastic Thin Shrink Small Outline Package (TSSOP) 8X A COMMON DIMENSIONS (Unit of Measure = mm) SYMBOL MIN NOM MAX NOTE A 1.05 1.10 1.20 A1 0.05 0.10 0.15 b 0.25 – 0.30 C – 0.127 – D 2.90 3.05 3.10 E1 4.30 4.40 4.50 E 6.20 6.40 6.60 e 0.65 TYP L 0.50 0.60 0.70 Ø 0o – 8o C A b L A1 D Side View Top View End View E 1 E1 e ØATtiny25/45/85 [DATASHEET] 18 2586QS–AVR–08/2013 7.5 20M1 2325 Orchard Parkway San Jose, CA 95131 TITLE DRAWING NO. R REV. 20M1, 20-pad, 4 x 4 x 0.8 mm Body, Lead Pitch 0.50 mm, 20M1 B 10/27/04 2.6 mm Exposed Pad, Micro Lead Frame Package (MLF) A 0.70 0.75 0.80 A1 – 0.01 0.05 A2 0.20 REF b 0.18 0.23 0.30 D 4.00 BSC D2 2.45 2.60 2.75 E 4.00 BSC E2 2.45 2.60 2.75 e 0.50 BSC L 0.35 0.40 0.55 SIDE VIEW Pin 1 ID Pin #1 Notch (0.20 R) BOTTOM VIEW TOP VIEW Note: Reference JEDEC Standard MO-220, Fig. 1 (SAW Singulation) WGGD-5. COMMON DIMENSIONS (Unit of Measure = mm) SYMBOL MIN NOM MAX NOTE D E e A2 A1 A D2 E2 0.08 C L 1 2 3 b 1 2 3ATtiny25/45/85 [DATASHEET] 19 2586QS–AVR–08/2013 8. Errata 8.1 Errata ATtiny25 The revision letter in this section refers to the revision of the ATtiny25 device. 8.1.1 Rev D – F No known errata. 8.1.2 Rev B – C • EEPROM read may fail at low supply voltage / low clock frequency 1. EEPROM read may fail at low supply voltage / low clock frequency Trying to read EEPROM at low clock frequencies and/or low supply voltage may result in invalid data. Problem Fix/Workaround Do not use the EEPROM when clock frequency is below 1MHz and supply voltage is below 2V. If operating frequency can not be raised above 1MHz then supply voltage should be more than 2V. Similarly, if supply voltage can not be raised above 2V then operating frequency should be more than 1MHz. This feature is known to be temperature dependent but it has not been characterised. Guidelines are given for room temperature, only. 8.1.3 Rev A Not sampled. 8.2 Errata ATtiny45 The revision letter in this section refers to the revision of the ATtiny45 device. 8.2.1 Rev F – G No known errata 8.2.2 Rev D – E • EEPROM read may fail at low supply voltage / low clock frequency 1. EEPROM read may fail at low supply voltage / low clock frequency Trying to read EEPROM at low clock frequencies and/or low supply voltage may result in invalid data. Problem Fix/Workaround Do not use the EEPROM when clock frequency is below 1MHz and supply voltage is below 2V. If operating frequency can not be raised above 1MHz then supply voltage should be more than 2V. Similarly, if supply voltage can not be raised above 2V then operating frequency should be more than 1MHz. This feature is known to be temperature dependent but it has not been characterised. Guidelines are given for room temperature, only.ATtiny25/45/85 [DATASHEET] 20 2586QS–AVR–08/2013 8.2.3 Rev B – C • PLL not locking • EEPROM read from application code does not work in Lock Bit Mode 3 • EEPROM read may fail at low supply voltage / low clock frequency • Timer Counter 1 PWM output generation on OC1B- XOC1B does not work correctly 1. PLL not locking When at frequencies below 6.0 MHz, the PLL will not lock Problem fix / Workaround When using the PLL, run at 6.0 MHz or higher. 2. EEPROM read from application code does not work in Lock Bit Mode 3 When the Memory Lock Bits LB2 and LB1 are programmed to mode 3, EEPROM read does not work from the application code. Problem Fix/Work around Do not set Lock Bit Protection Mode 3 when the application code needs to read from EEPROM. 3. EEPROM read may fail at low supply voltage / low clock frequency Trying to read EEPROM at low clock frequencies and/or low supply voltage may result in invalid data. Problem Fix/Workaround Do not use the EEPROM when clock frequency is below 1MHz and supply voltage is below 2V. If operating frequency can not be raised above 1MHz then supply voltage should be more than 2V. Similarly, if supply voltage can not be raised above 2V then operating frequency should be more than 1MHz. This feature is known to be temperature dependent but it has not been characterised. Guidelines are given for room temperature, only. 4. Timer Counter 1 PWM output generation on OC1B – XOC1B does not work correctly Timer Counter1 PWM output OC1B-XOC1B does not work correctly. Only in the case when the control bits, COM1B1 and COM1B0 are in the same mode as COM1A1 and COM1A0, respectively, the OC1B-XOC1B output works correctly. Problem Fix/Work around The only workaround is to use same control setting on COM1A[1:0] and COM1B[1:0] control bits, see table 14- 4 in the data sheet. The problem has been fixed for Tiny45 rev D. 8.2.4 Rev A • Too high power down power consumption • DebugWIRE looses communication when single stepping into interrupts • PLL not locking • EEPROM read from application code does not work in Lock Bit Mode 3 • EEPROM read may fail at low supply voltage / low clock frequency 1. Too high power down power consumption Three situations will lead to a too high power down power consumption. These are: – An external clock is selected by fuses, but the I/O PORT is still enabled as an output. – The EEPROM is read before entering power down. – VCC is 4.5 volts or higher. Problem fix / WorkaroundATtiny25/45/85 [DATASHEET] 21 2586QS–AVR–08/2013 – When using external clock, avoid setting the clock pin as Output. – Do not read the EEPROM if power down power consumption is important. – Use VCC lower than 4.5 Volts. 2. DebugWIRE looses communication when single stepping into interrupts When receiving an interrupt during single stepping, debugwire will loose communication. Problem fix / Workaround – When singlestepping, disable interrupts. – When debugging interrupts, use breakpoints within the interrupt routine, and run into the interrupt. 3. PLL not locking When at frequencies below 6.0 MHz, the PLL will not lock Problem fix / Workaround When using the PLL, run at 6.0 MHz or higher. 4. EEPROM read from application code does not work in Lock Bit Mode 3 When the Memory Lock Bits LB2 and LB1 are programmed to mode 3, EEPROM read does not work from the application code. Problem Fix/Work around Do not set Lock Bit Protection Mode 3 when the application code needs to read from EEPROM. 5. EEPROM read may fail at low supply voltage / low clock frequency Trying to read EEPROM at low clock frequencies and/or low supply voltage may result in invalid data. Problem Fix/Workaround Do not use the EEPROM when clock frequency is below 1MHz and supply voltage is below 2V. If operating frequency can not be raised above 1MHz then supply voltage should be more than 2V. Similarly, if supply voltage can not be raised above 2V then operating frequency should be more than 1MHz. This feature is known to be temperature dependent but it has not been characterized. Guidelines are given for room temperature, only.ATtiny25/45/85 [DATASHEET] 22 2586QS–AVR–08/2013 8.3 Errata ATtiny85 The revision letter in this section refers to the revision of the ATtiny85 device. 8.3.1 Rev B – C No known errata. 8.3.2 Rev A • EEPROM read may fail at low supply voltage / low clock frequency 1. EEPROM read may fail at low supply voltage / low clock frequency Trying to read EEPROM at low clock frequencies and/or low supply voltage may result in invalid data. Problem Fix/Workaround Do not use the EEPROM when clock frequency is below 1MHz and supply voltage is below 2V. If operating frequency can not be raised above 1MHz then supply voltage should be more than 2V. Similarly, if supply voltage can not be raised above 2V then operating frequency should be more than 1MHz. This feature is known to be temperature dependent but it has not been characterised. Guidelines are given for room temperature, only.ATtiny25/45/85 [DATASHEET] 23 2586QS–AVR–08/2013 9. Datasheet Revision History 9.1 Rev. 2586Q-08/13 9.2 Rev. 2586P-06/13 9.3 Rev. 2586O-02/13 Updated ordering codes on page 11, page 12, and page 13. 9.4 Rev. 2586N-04/11 1. Added: – Section “Capacitive Touch Sensing” on page 6. 2. Updated: – Document template. – Removed “Preliminary” on front page. All devices now final and in production. – Section “Limitations” on page 36. – Program example on page 49. – Section “Overview” on page 122. – Table 17-4 on page 135. – Section “Limitations of debugWIRE” on page 140. – Section “Serial Programming Algorithm” on page 151. – Table 21-7 on page 166. – EEPROM errata on pages 19, 19, 20, 21, and 22 – Ordering information on pages 11, 12, and 13. 9.5 Rev. 2586M-07/10 1. Clarified Section 6.4 “Clock Output Buffer” on page 31. 2. Added Ordering Codes -SN and -SNR for ATtiny25 extended temperature. 9.6 Rev. 2586L-06/10 1. Added: – TSSOP for ATtiny45 in “Features” on page 1, Pinout Figure 1-1 on page 2, Ordering Information in Section 6.2 “ATtiny45” on page 12, and Packaging Information in Section 7.4 “8X” on page 17 – Table 6-11, “Capacitance of Low-Frequency Crystal Oscillator,” on page 29 – Figure 22-36 on page 191 and Figure 22-37 on page 191, Typical Characteristics plots for Bandgap Voltage vs. VCC and Temperature – Extended temperature in Section 6.1 “ATtiny25” on page 11, Ordering Information 1. “Bit 3 – FOC1B: Force Output Compare Match 1B” description in “GTCCR – General Timer/Counter1 Control Register” on page 90 updated: PB3 in “compare match output pin PB3 (OC1B)” corrected to PB4. 1. Updated description of “EEARH – EEPROM Address Register” and “EEARL – EEPROM Address Register” on page 20.ATtiny25/45/85 [DATASHEET] 24 2586QS–AVR–08/2013 – Tape & reel part numbers in Ordering Information, in Section 6.1 “ATtiny25” on page 11 and Section 6.2 “ATtiny45” on page 12 2. Updated: – “Features” on page 1, removed Preliminary from ATtiny25 – Section 8.4.2 “Code Example” on page 44 – “PCMSK – Pin Change Mask Register” on page 52, Bit Descriptions – “TCCR1 – Timer/Counter1 Control Register” on page 89 and “GTCCR – General Timer/Counter1 Control Register” on page 90, COM bit descriptions clarified – Section 20.3.2 “Calibration Bytes” on page 150, frequencies (8 MHz, 6.4 MHz) – Table 20-11, “Minimum Wait Delay Before Writing the Next Flash or EEPROM Location,” on page 153, value for tWD_ERASE – Table 20-16, “High-voltage Serial Programming Instruction Set for ATtiny25/45/85,” on page 158 – Table 21-1, “DC Characteristics. TA = -40C to +85C,” on page 161, notes adjusted – Table 21-11, “Serial Programming Characteristics, TA = -40C to +85C, VCC = 1.8 - 5.5V (Unless Otherwise Noted),” on page 170, added tSLIV – Bit syntax throughout the datasheet, e.g. from CS02:0 to CS0[2:0]. 9.7 Rev. 2586K-01/08 1. Updated Document Template. 2. Added Sections: – “Data Retention” on page 6 – “Low Level Interrupt” on page 49 – “Device Signature Imprint Table” on page 149 3. Updated Sections: – “Internal PLL for Fast Peripheral Clock Generation - clkPCK” on page 24 – “System Clock and Clock Options” on page 23 – “Internal PLL in ATtiny15 Compatibility Mode” on page 24 – “Sleep Modes” on page 34 – “Software BOD Disable” on page 35 – “External Interrupts” on page 49 – “Timer/Counter1 in PWM Mode” on page 97 – “USI – Universal Serial Interface” on page 108 – “Temperature Measurement” on page 133 – “Reading Lock, Fuse and Signature Data from Software” on page 143 – “Program And Data Memory Lock Bits” on page 147 – “Fuse Bytes” on page 148 – “Signature Bytes” on page 150 – “Calibration Bytes” on page 150 – “System and Reset Characteristics” on page 165 4. Added Figures: – “Reset Pin Output Voltage vs. Sink Current (VCC = 3V)” on page 184 – “Reset Pin Output Voltage vs. Sink Current (VCC = 5V)” on page 185 – “Reset Pin Output Voltage vs. Source Current (VCC = 3V)” on page 185ATtiny25/45/85 [DATASHEET] 25 2586QS–AVR–08/2013 – “Reset Pin Output Voltage vs. Source Current (VCC = 5V)” on page 186 5. Updated Figure: – “Reset Logic” on page 39 6. Updated Tables: – “Start-up Times for Internal Calibrated RC Oscillator Clock” on page 28 – “Start-up Times for Internal Calibrated RC Oscillator Clock (in ATtiny15 Mode)” on page 28 – “Start-up Times for the 128 kHz Internal Oscillator” on page 28 – “Compare Mode Select in PWM Mode” on page 86 – “Compare Mode Select in PWM Mode” on page 98 – “DC Characteristics. TA = -40C to +85C” on page 161 – “Calibration Accuracy of Internal RC Oscillator” on page 164 – “ADC Characteristics” on page 167 7. Updated Code Example in Section: – “Write” on page 17 8. Updated Bit Descriptions in: – “MCUCR – MCU Control Register” on page 37 – “Bits 7:6 – COM0A[1:0]: Compare Match Output A Mode” on page 77 – “Bits 5:4 – COM0B[1:0]: Compare Match Output B Mode” on page 77 – “Bits 2:0 – ADTS[2:0]: ADC Auto Trigger Source” on page 138 – “SPMCSR – Store Program Memory Control and Status Register” on page 145. 9. Updated description of feature “EEPROM read may fail at low supply voltage / low clock frequency” in Sections: – “Errata ATtiny25” on page 19 – “Errata ATtiny45” on page 19 – “Errata ATtiny85” on page 22 10. Updated Package Description in Sections: – “ATtiny25” on page 11 – “ATtiny45” on page 12 – “ATtiny85” on page 13 11. Updated Package Drawing: – “S8S1” on page 16 12. Updated Order Codes for: – “ATtiny25” on page 11 9.8 Rev. 2586J-12/06 1. Updated “Low Power Consumption” on page 1. 2. Updated description of instruction length in “Architectural Overview” . 3. Updated Flash size in “In-System Re-programmable Flash Program Memory” on page 15. 4. Updated cross-references in sections “Atomic Byte Programming” , “Erase” and “Write” , starting on page 17. 5. Updated “Atomic Byte Programming” on page 17.ATtiny25/45/85 [DATASHEET] 26 2586QS–AVR–08/2013 6. Updated “Internal PLL for Fast Peripheral Clock Generation - clkPCK” on page 24. 7. Replaced single clocking system figure with two: Figure 6-2 and Figure 6-3. 8. Updated Table 6-1 on page 25, Table 6-13 on page 30 and Table 6-6 on page 27. 9. Updated “Calibrated Internal Oscillator” on page 27. 10. Updated Table 6-5 on page 26. 11. Updated “OSCCAL – Oscillator Calibration Register” on page 31. 12. Updated “CLKPR – Clock Prescale Register” on page 32. 13. Updated “Power-down Mode” on page 35. 14. Updated “Bit 0” in “PRR – Power Reduction Register” on page 38. 15. Added footnote to Table 8-3 on page 46. 16. Updated Table 10-5 on page 63. 17. Deleted “Bits 7, 2” in “MCUCR – MCU Control Register” on page 64. 18. Updated and moved section “Timer/Counter0 Prescaler and Clock Sources”, now located on page 66. 19. Updated “Timer/Counter1 Initialization for Asynchronous Mode” on page 86. 20. Updated bit description in “PLLCSR – PLL Control and Status Register” on page 94 and “PLLCSR – PLL Control and Status Register” on page 103. 21. Added recommended maximum frequency in“Prescaling and Conversion Timing” on page 125. 22. Updated Figure 17-8 on page 129 . 23. Updated “Temperature Measurement” on page 133. 24. Updated Table 17-3 on page 134. 25. Updated bit R/W descriptions in: “TIMSK – Timer/Counter Interrupt Mask Register” on page 81, “TIFR – Timer/Counter Interrupt Flag Register” on page 81, “TIMSK – Timer/Counter Interrupt Mask Register” on page 92, “TIFR – Timer/Counter Interrupt Flag Register” on page 93, “PLLCSR – PLL Control and Status Register” on page 94, “TIMSK – Timer/Counter Interrupt Mask Register” on page 102, “TIFR – Timer/Counter Interrupt Flag Register” on page 103, “PLLCSR – PLL Control and Status Register” on page 103 and “DIDR0 – Digital Input Disable Register 0” on page 138. 26. Added limitation to “Limitations of debugWIRE” on page 140. 27. Updated “DC Characteristics” on page 161. 28. Updated Table 21-7 on page 166. 29. Updated Figure 21-6 on page 171. 30. Updated Table 21-12 on page 171. 31. Updated Table 22-1 on page 177. 32. Updated Table 22-2 on page 177. 33. Updated Table 22-30, Table 22-31 and Table 22-32, starting on page 188. 34. Updated Table 22-33, Table 22-34 and Table 22-35, starting on page 189. 35. Updated Table 22-39 on page 192. 36. Updated Table 22-46, Table 22-47, Table 22-48 and Table 22-49.ATtiny25/45/85 [DATASHEET] 27 2586QS–AVR–08/2013 9.9 Rev. 2586I-09/06 9.10 Rev. 2586H-06/06 9.11 Rev. 2586G-05/06 9.12 Rev. 2586F-04/06 1. All Characterization data moved to “Electrical Characteristics” on page 161. 2. All Register Descriptions are gathered up in seperate sections in the end of each chapter. 3. Updated Table 11-3 on page 78, Table 11-5 on page 79, Table 11-6 on page 80 and Table 20-4 on page 148. 4. Updated “Calibrated Internal Oscillator” on page 27. 5. Updated Note in Table 7-1 on page 34. 6. Updated “System Control and Reset” on page 39. 7. Updated Register Description in “I/O Ports” on page 53. 8. Updated Features in “USI – Universal Serial Interface” on page 108. 9. Updated Code Example in “SPI Master Operation Example” on page 110 and “SPI Slave Operation Example” on page 111. 10. Updated “Analog Comparator Multiplexed Input” on page 119. 11. Updated Figure 17-1 on page 123. 12. Updated “Signature Bytes” on page 150. 13. Updated “Electrical Characteristics” on page 161. 1. Updated “Calibrated Internal Oscillator” on page 27. 2. Updated Table 6.5.1 on page 31. 3. Added Table 21-2 on page 164. 1. Updated “Internal PLL for Fast Peripheral Clock Generation - clkPCK” on page 24. 2. Updated “Default Clock Source” on page 30. 3. Updated “Low-Frequency Crystal Oscillator” on page 29. 4. Updated “Calibrated Internal Oscillator” on page 27. 5. Updated “Clock Output Buffer” on page 31. 6. Updated “Power Management and Sleep Modes” on page 34. 7. Added “Software BOD Disable” on page 35. 8. Updated Figure 16-1 on page 119. 9. Updated “Bit 6 – ACBG: Analog Comparator Bandgap Select” on page 120. 10. Added note for Table 17-2 on page 125. 11. Updated “Register Summary” on page 7. 1. Updated “Digital Input Enable and Sleep Modes” on page 57. 2. Updated Table 20-16 on page 158. 3. Updated “Ordering Information” on page 11.ATtiny25/45/85 [DATASHEET] 28 2586QS–AVR–08/2013 9.13 Rev. 2586E-03/06 9.14 Rev. 2586D-02/06 9.15 Rev. 2586C-06/05 9.16 Rev. 2586B-05/05 9.17 Rev. 2586A-02/05 Initial revision. 1. Updated Features in “Analog to Digital Converter” on page 122. 2. Updated Operation in “Analog to Digital Converter” on page 122. 3. Updated Table 17-2 on page 133. 4. Updated Table 17-3 on page 134. 5. Updated “Errata” on page 19. 1. Updated Table 6-13 on page 30, Table 6-10 on page 29, Table 6-3 on page 26, Table 6-9 on page 28, Table 6-5 on page 26, Table 9-1 on page 48,Table 17-4 on page 135, Table 20-16 on page 158, Table 21-8 on page 167. 2. Updated “Timer/Counter1 in PWM Mode” on page 86. 3. Updated text “Bit 2 – TOV1: Timer/Counter1 Overflow Flag” on page 93. 4. Updated values in “DC Characteristics” on page 161. 5. Updated “Register Summary” on page 7. 6. Updated “Ordering Information” on page 11. 7. Updated Rev B and C in “Errata ATtiny45” on page 19. 8. All references to power-save mode are removed. 9. Updated Register Adresses. 1. Updated “Features” on page 1. 2. Updated Figure 1-1 on page 2. 3. Updated Code Examples on page 18 and page 19. 4. Moved “Temperature Measurement” to Section 17.12 page 133. 5. Updated “Register Summary” on page 7. 6. Updated “Ordering Information” on page 11. 1. CLKI added, instances of EEMWE/EEWE renamed EEMPE/EEPE, removed some TBD. Removed “Preliminary Description” from “Temperature Measurement” on page 133. 2. Updated “Features” on page 1. 3. Updated Figure 1-1 on page 2 and Figure 8-1 on page 39. 4. Updated Table 7-2 on page 38, Table 10-4 on page 63, Table 10-5 on page 63 5. Updated “Serial Programming Instruction set” on page 153. 6. Updated SPH register in “Instruction Set Summary” on page 9. 7. Updated “DC Characteristics” on page 161. 8. Updated “Ordering Information” on page 11. 9. Updated “Errata” on page 19.ATtiny25/45/85 [DATASHEET] 29 2586QS–AVR–08/2013Atmel Corporation 1600 Technology Drive San Jose, CA 95110 USA Tel: (+1) (408) 441-0311 Fax: (+1) (408) 487-2600 www.atmel.com Atmel Asia Limited Unit 01-5 & 16, 19F BEA Tower, Millennium City 5 418 Kwun Tong Roa Kwun Tong, Kowloon HONG KONG Tel: (+852) 2245-6100 Fax: (+852) 2722-1369 Atmel Munich GmbH Business Campus Parkring 4 D-85748 Garching b. Munich GERMANY Tel: (+49) 89-31970-0 Fax: (+49) 89-3194621 Atmel Japan G.K. 16F Shin-Osaki Kangyo Bldg 1-6-4 Osaki, Shinagawa-ku Tokyo 141-0032 JAPAN Tel: (+81) (3) 6417-0300 Fax: (+81) (3) 6417-0370 © 2013 Atmel Corporation. All rights reserved. / Rev.: 2586QS–AVR–08/2013 Disclaimer: The information in this document is provided in connection with Atmel products. No license, express or implied, by estoppel or otherwise, to any intellectual property right is granted by this document or in connection with the sale of Atmel products. EXCEPT AS SET FORTH IN THE ATMEL TERMS AND CONDITIONS OF SALES LOCATED ON THE ATMEL WEBSITE, ATMEL ASSUMES NO LIABILITY WHATSOEVER AND DISCLAIMS ANY EXPRESS, IMPLIED OR STATUTORY WARRANTY RELATING TO ITS PRODUCTS INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTY OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, OR NON-INFRINGEMENT. IN NO EVENT SHALL ATMEL BE LIABLE FOR ANY DIRECT, INDIRECT, CONSEQUENTIAL, PUNITIVE, SPECIAL OR INCIDENTAL DAMAGES (INCLUDING, WITHOUT LIMITATION, DAMAGES FOR LOSS AND PROFITS, BUSINESS INTERRUPTION, OR LOSS OF INFORMATION) ARISING OUT OF THE USE OR INABILITY TO USE THIS DOCUMENT, EVEN IF ATMEL HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. Atmel makes no representations or warranties with respect to the accuracy or completeness of the contents of this document and reserves the right to make changes to specifications and products descriptions at any time without notice. Atmel does not make any commitment to update the information contained herein. Unless specifically provided otherwise, Atmel products are not suitable for, and shall not be used in, automotive applications. Atmel products are not intended, authorized, or warranted for use as components in applications intended to support or sustain life. Atmel®, Atmel logo and combinations thereof, Enabling Unlimited Possibilities®, AVR®, tinyAVR® and others are registered trademarks or trademarks of Atmel Corporation or its subsidiaries. Other terms and product names may be trademarks of others. © 2008 Microchip Technology Inc. DS39631E PIC18F2420/2520/4420/4520 Data Sheet 28/40/44-Pin Enhanced Flash Microcontrollers with 10-Bit A/D and nanoWatt TechnologyDS39631E-page ii © 2008 Microchip Technology Inc. Information contained in this publication regarding device applications and the like is provided only for your convenience and may be superseded by updates. It is your responsibility to ensure that your application meets with your specifications. MICROCHIP MAKES NO REPRESENTATIONS OR WARRANTIES OF ANY KIND WHETHER EXPRESS OR IMPLIED, WRITTEN OR ORAL, STATUTORY OR OTHERWISE, RELATED TO THE INFORMATION, INCLUDING BUT NOT LIMITED TO ITS CONDITION, QUALITY, PERFORMANCE, MERCHANTABILITY OR FITNESS FOR PURPOSE. Microchip disclaims all liability arising from this information and its use. Use of Microchip devices in life support and/or safety applications is entirely at the buyer’s risk, and the buyer agrees to defend, indemnify and hold harmless Microchip from any and all damages, claims, suits, or expenses resulting from such use. No licenses are conveyed, implicitly or otherwise, under any Microchip intellectual property rights. Trademarks The Microchip name and logo, the Microchip logo, Accuron, dsPIC, KEELOQ, KEELOQ logo, MPLAB, PIC, PICmicro, PICSTART, rfPIC, SmartShunt and UNI/O are registered trademarks of Microchip Technology Incorporated in the U.S.A. and other countries. FilterLab, Linear Active Thermistor, MXDEV, MXLAB, SEEVAL, SmartSensor and The Embedded Control Solutions Company are registered trademarks of Microchip Technology Incorporated in the U.S.A. Analog-for-the-Digital Age, Application Maestro, CodeGuard, dsPICDEM, dsPICDEM.net, dsPICworks, dsSPEAK, ECAN, ECONOMONITOR, FanSense, In-Circuit Serial Programming, ICSP, ICEPIC, Mindi, MiWi, MPASM, MPLAB Certified logo, MPLIB, MPLINK, mTouch, PICkit, PICDEM, PICDEM.net, PICtail, PIC32 logo, PowerCal, PowerInfo, PowerMate, PowerTool, REAL ICE, rfLAB, Select Mode, Total Endurance, WiperLock and ZENA are trademarks of Microchip Technology Incorporated in the U.S.A. and other countries. SQTP is a service mark of Microchip Technology Incorporated in the U.S.A. All other trademarks mentioned herein are property of their respective companies. © 2008, Microchip Technology Incorporated, Printed in the U.S.A., All Rights Reserved. Printed on recycled paper. Note the following details of the code protection feature on Microchip devices: • Microchip products meet the specification contained in their particular Microchip Data Sheet. • Microchip believes that its family of products is one of the most secure families of its kind on the market today, when used in the intended manner and under normal conditions. • There are dishonest and possibly illegal methods used to breach the code protection feature. All of these methods, to our knowledge, require using the Microchip products in a manner outside the operating specifications contained in Microchip’s Data Sheets. Most likely, the person doing so is engaged in theft of intellectual property. • Microchip is willing to work with the customer who is concerned about the integrity of their code. • Neither Microchip nor any other semiconductor manufacturer can guarantee the security of their code. Code protection does not mean that we are guaranteeing the product as “unbreakable.” Code protection is constantly evolving. We at Microchip are committed to continuously improving the code protection features of our products. Attempts to break Microchip’s code protection feature may be a violation of the Digital Millennium Copyright Act. If such acts allow unauthorized access to your software or other copyrighted work, you may have a right to sue for relief under that Act. Microchip received ISO/TS-16949:2002 certification for its worldwide headquarters, design and wafer fabrication facilities in Chandler and Tempe, Arizona; Gresham, Oregon and design centers in California and India. The Company’s quality system processes and procedures are for its PIC® MCUs and dsPIC® DSCs, KEELOQ® code hopping devices, Serial EEPROMs, microperipherals, nonvolatile memory and analog products. In addition, Microchip’s quality system for the design and manufacture of development systems is ISO 9001:2000 certified.© 2008 Microchip Technology Inc. DS39631E-page 1 PIC18F2420/2520/4420/4520 Power Management Features: • Run: CPU on, Peripherals on • Idle: CPU off, Peripherals on • Sleep: CPU off, Peripherals off • Ultra Low 50nA Input Leakage • Run mode Currents Down to 11 μA Typical • Idle mode Currents Down to 2.5 μA Typical • Sleep mode Current Down to 100 nA Typical • Timer1 Oscillator: 900 nA, 32 kHz, 2V • Watchdog Timer: 1.4 μA, 2V Typical • Two-Speed Oscillator Start-up Flexible Oscillator Structure: • Four Crystal modes, up to 40 MHz • 4x Phase Lock Loop (PLL) – Available for Crystal and Internal Oscillators • Two External RC modes, up to 4 MHz • Two External Clock modes, up to 40 MHz • Internal Oscillator Block: - Fast wake from Sleep and Idle, 1 μs typical - 8 use-selectable frequencies, from 31 kHz to 8 MHz - Provides a complete range of clock speeds from 31 kHz to 32 MHz when used with PLL - User-tunable to compensate for frequency drift • Secondary Oscillator using Timer1 @ 32 kHz • Fail-Safe Clock Monitor: - Allows for safe shutdown if peripheral clock stops Peripheral Highlights: • High-Current Sink/Source 25 mA/25 mA • Three Programmable External Interrupts • Four Input Change Interrupts • Up to 2 Capture/Compare/PWM (CCP) modules, one with Auto-Shutdown (28-pin devices) • Enhanced Capture/Compare/PWM (ECCP) module (40/44-pin devices only): - One, two or four PWM outputs - Selectable polarity - Programmable dead time - Auto-shutdown and auto-restart Peripheral Highlights (Continued): • Master Synchronous Serial Port (MSSP) module Supporting 3-Wire SPI (all 4 modes) and I2C™ Master and Slave modes • Enhanced Addressable USART module: - Supports RS-485, RS-232 and LIN/J2602 - RS-232 operation using internal oscillator block (no external crystal required) - Auto-wake-up on Start bit - Auto-Baud Detect • 10-Bit, up to 13-Channel Analog-to-Digital (A/D) Converter module: - Auto-acquisition capability - Conversion available during Sleep • Dual Analog Comparators with Input Multiplexing • Programmable 16-Level High/Low-Voltage Detection (HLVD) module: - Supports interrupt on High/Low-Voltage Detection Special Microcontroller Features: • C Compiler Optimized Architecture: - Optional extended instruction set designed to optimize re-entrant code • 100,000 Erase/Write Cycle Enhanced Flash Program Memory Typical • 1,000,000 Erase/Write Cycle Data EEPROM Memory Typical • Flash/Data EEPROM Retention: 100 Years Typical • Self-Programmable under Software Control • Priority Levels for Interrupts • 8 x 8 Single-Cycle Hardware Multiplier • Extended Watchdog Timer (WDT): - Programmable period from 4 ms to 131s • Single-Supply 5V In-Circuit Serial Programming™ (ICSP™) via Two Pins • In-Circuit Debug (ICD) via Two Pins • Wide Operating Voltage Range: 2.0V to 5.5V • Programmable Brown-out Reset (BOR) with Software Enable Option - Device Program Memory Data Memory I/O 10-Bit A/D (ch) CCP/ ECCP (PWM) MSSP EUSART Comp. Timers 8/16-Bit Flash (bytes) # Single-Word Instructions SRAM (bytes) EEPROM (bytes) SPI Master I 2C™ PIC18F2420 16K 8192 768 256 25 10 2/0 Y Y 1 2 1/3 PIC18F2520 32K 16384 1536 256 25 10 2/0 Y Y 1 2 1/3 PIC18F4420 16K 8192 768 256 36 13 1/1 Y Y 1 2 1/3 PIC18F4520 32K 16384 1536 256 36 13 1/1 Y Y 1 2 1/3 28/40/44-Pin Enhanced Flash Microcontrollers with 10-Bit A/D and nanoWatt TechnologyPIC18F2420/2520/4420/4520 DS39631E-page 2 © 2008 Microchip Technology Inc. Pin Diagrams PIC18F2520 10 11 2 3 4 5 6 1 8 7 9 12 13 14 15 16 17 18 19 20 23 24 25 26 27 28 22 21 MCLR/VPP/RE3 RA0/AN0 RA1/AN1 RA2/AN2/VREF-/CVREF RA3/AN3/VREF+ RA4/T0CKI/C1OUT RA5/AN4/SS/HLVDIN/C2OUT VSS OSC1/CLKI/RA7 OSC2/CLKO/RA6 RC0/T1OSO/T13CKI RC1/T1OSI/CCP2(1) RC2/CCP1 RC3/SCK/SCL RB7/KBI3/PGD RB6//KBI2/PGC RB5/KBI1/PGM RB4/KBI0/AN11 RB3/AN9/CCP2(1) RB2/INT2/AN8 RB1/INT1/AN10 RB0/INT0/FLT0/AN12 VDD VSS RC7/RX/DT RC6/TX/CK RC5/SDO RC4/SDI/SDA 28-Pin SPDIP, SOIC PIC18F2420 Note 1: RB3 is the alternate pin for CCP2 multiplexing. 10 11 2 3 6 1 18 19 20 21 22 12 13 14 15 8 7 16 17 2827 2625 2423 9 PIC18F2420 RC0/T1OSO/T13CKI 5 4 RB7/KBI3/PGD RB6/KBI2/PGC RB5/KBI1/PGM RB4KBI0/AN11 RB3/AN9/CCP2(1) RB2/INT2/AN8 RB1/INT1/AN10 RB0/INT0/FLT0/AN12 VDD VSS RC7/RX/DT RC6/TX/CK RC5/SDO RC4/SDI/SDA MCLR/VPP/RE3 RA1/AN1 RA0/AN0 RA2/AN2/VREF-/CVREF RA3/AN3/VREF+ RA4/T0CKI/C1OUT RA5/AN4/SS/HLVDIN/C2OUT VSS OSC1/CLKI/RA7 OSC2/CLKO/RA6 RC1/T1OSI/CCP2(1) RC2/CCP1 RC3/SCK/SCL PIC18F2520 28-Pin QFN RB7/KBI3/PGD RB6/KBI2/PGC RB5/KBI1/PGM RB4/KBI0/AN11 RB3/AN9/CCP2(1) RB2/INT2/AN8 RB1/INT1/AN10 RB0/INT0/FLT0/AN12 VDD VSS RD7/PSP7/P1D RD6/PSP6/P1C RD5/PSP5/P1B RD4/PSP4 RC7/RX/DT RC6/TX/CK RC5/SDO RC4/SDI/SDA RD3/PSP3 RD2/PSP2 MCLR/VPP/RE3 RA0/AN0 RA1/AN1 RA2/AN2/VREF-/CVREF RA3/AN3/VREF+ RA4/T0CKI/C1OUT RA5/AN4/SS/HLVDIN/C2OUT RE0/RD/AN5 RE1/WR/AN6 RE2/CS/AN7 VDD VSS OSC1/CLKI/RA7 OSC2/CLKO/RA6 RC0/T1OSO/T13CKI RC1/T1OSI/CCP2(1) RC2/CCP1/P1A RC3/SCK/SCL RD0/PSP0 RD1/PSP1 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 40 39 38 37 36 35 34 33 32 31 30 29 28 27 26 25 24 23 22 21 PIC18F4520 40-Pin PDIP PIC18F4420© 2008 Microchip Technology Inc. DS39631E-page 3 PIC18F2420/2520/4420/4520 Pin Diagrams (Cont.’d) Note 1: RB3 is the alternate pin for CCP2 multiplexing. 10 11 2 3 4 5 6 1 12 13 14 15 18 19 20 21 22 38 8 7 44 43 42 41 40 39 16 17 29 30 31 32 33 23 24 25 26 27 28 36 35 34 9 PIC18F442037 RA3/AN3/VREF+ RA2/AN2/VREF-/CVREF RA0/AN0 RA1/AN1 MCLR/VPP/RE3 RB3/AN9/CCP2(1) RB4/KBI0/AN11 RB5/KBI1/PGM RB6/KBI2/PGC RB7/KBI3/PGD NC RC6/TX/CK RC5/SDO RC4/SDI/SDA RD3/PSP3 RD2/PSP2 RD1/PSP1 RD0/PSP0 RC3/SCK/SCL RC2/CCP1/P1A RC1/T1OSI/CCP2(1) RC0/T1OSO/T13CKI OSC2/CLKO/RA6 OSC1/CLKI/RA7 VSS VSS VDD VDD RE2/CS/AN7 RE1/WR/AN6 RE0/RD/AN5 RA5/AN4/SS/HLVDIN/C2OUT RA4/T0CKI/C1OUT RC7/RX/DT RD4/PSP4 RD5/PSP5/P1B RD6/PSP6/P1C RD7/PSP7/P1D VSS VDD VDD RB0/INT0/FLT0/AN12 RB1/INT1/AN10 RB2/INT2/AN8 44-pin QFN PIC18F4520 10 11 2 3 4 5 6 1 12 13 14 15 18 19 20 21 22 38 8 7 44 43 42 41 40 39 16 17 29 30 31 32 33 23 24 25 26 27 28 36 35 34 9 PIC18F442037 RA3/AN3/VREF+ RA2/AN2/VREF-/CVREF RA0/AN0 RA1/AN1 MCLR/VPP/RE3 NC RB4/KBI0/AN11 RB5/KBI1/PGM RB6/KBI2/PGC RB7/KBI3/PGD NC RC6/TX/CK RC5/SDO RC4/SDI/SDA RD3/PSP3 RD2/PSP2 RD1/PSP1 RD0/PSP0 RC3/SCK/SCL RC2/CCP1/P1A RC1/T1OSI/CCP2(1) NC NC RC0/T1OSO/T13CKI OSC2/CLKO/RA6 OSC1/CLKI/RA7 VSS VDD RE2/CS/AN7 RE1/WR/AN6 RE0/RD/AN5 RA5/AN4/SS/HLVDIN/C2OUT RA4/T0CKI/C1OUT RC7/RX/DT RD4/PSP4 RD5/PSP5/P1B RD6/PSP6/P1C RD7/PSP7/P1D VSS VDD RB0/INT0/FLT0/AN12 RB1/INT1/AN10 RB2/INT2/AN8 RB3/AN9/CCP2(1) 44-pin TQFP PIC18F4520PIC18F2420/2520/4420/4520 DS39631E-page 4 © 2008 Microchip Technology Inc. Table of Contents 1.0 Device Overview .......................................................................................................................................................................... 7 2.0 Oscillator Configurations ............................................................................................................................................................ 23 3.0 Power-Managed Modes ............................................................................................................................................................. 33 4.0 Reset .......................................................................................................................................................................................... 41 5.0 Memory Organization ................................................................................................................................................................. 53 6.0 Flash Program Memory.............................................................................................................................................................. 73 7.0 Data EEPROM Memory ............................................................................................................................................................. 83 8.0 8 x 8 Hardware Multiplier............................................................................................................................................................ 89 9.0 Interrupts .................................................................................................................................................................................... 91 10.0 I/O Ports ................................................................................................................................................................................... 105 11.0 Timer0 Module ......................................................................................................................................................................... 123 12.0 Timer1 Module ......................................................................................................................................................................... 127 13.0 Timer2 Module ......................................................................................................................................................................... 133 14.0 Timer3 Module ......................................................................................................................................................................... 135 15.0 Capture/Compare/PWM (CCP) Modules ................................................................................................................................. 139 16.0 Enhanced Capture/Compare/PWM (ECCP) Module................................................................................................................ 147 17.0 Master Synchronous Serial Port (MSSP) Module .................................................................................................................... 161 18.0 Enhanced Universal Synchronous Asynchronous Receiver Transmitter (EUSART) ............................................................... 201 19.0 10-Bit Analog-to-Digital Converter (A/D) Module ..................................................................................................................... 223 20.0 Comparator Module.................................................................................................................................................................. 233 21.0 Comparator Voltage Reference Module................................................................................................................................... 239 22.0 High/Low-Voltage Detect (HLVD)............................................................................................................................................. 243 23.0 Special Features of the CPU.................................................................................................................................................... 249 24.0 Instruction Set Summary .......................................................................................................................................................... 267 25.0 Development Support............................................................................................................................................................... 317 26.0 Electrical Characteristics .......................................................................................................................................................... 321 27.0 DC and AC Characteristics Graphs and Tables....................................................................................................................... 361 28.0 Packaging Information.............................................................................................................................................................. 383 Appendix A: Revision History............................................................................................................................................................. 395 Appendix B: Device Differences......................................................................................................................................................... 395 Appendix C: Migration from Mid-Range to Enhanced Devices .......................................................................................................... 396 Appendix D: Migration from High-End to Enhanced Devices............................................................................................................. 396 Index .................................................................................................................................................................................................. 397 The Microchip Web Site ..................................................................................................................................................................... 407 Customer Change Notification Service .............................................................................................................................................. 407 Customer Support.............................................................................................................................................................................. 407 Reader Response .............................................................................................................................................................................. 408 PIC18F2420/2520/4420/4520 Product Identification System ............................................................................................................ 409© 2008 Microchip Technology Inc. DS39631E-page 5 PIC18F2420/2520/4420/4520 TO OUR VALUED CUSTOMERS It is our intention to provide our valued customers with the best documentation possible to ensure successful use of your Microchip products. To this end, we will continue to improve our publications to better suit your needs. Our publications will be refined and enhanced as new volumes and updates are introduced. If you have any questions or comments regarding this publication, please contact the Marketing Communications Department via E-mail at docerrors@microchip.com or fax the Reader Response Form in the back of this data sheet to (480) 792-4150. We welcome your feedback. Most Current Data Sheet To obtain the most up-to-date version of this data sheet, please register at our Worldwide Web site at: http://www.microchip.com You can determine the version of a data sheet by examining its literature number found on the bottom outside corner of any page. The last character of the literature number is the version number, (e.g., DS30000A is version A of document DS30000). Errata An errata sheet, describing minor operational differences from the data sheet and recommended workarounds, may exist for current devices. As device/documentation issues become known to us, we will publish an errata sheet. The errata will specify the revision of silicon and revision of document to which it applies. To determine if an errata sheet exists for a particular device, please check with one of the following: • Microchip’s Worldwide Web site; http://www.microchip.com • Your local Microchip sales office (see last page) When contacting a sales office, please specify which device, revision of silicon and data sheet (include literature number) you are using. Customer Notification System Register on our web site at www.microchip.com to receive the most current information on all of our products.PIC18F2420/2520/4420/4520 DS39631E-page 6 © 2008 Microchip Technology Inc. NOTES:© 2008 Microchip Technology Inc. DS39631E-page 7 PIC18F2420/2520/4420/4520 1.0 DEVICE OVERVIEW This document contains device-specific information for the following devices: This family offers the advantages of all PIC18 microcontrollers – namely, high computational performance at an economical price – with the addition of high-endurance, Enhanced Flash program memory. On top of these features, the PIC18F2420/2520/4420/ 4520 family introduces design enhancements that make these microcontrollers a logical choice for many high-performance, power sensitive applications. 1.1 New Core Features 1.1.1 nanoWatt TECHNOLOGY All of the devices in the PIC18F2420/2520/4420/4520 family incorporate a range of features that can significantly reduce power consumption during operation. Key items include: • Alternate Run Modes: By clocking the controller from the Timer1 source or the internal oscillator block, power consumption during code execution can be reduced by as much as 90%. • Multiple Idle Modes: The controller can also run with its CPU core disabled but the peripherals still active. In these states, power consumption can be reduced even further, to as little as 4% of normal operation requirements. • On-the-Fly Mode Switching: The powermanaged modes are invoked by user code during operation, allowing the user to incorporate power-saving ideas into their application’s software design. • Low Consumption in Key Modules: The power requirements for both Timer1 and the Watchdog Timer are minimized. See Section 26.0 “Electrical Characteristics” for values. 1.1.2 MULTIPLE OSCILLATOR OPTIONS AND FEATURES All of the devices in the PIC18F2420/2520/4420/4520 family offer ten different oscillator options, allowing users a wide range of choices in developing application hardware. These include: • Four Crystal modes, using crystals or ceramic resonators • Two External Clock modes, offering the option of using two pins (oscillator input and a divide-by-4 clock output) or one pin (oscillator input, with the second pin reassigned as general I/O) • Two External RC Oscillator modes with the same pin options as the External Clock modes • An internal oscillator block which provides an 8 MHz clock and an INTRC source (approximately 31 kHz), as well as a range of 6 user-selectable clock frequencies, between 125 kHz to 4 MHz, for a total of 8 clock frequencies. This option frees the two oscillator pins for use as additional general purpose I/O. • A Phase Lock Loop (PLL) frequency multiplier, available to both the High-Speed Crystal and Internal Oscillator modes, which allows clock speeds of up to 40 MHz. Used with the internal oscillator, the PLL gives users a complete selection of clock speeds, from 31 kHz to 32 MHz – all without using an external crystal or clock circuit. Besides its availability as a clock source, the internal oscillator block provides a stable reference source that gives the family additional features for robust operation: • Fail-Safe Clock Monitor: This option constantly monitors the main clock source against a reference signal provided by the internal oscillator. If a clock failure occurs, the controller is switched to the internal oscillator block, allowing for continued low-speed operation or a safe application shutdown. • Two-Speed Start-up: This option allows the internal oscillator to serve as the clock source from Power-on Reset, or wake-up from Sleep mode, until the primary clock source is available. • PIC18F2420 • PIC18LF2420 • PIC18F2520 • PIC18LF2520 • PIC18F4420 • PIC18LF4420 • PIC18F4520 • PIC18LF4520PIC18F2420/2520/4420/4520 DS39631E-page 8 © 2008 Microchip Technology Inc. 1.2 Other Special Features • Memory Endurance: The Enhanced Flash cells for both program memory and data EEPROM are rated to last for many thousands of erase/write cycles – up to 100,000 for program memory and 1,000,000 for EEPROM. Data retention without refresh is conservatively estimated to be greater than 40 years. • Self-Programmability: These devices can write to their own program memory spaces under internal software control. By using a bootloader routine located in the protected Boot Block at the top of program memory, it becomes possible to create an application that can update itself in the field. • Extended Instruction Set: The PIC18F2420/ 2520/4420/4520 family introduces an optional extension to the PIC18 instruction set, which adds 8 new instructions and an Indexed Addressing mode. This extension, enabled as a device configuration option, has been specifically designed to optimize re-entrant application code originally developed in high-level languages, such as C. • Enhanced CCP Module: In PWM mode, this module provides 1, 2 or 4 modulated outputs for controlling half-bridge and full-bridge drivers. Other features include auto-shutdown, for disabling PWM outputs on interrupt, or other select conditions, and auto-restart to reactivate outputs once the condition has cleared. • Enhanced Addressable USART: This serial communication module is capable of standard RS-232 operation and provides support for the LIN bus protocol. Other enhancements include automatic baud rate detection and a 16-bit Baud Rate Generator for improved resolution. When the microcontroller is using the internal oscillator block, the EUSART provides stable operation for applications that talk to the outside world without using an external crystal (or its accompanying power requirement). • 10-Bit A/D Converter: This module incorporates programmable acquisition time, allowing for a channel to be selected and a conversion to be initiated without waiting for a sampling period and thus, reducing code overhead. • Extended Watchdog Timer (WDT): This enhanced version incorporates a 16-bit prescaler, allowing an extended time-out range that is stable across operating voltage and temperature. See Section 26.0 “Electrical Characteristics” for time-out periods. 1.3 Details on Individual Family Members Devices in the PIC18F2420/2520/4420/4520 family are available in 28-pin and 40/44-pin packages. Block diagrams for the two groups are shown in Figure 1-1 and Figure 1-2. The devices are differentiated from each other in five ways: 1. Flash program memory (16 Kbytes for PIC18F2420/4420 devices and 32 Kbytes for PIC18F2520/4520 devices). 2. A/D channels (10 for 28-pin devices, 13 for 40/44-pin devices). 3. I/O ports (3 bidirectional ports on 28-pin devices, 5 bidirectional ports on 40/44-pin devices). 4. CCP and Enhanced CCP implementation (28-pin devices have 2 standard CCP modules, 40/44-pin devices have one standard CCP module and one ECCP module). 5. Parallel Slave Port (present only on 40/44-pin devices). All other features for devices in this family are identical. These are summarized in Table 1-1. The pinouts for all devices are listed in Table 1-2 and Table 1-3. Like all Microchip PIC18 devices, members of the PIC18F2420/2520/4420/4520 family are available as both standard and low-voltage devices. Standard devices with Enhanced Flash memory, designated with an “F” in the part number (such as PIC18F2420), accommodate an operating VDD range of 4.2V to 5.5V. Low-voltage parts, designated by “LF” (such as PIC18LF2420), function over an extended VDD range of 2.0V to 5.5V. © 2008 Microchip Technology Inc. DS39631E-page 9 PIC18F2420/2520/4420/4520 TABLE 1-1: DEVICE FEATURES Features PIC18F2420 PIC18F2520 PIC18F4420 PIC18F4520 Operating Frequency DC – 40 MHz DC – 40 MHz DC – 40 MHz DC – 40 MHz Program Memory (Bytes) 16384 32768 16384 32768 Program Memory (Instructions) 8192 16384 8192 16384 Data Memory (Bytes) 768 1536 768 1536 Data EEPROM Memory (Bytes) 256 256 256 256 Interrupt Sources 19 19 20 20 I/O Ports Ports A, B, C, (E) Ports A, B, C, (E) Ports A, B, C, D, E Ports A, B, C, D, E Timers 4 4 4 4 Capture/Compare/PWM Modules 2 2 1 1 Enhanced Capture/Compare/PWM Modules 0011 Serial Communications MSSP, Enhanced USART MSSP, Enhanced USART MSSP, Enhanced USART MSSP, Enhanced USART Parallel Communications (PSP) No No Yes Yes 10-Bit Analog-to-Digital Module 10 Input Channels 10 Input Channels 13 Input Channels 13 Input Channels Resets (and Delays) POR, BOR, RESET Instruction, Stack Full, Stack Underflow (PWRT, OST), MCLR (optional), WDT POR, BOR, RESET Instruction, Stack Full, Stack Underflow (PWRT, OST), MCLR (optional), WDT POR, BOR, RESET Instruction, Stack Full, Stack Underflow (PWRT, OST), MCLR (optional), WDT POR, BOR, RESET Instruction, Stack Full, Stack Underflow (PWRT, OST), MCLR (optional), WDT Programmable High/Low-Voltage Detect Yes Yes Yes Yes Programmable Brown-out Reset Yes Yes Yes Yes Instruction Set 75 Instructions; 83 with Extended Instruction Set Enabled 75 Instructions; 83 with Extended Instruction Set Enabled 75 Instructions; 83 with Extended Instruction Set Enabled 75 Instructions; 83 with Extended Instruction Set Enabled Packages 28-Pin SPDIP 28-Pin SOIC 28-Pin QFN 28-Pin SPDIP 28-Pin SOIC 28-Pin QFN 40-Pin PDIP 44-Pin QFN 44-Pin TQFP 40-Pin PDIP 44-Pin QFN 44-Pin TQFPPIC18F2420/2520/4420/4520 DS39631E-page 10 © 2008 Microchip Technology Inc. FIGURE 1-1: PIC18F2420/2520 (28-PIN) BLOCK DIAGRAM Instruction Decode and Control PORTA PORTB PORTC RA4/T0CKI/C1OUT RA5/AN4/SS/HLVDIN/C2OUT RB0/INT0/FLT0/AN12 RC0/T1OSO/T13CKI RC1/T1OSI/CCP2(1) RC2/CCP1 RC3/SCK/SCL RC4/SDI/SDA RC5/SDO RC6/TX/CK RC7/RX/DT RA3/AN3/VREF+ RA2/AN2/VREF-/CVREF RA1/AN1 RA0/AN0 RB1/INT1/AN10 Data Latch Data Memory ( 3.9 Kbytes ) Address Latch Data Address<12> 12 BSR Access FSR0 FSR1 FSR2 inc/dec logic Address 4 12 4 PCH PCL PCLATH 8 31-Level Stack Program Counter PRODH PRODL 8 x 8 Multiply 8 BITOP 8 8 ALU<8> Address Latch Program Memory (16/32 Kbytes) Data Latch 20 8 8 Table Pointer<21> inc/dec logic 21 8 Data Bus<8> Table Latch 8 IR 12 3 ROM Latch RB2/INT2/AN8 RB3/AN9/CCP2(1) PCLATU PCU OSC2/CLKO(3)/RA6 Note 1: CCP2 is multiplexed with RC1 when Configuration bit, CCP2MX, is set, or RB3 when CCP2MX is not set. 2: RE3 is only available when MCLR functionality is disabled. 3: OSC1/CLKI and OSC2/CLKO are only available in select oscillator modes and when these pins are not being used as digital I/O. Refer to Section 2.0 “Oscillator Configurations” for additional information. RB4/KBI0/AN11 RB5/KBI1/PGM RB6/KBI2/PGC RB7/KBI3/PGD Comparator MSSP EUSART 10-Bit ADC Timer0 Timer1 Timer2 Timer3 CCP2 HLVD CCP1 BOR Data EEPROM W Instruction Bus <16> STKPTR Bank 8 State Machine Control Signals Decode 8 8 Power-up Timer Oscillator Start-up Timer Power-on Reset Watchdog Timer OSC1(3) OSC2(3) VDD, Brown-out Reset Internal Oscillator Fail-Safe Clock Monitor Precision Reference Band Gap VSS MCLR(2) Block INTRC Oscillator 8 MHz Oscillator Single-Supply Programming In-Circuit Debugger T1OSO OSC1/CLKI(3)/RA7 T1OSI PORTE MCLR/VPP/RE3(2)© 2008 Microchip Technology Inc. DS39631E-page 11 PIC18F2420/2520/4420/4520 FIGURE 1-2: PIC18F4420/4520 (40/44-PIN) BLOCK DIAGRAM Instruction Decode and Control Data Latch Data Memory ( 3.9 Kbytes ) Address Latch Data Address<12> 12 BSR Access FSR0 FSR1 FSR2 inc/dec logic Address 4 12 4 PCH PCL PCLATH 8 31-Level Stack Program Counter PRODH PRODL 8 x 8 Multiply 8 BITOP 8 8 ALU<8> Address Latch Program Memory (16/32 Kbytes) Data Latch 20 8 8 Table Pointer<21> inc/dec logic 21 8 Data Bus<8> Table Latch 8 IR 12 3 ROM Latch PORTD RD0/PSP0 PCLATU PCU PORTE MCLR/VPP/RE3(2) RE2/CS/AN7 RE0/RD/AN5 RE1/WR/AN6 Note 1: CCP2 is multiplexed with RC1 when Configuration bit, CCP2MX, is set, or RB3 when CCP2MX is not set. 2: RE3 is only available when MCLR functionality is disabled. 3: OSC1/CLKI and OSC2/CLKO are only available in select oscillator modes and when these pins are not being used as digital I/O. Refer to Section 2.0 “Oscillator Configurations” for additional information. :RD4/PSP4 Comparator MSSP EUSART 10-Bit ADC Timer0 Timer1 Timer2 Timer3 CCP2 HLVD ECCP1 BOR Data EEPROM W Instruction Bus <16> STKPTR Bank 8 State Machine Control Signals Decode 8 8 Power-up Timer Oscillator Start-up Timer Power-on Reset Watchdog Timer OSC1(3) OSC2(3) VDD, Brown-out Reset Internal Oscillator Fail-Safe Clock Monitor Precision Reference Band Gap VSS MCLR(2) Block INTRC Oscillator 8 MHz Oscillator Single-Supply Programming In-Circuit Debugger T1OSI T1OSO RD5/PSP5/P1B RD6/PSP6/P1C RD7/PSP7/P1D PORTA PORTB PORTC RA4/T0CKI/C1OUT RA5/AN4/SS/HLVDIN/C2OUT RB0/INT0/FLT0/AN12 RC0/T1OSO/T13CKI RC1/T1OSI/CCP2(1) RC2/CCP1/P1A RC3/SCK/SCL RC4/SDI/SDA RC5/SDO RC6/TX/CK RC7/RX/DT RA3/AN3/VREF+ RA2/AN2/VREF-/CVREF RA1/AN1 RA0/AN0 RB1/INT1/AN10 RB2/INT2/AN8 RB3/AN9/CCP2(1) OSC2/CLKO(3)/RA6 RB4/KBI0/AN11 RB5/KBI1/PGM RB6/KBI2/PGC RB7/KBI3/PGD OSC1/CLKI(3)/RA7PIC18F2420/2520/4420/4520 DS39631E-page 12 © 2008 Microchip Technology Inc. TABLE 1-2: PIC18F2420/2520 PINOUT I/O DESCRIPTIONS Pin Name Pin Number Pin Type Buffer Type SPDIP, Description SOIC QFN MCLR/VPP/RE3 MCLR VPP RE3 1 26 I P I ST ST Master Clear (input) or programming voltage (input). Master Clear (Reset) input. This pin is an active-low Reset to the device. Programming voltage input. Digital input. OSC1/CLKI/RA7 OSC1 CLKI RA7 9 6 I I I/O ST CMOS TTL Oscillator crystal or external clock input. Oscillator crystal input or external clock source input. ST buffer when configured in RC mode; CMOS otherwise. External clock source input. Always associated with pin function, OSC1. (See related OSC1/CLKI, OSC2/CLKO pins.) General purpose I/O pin. OSC2/CLKO/RA6 OSC2 CLKO RA6 10 7 O O I/O — — TTL Oscillator crystal or clock output. Oscillator crystal output. Connects to crystal or resonator in Crystal Oscillator mode. In RC mode, OSC2 pin outputs CLKO which has 1/4 the frequency of OSC1 and denotes the instruction cycle rate. General purpose I/O pin. Legend: TTL = TTL compatible input CMOS = CMOS compatible input or output ST = Schmitt Trigger input with CMOS levels I = Input O = Output P = Power Note 1: Default assignment for CCP2 when Configuration bit, CCP2MX, is set. 2: Alternate assignment for CCP2 when Configuration bit, CCP2MX, is cleared. © 2008 Microchip Technology Inc. DS39631E-page 13 PIC18F2420/2520/4420/4520 PORTA is a bidirectional I/O port. RA0/AN0 RA0 AN0 2 27 I/O I TTL Analog Digital I/O. Analog input 0. RA1/AN1 RA1 AN1 3 28 I/O I TTL Analog Digital I/O. Analog input 1. RA2/AN2/VREF-/CVREF RA2 AN2 VREFCVREF 4 1 I/O I I O TTL Analog Analog Analog Digital I/O. Analog input 2. A/D reference voltage (low) input. Comparator reference voltage output. RA3/AN3/VREF+ RA3 AN3 VREF+ 5 2 I/O I I TTL Analog Analog Digital I/O. Analog input 3. A/D reference voltage (high) input. RA4/T0CKI/C1OUT RA4 T0CKI C1OUT 6 3 I/O I O ST ST — Digital I/O. Timer0 external clock input. Comparator 1 output. RA5/AN4/SS/HLVDIN/ C2OUT RA5 AN4 SS HLVDIN C2OUT 7 4 I/O I I I O TTL Analog TTL Analog — Digital I/O. Analog input 4. SPI slave select input. High/Low-Voltage Detect input. Comparator 2 output. RA6 See the OSC2/CLKO/RA6 pin. RA7 See the OSC1/CLKI/RA7 pin. TABLE 1-2: PIC18F2420/2520 PINOUT I/O DESCRIPTIONS (CONTINUED) Pin Name Pin Number Pin Type Buffer Type SPDIP, Description SOIC QFN Legend: TTL = TTL compatible input CMOS = CMOS compatible input or output ST = Schmitt Trigger input with CMOS levels I = Input O = Output P = Power Note 1: Default assignment for CCP2 when Configuration bit, CCP2MX, is set. 2: Alternate assignment for CCP2 when Configuration bit, CCP2MX, is cleared. PIC18F2420/2520/4420/4520 DS39631E-page 14 © 2008 Microchip Technology Inc. PORTB is a bidirectional I/O port. PORTB can be software programmed for internal weak pull-ups on all inputs. RB0/INT0/FLT0/AN12 RB0 INT0 FLT0 AN12 21 18 I/O I I I TTL ST ST Analog Digital I/O. External interrupt 0. PWM Fault input for CCP1. Analog input 12. RB1/INT1/AN10 RB1 INT1 AN10 22 19 I/O I I TTL ST Analog Digital I/O. External interrupt 1. Analog input 10. RB2/INT2/AN8 RB2 INT2 AN8 23 20 I/O I I TTL ST Analog Digital I/O. External interrupt 2. Analog input 8. RB3/AN9/CCP2 RB3 AN9 CCP2(1) 24 21 I/O I I/O TTL Analog ST Digital I/O. Analog input 9. Capture 2 input/Compare 2 output/PWM2 output. RB4/KBI0/AN11 RB4 KBI0 AN11 25 22 I/O I I TTL TTL Analog Digital I/O. Interrupt-on-change pin. Analog input 11. RB5/KBI1/PGM RB5 KBI1 PGM 26 23 I/O I I/O TTL TTL ST Digital I/O. Interrupt-on-change pin. Low-Voltage ICSP™ Programming enable pin. RB6/KBI2/PGC RB6 KBI2 PGC 27 24 I/O I I/O TTL TTL ST Digital I/O. Interrupt-on-change pin. In-Circuit Debugger and ICSP programming clock pin. RB7/KBI3/PGD RB7 KBI3 PGD 28 25 I/O I I/O TTL TTL ST Digital I/O. Interrupt-on-change pin. In-Circuit Debugger and ICSP programming data pin. TABLE 1-2: PIC18F2420/2520 PINOUT I/O DESCRIPTIONS (CONTINUED) Pin Name Pin Number Pin Type Buffer Type SPDIP, Description SOIC QFN Legend: TTL = TTL compatible input CMOS = CMOS compatible input or output ST = Schmitt Trigger input with CMOS levels I = Input O = Output P = Power Note 1: Default assignment for CCP2 when Configuration bit, CCP2MX, is set. 2: Alternate assignment for CCP2 when Configuration bit, CCP2MX, is cleared. © 2008 Microchip Technology Inc. DS39631E-page 15 PIC18F2420/2520/4420/4520 PORTC is a bidirectional I/O port. RC0/T1OSO/T13CKI RC0 T1OSO T13CKI 11 8 I/O O I ST — ST Digital I/O. Timer1 oscillator output. Timer1/Timer3 external clock input. RC1/T1OSI/CCP2 RC1 T1OSI CCP2(2) 12 9 I/O I I/O ST Analog ST Digital I/O. Timer1 oscillator input. Capture 2 input/Compare 2 output/PWM2 output. RC2/CCP1 RC2 CCP1 13 10 I/O I/O ST ST Digital I/O. Capture 1 input/Compare 1 output/PWM1 output. RC3/SCK/SCL RC3 SCK SCL 14 11 I/O I/O I/O ST ST ST Digital I/O. Synchronous serial clock input/output for SPI mode. Synchronous serial clock input/output for I2C™ mode. RC4/SDI/SDA RC4 SDI SDA 15 12 I/O I I/O ST ST ST Digital I/O. SPI data in. I 2C data I/O. RC5/SDO RC5 SDO 16 13 I/O O ST — Digital I/O. SPI data out. RC6/TX/CK RC6 TX CK 17 14 I/O O I/O ST — ST Digital I/O. EUSART asynchronous transmit. EUSART synchronous clock (see related RX/DT). RC7/RX/DT RC7 RX DT 18 15 I/O I I/O ST ST ST Digital I/O. EUSART asynchronous receive. EUSART synchronous data (see related TX/CK). RE3 — — — — See MCLR/VPP/RE3 pin. VSS 8, 19 5, 16 P — Ground reference for logic and I/O pins. VDD 20 17 P — Positive supply for logic and I/O pins. TABLE 1-2: PIC18F2420/2520 PINOUT I/O DESCRIPTIONS (CONTINUED) Pin Name Pin Number Pin Type Buffer Type SPDIP, Description SOIC QFN Legend: TTL = TTL compatible input CMOS = CMOS compatible input or output ST = Schmitt Trigger input with CMOS levels I = Input O = Output P = Power Note 1: Default assignment for CCP2 when Configuration bit, CCP2MX, is set. 2: Alternate assignment for CCP2 when Configuration bit, CCP2MX, is cleared. PIC18F2420/2520/4420/4520 DS39631E-page 16 © 2008 Microchip Technology Inc. TABLE 1-3: PIC18F4420/4520 PINOUT I/O DESCRIPTIONS Pin Name Pin Number Pin Type Buffer Type Description PDIP QFN TQFP MCLR/VPP/RE3 MCLR VPP RE3 1 18 18 I P I ST ST Master Clear (input) or programming voltage (input). Master Clear (Reset) input. This pin is an active-low Reset to the device. Programming voltage input. Digital input. OSC1/CLKI/RA7 OSC1 CLKI RA7 13 32 30 I I I/O ST CMOS TTL Oscillator crystal or external clock input. Oscillator crystal input or external clock source input. ST buffer when configured in RC mode; analog otherwise. External clock source input. Always associated with pin function, OSC1. (See related OSC1/CLKI, OSC2/CLKO pins.) General purpose I/O pin. OSC2/CLKO/RA6 OSC2 CLKO RA6 14 33 31 O O I/O — — TTL Oscillator crystal or clock output. Oscillator crystal output. Connects to crystal or resonator in Crystal Oscillator mode. In RC mode, OSC2 pin outputs CLKO which has 1/4 the frequency of OSC1 and denotes the instruction cycle rate. General purpose I/O pin. Legend: TTL = TTL compatible input CMOS = CMOS compatible input or output ST = Schmitt Trigger input with CMOS levels I = Input O = Output P = Power Note 1: Default assignment for CCP2 when Configuration bit, CCP2MX, is set. 2: Alternate assignment for CCP2 when Configuration bit, CCP2MX, is cleared. © 2008 Microchip Technology Inc. DS39631E-page 17 PIC18F2420/2520/4420/4520 PORTA is a bidirectional I/O port. RA0/AN0 RA0 AN0 2 19 19 I/O I TTL Analog Digital I/O. Analog input 0. RA1/AN1 RA1 AN1 3 20 20 I/O I TTL Analog Digital I/O. Analog input 1. RA2/AN2/VREF-/CVREF RA2 AN2 VREFCVREF 4 21 21 I/O I I O TTL Analog Analog Analog Digital I/O. Analog input 2. A/D reference voltage (low) input. Comparator reference voltage output. RA3/AN3/VREF+ RA3 AN3 VREF+ 5 22 22 I/O I I TTL Analog Analog Digital I/O. Analog input 3. A/D reference voltage (high) input. RA4/T0CKI/C1OUT RA4 T0CKI C1OUT 6 23 23 I/O I O ST ST — Digital I/O. Timer0 external clock input. Comparator 1 output. RA5/AN4/SS/HLVDIN/ C2OUT RA5 AN4 SS HLVDIN C2OUT 7 24 24 I/O I I I O TTL Analog TTL Analog — Digital I/O. Analog input 4. SPI slave select input. High/Low-Voltage Detect input. Comparator 2 output. RA6 See the OSC2/CLKO/RA6 pin. RA7 See the OSC1/CLKI/RA7 pin. TABLE 1-3: PIC18F4420/4520 PINOUT I/O DESCRIPTIONS (CONTINUED) Pin Name Pin Number Pin Type Buffer Type Description PDIP QFN TQFP Legend: TTL = TTL compatible input CMOS = CMOS compatible input or output ST = Schmitt Trigger input with CMOS levels I = Input O = Output P = Power Note 1: Default assignment for CCP2 when Configuration bit, CCP2MX, is set. 2: Alternate assignment for CCP2 when Configuration bit, CCP2MX, is cleared. PIC18F2420/2520/4420/4520 DS39631E-page 18 © 2008 Microchip Technology Inc. PORTB is a bidirectional I/O port. PORTB can be software programmed for internal weak pull-ups on all inputs. RB0/INT0/FLT0/AN12 RB0 INT0 FLT0 AN12 33 9 8 I/O I I I TTL ST ST Analog Digital I/O. External interrupt 0. PWM Fault input for Enhanced CCP1. Analog input 12. RB1/INT1/AN10 RB1 INT1 AN10 34 10 9 I/O I I TTL ST Analog Digital I/O. External interrupt 1. Analog input 10. RB2/INT2/AN8 RB2 INT2 AN8 35 11 10 I/O I I TTL ST Analog Digital I/O. External interrupt 2. Analog input 8. RB3/AN9/CCP2 RB3 AN9 CCP2(1) 36 12 11 I/O I I/O TTL Analog ST Digital I/O. Analog input 9. Capture 2 input/Compare 2 output/PWM2 output. RB4/KBI0/AN11 RB4 KBI0 AN11 37 14 14 I/O I I TTL TTL Analog Digital I/O. Interrupt-on-change pin. Analog input 11. RB5/KBI1/PGM RB5 KBI1 PGM 38 15 15 I/O I I/O TTL TTL ST Digital I/O. Interrupt-on-change pin. Low-Voltage ICSP™ Programming enable pin. RB6/KBI2/PGC RB6 KBI2 PGC 39 16 16 I/O I I/O TTL TTL ST Digital I/O. Interrupt-on-change pin. In-Circuit Debugger and ICSP programming clock pin. RB7/KBI3/PGD RB7 KBI3 PGD 40 17 17 I/O I I/O TTL TTL ST Digital I/O. Interrupt-on-change pin. In-Circuit Debugger and ICSP programming data pin. TABLE 1-3: PIC18F4420/4520 PINOUT I/O DESCRIPTIONS (CONTINUED) Pin Name Pin Number Pin Type Buffer Type Description PDIP QFN TQFP Legend: TTL = TTL compatible input CMOS = CMOS compatible input or output ST = Schmitt Trigger input with CMOS levels I = Input O = Output P = Power Note 1: Default assignment for CCP2 when Configuration bit, CCP2MX, is set. 2: Alternate assignment for CCP2 when Configuration bit, CCP2MX, is cleared. © 2008 Microchip Technology Inc. DS39631E-page 19 PIC18F2420/2520/4420/4520 PORTC is a bidirectional I/O port. RC0/T1OSO/T13CKI RC0 T1OSO T13CKI 15 34 32 I/O O I ST — ST Digital I/O. Timer1 oscillator output. Timer1/Timer3 external clock input. RC1/T1OSI/CCP2 RC1 T1OSI CCP2(2) 16 35 35 I/O I I/O ST CMOS ST Digital I/O. Timer1 oscillator input. Capture 2 input/Compare 2 output/PWM2 output. RC2/CCP1/P1A RC2 CCP1 P1A 17 36 36 I/O I/O O ST ST — Digital I/O. Capture 1 input/Compare 1 output/PWM1 output. Enhanced CCP1 output. RC3/SCK/SCL RC3 SCK SCL 18 37 37 I/O I/O I/O ST ST ST Digital I/O. Synchronous serial clock input/output for SPI mode. Synchronous serial clock input/output for I2C™ mode. RC4/SDI/SDA RC4 SDI SDA 23 42 42 I/O I I/O ST ST ST Digital I/O. SPI data in. I 2C data I/O. RC5/SDO RC5 SDO 24 43 43 I/O O ST — Digital I/O. SPI data out. RC6/TX/CK RC6 TX CK 25 44 44 I/O O I/O ST — ST Digital I/O. EUSART asynchronous transmit. EUSART synchronous clock (see related RX/DT). RC7/RX/DT RC7 RX DT 26 1 1 I/O I I/O ST ST ST Digital I/O. EUSART asynchronous receive. EUSART synchronous data (see related TX/CK). TABLE 1-3: PIC18F4420/4520 PINOUT I/O DESCRIPTIONS (CONTINUED) Pin Name Pin Number Pin Type Buffer Type Description PDIP QFN TQFP Legend: TTL = TTL compatible input CMOS = CMOS compatible input or output ST = Schmitt Trigger input with CMOS levels I = Input O = Output P = Power Note 1: Default assignment for CCP2 when Configuration bit, CCP2MX, is set. 2: Alternate assignment for CCP2 when Configuration bit, CCP2MX, is cleared. PIC18F2420/2520/4420/4520 DS39631E-page 20 © 2008 Microchip Technology Inc. PORTD is a bidirectional I/O port or a Parallel Slave Port (PSP) for interfacing to a microprocessor port. These pins have TTL input buffers when PSP module is enabled. RD0/PSP0 RD0 PSP0 19 38 38 I/O I/O ST TTL Digital I/O. Parallel Slave Port data. RD1/PSP1 RD1 PSP1 20 39 39 I/O I/O ST TTL Digital I/O. Parallel Slave Port data. RD2/PSP2 RD2 PSP2 21 40 40 I/O I/O ST TTL Digital I/O. Parallel Slave Port data. RD3/PSP3 RD3 PSP3 22 41 41 I/O I/O ST TTL Digital I/O. Parallel Slave Port data. RD4/PSP4 RD4 PSP4 27 2 2 I/O I/O ST TTL Digital I/O. Parallel Slave Port data. RD5/PSP5/P1B RD5 PSP5 P1B 28 3 3 I/O I/O O ST TTL — Digital I/O. Parallel Slave Port data. Enhanced CCP1 output. RD6/PSP6/P1C RD6 PSP6 P1C 29 4 4 I/O I/O O ST TTL — Digital I/O. Parallel Slave Port data. Enhanced CCP1 output. RD7/PSP7/P1D RD7 PSP7 P1D 30 5 5 I/O I/O O ST TTL — Digital I/O. Parallel Slave Port data. Enhanced CCP1 output. TABLE 1-3: PIC18F4420/4520 PINOUT I/O DESCRIPTIONS (CONTINUED) Pin Name Pin Number Pin Type Buffer Type Description PDIP QFN TQFP Legend: TTL = TTL compatible input CMOS = CMOS compatible input or output ST = Schmitt Trigger input with CMOS levels I = Input O = Output P = Power Note 1: Default assignment for CCP2 when Configuration bit, CCP2MX, is set. 2: Alternate assignment for CCP2 when Configuration bit, CCP2MX, is cleared. © 2008 Microchip Technology Inc. DS39631E-page 21 PIC18F2420/2520/4420/4520 PORTE is a bidirectional I/O port. RE0/RD/AN5 RE0 RD AN5 8 25 25 I/O I I ST TTL Analog Digital I/O. Read control for Parallel Slave Port (see also WR and CS pins). Analog input 5. RE1/WR/AN6 RE1 WR AN6 9 26 26 I/O I I ST TTL Analog Digital I/O. Write control for Parallel Slave Port (see CS and RD pins). Analog input 6. RE2/CS/AN7 RE2 CS AN7 10 27 27 I/O I I ST TTL Analog Digital I/O. Chip Select control for Parallel Slave Port (see related RD and WR). Analog input 7. RE3 — — — — — See MCLR/VPP/RE3 pin. VSS 12, 31 6, 30, 31 6, 29 P — Ground reference for logic and I/O pins. VDD 11, 32 7, 8, 28, 29 7, 28 P — Positive supply for logic and I/O pins. NC — 13 12, 13, 33, 34 — — No Connect. TABLE 1-3: PIC18F4420/4520 PINOUT I/O DESCRIPTIONS (CONTINUED) Pin Name Pin Number Pin Type Buffer Type Description PDIP QFN TQFP Legend: TTL = TTL compatible input CMOS = CMOS compatible input or output ST = Schmitt Trigger input with CMOS levels I = Input O = Output P = Power Note 1: Default assignment for CCP2 when Configuration bit, CCP2MX, is set. 2: Alternate assignment for CCP2 when Configuration bit, CCP2MX, is cleared. PIC18F2420/2520/4420/4520 DS39631E-page 22 © 2008 Microchip Technology Inc. NOTES:© 2008 Microchip Technology Inc. DS39631E-page 23 PIC18F2420/2520/4420/4520 2.0 OSCILLATOR CONFIGURATIONS 2.1 Oscillator Types PIC18F2420/2520/4420/4520 devices can be operated in ten different oscillator modes. The user can program the Configuration bits, FOSC<3:0>, in Configuration Register 1H to select one of these ten modes: 1. LP Low-Power Crystal 2. XT Crystal/Resonator 3. HS High-Speed Crystal/Resonator 4. HSPLL High-Speed Crystal/Resonator with PLL Enabled 5. RC External Resistor/Capacitor with FOSC/4 Output on RA6 6. RCIO External Resistor/Capacitor with I/O on RA6 7. INTIO1 Internal Oscillator with FOSC/4 Output on RA6 and I/O on RA7 8. INTIO2 Internal Oscillator with I/O on RA6 and RA7 9. EC External Clock with FOSC/4 Output 10. ECIO External Clock with I/O on RA6 2.2 Crystal Oscillator/Ceramic Resonators In XT, LP, HS or HSPLL Oscillator modes, a crystal or ceramic resonator is connected to the OSC1 and OSC2 pins to establish oscillation. Figure 2-1 shows the pin connections. The oscillator design requires the use of a parallel cut crystal. FIGURE 2-1: CRYSTAL/CERAMIC RESONATOR OPERATION (XT, LP, HS OR HSPLL CONFIGURATION) TABLE 2-1: CAPACITOR SELECTION FOR CERAMIC RESONATORS Note: Use of a series cut crystal may give a frequency out of the crystal manufacturer’s specifications. Typical Capacitor Values Used: Mode Freq OSC1 OSC2 XT 3.58 MHz 4.19 MHz 4 MHz 4 MHz 15 pF 15 pF 30 pF 50 pF 15 pF 15 pF 30 pF 50 pF Capacitor values are for design guidance only. Different capacitor values may be required to produce acceptable oscillator operation. The user should test the performance of the oscillator over the expected VDD and temperature range for the application. See the notes following Table 2-2 for additional information. Note: When using resonators with frequencies above 3.5 MHz, the use of HS mode, rather than XT mode, is recommended. HS mode may be used at any VDD for which the controller is rated. If HS is selected, it is possible that the gain of the oscillator will overdrive the resonator. Therefore, a series resistor should be placed between the OSC2 pin and the resonator. As a good starting point, the recommended value of RS is 330Ω. Note 1: See Table 2-1 and Table 2-2 for initial values of C1 and C2. 2: A series resistor (RS) may be required for AT strip cut crystals. 3: RF varies with the oscillator mode chosen. C1(1) C2(1) XTAL OSC2 OSC1 RF(3) Sleep To Logic PIC18FXXXX RS(2) InternalPIC18F2420/2520/4420/4520 DS39631E-page 24 © 2008 Microchip Technology Inc. TABLE 2-2: CAPACITOR SELECTION FOR CRYSTAL OSCILLATOR An external clock source may also be connected to the OSC1 pin in the HS mode, as shown in Figure 2-2. FIGURE 2-2: EXTERNAL CLOCK INPUT OPERATION (HS OSC CONFIGURATION) 2.3 External Clock Input The EC and ECIO Oscillator modes require an external clock source to be connected to the OSC1 pin. There is no oscillator start-up time required after a Power-on Reset or after an exit from Sleep mode. In the EC Oscillator mode, the oscillator frequency divided by 4 is available on the OSC2 pin. This signal may be used for test purposes or to synchronize other logic. Figure 2-3 shows the pin connections for the EC Oscillator mode. FIGURE 2-3: EXTERNAL CLOCK INPUT OPERATION (EC CONFIGURATION) The ECIO Oscillator mode functions like the EC mode, except that the OSC2 pin becomes an additional general purpose I/O pin. The I/O pin becomes bit 6 of PORTA (RA6). Figure 2-4 shows the pin connections for the ECIO Oscillator mode. FIGURE 2-4: EXTERNAL CLOCK INPUT OPERATION (ECIO CONFIGURATION) Osc Type Crystal Freq Typical Capacitor Values Tested: C1 C2 LP 32 kHz 30 pF 30 pF XT 1 MHz 4 MHz 15 pF 15 pF 15 pF 15 pF HS 4 MHz 10 MHz 20 MHz 25 MHz 25 MHz 15 pF 15 pF 15 pF 0 pF 15 pF 15 pF 15 pF 15 pF 5 pF 15 pF Capacitor values are for design guidance only. These capacitors were tested with the crystals listed below for basic start-up and operation. These values are not optimized. Different capacitor values may be required to produce acceptable oscillator operation. The user should test the performance of the oscillator over the expected VDD and temperature range for the application. See the notes following this table for additional information. Crystals Used: 32 kHz 4 MHz 25 MHz 10 MHz 1 MHz 20 MHz Note 1: Higher capacitance increases the stability of the oscillator but also increases the start-up time. 2: When operating below 3V VDD, or when using certain ceramic resonators at any voltage, it may be necessary to use the HS mode or switch to a crystal oscillator. 3: Since each resonator/crystal has its own characteristics, the user should consult the resonator/crystal manufacturer for appropriate values of external components. 4: Rs may be required to avoid overdriving crystals with low drive level specification. 5: Always verify oscillator performance over the VDD and temperature range that is expected for the application. OSC1 Open OSC2 Clock from Ext. System PIC18FXXXX (HS Mode) OSC1/CLKI FOSC/4 OSC2/CLKO Clock from Ext. System PIC18FXXXX OSC1/CLKI RA6 I/O (OSC2) Clock from Ext. System PIC18FXXXX© 2008 Microchip Technology Inc. DS39631E-page 25 PIC18F2420/2520/4420/4520 2.4 RC Oscillator For timing insensitive applications, the “RC” and “RCIO” device options offer additional cost savings. The actual oscillator frequency is a function of several factors: • supply voltage • values of the external resistor (REXT) and capacitor (CEXT) • operating temperature Given the same device, operating voltage and temperature and component values, there will also be unit-to-unit frequency variations. These are due to factors such as: • normal manufacturing variation • difference in lead frame capacitance between package types (especially for low CEXT values) • variations within the tolerance of limits of REXT and CEXT In the RC Oscillator mode, the oscillator frequency divided by 4 is available on the OSC2 pin. This signal may be used for test purposes or to synchronize other logic. Figure 2-5 shows how the R/C combination is connected. FIGURE 2-5: RC OSCILLATOR MODE The RCIO Oscillator mode (Figure 2-6) functions like the RC mode, except that the OSC2 pin becomes an additional general purpose I/O pin. The I/O pin becomes bit 6 of PORTA (RA6). FIGURE 2-6: RCIO OSCILLATOR MODE 2.5 PLL Frequency Multiplier A Phase Locked Loop (PLL) circuit is provided as an option for users who wish to use a lower frequency oscillator circuit or to clock the device up to its highest rated frequency from a crystal oscillator. This may be useful for customers who are concerned with EMI due to high-frequency crystals or users who require higher clock speeds from an internal oscillator. 2.5.1 HSPLL OSCILLATOR MODE The HSPLL mode makes use of the HS Oscillator mode for frequencies up to 10 MHz. A PLL then multiplies the oscillator output frequency by 4 to produce an internal clock frequency up to 40 MHz. The PLLEN bit is not available in this oscillator mode. The PLL is only available to the crystal oscillator when the FOSC<3:0> Configuration bits are programmed for HSPLL mode (= 0110). FIGURE 2-7: PLL BLOCK DIAGRAM (HS MODE) 2.5.2 PLL AND INTOSC The PLL is also available to the internal oscillator block in selected oscillator modes. In this configuration, the PLL is enabled in software and generates a clock output of up to 32 MHz. The operation of INTOSC with the PLL is described in Section 2.6.4 “PLL in INTOSC Modes”. OSC2/CLKO CEXT REXT PIC18FXXXX OSC1 FOSC/4 Internal Clock VDD VSS Recommended values: 3 kΩ ≤ REXT ≤ 100 kΩ CEXT > 20 pF CEXT REXT PIC18FXXXX OSC1 Internal Clock VDD VSS Recommended values: 3 kΩ ≤ REXT ≤ 100 kΩ CEXT > 20 pF RA6 I/O (OSC2) MUX VCO Loop Filter Crystal Osc OSC2 OSC1 PLL Enable FIN FOUT SYSCLK Phase Comparator HS Oscillator Enable ÷4 (from Configuration Register 1H) HS ModePIC18F2420/2520/4420/4520 DS39631E-page 26 © 2008 Microchip Technology Inc. 2.6 Internal Oscillator Block The PIC18F2420/2520/4420/4520 devices include an internal oscillator block which generates two different clock signals; either can be used as the microcontroller’s clock source. This may eliminate the need for external oscillator circuits on the OSC1 and/or OSC2 pins. The main output (INTOSC) is an 8 MHz clock source which can be used to directly drive the device clock. It also drives a postscaler which can provide a range of clock frequencies from 31 kHz to 4 MHz. The INTOSC output is enabled when a clock frequency from 125 kHz to 8 MHz is selected. The other clock source is the internal RC oscillator (INTRC), which provides a nominal 31 kHz output. INTRC is enabled if it is selected as the device clock source; it is also enabled automatically when any of the following are enabled: • Power-up Timer • Fail-Safe Clock Monitor • Watchdog Timer • Two-Speed Start-up These features are discussed in greater detail in Section 23.0 “Special Features of the CPU”. The clock source frequency (INTOSC direct, INTRC direct or INTOSC postscaler) is selected by configuring the IRCF bits of the OSCCON register (page 30). 2.6.1 INTIO MODES Using the internal oscillator as the clock source eliminates the need for up to two external oscillator pins, which can then be used for digital I/O. Two distinct configurations are available: • In INTIO1 mode, the OSC2 pin outputs FOSC/4, while OSC1 functions as RA7 for digital input and output. • In INTIO2 mode, OSC1 functions as RA7 and OSC2 functions as RA6, both for digital input and output. 2.6.2 INTOSC OUTPUT FREQUENCY The internal oscillator block is calibrated at the factory to produce an INTOSC output frequency of 8.0 MHz. The INTRC oscillator operates independently of the INTOSC source. Any changes in INTOSC across voltage and temperature are not necessarily reflected by changes in INTRC and vice versa. 2.6.3 OSCTUNE REGISTER The internal oscillator’s output has been calibrated at the factory but can be adjusted in the user’s application. This is done by writing to the OSCTUNE register (Register 2-1). When the OSCTUNE register is modified, the INTOSC frequency will begin shifting to the new frequency. The INTRC clock will reach the new frequency within 8 clock cycles (approximately 8 * 32 μs = 256 μs). The INTOSC clock will stabilize within 1 ms. Code execution continues during this shift. There is no indication that the shift has occurred. The OSCTUNE register also implements the INTSRC and PLLEN bits, which control certain features of the internal oscillator block. The INTSRC bit allows users to select which internal oscillator provides the clock source when the 31 kHz frequency option is selected. This is covered in greater detail in Section 2.7.1 “Oscillator Control Register”. The PLLEN bit controls the operation of the frequency multiplier, PLL, in internal oscillator modes. 2.6.4 PLL IN INTOSC MODES The 4x frequency multiplier can be used with the internal oscillator block to produce faster device clock speeds than are normally possible with an internal oscillator. When enabled, the PLL produces a clock speed of up to 32 MHz. Unlike HSPLL mode, the PLL is controlled through software. The control bit, PLLEN (OSCTUNE<6>), is used to enable or disable its operation. The PLL is available when the device is configured to use the internal oscillator block as its primary clock source (FOSC<3:0> = 1001 or 1000). Additionally, the PLL will only function when the selected output frequency is either 4 MHz or 8 MHz (OSCCON<6:4> = 111 or 110). If both of these conditions are not met, the PLL is disabled. The PLLEN control bit is only functional in those internal oscillator modes where the PLL is available. In all other modes, it is forced to ‘0’ and is effectively unavailable. 2.6.5 INTOSC FREQUENCY DRIFT The factory calibrates the internal oscillator block output (INTOSC) for 8 MHz. However, this frequency may drift as VDD or temperature changes, which can affect the controller operation in a variety of ways. It is possible to adjust the INTOSC frequency by modifying the value in the OSCTUNE register. This has no effect on the INTRC clock source frequency. Tuning the INTOSC source requires knowing when to make the adjustment, in which direction it should be made, and in some cases, how large a change is needed. Three compensation techniques are discussed in Section 2.6.5.1 “Compensating with the EUSART”, Section 2.6.5.2 “Compensating with the Timers” and Section 2.6.5.3 “Compensating with the CCP Module in Capture Mode”, but other techniques may be used.© 2008 Microchip Technology Inc. DS39631E-page 27 PIC18F2420/2520/4420/4520 2.6.5.1 Compensating with the EUSART An adjustment may be required when the EUSART begins to generate framing errors or receives data with errors while in Asynchronous mode. Framing errors indicate that the device clock frequency is too high. To adjust for this, decrement the value in OSCTUNE to reduce the clock frequency. On the other hand, errors in data may suggest that the clock speed is too low. To compensate, increment OSCTUNE to increase the clock frequency. 2.6.5.2 Compensating with the Timers This technique compares device clock speed to some reference clock. Two timers may be used; one timer is clocked by the peripheral clock, while the other is clocked by a fixed reference source, such as the Timer1 oscillator. Both timers are cleared, but the timer clocked by the reference generates interrupts. When an interrupt occurs, the internally clocked timer is read and both timers are cleared. If the internally clocked timer value is greater than expected, then the internal oscillator block is running too fast. To adjust for this, decrement the OSCTUNE register. 2.6.5.3 Compensating with the CCP Module in Capture Mode A CCP module can use free-running Timer1 (or Timer3), clocked by the internal oscillator block and an external event with a known period (i.e., AC power frequency). The time of the first event is captured in the CCPRxH:CCPRxL registers and is recorded for use later. When the second event causes a capture, the time of the first event is subtracted from the time of the second event. Since the period of the external event is known, the time difference between events can be calculated. If the measured time is much greater than the calculated time, the internal oscillator block is running too fast; to compensate, decrement the OSCTUNE register. If the measured time is much less than the calculated time, the internal oscillator block is running too slow; to compensate, increment the OSCTUNE register. REGISTER 2-1: OSCTUNE: OSCILLATOR TUNING REGISTER R/W-0 R/W-0(1) U-0 R/W-0 R/W-0 R/W-0 R/W-0 R/W-0 INTSRC PLLEN(1) — TUN4 TUN3 TUN2 TUN1 TUN0 bit 7 bit 0 Legend: R = Readable bit W = Writable bit U = Unimplemented bit, read as ‘0’ -n = Value at POR ‘1’ = Bit is set ‘0’ = Bit is cleared x = Bit is unknown bit 7 INTSRC: Internal Oscillator Low-Frequency Source Select bit 1 = 31.25 kHz device clock derived from 8 MHz INTOSC source (divide-by-256 enabled) 0 = 31 kHz device clock derived directly from INTRC internal oscillator bit 6 PLLEN: Frequency Multiplier PLL for INTOSC Enable bit(1) 1 = PLL enabled for INTOSC (4 MHz and 8 MHz only) 0 = PLL disabled bit 5 Unimplemented: Read as ‘0’ bit 4-0 TUN<4:0>: Frequency Tuning bits 011111 = Maximum frequency • • • • 000001 000000 = Center frequency. Oscillator module is running at the calibrated frequency. 111111 • • • • 100000 = Minimum frequency Note 1: Available only in certain oscillator configurations; otherwise, this bit is unavailable and reads as ‘0’. See Section 2.6.4 “PLL in INTOSC Modes” for details.PIC18F2420/2520/4420/4520 DS39631E-page 28 © 2008 Microchip Technology Inc. 2.7 Clock Sources and Oscillator Switching Like previous PIC18 devices, the PIC18F2420/2520/ 4420/4520 family includes a feature that allows the device clock source to be switched from the main oscillator to an alternate low-frequency clock source. PIC18F2420/2520/4420/4520 devices offer two alternate clock sources. When an alternate clock source is enabled, the various power-managed operating modes are available. Essentially, there are three clock sources for these devices: • Primary oscillators • Secondary oscillators • Internal oscillator block The primary oscillators include the External Crystal and Resonator modes, the External RC modes, the External Clock modes and the internal oscillator block. The particular mode is defined by the FOSC<3:0> Configuration bits. The details of these modes are covered earlier in this chapter. The secondary oscillators are those external sources not connected to the OSC1 or OSC2 pins. These sources may continue to operate even after the controller is placed in a power-managed mode. PIC18F2420/2520/4420/4520 devices offer the Timer1 oscillator as a secondary oscillator. This oscillator, in all power-managed modes, is often the time base for functions such as a Real-Time Clock (RTC). Most often, a 32.768 kHz watch crystal is connected between the RC0/T1OSO/T13CKI and RC1/T1OSI pins. Like the LP Oscillator mode circuit, loading capacitors are also connected from each pin to ground. The Timer1 oscillator is discussed in greater detail in Section 12.3 “Timer1 Oscillator”. In addition to being a primary clock source, the internal oscillator block is available as a power-managed mode clock source. The INTRC source is also used as the clock source for several special features, such as the WDT and Fail-Safe Clock Monitor. The clock sources for the PIC18F2420/2520/4420/4520 devices are shown in Figure 2-8. See Section 23.0 “Special Features of the CPU” for Configuration register details. FIGURE 2-8: PIC18F2420/2520/4420/4520 CLOCK DIAGRAM 4 x PLL FOSC<3:0> Secondary Oscillator T1OSCEN Enable Oscillator T1OSO T1OSI Clock Source Option for Other Modules OSC1 OSC2 Sleep HSPLL, INTOSC/PLL LP, XT, HS, RC, EC T1OSC CPU Peripherals IDLEN Postscaler MUX MUX 8 MHz 4 MHz 2 MHz 1 MHz 500 kHz 125 kHz 250 kHz OSCCON<6:4> 111 110 101 100 011 010 001 000 31 kHz INTRC Source Internal Oscillator Block WDT, PWRT, FSCM 8 MHz Internal Oscillator (INTOSC) OSCCON<6:4> Clock Control OSCCON<1:0> Source 8 MHz 31 kHz (INTRC) OSCTUNE<6> 0 1 OSCTUNE<7> and Two-Speed Start-up Primary Oscillator PIC18F2420/2520/4420/4520© 2008 Microchip Technology Inc. DS39631E-page 29 PIC18F2420/2520/4420/4520 2.7.1 OSCILLATOR CONTROL REGISTER The OSCCON register (Register 2-2) controls several aspects of the device clock’s operation, both in full-power operation and in power-managed modes. The System Clock Select bits, SCS<1:0>, select the clock source. The available clock sources are the primary clock (defined by the FOSC<3:0> Configuration bits), the secondary clock (Timer1 oscillator) and the internal oscillator block. The clock source changes immediately after one or more of the bits is written to, following a brief clock transition interval. The SCS bits are cleared on all forms of Reset. The Internal Oscillator Frequency Select bits (IRCF<2:0>) select the frequency output of the internal oscillator block to drive the device clock. The choices are the INTRC source, the INTOSC source (8 MHz) or one of the frequencies derived from the INTOSC postscaler (31.25 kHz to 4 MHz). If the internal oscillator block is supplying the device clock, changing the states of these bits will have an immediate change on the internal oscillator’s output. On device Resets, the default output frequency of the internal oscillator block is set at 1 MHz. When a nominal output frequency of 31 kHz is selected (IRCF<2:0> = 000), users may choose which internal oscillator acts as the source. This is done with the INTSRC bit in the OSCTUNE register (OSCTUNE<7>). Setting this bit selects INTOSC as a 31.25 kHz clock source by enabling the divide-by-256 output of the INTOSC postscaler. Clearing INTSRC selects INTRC (nominally 31 kHz) as the clock source. This option allows users to select the tunable and more precise INTOSC as a clock source, while maintaining power savings with a very low clock speed. Regardless of the setting of INTSRC, INTRC always remains the clock source for features such as the Watchdog Timer and the Fail-Safe Clock Monitor. The OSTS, IOFS and T1RUN bits indicate which clock source is currently providing the device clock. The OSTS bit indicates that the Oscillator Start-up Timer (OST) has timed out and the primary clock is providing the device clock in primary clock modes. The IOFS bit indicates when the internal oscillator block has stabilized and is providing the device clock in RC Clock modes. The T1RUN bit (T1CON<6>) indicates when the Timer1 oscillator is providing the device clock in secondary clock modes. In power-managed modes, only one of these three bits will be set at any time. If none of these bits are set, the INTRC is providing the clock or the internal oscillator block has just started and is not yet stable. The IDLEN bit determines if the device goes into Sleep mode or one of the Idle modes when the SLEEP instruction is executed. The use of the flag and control bits in the OSCCON register is discussed in more detail in Section 3.0 “Power-Managed Modes”. 2.7.2 OSCILLATOR TRANSITIONS PIC18F2420/2520/4420/4520 devices contain circuitry to prevent clock “glitches” when switching between clock sources. A short pause in the device clock occurs during the clock switch. The length of this pause is the sum of two cycles of the old clock source and three to four cycles of the new clock source. This formula assumes that the new clock source is stable. Clock transitions are discussed in greater detail in Section 3.1.2 “Entering Power-Managed Modes”. Note 1: The Timer1 oscillator must be enabled to select the secondary clock source. The Timer1 oscillator is enabled by setting the T1OSCEN bit in the Timer1 Control register (T1CON<3>). If the Timer1 oscillator is not enabled, then any attempt to select a secondary clock source will be ignored. 2: It is recommended that the Timer1 oscillator be operating and stable before selecting the secondary clock source or a very long delay may occur while the Timer1 oscillator starts. PIC18F2420/2520/4420/4520 DS39631E-page 30 © 2008 Microchip Technology Inc. REGISTER 2-2: OSCCON: OSCILLATOR CONTROL REGISTER R/W-0 R/W-1 R/W-0 R/W-0 R(1) R-0 R/W-0 R/W-0 IDLEN IRCF2 IRCF1 IRCF0 OSTS IOFS SCS1 SCS0 bit 7 bit 0 Legend: R = Readable bit W = Writable bit U = Unimplemented bit, read as ‘0’ -n = Value at POR ‘1’ = Bit is set ‘0’ = Bit is cleared x = Bit is unknown bit 7 IDLEN: Idle Enable bit 1 = Device enters an Idle mode on SLEEP instruction 0 = Device enters Sleep mode on SLEEP instruction bit 6-4 IRCF<2:0>: Internal Oscillator Frequency Select bits 111 = 8 MHz (INTOSC drives clock directly) 110 = 4 MHz 101 = 2 MHz 100 = 1 MHz(3) 011 = 500 kHz 010 = 250 kHz 001 = 125 kHz 000 = 31 kHz (from either INTOSC/256 or INTRC directly)(2) bit 3 OSTS: Oscillator Start-up Timer Time-out Status bit(1) 1 = Oscillator Start-up Timer (OST) time-out has expired; primary oscillator is running 0 = Oscillator Start-up Timer (OST) time-out is running; primary oscillator is not ready bit 2 IOFS: INTOSC Frequency Stable bit 1 = INTOSC frequency is stable 0 = INTOSC frequency is not stable bit 1-0 SCS<1:0>: System Clock Select bits 1x = Internal oscillator block 01 = Secondary (Timer1) oscillator 00 = Primary oscillator Note 1: Reset state depends on state of the IESO Configuration bit. 2: Source selected by the INTSRC bit (OSCTUNE<7>), see text. 3: Default output frequency of INTOSC on Reset.© 2008 Microchip Technology Inc. DS39631E-page 31 PIC18F2420/2520/4420/4520 2.8 Effects of Power-Managed Modes on the Various Clock Sources When PRI_IDLE mode is selected, the designated primary oscillator continues to run without interruption. For all other power-managed modes, the oscillator using the OSC1 pin is disabled. The OSC1 pin (and OSC2 pin, if used by the oscillator) will stop oscillating. In secondary clock modes (SEC_RUN and SEC_IDLE), the Timer1 oscillator is operating and providing the device clock. The Timer1 oscillator may also run in all power-managed modes if required to clock Timer1 or Timer3. In internal oscillator modes (RC_RUN and RC_IDLE), the internal oscillator block provides the device clock source. The 31 kHz INTRC output can be used directly to provide the clock and may be enabled to support various special features, regardless of the powermanaged mode (see Section 23.2 “Watchdog Timer (WDT)”, Section 23.3 “Two-Speed Start-up” and Section 23.4 “Fail-Safe Clock Monitor” for more information on WDT, Fail-Safe Clock Monitor and TwoSpeed Start-up). The INTOSC output at 8 MHz may be used directly to clock the device or may be divided down by the postscaler. The INTOSC output is disabled if the clock is provided directly from the INTRC output. If Sleep mode is selected, all clock sources are stopped. Since all the transistor switching currents have been stopped, Sleep mode achieves the lowest current consumption of the device (only leakage currents). Enabling any on-chip feature that will operate during Sleep will increase the current consumed during Sleep. The INTRC is required to support WDT operation. The Timer1 oscillator may be operating to support a RealTime Clock. Other features may be operating that do not require a device clock source (i.e., MSSP slave, PSP, INTx pins and others). Peripherals that may add significant current consumption are listed in Section 26.2 “DC Characteristics”. 2.9 Power-up Delays Power-up delays are controlled by two timers so that no external Reset circuitry is required for most applications. The delays ensure that the device is kept in Reset until the device power supply is stable under normal circumstances and the primary clock is operating and stable. For additional information on power-up delays, see Section 4.5 “Device Reset Timers”. The first timer is the Power-up Timer (PWRT), which provides a fixed delay on power-up (parameter 33, Table 26-10). It is enabled by clearing (= 0) the PWRTEN Configuration bit. The second timer is the Oscillator Start-up Timer (OST), intended to keep the chip in Reset until the crystal oscillator is stable (LP, XT and HS modes). The OST does this by counting 1024 oscillator cycles before allowing the oscillator to clock the device. When the HSPLL Oscillator mode is selected, the device is kept in Reset for an additional 2 ms, following the HS mode OST delay, so the PLL can lock to the incoming clock frequency. There is a delay of interval, TCSD (parameter 38, Table 26-10), following POR, while the controller becomes ready to execute instructions. This delay runs concurrently with any other delays. This may be the only delay that occurs when any of the EC, RC or INTIO modes are used as the primary clock source. TABLE 2-3: OSC1 AND OSC2 PIN STATES IN SLEEP MODE OSC Mode OSC1 Pin OSC2 Pin RC, INTIO1 Floating, external resistor should pull high At logic low (clock/4 output) RCIO Floating, external resistor should pull high Configured as PORTA, bit 6 INTIO2 Configured as PORTA, bit 7 Configured as PORTA, bit 6 ECIO Floating, pulled by external clock Configured as PORTA, bit 6 EC Floating, pulled by external clock At logic low (clock/4 output) LP, XT and HS Feedback inverter disabled at quiescent voltage level Feedback inverter disabled at quiescent voltage level Note: See Table 4-2 in Section 4.0 “Reset” for time-outs due to Sleep and MCLR Reset.PIC18F2420/2520/4420/4520 DS39631E-page 32 © 2008 Microchip Technology Inc. NOTES:© 2008 Microchip Technology Inc. Advance Information DS39631E-page 33 PIC18F2420/2520/4420/4520 3.0 POWER-MANAGED MODES PIC18F2420/2520/4420/4520 devices offer a total of seven operating modes for more efficient powermanagement. These modes provide a variety of options for selective power conservation in applications where resources may be limited (i.e., battery-powered devices). There are three categories of power-managed modes: • Run modes • Idle modes • Sleep mode These categories define which portions of the device are clocked and sometimes, what speed. The Run and Idle modes may use any of the three available clock sources (primary, secondary or internal oscillator block); the Sleep mode does not use a clock source. The power-managed modes include several powersaving features offered on previous PIC® devices. One is the clock switching feature, offered in other PIC18 devices, allowing the controller to use the Timer1 oscillator in place of the primary oscillator. Also included is the Sleep mode, offered by all PIC devices, where all device clocks are stopped. 3.1 Selecting Power-Managed Modes Selecting a power-managed mode requires two decisions: if the CPU is to be clocked or not and the selection of a clock source. The IDLEN bit (OSCCON<7>) controls CPU clocking, while the SCS<1:0> bits (OSCCON<1:0>) select the clock source. The individual modes, bit settings, clock sources and affected modules are summarized in Table 3-1. 3.1.1 CLOCK SOURCES The SCS<1:0> bits allow the selection of one of three clock sources for power-managed modes. They are: • the primary clock, as defined by the FOSC<3:0> Configuration bits • the secondary clock (the Timer1 oscillator) • the internal oscillator block (for RC modes) 3.1.2 ENTERING POWER-MANAGED MODES Switching from one power-managed mode to another begins by loading the OSCCON register. The SCS<1:0> bits select the clock source and determine which Run or Idle mode is to be used. Changing these bits causes an immediate switch to the new clock source, assuming that it is running. The switch may also be subject to clock transition delays. These are discussed in Section 3.1.3 “Clock Transitions and Status Indicators” and subsequent sections. Entry to the power-managed Idle or Sleep modes is triggered by the execution of a SLEEP instruction. The actual mode that results depends on the status of the IDLEN bit. Depending on the current mode and the mode being switched to, a change to a power-managed mode does not always require setting all of these bits. Many transitions may be done by changing the oscillator select bits, or changing the IDLEN bit, prior to issuing a SLEEP instruction. If the IDLEN bit is already configured correctly, it may only be necessary to perform a SLEEP instruction to switch to the desired mode. TABLE 3-1: POWER-MANAGED MODES Mode OSCCON<7,1:0> Bits Module Clocking Available Clock and Oscillator Source IDLEN(1) SCS<1:0> CPU Peripherals Sleep 0 N/A Off Off None – All clocks are disabled PRI_RUN N/A 00 Clocked Clocked Primary – LP, XT, HS, HSPLL, RC, EC and Internal Oscillator Block(2). This is the normal full-power execution mode. SEC_RUN N/A 01 Clocked Clocked Secondary – Timer1 Oscillator RC_RUN N/A 1x Clocked Clocked Internal Oscillator Block(2) PRI_IDLE 1 00 Off Clocked Primary – LP, XT, HS, HSPLL, RC, EC SEC_IDLE 1 01 Off Clocked Secondary – Timer1 Oscillator RC_IDLE 1 1x Off Clocked Internal Oscillator Block(2) Note 1: IDLEN reflects its value when the SLEEP instruction is executed. 2: Includes INTOSC and INTOSC postscaler, as well as the INTRC source.PIC18F2420/2520/4420/4520 DS39631E-page 34 Advance Information © 2008 Microchip Technology Inc. 3.1.3 CLOCK TRANSITIONS AND STATUS INDICATORS The length of the transition between clock sources is the sum of two cycles of the old clock source and three to four cycles of the new clock source. This formula assumes that the new clock source is stable. Three bits indicate the current clock source and its status. They are: • OSTS (OSCCON<3>) • IOFS (OSCCON<2>) • T1RUN (T1CON<6>) In general, only one of these bits will be set while in a given power-managed mode. When the OSTS bit is set, the primary clock is providing the device clock. When the IOFS bit is set, the INTOSC output is providing a stable 8 MHz clock source to a divider that actually drives the device clock. When the T1RUN bit is set, the Timer1 oscillator is providing the clock. If none of these bits are set, then either the INTRC clock source is clocking the device or the INTOSC source is not yet stable. If the internal oscillator block is configured as the primary clock source by the FOSC<3:0> Configuration bits, then both the OSTS and IOFS bits may be set when in PRI_RUN or PRI_IDLE modes. This indicates that the primary clock (INTOSC output) is generating a stable 8 MHz output. Entering another power-managed RC mode at the same frequency would clear the OSTS bit. 3.1.4 MULTIPLE SLEEP COMMANDS The power-managed mode that is invoked with the SLEEP instruction is determined by the setting of the IDLEN bit at the time the instruction is executed. If another SLEEP instruction is executed, the device will enter the power-managed mode specified by IDLEN at that time. If IDLEN has changed, the device will enter the new power-managed mode specified by the new setting. 3.2 Run Modes In the Run modes, clocks to both the core and peripherals are active. The difference between these modes is the clock source. 3.2.1 PRI_RUN MODE The PRI_RUN mode is the normal, full-power execution mode of the microcontroller. This is also the default mode upon a device Reset unless Two-Speed Start-up is enabled (see Section 23.3 “Two-Speed Start-up” for details). In this mode, the OSTS bit is set. The IOFS bit may be set if the internal oscillator block is the primary clock source (see Section 2.7.1 “Oscillator Control Register”). 3.2.2 SEC_RUN MODE The SEC_RUN mode is the compatible mode to the “clock switching” feature offered in other PIC18 devices. In this mode, the CPU and peripherals are clocked from the Timer1 oscillator. This gives users the option of lower power consumption while still using a high-accuracy clock source. SEC_RUN mode is entered by setting the SCS<1:0> bits to ‘01’. The device clock source is switched to the Timer1 oscillator (see Figure 3-1), the primary oscillator is shut down, the T1RUN bit (T1CON<6>) is set and the OSTS bit is cleared. On transitions from SEC_RUN mode to PRI_RUN mode, the peripherals and CPU continue to be clocked from the Timer1 oscillator while the primary clock is started. When the primary clock becomes ready, a clock switch back to the primary clock occurs (see Figure 3-2). When the clock switch is complete, the T1RUN bit is cleared, the OSTS bit is set and the primary clock is providing the clock. The IDLEN and SCS bits are not affected by the wake-up; the Timer1 oscillator continues to run. Note 1: Caution should be used when modifying a single IRCF bit. If VDD is less than 3V, it is possible to select a higher clock speed than is supported by the low VDD. Improper device operation may result if the VDD/FOSC specifications are violated. 2: Executing a SLEEP instruction does not necessarily place the device into Sleep mode. It acts as the trigger to place the controller into either the Sleep mode or one of the Idle modes, depending on the setting of the IDLEN bit. Note: The Timer1 oscillator should already be running prior to entering SEC_RUN mode. If the T1OSCEN bit is not set when the SCS<1:0> bits are set to ‘01’, entry to SEC_RUN mode will not occur. If the Timer1 oscillator is enabled, but not yet running, device clocks will be delayed until the oscillator has started. In such situations, initial oscillator operation is far from stable and unpredictable operation may result.© 2008 Microchip Technology Inc. Advance Information DS39631E-page 35 PIC18F2420/2520/4420/4520 FIGURE 3-1: TRANSITION TIMING FOR ENTRY TO SEC_RUN MODE FIGURE 3-2: TRANSITION TIMING FROM SEC_RUN MODE TO PRI_RUN MODE (HSPLL) 3.2.3 RC_RUN MODE In RC_RUN mode, the CPU and peripherals are clocked from the internal oscillator block using the INTOSC multiplexer. In this mode, the primary clock is shut down. When using the INTRC source, this mode provides the best power conservation of all the Run modes while still executing code. It works well for user applications which are not highly timing sensitive or do not require high-speed clocks at all times. If the primary clock source is the internal oscillator block (either INTRC or INTOSC), there are no distinguishable differences between PRI_RUN and RC_RUN modes during execution. However, a clock switch delay will occur during entry to and exit from RC_RUN mode. Therefore, if the primary clock source is the internal oscillator block, the use of RC_RUN mode is not recommended. This mode is entered by setting the SCS1 bit to ‘1’. Although it is ignored, it is recommended that the SCS0 bit also be cleared; this is to maintain software compatibility with future devices. When the clock source is switched to the INTOSC multiplexer (see Figure 3-3), the primary oscillator is shut down and the OSTS bit is cleared. The IRCF bits may be modified at any time to immediately change the clock speed. Q2 Q3 Q4 OSC1 Peripheral Program Q1 T1OSI Q1 Counter Clock CPU Clock PC PC + 2 1 2 3 n-1 n Clock Transition(1) Q2 Q3 Q4 Q1 Q2 Q3 PC + 4 Note 1: Clock transition typically occurs within 2-4 TOSC. Q1 Q3 Q4 OSC1 Peripheral Program PC T1OSI PLL Clock Q1 PC + 4 Q2 Output Q3 Q4 Q1 CPU Clock PC + 2 Clock Counter Q2 Q2 Q3 Note1: TOST = 1024 TOSC; TPLL = 2 ms (approx). These intervals are not shown to scale. 2: Clock transition typically occurs within 2-4 TOSC. SCS<1:0> bits Changed TPLL(1) 1 2 n-1 n Clock OSTS bit Set Transition(2) TOST(1) Note: Caution should be used when modifying a single IRCF bit. If VDD is less than 3V, it is possible to select a higher clock speed than is supported by the low VDD. Improper device operation may result if the VDD/FOSC specifications are violated.PIC18F2420/2520/4420/4520 DS39631E-page 36 Advance Information © 2008 Microchip Technology Inc. If the IRCF bits and the INTSRC bit are all clear, the INTOSC output is not enabled and the IOFS bit will remain clear; there will be no indication of the current clock source. The INTRC source is providing the device clocks. If the IRCF bits are changed from all clear (thus, enabling the INTOSC output), or if INTSRC is set, the IOFS bit becomes set after the INTOSC output becomes stable. Clocks to the device continue while the INTOSC source stabilizes after an interval of TIOBST. If the IRCF bits were previously at a non-zero value, or if INTSRC was set before setting SCS1 and the INTOSC source was already stable, the IOFS bit will remain set. On transitions from RC_RUN mode to PRI_RUN mode, the device continues to be clocked from the INTOSC multiplexer while the primary clock is started. When the primary clock becomes ready, a clock switch to the primary clock occurs (see Figure 3-4). When the clock switch is complete, the IOFS bit is cleared, the OSTS bit is set and the primary clock is providing the device clock. The IDLEN and SCS bits are not affected by the switch. The INTRC source will continue to run if either the WDT or the Fail-Safe Clock Monitor is enabled. FIGURE 3-3: TRANSITION TIMING TO RC_RUN MODE FIGURE 3-4: TRANSITION TIMING FROM RC_RUN MODE TO PRI_RUN MODE Q2 Q3 Q4 OSC1 Peripheral Program Q1 INTRC Q1 Counter Clock CPU Clock PC PC + 2 1 2 3 n-1 n Clock Transition(1) Q2 Q3 Q4 Q1 Q2 Q3 PC + 4 Note 1: Clock transition typically occurs within 2-4 TOSC. Q1 Q3 Q4 OSC1 Peripheral Program PC INTOSC PLL Clock Q1 PC + 4 Q2 Output Q3 Q4 Q1 CPU Clock PC + 2 Clock Counter Q2 Q2 Q3 Note1: TOST = 1024 TOSC; TPLL = 2 ms (approx). These intervals are not shown to scale. 2: Clock transition typically occurs within 2-4 TOSC. SCS<1:0> bits Changed TPLL(1) 1 2 n-1 n Clock OSTS bit Set Transition(2) Multiplexer TOST(1)© 2008 Microchip Technology Inc. Advance Information DS39631E-page 37 PIC18F2420/2520/4420/4520 3.3 Sleep Mode The power-managed Sleep mode in the PIC18F2420/ 2520/4420/4520 devices is identical to the legacy Sleep mode offered in all other PIC devices. It is entered by clearing the IDLEN bit (the default state on device Reset) and executing the SLEEP instruction. This shuts down the selected oscillator (Figure 3-5). All clock source status bits are cleared. Entering the Sleep mode from any other mode does not require a clock switch. This is because no clocks are needed once the controller has entered Sleep. If the WDT is selected, the INTRC source will continue to operate. If the Timer1 oscillator is enabled, it will also continue to run. When a wake event occurs in Sleep mode (by interrupt, Reset or WDT time-out), the device will not be clocked until the clock source selected by the SCS<1:0> bits becomes ready (see Figure 3-6), or it will be clocked from the internal oscillator block if either the Two-Speed Start-up or the Fail-Safe Clock Monitor are enabled (see Section 23.0 “Special Features of the CPU”). In either case, the OSTS bit is set when the primary clock is providing the device clocks. The IDLEN and SCS bits are not affected by the wake-up. 3.4 Idle Modes The Idle modes allow the controller’s CPU to be selectively shut down while the peripherals continue to operate. Selecting a particular Idle mode allows users to further manage power consumption. If the IDLEN bit is set to ‘1’ when a SLEEP instruction is executed, the peripherals will be clocked from the clock source selected using the SCS<1:0> bits; however, the CPU will not be clocked. The clock source status bits are not affected. Setting IDLEN and executing a SLEEP instruction provides a quick method of switching from a given Run mode to its corresponding Idle mode. If the WDT is selected, the INTRC source will continue to operate. If the Timer1 oscillator is enabled, it will also continue to run. Since the CPU is not executing instructions, the only exits from any of the Idle modes are by interrupt, WDT time-out or a Reset. When a wake event occurs, CPU execution is delayed by an interval of TCSD (parameter 38, Table 26-10) while it becomes ready to execute code. When the CPU begins executing code, it resumes with the same clock source for the current Idle mode. For example, when waking from RC_IDLE mode, the internal oscillator block will clock the CPU and peripherals (in other words, RC_RUN mode). The IDLEN and SCS bits are not affected by the wake-up. While in any Idle mode or the Sleep mode, a WDT time-out will result in a WDT wake-up to the Run mode currently specified by the SCS1:SCS0 bits. FIGURE 3-5: TRANSITION TIMING FOR ENTRY TO SLEEP MODE FIGURE 3-6: TRANSITION TIMING FOR WAKE FROM SLEEP (HSPLL) Q2 Q3 Q4 OSC1 Peripheral Sleep Program Q1 Q1 Counter Clock CPU Clock PC PC + 2 Q3 Q4 Q1 Q2 OSC1 Peripheral Program PC PLL Clock Q3 Q4 Output CPU Clock Q1 Q2 Q3 Q4 Q1 Q2 Clock Counter PC + 4 PC + 6 Q1 Q2 Q3 Q4 Wake Event Note1: TOST = 1024 TOSC; TPLL = 2 ms (approx). These intervals are not shown to scale. TOST(1) TPLL(1) OSTS bit Set PC + 2PIC18F2420/2520/4420/4520 DS39631E-page 38 Advance Information © 2008 Microchip Technology Inc. 3.4.1 PRI_IDLE MODE This mode is unique among the three low-power Idle modes in that it does not disable the primary device clock. For timing-sensitive applications, this allows for the fastest resumption of device operation with its more accurate primary clock source, since the clock source does not have to “warm-up” or transition from another oscillator. PRI_IDLE mode is entered from PRI_RUN mode by setting the IDLEN bit and executing a SLEEP instruction. If the device is in another Run mode, set IDLEN first, then clear the SCS bits and execute SLEEP. Although the CPU is disabled, the peripherals continue to be clocked from the primary clock source specified by the FOSC<3:0> Configuration bits. The OSTS bit remains set (see Figure 3-7). When a wake event occurs, the CPU is clocked from the primary clock source. A delay of interval TCSD is required between the wake event and when code execution starts. This is required to allow the CPU to become ready to execute instructions. After the wakeup, the OSTS bit remains set. The IDLEN and SCS bits are not affected by the wake-up (see Figure 3-8). 3.4.2 SEC_IDLE MODE In SEC_IDLE mode, the CPU is disabled but the peripherals continue to be clocked from the Timer1 oscillator. This mode is entered from SEC_RUN by setting the IDLEN bit and executing a SLEEP instruction. If the device is in another Run mode, set the IDLEN bit first, then set the SCS<1:0> bits to ‘01’ and execute SLEEP. When the clock source is switched to the Timer1 oscillator, the primary oscillator is shut down, the OSTS bit is cleared and the T1RUN bit is set. When a wake event occurs, the peripherals continue to be clocked from the Timer1 oscillator. After an interval of TCSD, following the wake event, the CPU begins executing code being clocked by the Timer1 oscillator. The IDLEN and SCS bits are not affected by the wake-up; the Timer1 oscillator continues to run (see Figure 3-8). FIGURE 3-7: TRANSITION TIMING FOR ENTRY TO IDLE MODE FIGURE 3-8: TRANSITION TIMING FOR WAKE FROM IDLE TO RUN MODE Note: The Timer1 oscillator should already be running prior to entering SEC_IDLE mode. If the T1OSCEN bit is not set when the SLEEP instruction is executed, the SLEEP instruction will be ignored and entry to SEC_IDLE mode will not occur. If the Timer1 oscillator is enabled but not yet running, peripheral clocks will be delayed until the oscillator has started. In such situations, initial oscillator operation is far from stable and unpredictable operation may result. Q1 Peripheral Program PC PC + 2 OSC1 Q3 Q4 Q1 CPU Clock Clock Counter Q2 OSC1 Peripheral Program PC CPU Clock Q1 Q3 Q4 Clock Counter Q2 Wake Event TCSD© 2008 Microchip Technology Inc. Advance Information DS39631E-page 39 PIC18F2420/2520/4420/4520 3.4.3 RC_IDLE MODE In RC_IDLE mode, the CPU is disabled but the peripherals continue to be clocked from the internal oscillator block using the INTOSC multiplexer. This mode allows for controllable power conservation during Idle periods. From RC_RUN, this mode is entered by setting the IDLEN bit and executing a SLEEP instruction. If the device is in another Run mode, first set IDLEN, then set the SCS1 bit and execute SLEEP. Although its value is ignored, it is recommended that SCS0 also be cleared; this is to maintain software compatibility with future devices. The INTOSC multiplexer may be used to select a higher clock frequency by modifying the IRCF bits before executing the SLEEP instruction. When the clock source is switched to the INTOSC multiplexer, the primary oscillator is shut down and the OSTS bit is cleared. If the IRCF bits are set to any non-zero value, or the INTSRC bit is set, the INTOSC output is enabled. The IOFS bit becomes set, after the INTOSC output becomes stable, after an interval of TIOBST (parameter 39, Table 26-10). Clocks to the peripherals continue while the INTOSC source stabilizes. If the IRCF bits were previously at a non-zero value, or INTSRC was set before the SLEEP instruction was executed and the INTOSC source was already stable, the IOFS bit will remain set. If the IRCF bits and INTSRC are all clear, the INTOSC output will not be enabled, the IOFS bit will remain clear and there will be no indication of the current clock source. When a wake event occurs, the peripherals continue to be clocked from the INTOSC multiplexer. After a delay of TCSD following the wake event, the CPU begins executing code being clocked by the INTOSC multiplexer. The IDLEN and SCS bits are not affected by the wake-up. The INTRC source will continue to run if either the WDT or the Fail-Safe Clock Monitor is enabled. 3.5 Exiting Idle and Sleep Modes An exit from Sleep mode or any of the Idle modes is triggered by an interrupt, a Reset or a WDT time-out. This section discusses the triggers that cause exits from power-managed modes. The clocking subsystem actions are discussed in each of the power-managed modes (see Section 3.2 “Run Modes”, Section 3.3 “Sleep Mode” and Section 3.4 “Idle Modes”). 3.5.1 EXIT BY INTERRUPT Any of the available interrupt sources can cause the device to exit from an Idle mode or the Sleep mode to a Run mode. To enable this functionality, an interrupt source must be enabled by setting its enable bit in one of the INTCON or PIE registers. The exit sequence is initiated when the corresponding interrupt flag bit is set. On all exits from Idle or Sleep modes by interrupt, code execution branches to the interrupt vector if the GIE/ GIEH bit (INTCON<7>) is set. Otherwise, code execution continues or resumes without branching (see Section 9.0 “Interrupts”). A fixed delay of interval TCSD following the wake event is required when leaving Sleep and Idle modes. This delay is required for the CPU to prepare for execution. Instruction execution resumes on the first clock cycle following this delay. 3.5.2 EXIT BY WDT TIME-OUT A WDT time-out will cause different actions depending on which power-managed mode the device is in when the time-out occurs. If the device is not executing code (all Idle modes and Sleep mode), the time-out will result in an exit from the power-managed mode (see Section 3.2 “Run Modes” and Section 3.3 “Sleep Mode”). If the device is executing code (all Run modes), the time-out will result in a WDT Reset (see Section 23.2 “Watchdog Timer (WDT)”). The WDT timer and postscaler are cleared by executing a SLEEP or CLRWDT instruction, the loss of a currently selected clock source (if the Fail-Safe Clock Monitor is enabled) and modifying the IRCF bits in the OSCCON register if the internal oscillator block is the device clock source. 3.5.3 EXIT BY RESET Normally, the device is held in Reset by the Oscillator Start-up Timer (OST) until the primary clock becomes ready. At that time, the OSTS bit is set and the device begins executing code. If the internal oscillator block is the new clock source, the IOFS bit is set instead. The exit delay time from Reset to the start of code execution depends on both the clock sources before and after the wake-up and the type of oscillator if the new clock source is the primary clock. Exit delays are summarized in Table 3-2. Code execution can begin before the primary clock becomes ready. If either the Two-Speed Start-up (see Section 23.3 “Two-Speed Start-up”) or Fail-Safe Clock Monitor (see Section 23.4 “Fail-Safe Clock Monitor”) is enabled, the device may begin execution as soon as the Reset source has cleared. Execution is clocked by the INTOSC multiplexer driven by the internal oscillator block. Execution is clocked by the internal oscillator block until either the primary clock becomes ready or a power-managed mode is entered before the primary clock becomes ready; the primary clock is then shut down.PIC18F2420/2520/4420/4520 DS39631E-page 40 Advance Information © 2008 Microchip Technology Inc. 3.5.4 EXIT WITHOUT AN OSCILLATOR START-UP DELAY Certain exits from power-managed modes do not invoke the OST at all. There are two cases: • PRI_IDLE mode, where the primary clock source is not stopped and • the primary clock source is not any of the LP, XT, HS or HSPLL modes. In these instances, the primary clock source either does not require an oscillator start-up delay, since it is already running (PRI_IDLE), or normally does not require an oscillator start-up delay (RC, EC and INTIO Oscillator modes). However, a fixed delay of interval TCSD following the wake event is still required when leaving Sleep and Idle modes to allow the CPU to prepare for execution. Instruction execution resumes on the first clock cycle following this delay. TABLE 3-2: EXIT DELAY ON WAKE-UP BY RESET FROM SLEEP MODE OR ANY IDLE MODE (BY CLOCK SOURCES) Clock Source Before Wake-up Clock Source After Wake-up Exit Delay Clock Ready Status Bit (OSCCON) Primary Device Clock (PRI_IDLE mode) LP, XT, HS TCSD HSPLL (1) OSTS EC, RC INTOSC(2) IOFS T1OSC or INTRC(1) LP, XT, HS TOST(3) HSPLL TOST + trc OSTS (3) EC, RC TCSD(1) INTOSC(2) TCSD(1) IOFS INTOSC(2) LP, XT, HS TOST(3) HSPLL TOST + trc OSTS (3) EC, RC TCSD(1) INTOSC(2) TCSD(1) IOFS None (Sleep mode) LP, XT, HS TOST(3) HSPLL TOST + trc OSTS (3) EC, RC TCSD(1) INTOSC(2) TCSD(1) IOFS Note 1: TCSD (parameter 38) is a required delay when waking from Sleep and all Idle modes and runs concurrently with any other required delays (see Section 3.4 “Idle Modes”). On Reset, INTOSC defaults to 1 MHz. 2: Includes both the INTOSC 8 MHz source and postscaler derived frequencies. 3: TOST is the Oscillator Start-up Timer (parameter 32). trc is the PLL lock-out timer (parameter F12); it is also designated as TPLL.© 2008 Microchip Technology Inc. DS39631E-page 41 PIC18F2420/2520/4420/4520 4.0 RESET The PIC18F2420/2520/4420/4520 devices differentiate between various kinds of Reset: a) Power-on Reset (POR) b) MCLR Reset during normal operation c) MCLR Reset during power-managed modes d) Watchdog Timer (WDT) Reset (during execution) e) Programmable Brown-out Reset (BOR) f) RESET Instruction g) Stack Full Reset h) Stack Underflow Reset This section discusses Resets generated by MCLR, POR and BOR and covers the operation of the various start-up timers. Stack Reset events are covered in Section 5.1.2.4 “Stack Full and Underflow Resets”. WDT Resets are covered in Section 23.2 “Watchdog Timer (WDT)”. A simplified block diagram of the On-Chip Reset Circuit is shown in Figure 4-1. 4.1 RCON Register Device Reset events are tracked through the RCON register (Register 4-1). The lower five bits of the register indicate that a specific Reset event has occurred. In most cases, these bits can only be cleared by the event and must be set by the application after the event. The state of these flag bits, taken together, can be read to indicate the type of Reset that just occurred. This is described in more detail in Section 4.6 “Reset State of Registers”. The RCON register also has control bits for setting interrupt priority (IPEN) and software control of the BOR (SBOREN). Interrupt priority is discussed in Section 9.0 “Interrupts”. BOR is covered in Section 4.4 “Brown-out Reset (BOR)”. FIGURE 4-1: SIMPLIFIED BLOCK DIAGRAM OF ON-CHIP RESET CIRCUIT External Reset MCLR VDD OSC1 WDT Time-out VDD Rise Detect OST/PWRT INTRC(1) POR Pulse OST 10-Bit Ripple Counter PWRT 11-Bit Ripple Counter Enable OST(2) Enable PWRT Note 1: This is the INTRC source from the internal oscillator block and is separate from the RC oscillator of the CLKI pin. 2: See Table 4-2 for time-out situations. Brown-out Reset BOREN RESET Instruction Stack Pointer Stack Full/Underflow Reset Sleep ( )_IDLE 1024 Cycles 65.5 ms 32 μs MCLRE S R Q Chip_ResetPIC18F2420/2520/4420/4520 DS39631E-page 42 © 2008 Microchip Technology Inc. REGISTER 4-1: RCON: RESET CONTROL REGISTER R/W-0 R/W-1(1) U-0 R/W-1 R-1 R-1 R/W-0(2) R/W-0 IPEN SBOREN — RI TO PD POR BOR bit 7 bit 0 Legend: R = Readable bit W = Writable bit U = Unimplemented bit, read as ‘0’ -n = Value at POR ‘1’ = Bit is set ‘0’ = Bit is cleared x = Bit is unknown bit 7 IPEN: Interrupt Priority Enable bit 1 = Enable priority levels on interrupts 0 = Disable priority levels on interrupts (PIC16CXXX Compatibility mode) bit 6 SBOREN: BOR Software Enable bit(1) If BOREN1:BOREN0 = 01: 1 = BOR is enabled 0 = BOR is disabled If BOREN1:BOREN0 = 00, 10 or 11: Bit is disabled and read as ‘0’. bit 5 Unimplemented: Read as ‘0’ bit 4 RI: RESET Instruction Flag bit 1 = The RESET instruction was not executed (set by firmware only) 0 = The RESET instruction was executed causing a device Reset (must be set in software after a Brown-out Reset occurs) bit 3 TO: Watchdog Time-out Flag bit 1 = Set by power-up, CLRWDT instruction or SLEEP instruction 0 = A WDT time-out occurred bit 2 PD: Power-Down Detection Flag bit 1 = Set by power-up or by the CLRWDT instruction 0 = Set by execution of the SLEEP instruction bit 1 POR: Power-on Reset Status bit 1 = A Power-on Reset has not occurred (set by firmware only) 0 = A Power-on Reset occurred (must be set in software after a Power-on Reset occurs) bit 0 BOR: Brown-out Reset Status bit 1 = A Brown-out Reset has not occurred (set by firmware only) 0 = A Brown-out Reset occurred (must be set in software after a Brown-out Reset occurs) Note 1: If SBOREN is enabled, its Reset state is ‘1’; otherwise, it is ‘0’. 2: The actual Reset value of POR is determined by the type of device Reset. See the notes following this register and Section 4.6 “Reset State of Registers” for additional information. Note 1: It is recommended that the POR bit be set after a Power-on Reset has been detected so that subsequent Power-on Resets may be detected. 2: Brown-out Reset is said to have occurred when BOR is ‘0’ and POR is ‘1’ (assuming that POR was set to ‘1’ by software immediately after a Power-on Reset).© 2008 Microchip Technology Inc. DS39631E-page 43 PIC18F2420/2520/4420/4520 4.2 Master Clear (MCLR) The MCLR pin provides a method for triggering an external Reset of the device. A Reset is generated by holding the pin low. These devices have a noise filter in the MCLR Reset path which detects and ignores small pulses. The MCLR pin is not driven low by any internal Resets, including the WDT. In PIC18F2420/2520/4420/4520 devices, the MCLR input can be disabled with the MCLRE Configuration bit. When MCLR is disabled, the pin becomes a digital input. See Section 10.5 “PORTE, TRISE and LATE Registers” for more information. 4.3 Power-on Reset (POR) A Power-on Reset pulse is generated on-chip whenever VDD rises above a certain threshold. This allows the device to start in the initialized state when VDD is adequate for operation. To take advantage of the POR circuitry, tie the MCLR pin through a resistor (1 kΩ to 10 kΩ) to VDD. This will eliminate external RC components usually needed to create a Power-on Reset delay. A minimum rise rate for VDD is specified (parameter D004). For a slow rise time, see Figure 4-2. When the device starts normal operation (i.e., exits the Reset condition), device operating parameters (voltage, frequency, temperature, etc.) must be met to ensure operation. If these conditions are not met, the device must be held in Reset until the operating conditions are met. POR events are captured by the POR bit (RCON<1>). The state of the bit is set to ‘0’ whenever a POR occurs; it does not change for any other Reset event. POR is not reset to ‘1’ by any hardware event. To capture multiple events, the user manually resets the bit to ‘1’ in software following any POR. FIGURE 4-2: EXTERNAL POWER-ON RESET CIRCUIT (FOR SLOW VDD POWER-UP) Note 1: External Power-on Reset circuit is required only if the VDD power-up slope is too slow. The diode D helps discharge the capacitor quickly when VDD powers down. 2: R < 40 kΩ is recommended to make sure that the voltage drop across R does not violate the device’s electrical specification. 3: R1 ≥ 1 kΩ will limit any current flowing into MCLR from external capacitor C, in the event of MCLR/VPP pin breakdown, due to Electrostatic Discharge (ESD) or Electrical Overstress (EOS). C R1 D R VDD MCLR PIC18FXXXX VDDPIC18F2420/2520/4420/4520 DS39631E-page 44 © 2008 Microchip Technology Inc. 4.4 Brown-out Reset (BOR) PIC18F2420/2520/4420/4520 devices implement a BOR circuit that provides the user with a number of configuration and power-saving options. The BOR is controlled by the BORV<1:0> and BOREN<1:0> Configuration bits. There are a total of four BOR configurations which are summarized in Table 4-1. The BOR threshold is set by the BORV<1:0> bits. If BOR is enabled (any values of BOREN<1:0>, except ‘00’), any drop of VDD below VBOR (parameter D005) for greater than TBOR (parameter 35) will reset the device. A Reset may or may not occur if VDD falls below VBOR for less than TBOR. The chip will remain in Brown-out Reset until VDD rises above VBOR. If the Power-up Timer is enabled, it will be invoked after VDD rises above VBOR; it then will keep the chip in Reset for an additional time delay, TPWRT (parameter 33). If VDD drops below VBOR while the Power-up Timer is running, the chip will go back into a Brown-out Reset and the Power-up Timer will be initialized. Once VDD rises above VBOR, the Power-up Timer will execute the additional time delay. BOR and the Power-up Timer (PWRT) are independently configured. Enabling the Brown-out Reset does not automatically enable the PWRT. 4.4.1 SOFTWARE ENABLED BOR When BOREN<1:0> = 01, the BOR can be enabled or disabled by the user in software. This is done with the control bit, SBOREN (RCON<6>). Setting SBOREN enables the BOR to function as previously described. Clearing SBOREN disables the BOR entirely. The SBOREN bit operates only in this mode; otherwise it is read as ‘0’. Placing the BOR under software control gives the user the additional flexibility of tailoring the application to its environment without having to reprogram the device to change BOR configuration. It also allows the user to tailor device power consumption in software by eliminating the incremental current that the BOR consumes. While the BOR current is typically very small, it may have some impact in low-power applications. 4.4.2 DETECTING BOR When BOR is enabled, the BOR bit always resets to ‘0’ on any BOR or POR event. This makes it difficult to determine if a BOR event has occurred just by reading the state of BOR alone. A more reliable method is to simultaneously check the state of both POR and BOR. This assumes that the POR bit is reset to ‘1’ in software immediately after any POR event. If BOR is ‘0’ while POR is ‘1’, it can be reliably assumed that a BOR event has occurred. 4.4.3 DISABLING BOR IN SLEEP MODE When BOREN<1:0> = 10, the BOR remains under hardware control and operates as previously described. Whenever the device enters Sleep mode, however, the BOR is automatically disabled. When the device returns to any other operating mode, BOR is automatically re-enabled. This mode allows for applications to recover from brown-out situations, while actively executing code, when the device requires BOR protection the most. At the same time, it saves additional power in Sleep mode by eliminating the small incremental BOR current. TABLE 4-1: BOR CONFIGURATIONS Note: Even when BOR is under software control, the Brown-out Reset voltage level is still set by the BORV<1:0> Configuration bits; it cannot be changed in software. BOR Configuration Status of SBOREN (RCON<6>) BOR Operation BOREN1 BOREN0 0 0 Unavailable BOR disabled; must be enabled by reprogramming the Configuration bits. 0 1 Available BOR enabled in software; operation controlled by SBOREN. 1 0 Unavailable BOR enabled in hardware in Run and Idle modes, disabled during Sleep mode. 1 1 Unavailable BOR enabled in hardware; must be disabled by reprogramming the Configuration bits.© 2008 Microchip Technology Inc. DS39631E-page 45 PIC18F2420/2520/4420/4520 4.5 Device Reset Timers PIC18F2420/2520/4420/4520 devices incorporate three separate on-chip timers that help regulate the Power-on Reset process. Their main function is to ensure that the device clock is stable before code is executed. These timers are: • Power-up Timer (PWRT) • Oscillator Start-up Timer (OST) • PLL Lock Time-out 4.5.1 POWER-UP TIMER (PWRT) The Power-up Timer (PWRT) of PIC18F2420/2520/ 4420/4520 devices is an 11-bit counter which uses the INTRC source as the clock input. This yields an approximate time interval of 2048 x 32 μs = 65.6 ms. While the PWRT is counting, the device is held in Reset. The power-up time delay depends on the INTRC clock and will vary from chip to chip due to temperature and process variation. See DC parameter 33 for details. The PWRT is enabled by clearing the PWRTEN Configuration bit. 4.5.2 OSCILLATOR START-UP TIMER (OST) The Oscillator Start-up Timer (OST) provides a 1024 oscillator cycle (from OSC1 input) delay after the PWRT delay is over (parameter 33). This ensures that the crystal oscillator or resonator has started and stabilized. The OST time-out is invoked only for XT, LP, HS and HSPLL modes and only on Power-on Reset, or on exit from most power-managed modes. 4.5.3 PLL LOCK TIME-OUT With the PLL enabled in its PLL mode, the time-out sequence following a Power-on Reset is slightly different from other oscillator modes. A separate timer is used to provide a fixed time-out that is sufficient for the PLL to lock to the main oscillator frequency. This PLL lock time-out (TPLL) is typically 2 ms and follows the oscillator start-up time-out. 4.5.4 TIME-OUT SEQUENCE On power-up, the time-out sequence is as follows: 1. After the POR pulse has cleared, PWRT time-out is invoked (if enabled). 2. Then, the OST is activated. The total time-out will vary based on oscillator configuration and the status of the PWRT. Figure 4-3, Figure 4-4, Figure 4-5, Figure 4-6 and Figure 4-7 all depict time-out sequences on power-up, with the Power-up Timer enabled and the device operating in HS Oscillator mode. Figure 4-3 through Figure 4-6 also apply to devices operating in XT or LP modes. For devices in RC mode and with the PWRT disabled, on the other hand, there will be no time-out at all. Since the time-outs occur from the POR pulse, if MCLR is kept low long enough, all time-outs will expire. Bringing MCLR high will begin execution immediately (Figure 4-5). This is useful for testing purposes or to synchronize more than one PIC18FXXXX device operating in parallel. TABLE 4-2: TIME-OUT IN VARIOUS SITUATIONS Oscillator Configuration Power-up(2) and Brown-out Exit from Power-Managed Mode PWRTEN = 0 PWRTEN = 1 HSPLL 66 ms(1) + 1024 TOSC + 2 ms(2) 1024 TOSC + 2 ms(2) 1024 TOSC + 2 ms(2) HS, XT, LP 66 ms(1) + 1024 TOSC 1024 TOSC 1024 TOSC EC, ECIO 66 ms(1) — — RC, RCIO 66 ms(1) — — INTIO1, INTIO2 66 ms(1) — — Note 1: 66 ms (65.5 ms) is the nominal Power-up Timer (PWRT) delay. 2: 2 ms is the nominal time required for the PLL to lock.PIC18F2420/2520/4420/4520 DS39631E-page 46 © 2008 Microchip Technology Inc. FIGURE 4-3: TIME-OUT SEQUENCE ON POWER-UP (MCLR TIED TO VDD, VDD RISE < TPWRT) FIGURE 4-4: TIME-OUT SEQUENCE ON POWER-UP (MCLR NOT TIED TO VDD): CASE 1 FIGURE 4-5: TIME-OUT SEQUENCE ON POWER-UP (MCLR NOT TIED TO VDD): CASE 2 TPWRT TOST VDD MCLR INTERNAL POR PWRT TIME-OUT OST TIME-OUT INTERNAL RESET TPWRT TOST VDD MCLR INTERNAL POR PWRT TIME-OUT OST TIME-OUT INTERNAL RESET VDD MCLR INTERNAL POR PWRT TIME-OUT OST TIME-OUT INTERNAL RESET TPWRT TOST© 2008 Microchip Technology Inc. DS39631E-page 47 PIC18F2420/2520/4420/4520 FIGURE 4-6: SLOW RISE TIME (MCLR TIED TO VDD, VDD RISE > TPWRT) FIGURE 4-7: TIME-OUT SEQUENCE ON POR W/PLL ENABLED (MCLR TIED TO VDD) VDD MCLR INTERNAL POR PWRT TIME-OUT OST TIME-OUT INTERNAL RESET 0V 5V TPWRT TOST TPWRT TOST VDD MCLR INTERNAL POR PWRT TIME-OUT OST TIME-OUT INTERNAL RESET PLL TIME-OUT TPLL Note: TOST = 1024 clock cycles. TPLL ≈ 2 ms max. First three stages of the PWRT timer.PIC18F2420/2520/4420/4520 DS39631E-page 48 © 2008 Microchip Technology Inc. 4.6 Reset State of Registers Most registers are unaffected by a Reset. Their status is unknown on POR and unchanged by all other Resets. The other registers are forced to a “Reset state” depending on the type of Reset that occurred. Most registers are not affected by a WDT wake-up, since this is viewed as the resumption of normal operation. Status bits from the RCON register, RI, TO, PD, POR and BOR, are set or cleared differently in different Reset situations, as indicated in Table 4-3. These bits are used in software to determine the nature of the Reset. Table 4-4 describes the Reset states for all of the Special Function Registers. These are categorized by Power-on and Brown-out Resets, Master Clear and WDT Resets and WDT wake-ups. TABLE 4-3: STATUS BITS, THEIR SIGNIFICANCE AND THE INITIALIZATION CONDITION FOR RCON REGISTER Condition Program Counter RCON Register STKPTR Register RI TO PD POR BOR STKFUL STKUNF Power-on Reset 0000h 11100 0 0 RESET Instruction 0000h 0uuuu u u Brown-out Reset 0000h 111u0 u u MCLR Reset during Power-Managed Run Modes 0000h u1uuu u u MCLR Reset during Power-Managed Idle Modes and Sleep Mode 0000h u10uu u u WDT Time-out during Full Power or Power-Managed Run Mode 0000h u0uuu u u MCLR Reset during Full-Power Execution 0000h uuuuu u u Stack Full Reset (STVREN = 1) 0000h uuuuu 1 u Stack Underflow Reset (STVREN = 1) 0000h uuuuu u 1 Stack Underflow Error (not an actual Reset, STVREN = 0) 0000h uuuuu u 1 WDT Time-out during Power-Managed Idle or Sleep Modes PC + 2 u00uu u u Interrupt Exit from Power-Managed Modes PC + 2(1) uu0uu u u Legend: u = unchanged Note 1: When the wake-up is due to an interrupt and the GIEH or GIEL bits are set, the PC is loaded with the interrupt vector (008h or 0018h).© 2008 Microchip Technology Inc. DS39631E-page 49 PIC18F2420/2520/4420/4520 TABLE 4-4: INITIALIZATION CONDITIONS FOR ALL REGISTERS Register Applicable Devices Power-on Reset, Brown-out Reset MCLR Resets, WDT Reset, RESET Instruction, Stack Resets Wake-up via WDT or Interrupt TOSU 2420 2520 4420 4520 ---0 0000 ---0 0000 ---0 uuuu(3) TOSH 2420 2520 4420 4520 0000 0000 0000 0000 uuuu uuuu(3) TOSL 2420 2520 4420 4520 0000 0000 0000 0000 uuuu uuuu(3) STKPTR 2420 2520 4420 4520 00-0 0000 uu-0 0000 uu-u uuuu(3) PCLATU 2420 2520 4420 4520 ---0 0000 ---0 0000 ---u uuuu PCLATH 2420 2520 4420 4520 0000 0000 0000 0000 uuuu uuuu PCL 2420 2520 4420 4520 0000 0000 0000 0000 PC + 2(2) TBLPTRU 2420 2520 4420 4520 --00 0000 --00 0000 --uu uuuu TBLPTRH 2420 2520 4420 4520 0000 0000 0000 0000 uuuu uuuu TBLPTRL 2420 2520 4420 4520 0000 0000 0000 0000 uuuu uuuu TABLAT 2420 2520 4420 4520 0000 0000 0000 0000 uuuu uuuu PRODH 2420 2520 4420 4520 xxxx xxxx uuuu uuuu uuuu uuuu PRODL 2420 2520 4420 4520 xxxx xxxx uuuu uuuu uuuu uuuu INTCON 2420 2520 4420 4520 0000 000x 0000 000u uuuu uuuu(1) INTCON2 2420 2520 4420 4520 1111 -1-1 1111 -1-1 uuuu -u-u(1) INTCON3 2420 2520 4420 4520 11-0 0-00 11-0 0-00 uu-u u-uu(1) INDF0 2420 2520 4420 4520 N/A N/A N/A POSTINC0 2420 2520 4420 4520 N/A N/A N/A POSTDEC0 2420 2520 4420 4520 N/A N/A N/A PREINC0 2420 2520 4420 4520 N/A N/A N/A PLUSW0 2420 2520 4420 4520 N/A N/A N/A FSR0H 2420 2520 4420 4520 ---- 0000 ---- 0000 ---- uuuu FSR0L 2420 2520 4420 4520 xxxx xxxx uuuu uuuu uuuu uuuu WREG 2420 2520 4420 4520 xxxx xxxx uuuu uuuu uuuu uuuu INDF1 2420 2520 4420 4520 N/A N/A N/A POSTINC1 2420 2520 4420 4520 N/A N/A N/A POSTDEC1 2420 2520 4420 4520 N/A N/A N/A PREINC1 2420 2520 4420 4520 N/A N/A N/A PLUSW1 2420 2520 4420 4520 N/A N/A N/A Legend: u = unchanged, x = unknown, - = unimplemented bit, read as ‘0’, q = value depends on condition. Shaded cells indicate conditions do not apply for the designated device. Note 1: One or more bits in the INTCONx or PIRx registers will be affected (to cause wake-up). 2: When the wake-up is due to an interrupt and the GIEL or GIEH bit is set, the PC is loaded with the interrupt vector (0008h or 0018h). 3: When the wake-up is due to an interrupt and the GIEL or GIEH bit is set, the TOSU, TOSH and TOSL are updated with the current value of the PC. The STKPTR is modified to point to the next location in the hardware stack. 4: See Table 4-3 for Reset value for specific condition. 5: Bits 6 and 7 of PORTA, LATA and TRISA are enabled depending on the oscillator mode selected. When not enabled as PORTA pins, they are disabled and read ‘0’. 6: The Reset value of the PCFG bits depends on the value of the PBADEN Configuration bit (CONFIG3H<1>). When PBADEN = 1, PCFG<2:0> = 000; when PBADEN = 0, PCFG<2:0> = 111.PIC18F2420/2520/4420/4520 DS39631E-page 50 © 2008 Microchip Technology Inc. FSR1H 2420 2520 4420 4520 ---- 0000 ---- 0000 ---- uuuu FSR1L 2420 2520 4420 4520 xxxx xxxx uuuu uuuu uuuu uuuu BSR 2420 2520 4420 4520 ---- 0000 ---- 0000 ---- uuuu INDF2 2420 2520 4420 4520 N/A N/A N/A POSTINC2 2420 2520 4420 4520 N/A N/A N/A POSTDEC2 2420 2520 4420 4520 N/A N/A N/A PREINC2 2420 2520 4420 4520 N/A N/A N/A PLUSW2 2420 2520 4420 4520 N/A N/A N/A FSR2H 2420 2520 4420 4520 ---- 0000 ---- 0000 ---- uuuu FSR2L 2420 2520 4420 4520 xxxx xxxx uuuu uuuu uuuu uuuu STATUS 2420 2520 4420 4520 ---x xxxx ---u uuuu ---u uuuu TMR0H 2420 2520 4420 4520 0000 0000 0000 0000 uuuu uuuu TMR0L 2420 2520 4420 4520 xxxx xxxx uuuu uuuu uuuu uuuu T0CON 2420 2520 4420 4520 1111 1111 1111 1111 uuuu uuuu OSCCON 2420 2520 4420 4520 0100 q000 0100 q000 uuuu quuu HLVDCON 2420 2520 4420 4520 0-00 0101 0-00 0101 u-uu uuuu WDTCON 2420 2520 4420 4520 ---- ---0 ---- ---0 ---- ---u RCON(4) 2420 2520 4420 4520 0q-1 11q0 0q-q qquu uq-u qquu TMR1H 2420 2520 4420 4520 xxxx xxxx uuuu uuuu uuuu uuuu TMR1L 2420 2520 4420 4520 xxxx xxxx uuuu uuuu uuuu uuuu T1CON 2420 2520 4420 4520 0000 0000 u0uu uuuu uuuu uuuu TMR2 2420 2520 4420 4520 0000 0000 0000 0000 uuuu uuuu PR2 2420 2520 4420 4520 1111 1111 1111 1111 1111 1111 T2CON 2420 2520 4420 4520 -000 0000 -000 0000 -uuu uuuu SSPBUF 2420 2520 4420 4520 xxxx xxxx uuuu uuuu uuuu uuuu SSPADD 2420 2520 4420 4520 0000 0000 0000 0000 uuuu uuuu SSPSTAT 2420 2520 4420 4520 0000 0000 0000 0000 uuuu uuuu SSPCON1 2420 2520 4420 4520 0000 0000 0000 0000 uuuu uuuu SSPCON2 2420 2520 4420 4520 0000 0000 0000 0000 uuuu uuuu TABLE 4-4: INITIALIZATION CONDITIONS FOR ALL REGISTERS (CONTINUED) Register Applicable Devices Power-on Reset, Brown-out Reset MCLR Resets, WDT Reset, RESET Instruction, Stack Resets Wake-up via WDT or Interrupt Legend: u = unchanged, x = unknown, - = unimplemented bit, read as ‘0’, q = value depends on condition. Shaded cells indicate conditions do not apply for the designated device. Note 1: One or more bits in the INTCONx or PIRx registers will be affected (to cause wake-up). 2: When the wake-up is due to an interrupt and the GIEL or GIEH bit is set, the PC is loaded with the interrupt vector (0008h or 0018h). 3: When the wake-up is due to an interrupt and the GIEL or GIEH bit is set, the TOSU, TOSH and TOSL are updated with the current value of the PC. The STKPTR is modified to point to the next location in the hardware stack. 4: See Table 4-3 for Reset value for specific condition. 5: Bits 6 and 7 of PORTA, LATA and TRISA are enabled depending on the oscillator mode selected. When not enabled as PORTA pins, they are disabled and read ‘0’. 6: The Reset value of the PCFG bits depends on the value of the PBADEN Configuration bit (CONFIG3H<1>). When PBADEN = 1, PCFG<2:0> = 000; when PBADEN = 0, PCFG<2:0> = 111.© 2008 Microchip Technology Inc. DS39631E-page 51 PIC18F2420/2520/4420/4520 ADRESH 2420 2520 4420 4520 xxxx xxxx uuuu uuuu uuuu uuuu ADRESL 2420 2520 4420 4520 xxxx xxxx uuuu uuuu uuuu uuuu ADCON0 2420 2520 4420 4520 --00 0000 --00 0000 --uu uuuu ADCON1 2420 2520 4420 4520 --00 0qqq(6) --00 0qqq(6) --uu uuuu ADCON2 2420 2520 4420 4520 0-00 0000 0-00 0000 u-uu uuuu CCPR1H 2420 2520 4420 4520 xxxx xxxx uuuu uuuu uuuu uuuu CCPR1L 2420 2520 4420 4520 xxxx xxxx uuuu uuuu uuuu uuuu CCP1CON 2420 2520 4420 4520 0000 0000 0000 0000 uuuu uuuu 2420 2520 4420 4520 --00 0000 --00 0000 --uu uuuu CCPR2H 2420 2520 4420 4520 xxxx xxxx uuuu uuuu uuuu uuuu CCPR2L 2420 2520 4420 4520 xxxx xxxx uuuu uuuu uuuu uuuu CCP2CON 2420 2520 4420 4520 --00 0000 --00 0000 --uu uuuu BAUDCON 2420 2520 4420 4520 0100 0-00 0100 0-00 uuuu u-uu PWM1CON 2420 2520 4420 4520 0000 0000 0000 0000 uuuu uuuu ECCP1AS 2420 2520 4420 4520 0000 0000 0000 0000 uuuu uuuu 2420 2520 4420 4520 0000 00-- 0000 00-- uuuu uu-- CVRCON 2420 2520 4420 4520 0000 0000 0000 0000 uuuu uuuu CMCON 2420 2520 4420 4520 0000 0111 0000 0111 uuuu uuuu TMR3H 2420 2520 4420 4520 xxxx xxxx uuuu uuuu uuuu uuuu TMR3L 2420 2520 4420 4520 xxxx xxxx uuuu uuuu uuuu uuuu T3CON 2420 2520 4420 4520 0000 0000 uuuu uuuu uuuu uuuu SPBRGH 2420 2520 4420 4520 0000 0000 0000 0000 uuuu uuuu SPBRG 2420 2520 4420 4520 0000 0000 0000 0000 uuuu uuuu RCREG 2420 2520 4420 4520 0000 0000 0000 0000 uuuu uuuu TXREG 2420 2520 4420 4520 0000 0000 0000 0000 uuuu uuuu TXSTA 2420 2520 4420 4520 0000 0010 0000 0010 uuuu uuuu RCSTA 2420 2520 4420 4520 0000 000x 0000 000x uuuu uuuu EEADR 2420 2520 4420 4520 0000 0000 0000 0000 uuuu uuuu EEDATA 2420 2520 4420 4520 0000 0000 0000 0000 uuuu uuuu EECON2 2420 2520 4420 4520 0000 0000 0000 0000 0000 0000 EECON1 2420 2520 4420 4520 xx-0 x000 uu-0 u000 uu-0 u000 TABLE 4-4: INITIALIZATION CONDITIONS FOR ALL REGISTERS (CONTINUED) Register Applicable Devices Power-on Reset, Brown-out Reset MCLR Resets, WDT Reset, RESET Instruction, Stack Resets Wake-up via WDT or Interrupt Legend: u = unchanged, x = unknown, - = unimplemented bit, read as ‘0’, q = value depends on condition. Shaded cells indicate conditions do not apply for the designated device. Note 1: One or more bits in the INTCONx or PIRx registers will be affected (to cause wake-up). 2: When the wake-up is due to an interrupt and the GIEL or GIEH bit is set, the PC is loaded with the interrupt vector (0008h or 0018h). 3: When the wake-up is due to an interrupt and the GIEL or GIEH bit is set, the TOSU, TOSH and TOSL are updated with the current value of the PC. The STKPTR is modified to point to the next location in the hardware stack. 4: See Table 4-3 for Reset value for specific condition. 5: Bits 6 and 7 of PORTA, LATA and TRISA are enabled depending on the oscillator mode selected. When not enabled as PORTA pins, they are disabled and read ‘0’. 6: The Reset value of the PCFG bits depends on the value of the PBADEN Configuration bit (CONFIG3H<1>). When PBADEN = 1, PCFG<2:0> = 000; when PBADEN = 0, PCFG<2:0> = 111.PIC18F2420/2520/4420/4520 DS39631E-page 52 © 2008 Microchip Technology Inc. IPR2 2420 2520 4420 4520 11-1 1111 11-1 1111 uu-u uuuu PIR2 2420 2520 4420 4520 00-0 0000 00-0 0000 uu-u uuuu(1) PIE2 2420 2520 4420 4520 00-0 0000 00-0 0000 uu-u uuuu IPR1 2420 2520 4420 4520 1111 1111 1111 1111 uuuu uuuu 2420 2520 4420 4520 -111 1111 -111 1111 -uuu uuuu PIR1 2420 2520 4420 4520 0000 0000 0000 0000 uuuu uuuu(1) 2420 2520 4420 4520 -000 0000 -000 0000 -uuu uuuu(1) PIE1 2420 2520 4420 4520 0000 0000 0000 0000 uuuu uuuu 2420 2520 4420 4520 -000 0000 -000 0000 -uuu uuuu OSCTUNE 2420 2520 4420 4520 00-0 0000 00-0 0000 uu-u uuuu TRISE 2420 2520 4420 4520 0000 -111 0000 -111 uuuu -uuu TRISD 2420 2520 4420 4520 1111 1111 1111 1111 uuuu uuuu TRISC 2420 2520 4420 4520 1111 1111 1111 1111 uuuu uuuu TRISB 2420 2520 4420 4520 1111 1111 1111 1111 uuuu uuuu TRISA(5) 2420 2520 4420 4520 1111 1111(5) 1111 1111(5) uuuu uuuu(5) LATE 2420 2520 4420 4520 ---- -xxx ---- -uuu ---- -uuu LATD 2420 2520 4420 4520 xxxx xxxx uuuu uuuu uuuu uuuu LATC 2420 2520 4420 4520 xxxx xxxx uuuu uuuu uuuu uuuu LATB 2420 2520 4420 4520 xxxx xxxx uuuu uuuu uuuu uuuu LATA(5) 2420 2520 4420 4520 xxxx xxxx(5) uuuu uuuu(5) uuuu uuuu(5) PORTE 2420 2520 4420 4520 ---- xxxx ---- uuuu ---- uuuu PORTD 2420 2520 4420 4520 xxxx xxxx uuuu uuuu uuuu uuuu PORTC 2420 2520 4420 4520 xxxx xxxx uuuu uuuu uuuu uuuu PORTB 2420 2520 4420 4520 xxxx xxxx uuuu uuuu uuuu uuuu PORTA(5) 2420 2520 4420 4520 xx0x 0000(5) uu0u 0000(5) uuuu uuuu(5) TABLE 4-4: INITIALIZATION CONDITIONS FOR ALL REGISTERS (CONTINUED) Register Applicable Devices Power-on Reset, Brown-out Reset MCLR Resets, WDT Reset, RESET Instruction, Stack Resets Wake-up via WDT or Interrupt Legend: u = unchanged, x = unknown, - = unimplemented bit, read as ‘0’, q = value depends on condition. Shaded cells indicate conditions do not apply for the designated device. Note 1: One or more bits in the INTCONx or PIRx registers will be affected (to cause wake-up). 2: When the wake-up is due to an interrupt and the GIEL or GIEH bit is set, the PC is loaded with the interrupt vector (0008h or 0018h). 3: When the wake-up is due to an interrupt and the GIEL or GIEH bit is set, the TOSU, TOSH and TOSL are updated with the current value of the PC. The STKPTR is modified to point to the next location in the hardware stack. 4: See Table 4-3 for Reset value for specific condition. 5: Bits 6 and 7 of PORTA, LATA and TRISA are enabled depending on the oscillator mode selected. When not enabled as PORTA pins, they are disabled and read ‘0’. 6: The Reset value of the PCFG bits depends on the value of the PBADEN Configuration bit (CONFIG3H<1>). When PBADEN = 1, PCFG<2:0> = 000; when PBADEN = 0, PCFG<2:0> = 111.© 2008 Microchip Technology Inc. DS39631E-page 53 PIC18F2420/2520/4420/4520 5.0 MEMORY ORGANIZATION There are three types of memory in PIC18 enhanced microcontroller devices: • Program Memory • Data RAM • Data EEPROM As Harvard architecture devices, the data and program memories use separate busses; this allows for concurrent access of the two memory spaces. The data EEPROM, for practical purposes, can be regarded as a peripheral device, since it is addressed and accessed through a set of control registers. Additional detailed information on the operation of the Flash program memory is provided in Section 6.0 “Flash Program Memory”. Data EEPROM is discussed separately in Section 7.0 “Data EEPROM Memory”. 5.1 Program Memory Organization PIC18 microcontrollers implement a 21-bit program counter, which is capable of addressing a 2-Mbyte program memory space. Accessing a location between the upper boundary of the physically implemented memory and the 2-Mbyte address will return all ‘0’s (a NOP instruction). The PIC18F2420 and PIC18F4420 each have 16 Kbytes of Flash memory and can store up to 8,192 single-word instructions. The PIC18F2520 and PIC18F4520 each have 32 Kbytes of Flash memory and can store up to 16,384 single-word instructions. PIC18 devices have two interrupt vectors. The Reset vector address is at 0000h and the interrupt vector addresses are at 0008h and 0018h. The program memory map for PIC18F2420/2520/ 4420/4520 devices is shown in Figure 5-1. FIGURE 5-1: PROGRAM MEMORY MAP AND STACK FOR PIC18F2420/2520/4420/4520 DEVICES PC<20:0> Stack Level 1 • Stack Level 31 Reset Vector Low-Priority Interrupt Vector • • CALL,RCALL,RETURN RETFIE,RETLW 21 0000h 0018h On-Chip Program Memory High-Priority Interrupt Vector 0008h User Memory Space 1FFFFFh 4000h 3FFFh Read ‘0’ 200000h 8000h 7FFFh On-Chip Program Memory Read ‘0’ PIC18F2420/4420 PIC18F2520/4520PIC18F2420/2520/4420/4520 DS39631E-page 54 © 2008 Microchip Technology Inc. 5.1.1 PROGRAM COUNTER The Program Counter (PC) specifies the address of the instruction to fetch for execution. The PC is 21 bits wide and is contained in three separate 8-bit registers. The low byte, known as the PCL register, is both readable and writable. The high byte, or PCH register, contains the PC<15:8> bits; it is not directly readable or writable. Updates to the PCH register are performed through the PCLATH register. The upper byte is called PCU. This register contains the PC<20:16> bits; it is also not directly readable or writable. Updates to the PCU register are performed through the PCLATU register. The contents of PCLATH and PCLATU are transferred to the program counter by any operation that writes PCL. Similarly, the upper two bytes of the program counter are transferred to PCLATH and PCLATU by an operation that reads PCL. This is useful for computed offsets to the PC (see Section 5.1.4.1 “Computed GOTO”). The PC addresses bytes in the program memory. To prevent the PC from becoming misaligned with word instructions, the Least Significant bit of PCL is fixed to a value of ‘0’. The PC increments by 2 to address sequential instructions in the program memory. The CALL, RCALL, GOTO and program branch instructions write to the program counter directly. For these instructions, the contents of PCLATH and PCLATU are not transferred to the program counter. 5.1.2 RETURN ADDRESS STACK The return address stack allows any combination of up to 31 program calls and interrupts to occur. The PC is pushed onto the stack when a CALL or RCALL instruction is executed or an interrupt is Acknowledged. The PC value is pulled off the stack on a RETURN, RETLW or a RETFIE instruction. PCLATU and PCLATH are not affected by any of the RETURN or CALL instructions. The stack operates as a 31-word by 21-bit RAM and a 5-bit Stack Pointer, STKPTR. The stack space is not part of either program or data space. The Stack Pointer is readable and writable and the address on the top of the stack is readable and writable through the Top-ofStack (TOS) Special Function Registers. Data can also be pushed to, or popped from the stack, using these registers. A CALL type instruction causes a push onto the stack; the Stack Pointer is first incremented and the location pointed to by the Stack Pointer is written with the contents of the PC (already pointing to the instruction following the CALL). A RETURN type instruction causes a pop from the stack; the contents of the location pointed to by the STKPTR are transferred to the PC and then the Stack Pointer is decremented. The Stack Pointer is initialized to ‘00000’ after all Resets. There is no RAM associated with the location corresponding to a Stack Pointer value of ‘00000’; this is only a Reset value. Status bits indicate if the stack is full, or has overflowed or underflowed. 5.1.2.1 Top-of-Stack Access Only the top of the return address stack (TOS) is readable and writable. A set of three registers, TOSU:TOSH:TOSL, hold the contents of the stack location pointed to by the STKPTR register (Figure 5-2). This allows users to implement a software stack if necessary. After a CALL, RCALL or interrupt, the software can read the pushed value by reading the TOSU:TOSH:TOSL registers. These values can be placed on a user-defined software stack. At return time, the software can return these values to TOSU:TOSH:TOSL and do a return. The user must disable the global interrupt enable bits while accessing the stack to prevent inadvertent stack corruption. FIGURE 5-2: RETURN ADDRESS STACK AND ASSOCIATED REGISTERS 00011 001A34h 11111 11110 11101 00010 00001 00000 00010 Return Address Stack <20:0> Top-of-Stack 000D58h TOSU TOSH TOSL 00h 1Ah 34h STKPTR<4:0> Top-of-Stack Registers Stack Pointer© 2008 Microchip Technology Inc. DS39631E-page 55 PIC18F2420/2520/4420/4520 5.1.2.2 Return Stack Pointer (STKPTR) The STKPTR register (Register 5-1) contains the Stack Pointer value, the STKFUL (Stack Full) status bit and the STKUNF (Stack Underflow) status bits. The value of the Stack Pointer can be 0 through 31. The Stack Pointer increments before values are pushed onto the stack and decrements after values are popped off the stack. On Reset, the Stack Pointer value will be zero. The user may read and write the Stack Pointer value. This feature can be used by a Real-Time Operating System (RTOS) for return stack maintenance. After the PC is pushed onto the stack 31 times (without popping any values off the stack), the STKFUL bit is set. The STKFUL bit is cleared by software or by a POR. The action that takes place when the stack becomes full depends on the state of the STVREN (Stack Overflow Reset Enable) Configuration bit. (Refer to Section 23.1 “Configuration Bits” for a description of the device Configuration bits.) If STVREN is set (default), the 31st push will push the (PC + 2) value onto the stack, set the STKFUL bit and reset the device. The STKFUL bit will remain set and the Stack Pointer will be set to zero. If STVREN is cleared, the STKFUL bit will be set on the 31st push and the Stack Pointer will increment to 31. Any additional pushes will not overwrite the 31st push and STKPTR will remain at 31. When the stack has been popped enough times to unload the stack, the next pop will return a value of zero to the PC and sets the STKUNF bit, while the Stack Pointer remains at zero. The STKUNF bit will remain set until cleared by software or until a POR occurs. 5.1.2.3 PUSH and POP Instructions Since the Top-of-Stack is readable and writable, the ability to push values onto the stack and pull values off the stack without disturbing normal program execution is a desirable feature. The PIC18 instruction set includes two instructions, PUSH and POP, that permit the TOS to be manipulated under software control. TOSU, TOSH and TOSL can be modified to place data or a return address on the stack. The PUSH instruction places the current PC value onto the stack. This increments the Stack Pointer and loads the current PC value onto the stack. The POP instruction discards the current TOS by decrementing the Stack Pointer. The previous value pushed onto the stack then becomes the TOS value. Note: Returning a value of zero to the PC on an underflow has the effect of vectoring the program to the Reset vector, where the stack conditions can be verified and appropriate actions can be taken. This is not the same as a Reset, as the contents of the SFRs are not affected. REGISTER 5-1: STKPTR: STACK POINTER REGISTER R/C-0 R/C-0 U-0 R/W-0 R/W-0 R/W-0 R/W-0 R/W-0 STKFUL(1) STKUNF(1) — SP4 SP3 SP2 SP1 SP0 bit 7 bit 0 Legend: C = Clearable bit R = Readable bit W = Writable bit U = Unimplemented bit, read as ‘0’ -n = Value at POR ‘1’ = Bit is set ‘0’ = Bit is cleared x = Bit is unknown bit 7 STKFUL: Stack Full Flag bit(1) 1 = Stack became full or overflowed 0 = Stack has not become full or overflowed bit 6 STKUNF: Stack Underflow Flag bit(1) 1 = Stack underflow occurred 0 = Stack underflow did not occur bit 5 Unimplemented: Read as ‘0’ bit 4-0 SP<4:0>: Stack Pointer Location bits Note 1: Bit 7 and bit 6 are cleared by user software or by a POR.PIC18F2420/2520/4420/4520 DS39631E-page 56 © 2008 Microchip Technology Inc. 5.1.2.4 Stack Full and Underflow Resets Device Resets on stack overflow and stack underflow conditions are enabled by setting the STVREN bit in Configuration Register 4L. When STVREN is set, a full or underflow will set the appropriate STKFUL or STKUNF bit and then cause a device Reset. When STVREN is cleared, a full or underflow condition will set the appropriate STKFUL or STKUNF bit but not cause a device Reset. The STKFUL or STKUNF bits are cleared by the user software or a Power-on Reset. 5.1.3 FAST REGISTER STACK A Fast Register Stack is provided for the STATUS, WREG and BSR registers, to provide a “fast return” option for interrupts. The stack for each register is only one level deep and is neither readable nor writable. It is loaded with the current value of the corresponding register when the processor vectors for an interrupt. All interrupt sources will push values into the stack registers. The values in the registers are then loaded back into their associated registers if the RETFIE, FAST instruction is used to return from the interrupt. If both low and high-priority interrupts are enabled, the stack registers cannot be used reliably to return from low-priority interrupts. If a high-priority interrupt occurs while servicing a low-priority interrupt, the stack register values stored by the low-priority interrupt will be overwritten. In these cases, users must save the key registers in software during a low-priority interrupt. If interrupt priority is not used, all interrupts may use the Fast Register Stack for returns from interrupt. If no interrupts are used, the Fast Register Stack can be used to restore the STATUS, WREG and BSR registers at the end of a subroutine call. To use the Fast Register Stack for a subroutine call, a CALL label, FAST instruction must be executed to save the STATUS, WREG and BSR registers to the Fast Register Stack. A RETURN, FAST instruction is then executed to restore these registers from the Fast Register Stack. Example 5-1 shows a source code example that uses the Fast Register Stack during a subroutine call and return. EXAMPLE 5-1: FAST REGISTER STACK CODE EXAMPLE 5.1.4 LOOK-UP TABLES IN PROGRAM MEMORY There may be programming situations that require the creation of data structures, or look-up tables, in program memory. For PIC18 devices, look-up tables can be implemented in two ways: • Computed GOTO • Table Reads 5.1.4.1 Computed GOTO A computed GOTO is accomplished by adding an offset to the program counter. An example is shown in Example 5-2. A look-up table can be formed with an ADDWF PCL instruction and a group of RETLW nn instructions. The W register is loaded with an offset into the table before executing a call to that table. The first instruction of the called routine is the ADDWF PCL instruction. The next instruction executed will be one of the RETLW nn instructions that returns the value ‘nn’ to the calling function. The offset value (in WREG) specifies the number of bytes that the program counter should advance and should be multiples of 2 (LSb = 0). In this method, only one data byte may be stored in each instruction location and room on the return address stack is required. EXAMPLE 5-2: COMPUTED GOTO USING AN OFFSET VALUE 5.1.4.2 Table Reads and Table Writes A better method of storing data in program memory allows two bytes of data to be stored in each instruction location. Look-up table data may be stored two bytes per program word by using table reads and writes. The Table Pointer (TBLPTR) register specifies the byte address and the Table Latch (TABLAT) register contains the data that is read from or written to program memory. Data is transferred to or from program memory one byte at a time. Table read and table write operations are discussed further in Section 6.1 “Table Reads and Table Writes”. CALL SUB1, FAST ;STATUS, WREG, BSR ;SAVED IN FAST REGISTER ;STACK • • SUB1 • • RETURN, FAST ;RESTORE VALUES SAVED ;IN FAST REGISTER STACK MOVF OFFSET, W CALL TABLE ORG nn00h TABLE ADDWF PCL RETLW nnh RETLW nnh RETLW nnh . . .© 2008 Microchip Technology Inc. DS39631E-page 57 PIC18F2420/2520/4420/4520 5.2 PIC18 Instruction Cycle 5.2.1 CLOCKING SCHEME The microcontroller clock input, whether from an internal or external source, is internally divided by four to generate four non-overlapping quadrature clocks (Q1, Q2, Q3 and Q4). Internally, the program counter is incremented on every Q1; the instruction is fetched from the program memory and latched into the instruction register during Q4. The instruction is decoded and executed during the following Q1 through Q4. The clocks and instruction execution flow are shown in Figure 5-3. 5.2.2 INSTRUCTION FLOW/PIPELINING An “Instruction Cycle” consists of four Q cycles: Q1 through Q4. The instruction fetch and execute are pipelined in such a manner that a fetch takes one instruction cycle, while the decode and execute take another instruction cycle. However, due to the pipelining, each instruction effectively executes in one cycle. If an instruction causes the program counter to change (e.g., GOTO), then two cycles are required to complete the instruction (Example 5-3). A fetch cycle begins with the Program Counter (PC) incrementing in Q1. In the execution cycle, the fetched instruction is latched into the Instruction Register (IR) in cycle Q1. This instruction is then decoded and executed during the Q2, Q3 and Q4 cycles. Data memory is read during Q2 (operand read) and written during Q4 (destination write). FIGURE 5-3: CLOCK/INSTRUCTION CYCLE EXAMPLE 5-3: INSTRUCTION PIPELINE FLOW Q1 Q2 Q3 Q4 Q1 Q2 Q3 Q4 Q1 Q2 Q3 Q4 OSC1 Q1 Q2 Q3 Q4 PC OSC2/CLKO (RC mode) PC PC + 2 PC + 4 Fetch INST (PC) Execute INST (PC – 2) Fetch INST (PC + 2) Execute INST (PC) Fetch INST (PC + 4) Execute INST (PC + 2) Internal Phase Clock All instructions are single cycle, except for any program branches. These take two cycles since the fetch instruction is “flushed” from the pipeline while the new instruction is being fetched and then executed. TCY0 TCY1 TCY2 TCY3 TCY4 TCY5 1. MOVLW 55h Fetch 1 Execute 1 2. MOVWF PORTB Fetch 2 Execute 2 3. BRA SUB_1 Fetch 3 Execute 3 4. BSF PORTA, BIT3 (Forced NOP) Fetch 4 Flush (NOP) 5. Instruction @ address SUB_1 Fetch SUB_1 Execute SUB_1PIC18F2420/2520/4420/4520 DS39631E-page 58 © 2008 Microchip Technology Inc. 5.2.3 INSTRUCTIONS IN PROGRAM MEMORY The program memory is addressed in bytes. Instructions are stored as two bytes or four bytes in program memory. The Least Significant Byte of an instruction word is always stored in a program memory location with an even address (LSb = 0). To maintain alignment with instruction boundaries, the PC increments in steps of 2 and the LSb will always read ‘0’ (see Section 5.1.1 “Program Counter”). Figure 5-4 shows an example of how instruction words are stored in the program memory. The CALL and GOTO instructions have the absolute program memory address embedded into the instruction. Since instructions are always stored on word boundaries, the data contained in the instruction is a word address. The word address is written to PC<20:1>, which accesses the desired byte address in program memory. Instruction #2 in Figure 5-4 shows how the instruction GOTO 0006h is encoded in the program memory. Program branch instructions, which encode a relative address offset, operate in the same manner. The offset value stored in a branch instruction represents the number of single-word instructions that the PC will be offset by. Section 24.0 “Instruction Set Summary” provides further details of the instruction set. FIGURE 5-4: INSTRUCTIONS IN PROGRAM MEMORY 5.2.4 TWO-WORD INSTRUCTIONS The standard PIC18 instruction set has four two-word instructions: CALL, MOVFF, GOTO and LSFR. In all cases, the second word of the instructions always has ‘1111’ as its four Most Significant bits; the other 12 bits are literal data, usually a data memory address. The use of ‘1111’ in the 4 MSbs of an instruction specifies a special form of NOP. If the instruction is executed in proper sequence – immediately after the first word – the data in the second word is accessed and used by the instruction sequence. If the first word is skipped for some reason and the second word is executed by itself, a NOP is executed instead. This is necessary for cases when the two-word instruction is preceded by a conditional instruction that changes the PC. Example 5-4 shows how this works. EXAMPLE 5-4: TWO-WORD INSTRUCTIONS Word Address LSB = 1 LSB = 0 ↓ Program Memory Byte Locations → 000000h 000002h 000004h 000006h Instruction 1: MOVLW 055h 0Fh 55h 000008h Instruction 2: GOTO 0006h EFh 03h 00000Ah F0h 00h 00000Ch Instruction 3: MOVFF 123h, 456h C1h 23h 00000Eh F4h 56h 000010h 000012h 000014h Note: See Section 5.6 “PIC18 Instruction Execution and the Extended Instruction Set” for information on two-word instructions in the extended instruction set. CASE 1: Object Code Source Code 0110 0110 0000 0000 TSTFSZ REG1 ; is RAM location 0? 1100 0001 0010 0011 MOVFF REG1, REG2 ; No, skip this word 1111 0100 0101 0110 ; Execute this word as a NOP 0010 0100 0000 0000 ADDWF REG3 ; continue code CASE 2: Object Code Source Code 0110 0110 0000 0000 TSTFSZ REG1 ; is RAM location 0? 1100 0001 0010 0011 MOVFF REG1, REG2 ; Yes, execute this word 1111 0100 0101 0110 ; 2nd word of instruction 0010 0100 0000 0000 ADDWF REG3 ; continue code© 2008 Microchip Technology Inc. DS39631E-page 59 PIC18F2420/2520/4420/4520 5.3 Data Memory Organization The data memory in PIC18 devices is implemented as static RAM. Each register in the data memory has a 12-bit address, allowing up to 4096 bytes of data memory. The memory space is divided into as many as 16 banks that contain 256 bytes each; PIC18F2420/ 2520/4420/4520 devices implement all 16 banks. Figure 5-5 shows the data memory organization for the PIC18F2420/2520/4420/4520 devices. The data memory contains Special Function Registers (SFRs) and General Purpose Registers (GPRs). The SFRs are used for control and status of the controller and peripheral functions, while GPRs are used for data storage and scratchpad operations in the user’s application. Any read of an unimplemented location will read as ‘0’s. The instruction set and architecture allow operations across all banks. The entire data memory may be accessed by Direct, Indirect or Indexed Addressing modes. Addressing modes are discussed later in this subsection. To ensure that commonly used registers (SFRs and select GPRs) can be accessed in a single cycle, PIC18 devices implement an Access Bank. This is a 256-byte memory space that provides fast access to SFRs and the lower portion of GPR Bank 0 without using the BSR. Section 5.3.2 “Access Bank” provides a detailed description of the Access RAM. 5.3.1 BANK SELECT REGISTER (BSR) Large areas of data memory require an efficient addressing scheme to make rapid access to any address possible. Ideally, this means that an entire address does not need to be provided for each read or write operation. For PIC18 devices, this is accomplished with a RAM banking scheme. This divides the memory space into 16 contiguous banks of 256 bytes. Depending on the instruction, each location can be addressed directly by its full 12-bit address, or an 8-bit low-order address and a 4-bit Bank Pointer. Most instructions in the PIC18 instruction set make use of the Bank Pointer, known as the Bank Select Register (BSR). This SFR holds the 4 Most Significant bits of a location’s address; the instruction itself includes the 8 Least Significant bits. Only the four lower bits of the BSR are implemented (BSR<3:0>). The upper four bits are unused; they will always read ‘0’ and cannot be written to. The BSR can be loaded directly by using the MOVLB instruction. The value of the BSR indicates the bank in data memory; the 8 bits in the instruction show the location in the bank and can be thought of as an offset from the bank’s lower boundary. The relationship between the BSR’s value and the bank division in data memory is shown in Figure 5-7. Since up to 16 registers may share the same low-order address, the user must always be careful to ensure that the proper bank is selected before performing a data read or write. For example, writing what should be program data to an 8-bit address of F9h while the BSR is 0Fh will end up resetting the program counter. While any bank can be selected, only those banks that are actually implemented can be read or written to. Writes to unimplemented banks are ignored, while reads from unimplemented banks will return ‘0’s. Even so, the STATUS register will still be affected as if the operation was successful. The data memory map in Figure 5-5 indicates which banks are implemented. In the core PIC18 instruction set, only the MOVFF instruction fully specifies the 12-bit address of the source and target registers. This instruction ignores the BSR completely when it executes. All other instructions include only the low-order address as an operand and must use either the BSR or the Access Bank to locate their target registers. Note: The operation of some aspects of data memory are changed when the PIC18 extended instruction set is enabled. See Section 5.5 “Data Memory and the Extended Instruction Set” for more information.PIC18F2420/2520/4420/4520 DS39631E-page 60 © 2008 Microchip Technology Inc. FIGURE 5-5: DATA MEMORY MAP FOR PIC18F2420/4420 DEVICES Bank 0 Bank 1 Bank 14 Bank 15 BSR<3:0> Data Memory Map = 0000 = 0001 = 1111 080h 07Fh F80h FFFh 00h 7Fh 80h FFh Access Bank When ‘a’ = 0: The BSR is ignored and the Access Bank is used. The first 128 bytes are general purpose RAM (from Bank 0). The second 128 bytes are Special Function Registers (from Bank 15). When ‘a’ = 1: The BSR specifies the Bank used by the instruction. F7Fh F00h EFFh 1FFh 100h 0FFh 000h Access RAM FFh 00h FFh 00h FFh 00h GPR GPR SFR Access RAM High Access RAM Low Bank 2 = 0110 = 0010 (SFRs) 2FFh 200h 3FFh 300h 4FFh 400h 5FFh 500h 6FFh 600h 7FFh 700h 8FFh 800h 9FFh 900h AFFh A00h BFFh B00h CFFh C00h DFFh D00h E00h Bank 3 Bank 4 Bank 5 Bank 6 Bank 7 Bank 8 Bank 9 Bank 10 Bank 11 Bank 12 Bank 13 FFh 00h FFh 00h FFh 00h FFh 00h FFh 00h FFh 00h FFh 00h FFh 00h FFh 00h FFh 00h FFh 00h FFh 00h GPR FFh 00h = 0011 = 0100 = 0101 = 0111 = 1000 = 1001 = 1010 = 1011 = 1100 = 1101 = 1110 Unused Read 00h Unused© 2008 Microchip Technology Inc. DS39631E-page 61 PIC18F2420/2520/4420/4520 FIGURE 5-6: DATA MEMORY MAP FOR PIC18F2520/4520 DEVICES Bank 0 Bank 1 Bank 14 Bank 15 BSR<3:0> Data Memory Map = 0000 = 0001 = 1111 080h 07Fh F80h FFFh 00h 7Fh 80h FFh Access Bank When ‘a’ = 0: The BSR is ignored and the Access Bank is used. The first 128 bytes are general purpose RAM (from Bank 0). The second 128 bytes are Special Function Registers (from Bank 15). When ‘a’ = 1: The BSR specifies the Bank used by the instruction. F7Fh F00h EFFh 1FFh 100h 0FFh 000h Access RAM FFh 00h FFh 00h FFh 00h GPR GPR SFR Access RAM High Access RAM Low Bank 2 = 0110 = 0010 (SFRs) 2FFh 200h 3FFh 300h 4FFh 400h 5FFh 500h 6FFh 600h 7FFh 700h 8FFh 800h 9FFh 900h AFFh A00h BFFh B00h CFFh C00h DFFh D00h E00h Bank 3 Bank 4 Bank 5 Bank 6 Bank 7 Bank 8 Bank 9 Bank 10 Bank 11 Bank 12 Bank 13 FFh 00h FFh 00h FFh 00h FFh 00h FFh 00h FFh 00h FFh 00h FFh 00h FFh 00h FFh 00h FFh 00h FFh 00h GPR FFh 00h = 0011 = 0100 = 0101 = 0111 = 1000 = 1001 = 1010 = 1011 = 1100 = 1101 = 1110 Unused Read 00h Unused GPR GPR GPRPIC18F2420/2520/4420/4520 DS39631E-page 62 © 2008 Microchip Technology Inc. FIGURE 5-7: USE OF THE BANK SELECT REGISTER (DIRECT ADDRESSING) 5.3.2 ACCESS BANK While the use of the BSR with an embedded 8-bit address allows users to address the entire range of data memory, it also means that the user must always ensure that the correct bank is selected. Otherwise, data may be read from or written to the wrong location. This can be disastrous if a GPR is the intended target of an operation, but an SFR is written to instead. Verifying and/or changing the BSR for each read or write to data memory can become very inefficient. To streamline access for the most commonly used data memory locations, the data memory is configured with an Access Bank, which allows users to access a mapped block of memory without specifying a BSR. The Access Bank consists of the first 128 bytes of memory (00h-7Fh) in Bank 0 and the last 128 bytes of memory (80h-FFh) in Block 15. The lower half is known as the “Access RAM” and is composed of GPRs. This upper half is also where the device’s SFRs are mapped. These two areas are mapped contiguously in the Access Bank and can be addressed in a linear fashion by an 8-bit address (Figure 5-5). The Access Bank is used by core PIC18 instructions that include the Access RAM bit (the ‘a’ parameter in the instruction). When ‘a’ is equal to ‘1’, the instruction uses the BSR and the 8-bit address included in the opcode for the data memory address. When ‘a’ is ‘0’, however, the instruction is forced to use the Access Bank address map; the current value of the BSR is ignored entirely. Using this “forced” addressing allows the instruction to operate on a data address in a single cycle, without updating the BSR first. For 8-bit addresses of 80h and above, this means that users can evaluate and operate on SFRs more efficiently. The Access RAM below 80h is a good place for data values that the user might need to access rapidly, such as immediate computational results or common program variables. Access RAM also allows for faster and more code efficient context saving and switching of variables. The mapping of the Access Bank is slightly different when the extended instruction set is enabled (XINST Configuration bit = 1). This is discussed in more detail in Section 5.5.3 “Mapping the Access Bank in Indexed Literal Offset Mode”. 5.3.3 GENERAL PURPOSE REGISTER FILE PIC18 devices may have banked memory in the GPR area. This is data RAM, which is available for use by all instructions. GPRs start at the bottom of Bank 0 (address 000h) and grow upwards towards the bottom of the SFR area. GPRs are not initialized by a Power-on Reset and are unchanged on all other Resets. Note 1: The Access RAM bit of the instruction can be used to force an override of the selected bank (BSR<3:0>) to the registers of the Access Bank. 2: The MOVFF instruction embeds the entire 12-bit address in the instruction. Data Memory Bank Select(2) 7 0 From Opcode(2) 0000 000h 100h 200h 300h F00h E00h FFFh Bank 0 Bank 1 Bank 2 Bank 14 Bank 15 00h FFh 00h FFh 00h FFh 00h FFh 00h FFh 00h FFh Bank 3 through Bank 13 0011 11111111 7 0 BSR(1)© 2008 Microchip Technology Inc. DS39631E-page 63 PIC18F2420/2520/4420/4520 5.3.4 SPECIAL FUNCTION REGISTERS The Special Function Registers (SFRs) are registers used by the CPU and peripheral modules for controlling the desired operation of the device. These registers are implemented as static RAM. SFRs start at the top of data memory (FFFh) and extend downward to occupy the top half of Bank 15 (F80h to FFFh). A list of these registers is given in Table 5-1 and Table 5-2. The SFRs can be classified into two sets: those associated with the “core” device functionality (ALU, Resets and interrupts) and those related to the peripheral functions. The Reset and Interrupt registers are described in their respective chapters, while the ALU’s STATUS register is described later in this section. Registers related to the operation of a peripheral feature are described in the chapter for that peripheral. The SFRs are typically distributed among the peripherals whose functions they control. Unused SFR locations are unimplemented and read as ‘0’s. TABLE 5-1: SPECIAL FUNCTION REGISTER MAP FOR PIC18F2420/2520/4420/4520 DEVICES Address Name Address Name Address Name Address Name FFFh TOSU FDFh INDF2(1) FBFh CCPR1H F9Fh IPR1 FFEh TOSH FDEh POSTINC2(1) FBEh CCPR1L F9Eh PIR1 FFDh TOSL FDDh POSTDEC2(1) FBDh CCP1CON F9Dh PIE1 FFCh STKPTR FDCh PREINC2(1) FBCh CCPR2H F9Ch —(2) FFBh PCLATU FDBh PLUSW2(1) FBBh CCPR2L F9Bh OSCTUNE FFAh PCLATH FDAh FSR2H FBAh CCP2CON F9Ah —(2) FF9h PCL FD9h FSR2L FB9h —(2) F99h —(2) FF8h TBLPTRU FD8h STATUS FB8h BAUDCON F98h —(2) FF7h TBLPTRH FD7h TMR0H FB7h PWM1CON(3) F97h —(2) FF6h TBLPTRL FD6h TMR0L FB6h ECCP1AS(3) F96h TRISE(3) FF5h TABLAT FD5h T0CON FB5h CVRCON F95h TRISD(3) FF4h PRODH FD4h —(2) FB4h CMCON F94h TRISC FF3h PRODL FD3h OSCCON FB3h TMR3H F93h TRISB FF2h INTCON FD2h HLVDCON FB2h TMR3L F92h TRISA FF1h INTCON2 FD1h WDTCON FB1h T3CON F91h —(2) FF0h INTCON3 FD0h RCON FB0h SPBRGH F90h —(2) FEFh INDF0(1) FCFh TMR1H FAFh SPBRG F8Fh —(2) FEEh POSTINC0(1) FCEh TMR1L FAEh RCREG F8Eh —(2) FEDh POSTDEC0(1) FCDh T1CON FADh TXREG F8Dh LATE(3) FECh PREINC0(1) FCCh TMR2 FACh TXSTA F8Ch LATD(3) FEBh PLUSW0(1) FCBh PR2 FABh RCSTA F8Bh LATC FEAh FSR0H FCAh T2CON FAAh —(2) F8Ah LATB FE9h FSR0L FC9h SSPBUF FA9h EEADR F89h LATA FE8h WREG FC8h SSPADD FA8h EEDATA F88h —(2) FE7h INDF1(1) FC7h SSPSTAT FA7h EECON2(1) F87h —(2) FE6h POSTINC1(1) FC6h SSPCON1 FA6h EECON1 F86h —(2) FE5h POSTDEC1(1) FC5h SSPCON2 FA5h —(2) F85h —(2) FE4h PREINC1(1) FC4h ADRESH FA4h —(2) F84h PORTE(3) FE3h PLUSW1(1) FC3h ADRESL FA3h —(2) F83h PORTD(3) FE2h FSR1H FC2h ADCON0 FA2h IPR2 F82h PORTC FE1h FSR1L FC1h ADCON1 FA1h PIR2 F81h PORTB FE0h BSR FC0h ADCON2 FA0h PIE2 F80h PORTA Note 1: This is not a physical register. 2: Unimplemented registers are read as ‘0’. 3: This register is not available on 28-pin devices.PIC18F2420/2520/4420/4520 DS39631E-page 64 © 2008 Microchip Technology Inc. TABLE 5-2: PIC18F2420/2520/4420/4520 REGISTER FILE SUMMARY File Name Bit 7 Bit 6 Bit 5 Bit 4 Bit 3 Bit 2 Bit 1 Bit 0 Value on POR, BOR Details on page: TOSU — — — Top-of-Stack Upper Byte (TOS<20:16>) ---0 0000 49, 54 TOSH Top-of-Stack High Byte (TOS<15:8>) 0000 0000 49, 54 TOSL Top-of-Stack Low Byte (TOS<7:0>) 0000 0000 49, 54 STKPTR STKFUL STKUNF — SP4 SP3 SP2 SP1 SP0 00-0 0000 49, 55 PCLATU — — — Holding Register for PC<20:16> ---0 0000 49, 54 PCLATH Holding Register for PC<15:8> 0000 0000 49, 54 PCL PC Low Byte (PC<7:0>) 0000 0000 49, 54 TBLPTRU — — bit 21 Program Memory Table Pointer Upper Byte (TBLPTR<20:16>) --00 0000 49, 76 TBLPTRH Program Memory Table Pointer High Byte (TBLPTR<15:8>) 0000 0000 49, 76 TBLPTRL Program Memory Table Pointer Low Byte (TBLPTR<7:0>) 0000 0000 49, 76 TABLAT Program Memory Table Latch 0000 0000 49, 76 PRODH Product Register High Byte xxxx xxxx 49, 89 PRODL Product Register Low Byte xxxx xxxx 49, 89 INTCON GIE/GIEH PEIE/GIEL TMR0IE INT0IE RBIE TMR0IF INT0IF RBIF 0000 000x 49, 93 INTCON2 RBPU INTEDG0 INTEDG1 INTEDG2 — TMR0IP — RBIP 1111 -1-1 49, 94 INTCON3 INT2IP INT1IP — INT2IE INT1IE — INT2IF INT1IF 11-0 0-00 49, 95 INDF0 Uses contents of FSR0 to address data memory – value of FSR0 not changed (not a physical register) N/A 49, 69 POSTINC0 Uses contents of FSR0 to address data memory – value of FSR0 post-incremented (not a physical register) N/A 49, 69 POSTDEC0 Uses contents of FSR0 to address data memory – value of FSR0 post-decremented (not a physical register) N/A 49, 69 PREINC0 Uses contents of FSR0 to address data memory – value of FSR0 pre-incremented (not a physical register) N/A 49, 69 PLUSW0 Uses contents of FSR0 to address data memory – value of FSR0 pre-incremented (not a physical register) – value of FSR0 offset by W N/A 49, 69 FSR0H — — — — Indirect Data Memory Address Pointer 0 High Byte ---- 0000 49, 69 FSR0L Indirect Data Memory Address Pointer 0 Low Byte xxxx xxxx 49, 69 WREG Working Register xxxx xxxx 49 INDF1 Uses contents of FSR1 to address data memory – value of FSR1 not changed (not a physical register) N/A 49, 69 POSTINC1 Uses contents of FSR1 to address data memory – value of FSR1 post-incremented (not a physical register) N/A 49, 69 POSTDEC1 Uses contents of FSR1 to address data memory – value of FSR1 post-decremented (not a physical register) N/A 49, 69 PREINC1 Uses contents of FSR1 to address data memory – value of FSR1 pre-incremented (not a physical register) N/A 49, 69 PLUSW1 Uses contents of FSR1 to address data memory – value of FSR1 pre-incremented (not a physical register) – value of FSR1 offset by W N/A 49, 69 FSR1H — — — — Indirect Data Memory Address Pointer 1 High Byte ---- 0000 50, 69 FSR1L Indirect Data Memory Address Pointer 1 Low Byte xxxx xxxx 50, 69 BSR — — — — Bank Select Register ---- 0000 50, 59 INDF2 Uses contents of FSR2 to address data memory – value of FSR2 not changed (not a physical register) N/A 50, 69 POSTINC2 Uses contents of FSR2 to address data memory – value of FSR2 post-incremented (not a physical register) N/A 50, 69 POSTDEC2 Uses contents of FSR2 to address data memory – value of FSR2 post-decremented (not a physical register) N/A 50, 69 PREINC2 Uses contents of FSR2 to address data memory – value of FSR2 pre-incremented (not a physical register) N/A 50, 69 PLUSW2 Uses contents of FSR2 to address data memory – value of FSR2 pre-incremented (not a physical register) – value of FSR2 offset by W N/A 50, 69 FSR2H — — — — Indirect Data Memory Address Pointer 2 High Byte ---- 0000 50, 69 FSR2L Indirect Data Memory Address Pointer 2 Low Byte xxxx xxxx 50, 69 STATUS — — — N OV Z DC C ---x xxxx 50, 67 Legend: x = unknown, u = unchanged, — = unimplemented, q = value depends on condition. Shaded cells are unimplemented, read as ‘0’. Note 1: The SBOREN bit is only available when the BOREN<1:0> Configuration bits = 01; otherwise, it is disabled and reads as ‘0’. See Section 4.4 “Brown-out Reset (BOR)”. 2: These registers and/or bits are not implemented on 28-pin devices and are read as ‘0’. Reset values are shown for 40/44-pin devices; individual unimplemented bits should be interpreted as ‘-’. 3: The PLLEN bit is only available in specific oscillator configurations; otherwise, it is disabled and reads as ‘0’. See Section 2.6.4 “PLL in INTOSC Modes”. 4: The RE3 bit is only available when Master Clear Reset is disabled (MCLRE Configuration bit = 0); otherwise, RE3 reads as ‘0’. This bit is read-only. 5: RA6/RA7 and their associated latch and direction bits are individually configured as port pins based on various primary oscillator modes. When disabled, these bits read as ‘0’.© 2008 Microchip Technology Inc. DS39631E-page 65 PIC18F2420/2520/4420/4520 TMR0H Timer0 Register High Byte 0000 0000 50, 125 TMR0L Timer0 Register Low Byte xxxx xxxx 50, 125 T0CON TMR0ON T08BIT T0CS T0SE PSA T0PS2 T0PS1 T0PS0 1111 1111 50, 123 OSCCON IDLEN IRCF2 IRCF1 IRCF0 OSTS IOFS SCS1 SCS0 0100 q000 30, 50 HLVDCON VDIRMAG — IRVST HLVDEN HLVDL3 HLVDL2 HLVDL1 HLVDL0 0-00 0101 50, 245 WDTCON — — — — — — — SWDTEN --- ---0 50, 259 RCON IPEN SBOREN(1) — RI TO PD POR BOR 0q-1 11q0 42, 48, 102 TMR1H Timer1 Register High Byte xxxx xxxx 50, 132 TMR1L Timer1 Register Low Bytes xxxx xxxx 50, 132 T1CON RD16 T1RUN T1CKPS1 T1CKPS0 T1OSCEN T1SYNC TMR1CS TMR1ON 0000 0000 50, 127 TMR2 Timer2 Register 0000 0000 50, 134 PR2 Timer2 Period Register 1111 1111 50, 134 T2CON — T2OUTPS3 T2OUTPS2 T2OUTPS1 T2OUTPS0 TMR2ON T2CKPS1 T2CKPS0 -000 0000 50, 133 SSPBUF MSSP Receive Buffer/Transmit Register xxxx xxxx 50, 169, 170 SSPADD MSSP Address Register in I2C™ Slave Mode. MSSP Baud Rate Reload Register in I2C Master Mode. 0000 0000 50, 170 SSPSTAT SMP CKE D/A P S R/W UA BF 0000 0000 50, 162, 171 SSPCON1 WCOL SSPOV SSPEN CKP SSPM3 SSPM2 SSPM1 SSPM0 0000 0000 50, 163, 172 SSPCON2 GCEN ACKSTAT ACKDT ACKEN RCEN PEN RSEN SEN 0000 0000 50, 173 ADRESH A/D Result Register High Byte xxxx xxxx 51, 232 ADRESL A/D Result Register Low Byte xxxx xxxx 51, 232 ADCON0 — — CHS3 CHS2 CHS1 CHS0 GO/DONE ADON --00 0000 51, 223 ADCON1 — — VCFG1 VCFG0 PCFG3 PCFG2 PCFG1 PCFG0 --00 0qqq 51, 224 ADCON2 ADFM — ACQT2 ACQT1 ACQT0 ADCS2 ADCS1 ADCS0 0-00 0000 51, 225 CCPR1H Capture/Compare/PWM Register 1 High Byte xxxx xxxx 51, 140 CCPR1L Capture/Compare/PWM Register 1 Low Byte xxxx xxxx 51, 140 CCP1CON P1M1(2) P1M0(2) DC1B1 DC1B0 CCP1M3 CCP1M2 CCP1M1 CCP1M0 0000 0000 51, 139, 147 CCPR2H Capture/Compare/PWM Register 2 High Byte xxxx xxxx 51, 140 CCPR2L Capture/Compare/PWM Register 2 Low Byte xxxx xxxx 51, 140 CCP2CON — — DC2B1 DC2B0 CCP2M3 CCP2M2 CCP2M1 CCP2M0 --00 0000 51, 139 BAUDCON ABDOVF RCIDL RXDTP TXCKP BRG16 — WUE ABDEN 0100 0-00 51, 204 PWM1CON PRSEN PDC6(2) PDC5(2) PDC4(2) PDC3(2) PDC2(2) PDC1(2) PDC0(2) 0000 0000 51, 156 ECCP1AS ECCPASE ECCPAS2 ECCPAS1 ECCPAS0 PSSAC1 PSSAC0 PSSBD1(2) PSSBD0(2) 0000 0000 51, 157 CVRCON CVREN CVROE CVRR CVRSS CVR3 CVR2 CVR1 CVR0 0000 0000 51, 239 CMCON C2OUT C1OUT C2INV C1INV CIS CM2 CM1 CM0 0000 0111 51, 233 TMR3H Timer3 Register High Byte xxxx xxxx 51, 137 TMR3L Timer3 Register Low Byte xxxx xxxx 51, 137 T3CON RD16 T3CCP2 T3CKPS1 T3CKPS0 T3CCP1 T3SYNC TMR3CS TMR3ON 0000 0000 51, 135 TABLE 5-2: PIC18F2420/2520/4420/4520 REGISTER FILE SUMMARY (CONTINUED) File Name Bit 7 Bit 6 Bit 5 Bit 4 Bit 3 Bit 2 Bit 1 Bit 0 Value on POR, BOR Details on page: Legend: x = unknown, u = unchanged, — = unimplemented, q = value depends on condition. Shaded cells are unimplemented, read as ‘0’. Note 1: The SBOREN bit is only available when the BOREN<1:0> Configuration bits = 01; otherwise, it is disabled and reads as ‘0’. See Section 4.4 “Brown-out Reset (BOR)”. 2: These registers and/or bits are not implemented on 28-pin devices and are read as ‘0’. Reset values are shown for 40/44-pin devices; individual unimplemented bits should be interpreted as ‘-’. 3: The PLLEN bit is only available in specific oscillator configurations; otherwise, it is disabled and reads as ‘0’. See Section 2.6.4 “PLL in INTOSC Modes”. 4: The RE3 bit is only available when Master Clear Reset is disabled (MCLRE Configuration bit = 0); otherwise, RE3 reads as ‘0’. This bit is read-only. 5: RA6/RA7 and their associated latch and direction bits are individually configured as port pins based on various primary oscillator modes. When disabled, these bits read as ‘0’.PIC18F2420/2520/4420/4520 DS39631E-page 66 © 2008 Microchip Technology Inc. SPBRGH EUSART Baud Rate Generator Register High Byte 0000 0000 51, 206 SPBRG EUSART Baud Rate Generator Register Low Byte 0000 0000 51, 206 RCREG EUSART Receive Register 0000 0000 51, 213 TXREG EUSART Transmit Register 0000 0000 51, 211 TXSTA CSRC TX9 TXEN SYNC SENDB BRGH TRMT TX9D 0000 0010 51, 202 RCSTA SPEN RX9 SREN CREN ADDEN FERR OERR RX9D 0000 000x 51, 203 EEADR EEPROM Address Register 0000 0000 51, 74, 83 EEDATA EEPROM Data Register 0000 0000 51, 74, 83 EECON2 EEPROM Control Register 2 (not a physical register) 0000 0000 51, 74, 83 EECON1 EEPGD CFGS — FREE WRERR WREN WR RD xx-0 x000 51, 75, 84 IPR2 OSCFIP CMIP — EEIP BCLIP HLVDIP TMR3IP CCP2IP 11-1 1111 52, 101 PIR2 OSCFIF CMIF — EEIF BCLIF HLVDIF TMR3IF CCP2IF 00-0 0000 52, 97 PIE2 OSCFIE CMIE — EEIE BCLIE HLVDIE TMR3IE CCP2IE 00-0 0000 52, 99 IPR1 PSPIP(2) ADIP RCIP TXIP SSPIP CCP1IP TMR2IP TMR1IP 1111 1111 52, 100 PIR1 PSPIF(2) ADIF RCIF TXIF SSPIF CCP1IF TMR2IF TMR1IF 0000 0000 52, 96 PIE1 PSPIE(2) ADIE RCIE TXIE SSPIE CCP1IE TMR2IE TMR1IE 0000 0000 52, 98 OSCTUNE INTSRC PLLEN(3) — TUN4 TUN3 TUN2 TUN1 TUN0 0q-0 0000 27, 52 TRISE(2) IBF OBF IBOV PSPMODE — TRISE2 TRISE1 TRISE0 0000 -111 52, 118 TRISD(2) PORTD Data Direction Register 1111 1111 52, 114 TRISC PORTC Data Direction Register 1111 1111 52, 111 TRISB PORTB Data Direction Register 1111 1111 52, 108 TRISA TRISA7(5) TRISA6(5) PORTA Data Direction Register 1111 1111 52, 105 LATE(2) — — — — — PORTE Data Latch Register (Read and Write to Data Latch) ---- -xxx 52, 117 LATD(2) PORTD Data Latch Register (Read and Write to Data Latch) xxxx xxxx 52, 114 LATC PORTC Data Latch Register (Read and Write to Data Latch) xxxx xxxx 52, 111 LATB PORTB Data Latch Register (Read and Write to Data Latch) xxxx xxxx 52, 108 LATA LATA7(5) LATA6(5) PORTA Data Latch Register (Read and Write to Data Latch) xxxx xxxx 52, 105 PORTE — — — — RE3(4) RE2(2) RE1(2) RE0(2) ---- xxxx 52, 117 PORTD(2) RD7 RD6 RD5 RD4 RD3 RD2 RD1 RD0 xxxx xxxx 52, 114 PORTC RC7 RC6 RC5 RC4 RC3 RC2 RC1 RC0 xxxx xxxx 52, 111 PORTB RB7 RB6 RB5 RB4 RB3 RB2 RB1 RB0 xxxx xxxx 52, 108 PORTA RA7(5) RA6(5) RA5 RA4 RA3 RA2 RA1 RA0 xx0x 0000 52, 105 TABLE 5-2: PIC18F2420/2520/4420/4520 REGISTER FILE SUMMARY (CONTINUED) File Name Bit 7 Bit 6 Bit 5 Bit 4 Bit 3 Bit 2 Bit 1 Bit 0 Value on POR, BOR Details on page: Legend: x = unknown, u = unchanged, — = unimplemented, q = value depends on condition. Shaded cells are unimplemented, read as ‘0’. Note 1: The SBOREN bit is only available when the BOREN<1:0> Configuration bits = 01; otherwise, it is disabled and reads as ‘0’. See Section 4.4 “Brown-out Reset (BOR)”. 2: These registers and/or bits are not implemented on 28-pin devices and are read as ‘0’. Reset values are shown for 40/44-pin devices; individual unimplemented bits should be interpreted as ‘-’. 3: The PLLEN bit is only available in specific oscillator configurations; otherwise, it is disabled and reads as ‘0’. See Section 2.6.4 “PLL in INTOSC Modes”. 4: The RE3 bit is only available when Master Clear Reset is disabled (MCLRE Configuration bit = 0); otherwise, RE3 reads as ‘0’. This bit is read-only. 5: RA6/RA7 and their associated latch and direction bits are individually configured as port pins based on various primary oscillator modes. When disabled, these bits read as ‘0’.© 2008 Microchip Technology Inc. DS39631E-page 67 PIC18F2420/2520/4420/4520 5.3.5 STATUS REGISTER The STATUS register, shown in Register 5-2, contains the arithmetic status of the ALU. As with any other SFR, it can be the operand for any instruction. If the STATUS register is the destination for an instruction that affects the Z, DC, C, OV or N bits, the results of the instruction are not written; instead, the STATUS register is updated according to the instruction performed. Therefore, the result of an instruction with the STATUS register as its destination may be different than intended. As an example, CLRF STATUS will set the Z bit and leave the remaining Status bits unchanged (‘000u u1uu’). It is recommended that only BCF, BSF, SWAPF, MOVFF and MOVWF instructions are used to alter the STATUS register, because these instructions do not affect the Z, C, DC, OV or N bits in the STATUS register. For other instructions that do not affect Status bits, see the instruction set summaries in Table 24-2 and Table 24-3. Note: The C and DC bits operate as the borrow and digit borrow bits, respectively, in subtraction. REGISTER 5-2: STATUS REGISTER U-0 U-0 U-0 R/W-x R/W-x R/W-x R/W-x R/W-x — — — N OV Z DC(1) C(2) bit 7 bit 0 Legend: R = Readable bit W = Writable bit U = Unimplemented bit, read as ‘0’ -n = Value at POR ‘1’ = Bit is set ‘0’ = Bit is cleared x = Bit is unknown bit 7-5 Unimplemented: Read as ‘0’ bit 4 N: Negative bit This bit is used for signed arithmetic (2’s complement). It indicates whether the result was negative (ALU MSB = 1). 1 = Result was negative 0 = Result was positive bit 3 OV: Overflow bit This bit is used for signed arithmetic (2’s complement). It indicates an overflow of the 7-bit magnitude which causes the sign bit (bit 7) to change state. 1 = Overflow occurred for signed arithmetic (in this arithmetic operation) 0 = No overflow occurred bit 2 Z: Zero bit 1 = The result of an arithmetic or logic operation is zero 0 = The result of an arithmetic or logic operation is not zero bit 1 DC: Digit Carry/borrow bit(1) For ADDWF, ADDLW, SUBLW and SUBWF instructions: 1 = A carry-out from the 4th low-order bit of the result occurred 0 = No carry-out from the 4th low-order bit of the result bit 0 C: Carry/borrow bit(2) For ADDWF, ADDLW, SUBLW and SUBWF instructions: 1 = A carry-out from the Most Significant bit of the result occurred 0 = No carry-out from the Most Significant bit of the result occurred Note 1: For borrow, the polarity is reversed. A subtraction is executed by adding the 2’s complement of the second operand. For rotate (RRF, RLF) instructions, this bit is loaded with either bit 4 or bit 3 of the source register. 2: For borrow, the polarity is reversed. A subtraction is executed by adding the 2’s complement of the second operand. For rotate (RRF, RLF) instructions, this bit is loaded with either the high or low-order bit of the source register.PIC18F2420/2520/4420/4520 DS39631E-page 68 © 2008 Microchip Technology Inc. 5.4 Data Addressing Modes While the program memory can be addressed in only one way – through the program counter – information in the data memory space can be addressed in several ways. For most instructions, the addressing mode is fixed. Other instructions may use up to three modes, depending on which operands are used and whether or not the extended instruction set is enabled. The addressing modes are: • Inherent • Literal • Direct • Indirect An additional addressing mode, Indexed Literal Offset, is available when the extended instruction set is enabled (XINST Configuration bit = 1). Its operation is discussed in greater detail in Section 5.5.1 “Indexed Addressing with Literal Offset”. 5.4.1 INHERENT AND LITERAL ADDRESSING Many PIC18 control instructions do not need any argument at all; they either perform an operation that globally affects the device or they operate implicitly on one register. This addressing mode is known as Inherent Addressing. Examples include SLEEP, RESET and DAW. Other instructions work in a similar way but require an additional explicit argument in the opcode. This is known as Literal Addressing mode because they require some literal value as an argument. Examples include ADDLW and MOVLW, which respectively, add or move a literal value to the W register. Other examples include CALL and GOTO, which include a 20-bit program memory address. 5.4.2 DIRECT ADDRESSING Direct Addressing specifies all or part of the source and/or destination address of the operation within the opcode itself. The options are specified by the arguments accompanying the instruction. In the core PIC18 instruction set, bit-oriented and byteoriented instructions use some version of Direct Addressing by default. All of these instructions include some 8-bit literal address as their Least Significant Byte. This address specifies either a register address in one of the banks of data RAM (Section 5.3.3 “General Purpose Register File”) or a location in the Access Bank (Section 5.3.2 “Access Bank”) as the data source for the instruction. The Access RAM bit ‘a’ determines how the address is interpreted. When ‘a’ is ‘1’, the contents of the BSR (Section 5.3.1 “Bank Select Register (BSR)”) are used with the address to determine the complete 12-bit address of the register. When ‘a’ is ‘0’, the address is interpreted as being a register in the Access Bank. Addressing that uses the Access RAM is sometimes also known as Direct Forced Addressing mode. A few instructions, such as MOVFF, include the entire 12-bit address (either source or destination) in their opcodes. In these cases, the BSR is ignored entirely. The destination of the operation’s results is determined by the destination bit ‘d’. When ‘d’ is ‘1’, the results are stored back in the source register, overwriting its original contents. When ‘d’ is ‘0’, the results are stored in the W register. Instructions without the ‘d’ argument have a destination that is implicit in the instruction; their destination is either the target register being operated on or the W register. 5.4.3 INDIRECT ADDRESSING Indirect Addressing allows the user to access a location in data memory without giving a fixed address in the instruction. This is done by using File Select Registers (FSRs) as pointers to the locations to be read or written to. Since the FSRs are themselves located in RAM as Special Function Registers, they can also be directly manipulated under program control. This makes FSRs very useful in implementing data structures, such as tables and arrays in data memory. The registers for Indirect Addressing are also implemented with Indirect File Operands (INDFs) that permit automatic manipulation of the pointer value with auto-incrementing, auto-decrementing or offsetting with another value. This allows for efficient code, using loops, such as the example of clearing an entire RAM bank in Example 5-5. EXAMPLE 5-5: HOW TO CLEAR RAM (BANK 1) USING INDIRECT ADDRESSING Note: The execution of some instructions in the core PIC18 instruction set are changed when the PIC18 extended instruction set is enabled. See Section 5.5 “Data Memory and the Extended Instruction Set” for more information. LFSR FSR0, 100h; NEXT CLRF POSTINC0 ; Clear INDF ; register then ; inc pointer BTFSS FSR0H, 1; All done with ; Bank1? BRA NEXT ; NO, clear next CONTINUE ; YES, continue © 2008 Microchip Technology Inc. DS39631E-page 69 PIC18F2420/2520/4420/4520 5.4.3.1 FSR Registers and the INDF Operand At the core of Indirect Addressing are three sets of registers: FSR0, FSR1 and FSR2. Each represents a pair of 8-bit registers, FSRnH and FSRnL. The four upper bits of the FSRnH register are not used so each FSR pair holds a 12-bit value. This represents a value that can address the entire range of the data memory in a linear fashion. The FSR register pairs, then, serve as pointers to data memory locations. Indirect Addressing is accomplished with a set of Indirect File Operands, INDF0 through INDF2. These can be thought of as “virtual” registers: they are mapped in the SFR space but are not physically implemented. Reading or writing to a particular INDF register actually accesses its corresponding FSR register pair. A read from INDF1, for example, reads the data at the address indicated by FSR1H:FSR1L. Instructions that use the INDF registers as operands actually use the contents of their corresponding FSR as a pointer to the instruction’s target. The INDF operand is just a convenient way of using the pointer. Because Indirect Addressing uses a full 12-bit address, data RAM banking is not necessary. Thus, the current contents of the BSR and the Access RAM bit have no effect on determining the target address. 5.4.3.2 FSR Registers and POSTINC, POSTDEC, PREINC and PLUSW In addition to the INDF operand, each FSR register pair also has four additional indirect operands. Like INDF, these are “virtual” registers that cannot be indirectly read or written to. Accessing these registers actually accesses the associated FSR register pair, but also performs a specific action on it stored value. They are: • POSTDEC: accesses the FSR value, then automatically decrements it by 1 afterwards • POSTINC: accesses the FSR value, then automatically increments it by 1 afterwards • PREINC: increments the FSR value by 1, then uses it in the operation • PLUSW: adds the signed value of the W register (range of -127 to 128) to that of the FSR and uses the new value in the operation. In this context, accessing an INDF register uses the value in the FSR registers without changing them. Similarly, accessing a PLUSW register gives the FSR value offset by that in the W register; neither value is actually changed in the operation. Accessing the other virtual registers changes the value of the FSR registers. Operations on the FSRs with POSTDEC, POSTINC and PREINC affect the entire register pair; that is, rollovers of the FSRnL register from FFh to 00h carry over to the FSRnH register. On the other hand, results of these operations do not change the value of any flags in the STATUS register (e.g., Z, N, OV, etc.). FIGURE 5-8: INDIRECT ADDRESSING FSR1H:FSR1L 7 0 Data Memory 000h 100h 200h 300h F00h E00h FFFh Bank 0 Bank 1 Bank 2 Bank 14 Bank 15 Bank 3 through Bank 13 ADDWF, INDF1, 1 7 0 Using an instruction with one of the Indirect Addressing registers as the operand.... ...uses the 12-bit address stored in the FSR pair associated with that register.... ...to determine the data memory location to be used in that operation. In this case, the FSR1 pair contains ECCh. This means the contents of location ECCh will be added to that of the W register and stored back in ECCh. xxxx 1110 11001100PIC18F2420/2520/4420/4520 DS39631E-page 70 © 2008 Microchip Technology Inc. The PLUSW register can be used to implement a form of Indexed Addressing in the data memory space. By manipulating the value in the W register, users can reach addresses that are fixed offsets from pointer addresses. In some applications, this can be used to implement some powerful program control structure, such as software stacks, inside of data memory. 5.4.3.3 Operations by FSRs on FSRs Indirect Addressing operations that target other FSRs or virtual registers represent special cases. For example, using an FSR to point to one of the virtual registers will not result in successful operations. As a specific case, assume that FSR0H:FSR0L contains FE7h, the address of INDF1. Attempts to read the value of the INDF1 using INDF0 as an operand will return 00h. Attempts to write to INDF1 using INDF0 as the operand will result in a NOP. On the other hand, using the virtual registers to write to an FSR pair may not occur as planned. In these cases, the value will be written to the FSR pair but without any incrementing or decrementing. Thus, writing to INDF2 or POSTDEC2 will write the same value to the FSR2H:FSR2L. Since the FSRs are physical registers mapped in the SFR space, they can be manipulated through all direct operations. Users should proceed cautiously when working on these registers, particularly if their code uses indirect addressing. Similarly, operations by Indirect Addressing are generally permitted on all other SFRs. Users should exercise the appropriate caution that they do not inadvertently change settings that might affect the operation of the device. 5.5 Data Memory and the Extended Instruction Set Enabling the PIC18 extended instruction set (XINST Configuration bit = 1) significantly changes certain aspects of data memory and its addressing. Specifically, the use of the Access Bank for many of the core PIC18 instructions is different; this is due to the introduction of a new addressing mode for the data memory space. What does not change is just as important. The size of the data memory space is unchanged, as well as its linear addressing. The SFR map remains the same. Core PIC18 instructions can still operate in both Direct and Indirect Addressing mode; inherent and literal instructions do not change at all. Indirect Addressing with FSR0 and FSR1 also remains unchanged. 5.5.1 INDEXED ADDRESSING WITH LITERAL OFFSET Enabling the PIC18 extended instruction set changes the behavior of Indirect Addressing using the FSR2 register pair within Access RAM. Under the proper conditions, instructions that use the Access Bank – that is, most bit-oriented and byte-oriented instructions – can invoke a form of Indexed Addressing using an offset specified in the instruction. This special addressing mode is known as Indexed Addressing with Literal Offset, or Indexed Literal Offset mode. When using the extended instruction set, this addressing mode requires the following: • The use of the Access Bank is forced (‘a’ = 0) and • The file address argument is less than or equal to 5Fh.