Home
USB Flash Atmel
Contents
1. Compier Communication Erwrormen Hands simulator Progam Mon s P t BASCOM supports configuration of different register files for individual 8051 derivatives Although there are no specific settings for the AT89C5131 087 this microcontroller is largely compa tible with the 8052 so you should use 096 ps RS register file 8052 dat DES S i DBs The listing shows the source code of the test program It is easy to read and largely self explanatory After an intro ductory message is displayed on the LCD a running light routine is execut ed to check all the LEDs on Port PO Following this the inputs on port P3 are read in an endless loop and their states are copied to output port PO and shown on the LCD You can ac tuate the DIP swit F ches S2 and pushbuttons S3 S6 to check that they are proper ly assigned to the port pins The as sociated output LED will light up for each switch The test k pro gram thus F exer r cises practically all of the hardware A couple of ideas Finally a couple of ideas for further projects The microcontroller has an internal EEPROM similar to what is 11 2007 elektor po 7 tretin Dupa Comwonen aE LOD mise Pad Paf Make upper J bis hgh in LOD dengna Figure 7 The assignment of the LCD pins to port P2 must be configured under Options found in the 8958252 and the 89588253 However in thi
2. choose the driver to instal Choose ther opten bo pelesit the device deves from a let Windows dest rol guarantee zl Mom obra por chona wll bom Ham bc toute Fit pora Aum cta Nets Emos Figure 4 The microcontroller is recognised by Windows as a new device f Atal Flip 2 4 6 um 32 Fibers Black FF Fane O000 7FFF Ch ciin FENU Dist 0000 Fesp Eritrea Loading oe oso t stv oo FF FF Device 558 EN Level 1 Levo Figure 5 After you click Run FLIP downloads the program to the flash memory of the microcontroller 25 PROJECTS MICROCONTROLLERS F ARASCOM 6051 IDT fe dk Popia ook e n Hinder eko HH dh Pole is Beet A L raple test for inputs ulute and LC AAA Dim s Hylm Lover line Led Elektor Haat a Medel nner Figure 6 Main menu of the BASCOM compiler is connected and thus no communica tion will be established After a bit of practice you won t have any problems making the right settings and you can establish a communication session with the PC whenever you need it Program download Now launch FLIP First you have to use F2 Device a Select or the IC icon to select the correct IC AT89C5131 Then use F3 Settings a Communica tion a USB or the cable icon to select and open the USB interface Finally you have to use F4 or File a Load Hex Hardware test in Bascom 51 Simple test for inputs outputs and LCD Vkkkkkkkkkkkkkkkkkkk
3. create your awesome projects By getting technology in your hands we think everyone is better off We here at HandsOn like to think that we exist in the same group as our customers gt gt curious students engineers prototypers and hobbyists who love to create and share We are snowboarders and rock climbers painters and musicians engineers and writers but we all have one thing in common we love electronics We want to use electronics to make art projects gadgets and robots We live eat and breathe this stuff If you have more questions go ahead and poke around the website or send an email to sales handsontec com And as always feel free to let your geek shine around here we encourage it OGOO00000000060O c000000000000000c lt oc00000 71177 eeoooce eecece eeocoosocce O00000000000 Z m ole ee Pe ee ee e I ar A E di P i m E z Ca ey 2 TAS y i E smile ge i eet E ise Eat zz i r 22 ra aa JF r eae af Ma as E m 2 gt gt 4 _ lis JETTA all ntip www handsontec com
4. O Ta Ta Main Features e 8051 Central Processing Unit e On chip Flash Program Memory with In System Programming ISP and In Application Programming IAP capability e Boot ROM contains low level Flash programming routines for downloading code via the RS232 e Flash memory reliably stores program code even after 10 000 erase and program cycles 10 year minimum data retention e Programmable security for the code in the Flash The security feature protects against software piracy and prevents the contents of the Flash from being read e 4 level priority interrupt amp 7 interrupt sources 32 general purpose I O pins connected to 10pins header connectors for easy I O pins access Full duplex enhanced UART Framing error detection Automatic address recognition Programmable Counter Array PCA amp Pulse Width Modulation PWM Three 16 bits timer event counters AC DC 9 12V power supply easily available from wall socket power adapter On board stabilized 5Vdc for other external interface circuit power supply Included 8x LEDs and pushbuttons test board free with HT MC 02 while stock last for fast simple code testing Industrial popular window Keil C compiler and assembler included Eval version e Free Flash Magic Windows software for easy program code down loading PLEASE READ HT MC 02 GETTING STARTED MANUAL BEFORE OPERATE THIS BOARD INSTALL ACROBAT READER AcrobatReader705 Application TO OPEN AND P
5. P1 JP4 2 way SIL pinheader JP2 JP3 3 way SIL pinheader K2 USB A socket K3 K6 K8 10 way boxheader K4 6 way 2x3 pinheader K7 14 way boxheader K9 mains appliance socket PCB mount S1 S3 S6 miniature pushbutton PLCC socket PCB 070125 1 from Elektor SHOP Kit of parts 070125 71 from Elektor l l l l l l l l l l l l Miscellaneous l l l l l l l l l l SHOP i al It can be fitted directly on the PCB or mounted on a front panel Four full fledged 8 bit ports The microcontroller has four full fledged 8 bit ports each of which is accessible via a connector and or as signed a specific peripheral function Port PO is available on K3 and it also drives eight LEDs that can be con nected to VDD 5 V via series re sistors Port P1 is freely usable and accessible via K6 Port P2 is wired to LCD connector K7 An LCD module can be operated in 4 bit mode via this connector and a contrast adjustment trimpot is provided on the board Fi nally port P3 is specifically intended to be used for inputs and it can be accessed externally via K8 For testing user developed programs the board is fitted with pullup resistors four pushbutton switches P3 0 P3 3 and four DIP switches P3 4 P3 7 on port 3 Switches normally require de bouncing which can usually be imple mented in software The P3 2 and P3 3 lines have supplementary hardware debouncing in the form of capacitors C6 and C7 si
6. PO P3 Cls Led Lowerline Led Port 3 w PX RS da Waitms 60 Goto Status End If you want to download a new hex file after this test you must first dis connect the USB cable and then recon nect it and of course with the right jumper settings and a Reset first Af ter this you must establish the con nection again in FLIP Alternatively you can leave the USB cable connected and simply open JP3 which will also isolate the device from the USB without interrupting the supply voltage In order to download a new program you must first chan ge the setting of JP2 again The press Reset wait two seconds and fit JP3 again This initialises the USB device You will have to open the interface in FLIP again after which you can start the download Programming with BASCOM The BASCOM 51 Basic compiler is an ideal tool when you are just getting started with developing programs for the system although you can also write programs for the microcontroller in C or assembly language You can download a free demo version of BAS COM 51 from the site of its producer MCS Electronics www mcselec com The free version can generate up to 4 KB of code which is sufficient for many applications Figure 6 shows the main menu of the compiler In order to ensure correct operation of the board you must as BO Inputs elektor 11 2007 sign the LCD pins to port P2 under Options Figure 7 BASCOM 8051 Options
7. PROJECTS MICROCONTROLLERS USB Flash Board An 8051 based system for rapid software Alexander Kniel Flash microcontrollers are easy to program which makes them suitable for rapid software development environments and educational uses In the past program code was usually downloaded via a serial interface but nowadays many PCs especially laptops only have USB ports Our versatile Flash Board provides a solution to this problem It is built around an AT89C5131A which is an extended 8051 family microcontroller with an 80C52 core and a Full Speed USB port As a sort of bonus the IC has a complete update interface for downloading new firmware Atmel also provides suitable software in the form of its FLIP program which is available free of charge The Flash Microcontroller Board ori ginally published in December 2001 is well known to Elektor readers and it has helped many readers get started in the world of microcontrol lers That s hardly surprising since microcontrollers with flash memory such as the AT89C8252 used in the original Flash Board are easy to pro gram As with many other similar boards used for educational purpo ses the code is downloaded from a development PC to the microcontrol ler via a serial interface Unfortuna tely the good old RS232 interface is becoming increasingly rare Lapt ops in particular often have only USB ports and no longer come with prin ter ports or serial ports If a teacher
8. RINT ALL DOCUMENTS http www handsontec com Creativity or TOMOTTOW s HEMET MVA HandsOn Technology is a manufacturer of high quality educational and professional electronics kits and modules uController development evaluation boards Inside you will find Electronic Kits and fully assembled and tested Modules for all skill levels Please check back with us regularly as we will be adding many new kits and products to the site in the near future Do you want to stay up to date with electronics and computer technology Always looking for useful hints tips and interesting offers Inspiration and goals r j HandsOn Technology provides a multimedia and interactive platform for everyone interested in electronics From beginner to diehard from student to lecturer Information education inspiration and entertainment Analog and digital practical and aa Ple q eds theoretical software and hardware 3 aoe HandsOn Technology provides Designs ideas and 0 solutions for today s engineers and electronics hobbyists Creativity for tomorrow s better living HandsOn Technology believes everyone should have the tools hardware and resources to play with cool electronic gadgetry HandsOn Technology s goal is to get our hands On current technology and information and pass it on to you We set out to make finding the parts and information you need easier more intuitive and affordable so you can
9. e roe lari E S YET FE FP Pe A IC1 AT89C5131 C6 C7 100n 100n o 1N4001 070125 11 11 2007 elektor 23 PROJECTS MICROCONTROLLERS Lk Eee a kiai ol REA K4 p e o LLI o N JS K6 D1 D2 D3 D4 D5 D6 D7 D8 3398 R1 Figure 2 Assembling the circuit board should not present any problems microcontroller are for the USB data lines To activate the internal USB boot loader a low signal level must be applied to PSEN via JP2 jumper toward the edge of the board When reset switch S1 is pressed the boot loader starts up and receives data via the USB port Jumper posi Components list Resistors R1 1kQ5 8 way SIL array R2 R3 270 R4 R12 1kQ5 R5 1000 R6 R7 R11 4kQ7 R9 8 way 10kQ array R10 1kQ P1 10kQ potentiometer Capacitors C10 C11 22pF C3 2nF2 C4 10nF C1 C2 C5 C6 C7 C14 C15 C16 100nF C8 10uF 16V C9 1uF 16V C12 1000pF 16V C13 100uF 25V 24 tion JP3 must be closed jumper to ward IC2 to activate the USB port This connects pullup resistor R4 to the D line which indicates a Full Speed USB device to the PC If you would like to have a more conveni ent way to switch between run mode and download mode you can connect a changeover switch to JP2 and JP3 Semiconductors D1 D8 D12 LED red low current D9 BAT46 D10 1N4001 D11 zener diode 6V2 ICT AT89C5131AM IC2 7805 X1 12MHz quartz crystal J
10. ektor Flash Microcontroller Board and is suitable for not only learning how to program microcontrollers but also for mature applications in device controllers ro bots and many other areas Everything revolves around the abo ve mentioned AT89C5131AM which is an extended member of the 8051 fa mily Its core is an 80C52X2 with six clocks per instruction cycle Besides 32 KB of flash memory the IC has 1024 bytes of extended RAM additi onal EEPROM and many other useful peripherals Another helpful feature is that the M version of the microcontrol ler can also operate at 5 V and a versi on in the user friendly PLCC52 packa ge is available However probably the most important feature is the USB 1 1 USB 2 0 Full Speed module for the experts with endpoint O for control transfers and six additional endpoints with up to 512 bytes of FIFO memo ry If you want to develop USB soft ware this gives you everything you could wish for although you do need a bit of technical expertise Everyone else can regard the microcontroller as a normal 8051 device that can be pro grammed via USB The schematic diagram Figure 1 shows a dual power supply that can draw power either from the USB bus or with jumper JP4 fitted via voltage regulator IC2 from an AC adapter con nector K9 The D and D pins of the Figure 1 Schematic diagram of the USB Flash Board elektor 11 2007 070125 ji E lektor development Be
11. ised by its name Jungo AT89C5130 AT89C5131 If something goes wrong during this process you have to track down the problem Possible problem sources in clude incorrectly fitted jumpers For instance if you activate the USB port with JP3 pullup connected to D but do not start the internal firmware JP2 still in the Run position or no reset executed after switching over Win dows will report a new device but not the right one By contrast you might start the update firmware correctly but fit JP3 incorrectly In this case Win dows will not recognise that a device 11 2007 elektor Filp US8 Information L To perfora In Programming gwar the LSD wath Flip pienta proceed 5 Pollos 1 Complete Flo ratalabon 2 Connect your USB Largel Hardeare bo Um PC A Pollos the Mew Hardware Detection Wizard straps 4 Set the Winend Specie Location ch ck o only 5 Cope Hikes Provo E Proa TL PIP 7 do Figure 3 The free FLIP programming software displays a list of what you have to do fo start using the board Found Rew Hardwaro Wizard Firan thiom pour search amd metallateon pur T Search lot e bee deve mi ei location Une the check bowen below to imi qu spand the delaull search which includes local patita and uemorvable mera The besi deyer found vel be rebo Search memorable meda Mopey CD ROM E irekie ihe tocada ls aasch C Program Fim AT MEL LIP 4 Bush w tome CJ Doct pearch vall
12. kkk Dim X As Byte P1 0 Cls Led 8051 Test Wait 1 Lowerline Led Elektor Wait 3 For X 1 To 13 Shiftlcd Right Waitms 200 Next Cls Led Test Port O gt Lowerline Lcd Bit 2 exp 0 gt 26 File to load a suitable hex file Select program file 5131 TEST ELEKTOR HEX which you can obtain along with the BASCOM AVR source code from the Elektor home page Click the Run button see Figure 5 to download the program code to the flash memo ry After this you must change over JP2 and press the Reset button to run the program Caution the BLJB option is enabled automatically with a new microcontroller You must deselect uncheck it the first dime you down load a program since otherwise it will not be possible to run the program af ter it has been downloaded PO B11111110 Wait 1 Lowerline Led Bit 2 exp 1 PO amp B11111101 Wait 1 Lowerline Lcd Bit 2 exp 2 PO amp B11111011 Wait 1 Lowerline Lcd Bit 2 exp 3 gt P Bl1110111 Wait 1 Lowerline Lcd Bit 2 exp 4 PO amp B11101111 Wait 1 Lowerline Lcd Bit 2 exp 5 PO amp B11011111 Wait 1 Lowerline Lcd Bit 2 exp 6 gt PO amp B10111111 Wait 1 Lowerline Lcd Bit 2 exp 7 M PO amp B01111111 Wait 1 Lowerline Led All Bits 5 PO amp B00000000 Wait 1 Cls Lcd Test Port 3 Lowerline Lcd Test Port 0 LED 5 Wait 3 Status
13. nce these lines are con nected to the interrupt inputs of the microcontroller We also mustn t forget port P4 with the P4 0 and P4 1 lines which form the 12C bus interface and are accessible via K4 The bare PCB for the USB Flash Board Figure 2 is available from the Elek tor Shop under order number 070125 1 Alternatively you can purchase a complete kit with all the componen ts under order number 070125 71 As sembling the board is not difficult Be sure to avoid creating any shorts between D D or the 5 V supply line and ground in the area around the USB socket As there is no spe cial protection for the D D and 5 V supply lines it s a good idea to check this with an ohmmeter but be sure to remove the microcontroller from its socket first There is room for an ex tra 100 nF ceramic capacitor beneath the IC socket which should be fitted first It provides optimal supply vol tage decoupling Initial operation You should use an AC adapter 8 12 V DC for initial testing Fit jumper JP4 to select this power source LED D1 should light up now If you have already connected an LCD module it elektor 11 2007 should display dark pixels in the top line If necessary adjust the contrast trimpot until both lines are clearly dis tinguishable The upper line will re main dark until the board has been in itialised with a program If you have an oscilloscope you can also check the 12 MHz clock signal on the c
14. rystal This clearly shows that the microcontroller is running You have to download a program for the first real software test For this purpose you can use the Flexible In System Programmer FLIP software which you can download free of charge from Atmel s home page www atmel com Enter Flip as the search term to find FLIP 2 4 6 for Windows 4 MB Version 2 4 6 updated May 2006 First extract the contents of archive file flip 2 4 6 zip to a separate folder and then run the Setup exe file in that folder Fol low the installation instructions and accept the licence conditions and sug gested installation location You will then see a short list of instructions for vvhat you have to do next Figure 3 The program is installed by default in C Program Files Atmel FLIP 2 4 61 Now connect a cable to the USB con nector and fit jumper JP2 in the USB position toward the edge of the board To be on the safe side press reset switch S1 and close JP3 This starts the USB download firmware which waits for contact with the PC to be established The program reports vendor ID O3EB and product ID 2FFD which enable Windows to assign a sul table driver Windows will recognise a new device and ask you to select a suitable driver Select the driver loca ted in folder C Program Files Atmel FLIP 2 4 6 usb see Figure 4 After it is installed you will see the new de vice in the Device Manager window It can be recogn
15. s case it is governed by different control registers SFRs This means that you cannot escape a care ful study of the data sheet if you want to use the supplementary hardware Like the 8052 the AT89C5131 has ano ther serial interface that can be used with BASCOM by instructions such as Print and Input However this re quires connecting an additional line driver such as a MAX232 since the USB Flash Board does not have a serial interface port This opens the door to typical interface applications which means that you can use the micro controller as a PC based measuring in strument counter or motor controller Of course the AT89C5131 can also do a lot more including implementing a complete USB device This is descri bed in several application notes and accompanying source code on the At mel website The archive file c5131 usb kbd stand alone 1 0 2 zip de monstrates how to construct a USB keyboard With this USB microcontroller and the extensive software archive you have essentially everything you need to de velop your own USB applications 070999 1 27 HandsOn Technology Low Cost 8051uC Starter Kit Development Board HT MC 02 HT MC 02 is an ideal platform for small to medium scale embedded systems development and quick 8051 embedded design prototyping HT MC 02 can be used as Stand alone 8051uC Flash programmer or as a development prototyping and educational platform UOSPUEH E m El Li Pals
16. wants to give his students training boards that they can also program at home using a laptop a different ap proach is necessary The author an electronics instruc tor at a vocational technical school in Heilbronn Germany thus developed a version of the Flash Board based on a modern microcontroller with a USB interface For this purpose he selected the Atmel AT89C5131AM which has an 80C52 core and thus belongs to the 8051 family just like the AT89C8252 The IC incorporates an Full Speed USB 22 port and it is specifically designed for use in USB devices such as printers cameras and so on As a sort of bo nus the microcontroller has a complete update interface for downloading new firmware This in particular enabled the author who has a weakness for hardware and all sorts of programming languages to build an extremely simp le USB Flash Board because Atmel also provides suitable software in the form of its FLIP program which is available free of charge All you have to do is pro vide the program code in a hex file and you re ready to go Generation 2 Flash Board Many copies of the first version of the new board developed by Alexander Kniel have already been built by stu dents and used with laptop compu ters The board design was modified slightly in the Elektor lab and among other things Elektor designer Chris Vossen added an LCD interface The board thus follows in the footsteps of the 2001 version of the El
Download Pdf Manuals
Related Search
Related Contents
MPS, MXS - Calpeda USER MANUAL - I Garmin RS-232 User's Manual FB - seagro sl Descarga - NEC Display Solutions Europe Spire Symphony 363 Weider WEBE1291 User's Manual Copyright © All rights reserved.
Failed to retrieve file