Vous êtes sur la page 1sur 3

_readme_BlinkyIRQ05_demo_howto.

txt wmh 2010-11-12 : instructions for the BlinkyI RQ05 demo (ARM driving P24 resources) Setting up the development software: ==================================== yagarto -- download current version (2010813) of yagarto GNU ARM toolcha in from sourceforge.net/projects/yagarto and install it on your Windows machine. Do _not_ accept the invitation to install it in 'C:\Program Files\' -- there is a warning on the www.yagarto.de site about having spaces in the installation di rectory name. You can let the install program update Window's path variables w hen it requests --OR-- you can edit '_BlinkyIRQ05make.bat', the batch file for b uilding the example program, and in it the path to wherever you have installed y agarto. You'll have to edit the batch file anyway, as I've set the path in it t o my 'C:\_software_installs' directory, which you will want to change. You can a lso download and install 'YAGARTO Tools' from www.yagarto.de -- if you do, pleas e tell me what they are good for (I haven't used them). Keil -- go to https://www.keil.com/demo/eval/arm.htm and register, then download the free Keil uVision4 ARM development software (the version I got a fe w days ago is mdk413a.exe ) and install it. FlashMagic -- you will have to install the FlashMagic tool from http://w ww.flashmagictool.com in order to download ARM programs to the LPC2300 board. P24CDC_12.hex -- the included file 'P24CDC_12.hex' must be installed on the P24. It will provide the USB connection between your PC and the ARM board's serial port which FlashMagic uses to program the ARM chip. BlinkyIRQ05 demo -- extract the attached BlinkyIRQ05.zip somewhere, prob ably not on your desktop -- we want it in a directory on C:\ which doesn't have any spaces in its name, and isn't too long. Edit '_BlinkyIRQ05make.bat' as nece ssary to get the path to your yagarto tools set to where the yagarto \bin direct ory resides, then run the batch file from Windows Explorer or the DOS prompt. If all goes well you'll get a bunch of messages, but none of them will say 'error' , and you will be ready for the next step, which is: click on BlinkyIRQ05.Uv2 in the demo directory, and uVision4 should start up with the Blinky05 project load ed. When it does, go to to {Menu bar} Debug > Start/Stop Debug Session and have fun! What is BlinkyIRQ05? ==================== BlinkyIRQ05 is a demo program written (mostly) in ARM assembly language to run on the NXP2368 ARM processor on the cuteDigi LPC2300 board. BlinkyIRQ05 s ets up the ARM processor's timer0, interrupt controller, and I/O ports, then tra nsfers to main(), which writes various patterns to the ARM's output ports. A int errupt triggered by timer0 runs concurrently and reads several port bits, then r eports the result to main(). When the P24 and the ARM board are connected, with BlinkyIRQ05.hex runni ng on the ARM board and P24CDC_12.hex running on the P24, you have a complete de monstration of the ARM processor in control of the P24's lights and switches. I n BlinkyIRQ05 the ARM outputs to the P24's anode-drivers with the data sequence '11111110', '11111101', ... , '01111111', while also outputting the same data se quence '11111110', '11111101', ... , '01111111' to the P24's cathode-drivers, re sulting in a turning on a single illuminated segment which traverses all of the P24's LEDs. Meanwhile the ARM's timer0 interrupt is periodically sampling the P

24's SW1-Sw4 and displaying which switches are pressed by lighting the ARM board LEDs DS1-DS5. The switch status is also reported via a global variable to main( ), which turns on LED DS6 to report that it sees the switch information. Setting up the hardware: ======================== You don't need to have the P24/ARM hardware to be set up to get started on learning how to program and debug on the ARM. In fact I recommend that you ge t the yagarto and Keil development tools installed, build the 'BlinkyIRQ05' test program, and step through it with the Keil debugger while observing activities in the (simulated) ports before you set up the hardware testbed. TAfter that, l ook at information below and connect and test your boards. P24-ARM jumper connections -- the included 'P24-LPC2300_connections01.pd f' gives a table for the jumper connections between the P24 and LPC2300 boards. This is a job you should take your time with, as a misconnection may have an unk nown effect. To help you identify which pin does what, look at lower left corner of t he table in P24-LPC2300_connections01.pdf. This is the P24 signal SW_COL2 which carries switch closure information back to the PIC processor's port pin RA3. Thi s signal can also be accessed on the header H_PIC at pin 10. We have it connect ed by jumper to the ARM's P4 header at pin 24, therefore, the ARM processor will be able to monitor the state of SW_COL2 on the P24 board by testing its (the AR M's) input at port 0, bit 7. To help you identify pin physical locations for installing the jumpers, look at the included 'cutedigi_(Colorado) $35_lpc2368mini090831.sch.pdf', which shows how the pins on the ARM board's P4 connector are arranged. Notice how they follow the usual header-pin counting convention, with pin 1 in the upper left, pin 2 in the upper right, and the remaining odd and even numbered pins on opposi te sides all the way down. Please _don't_ remember how the DIP IC packages that you used in ENEE206 are numbered (e.g. differently). Now look at the included 'P 24v02r13_illustration.pdf'. Pin 1 on H_PIC is marked with a black dot (not as ni ce as the numbers on P4), so all of the odd-numbered pins are on the top row of H_PIC, and the even-numbered pins are on the bottom row. The only jumper connection not involving H_PIC or P4 is for the power su pply jumper from the P24 to the ARM board -- on the P24 this is connected to the left (sorry, no number is available) pin on H_NOREG, while on the ARM board its connected to the center pin of P6. Next, put the ARM board in ISP (serial loader) mode by holding down swit ch S2 ('ISP') on LPC2300 board while pressing/releasing S1 ('RST'), then releasi ng S2. Now start FlashMagic and: 1. select device set device = LPC2368 select COM port (check windows device manager for COM po rt# for 'Microchip CDC RS-232 Emulation Demo' set baud rate as 9600 (probably doesnt matter) set interface = 'None (ISP)' set oscillator = 12.0 Mhz read the manual for more info 2. select blocks to erase check 'Erase blocks used by hex file' 3. select file to download Browse to and select BlinkyIRQ05.hex

4. Options Check 'verify' 5. 'Start' Watch the counter on the bottom left, think positive tho ughts. To test the program, press/release the reset switch S1 on the ARM board, then watch LEDs march around on the P24. Press SW1-SW4 on the P24 in any combi nation, watch LEDs on the ARM board turn on. FAQ: Q: I loaded the BlinkIRQ05 demo on the ARM board, and now I can't get my P24 into programming mode unless I disconnect all of the jumpers, which I don't want to do. A: The problem is that some ARM board outputs are conflicting with some P24 outputs during the P24's programming-selection phase (when you reset the P24 while holding down SW1). Solution is to put the ARM board into programming mod e first -- hold down S2 on the ARM, press/release S1, then release S2. You can l eave the ARM in programming mode indefinitely while doing development on the P24 alone. Q: How can I fry my ARM board? A: One possibility to try: with all of the jumpers betweem the boards co nnected and the boards powered up, disconnect the power supply jumper between th em. This will let the PIC drive the ARM's inputs at voltages well above the LPC2 368 data sheet's permissible absolute maximums over Vss, and you are quite likel y to see smoke.

Vous aimerez peut-être aussi