tag:blogger.com,1999:blog-319977725441392717.post4944775730048574924..comments2024-02-11T04:20:28.299-08:00Comments on Sagar's blog: Hello Word ( LED blinker ) on LPC1768 explained. GPIO tutorialSagarhttp://www.blogger.com/profile/03543279903823145650noreply@blogger.comBlogger38125tag:blogger.com,1999:blog-319977725441392717.post-61423742104261782902012-11-16T05:57:40.476-08:002012-11-16T05:57:40.476-08:00it was very very useful and i thank you, but when ...it was very very useful and i thank you, but when i connect a led to pin0.0 it seems on , i connected to other pins but its the same, its like there is some voltage on all pins.<br />i defined pin0.0 as output and set and reset it but there is no change in led status.here is my complete code:<br />#include <br />int main (void){<br /><br />LPC_SC->PCONP |= ( 1 << 15 ); // power up GPIO <br />LPC_GPIO0->FIODIR |= 1 << 0;<br />LPC_GPIO0->FIOPIN |= 1 << 0;<br /><br />}<br />i will be thankful if you tell me what file should i add to project or what settings i should i do for cclk andpclk,<br />thanks a lot for your attention.<br />Anonymoushttps://www.blogger.com/profile/07874484848361997051noreply@blogger.comtag:blogger.com,1999:blog-319977725441392717.post-70767309732460920192012-09-15T21:05:45.126-07:002012-09-15T21:05:45.126-07:00I thank you alot for this tutorial. Helped alot!I thank you alot for this tutorial. Helped alot!Anonymousnoreply@blogger.comtag:blogger.com,1999:blog-319977725441392717.post-17504778274088397112012-07-28T08:17:03.305-07:002012-07-28T08:17:03.305-07:00Hi again,
i wanted to clarify that i want my progr...Hi again,<br />i wanted to clarify that i want my program to print "hello world" on the serial window.<br /><br />DeepthiAnonymoushttps://www.blogger.com/profile/02971533343493888066noreply@blogger.comtag:blogger.com,1999:blog-319977725441392717.post-43918027608340061332012-07-27T05:36:10.695-07:002012-07-27T05:36:10.695-07:00Hi,
I am in my final year engineering. I am fairly...Hi,<br />I am in my final year engineering. I am fairly new to LPC1768.<br />I have tried the blinky program. Can you please help me with HELLO WORLD program?<br /><br />DeepthiAnonymoushttps://www.blogger.com/profile/02971533343493888066noreply@blogger.comtag:blogger.com,1999:blog-319977725441392717.post-84477109464771306292012-02-29T00:54:35.082-08:002012-02-29T00:54:35.082-08:00ok, I renamed cs-make.exe file to make.exe and now...ok, I renamed cs-make.exe file to make.exe and now it compiles. thank you for ur help.Anonymousnoreply@blogger.comtag:blogger.com,1999:blog-319977725441392717.post-26476778948659210822012-02-29T00:08:19.063-08:002012-02-29T00:08:19.063-08:00I dont have make.exe, but I have cs-make.exe file....I dont have make.exe, but I have cs-make.exe file.Anonymousnoreply@blogger.comtag:blogger.com,1999:blog-319977725441392717.post-56905262655592566632012-02-29T00:06:49.544-08:002012-02-29T00:06:49.544-08:00Sorry for this very late reply.
Perhaps your boot...Sorry for this very late reply.<br /><br />Perhaps your bootloader is larger and the start point for the main application is different.Sagarhttps://www.blogger.com/profile/15831013932411819192noreply@blogger.comtag:blogger.com,1999:blog-319977725441392717.post-16581489884090276052012-02-29T00:04:31.424-08:002012-02-29T00:04:31.424-08:00Probably "make" is not in PATH. The othe...Probably "make" is not in PATH. The other remote possibility is that somehow "make" was not installed. Try locating make.exe in the installation directory and include that in PATH.<br /><br />Another crude option is to install WinAVR or some other GCC compiler which will also install "make"Sagarhttps://www.blogger.com/profile/15831013932411819192noreply@blogger.comtag:blogger.com,1999:blog-319977725441392717.post-74613431132570717422012-02-28T23:47:44.744-08:002012-02-28T23:47:44.744-08:00sorry, I run it again by using following command:
...sorry, I run it again by using following command:<br />arm-none-eabi-g++ -v<br /><br />The last line of output is :<br />gcc version 4.4.1Anonymousnoreply@blogger.comtag:blogger.com,1999:blog-319977725441392717.post-43363727007325042762012-02-28T23:35:18.552-08:002012-02-28T23:35:18.552-08:00output that I get when I run in cmd:
C:User\Khass...output that I get when I run in cmd:<br /><br />C:User\Khassan\make<br />'make' is not recognized as internal or external command,<br />operable program or batch file.Anonymousnoreply@blogger.comtag:blogger.com,1999:blog-319977725441392717.post-55155696720643485562012-02-28T22:29:45.118-08:002012-02-28T22:29:45.118-08:00Try running make from the command line.Try running make from the command line.Sagarhttps://www.blogger.com/profile/15831013932411819192noreply@blogger.comtag:blogger.com,1999:blog-319977725441392717.post-89528073854839348032012-02-28T22:23:56.440-08:002012-02-28T22:23:56.440-08:00hello, thank you for a nice guide.
But, I have a p...hello, thank you for a nice guide.<br />But, I have a problem. I did all the mentioned steps and when it comes to build step I get this message:<br /><br />**** Build of configuration Default for project LEDBlinky ****<br />(Cannot run program "make": Launching failed)<br /><br />I tried to reinstall codesourcery several times, and checked Path, everything is fine. please help me to figure out the problem!!Anonymousnoreply@blogger.comtag:blogger.com,1999:blog-319977725441392717.post-40696033872735960652012-01-12T23:31:57.046-08:002012-01-12T23:31:57.046-08:00I just did the whole setup in programmers notepad....I just did the whole setup in programmers notepad. it works, as in compiles and everything.. But the same issue, after copying the bin file over, it doesnt run the code. No LED flashing or pin toggeling either...<br /><br />Also, it was the bin file or the hex file.. regardless, I copied both, for a test each time.. didnt work.. any hints?Anonymousnoreply@blogger.comtag:blogger.com,1999:blog-319977725441392717.post-21946310257846762662012-01-12T21:22:49.019-08:002012-01-12T21:22:49.019-08:00Wow Thanks for the prompt reply! :D
Ok, So I unin...Wow Thanks for the prompt reply! :D<br /><br />Ok, So I uninstalled it, and reinstalled it with the destination directory C:\eclips.<br /><br />I figured, this is the most likely place eclips would want its stuff to be in.. and IT WORKED!!! =D<br /><br />Well I think.. Cuz, I kept getting errors on the delay function in your code. So, as a test, I commented out all the delay stuff. and just had it turn off the pin on Port1.29<br /><br />but when I test it, the pin is still high. :/<br /><br />Any clues to that?<br /><br />I'm using the bootloader method. and I also made sure that the start location is 0x00002000.<br /><br />Hope to hear soonAnonymousnoreply@blogger.comtag:blogger.com,1999:blog-319977725441392717.post-69993727589081371902012-01-12T20:52:10.513-08:002012-01-12T20:52:10.513-08:001. Your PATH enviroment variable doesnt point to m...1. Your PATH enviroment variable doesnt point to make.<br />2. There is something wrong with the g++ installation.<br /><br />Try going to the command line and see if you can run make from there.<br />Try uninstalling and re-installing sourcery g++.Sagarhttps://www.blogger.com/profile/15831013932411819192noreply@blogger.comtag:blogger.com,1999:blog-319977725441392717.post-66857741494366816482012-01-12T20:14:01.029-08:002012-01-12T20:14:01.029-08:00Hi Sagar,
Thanks for this awesome page. I wouldnt...Hi Sagar,<br /><br />Thanks for this awesome page. I wouldnt have known how to deal with this stuff without.<br /><br />I however am having a problem with the environment. I downloaded eclips and code sourcery as instructed. I wrote the code as written above, but when it comes to building it, eclips says:<br /><br />**** Build of configuration Default for project LEDBlinky ****<br /><br /><br />(Cannot run program "make": Launching failed)<br /><br />Did you ever come across something like this?<br /><br />Any help would be greatly appreciated.<br /><br />ThanksAnonymousnoreply@blogger.comtag:blogger.com,1999:blog-319977725441392717.post-85484054302600636112011-12-26T09:42:33.267-08:002011-12-26T09:42:33.267-08:00Hello Sagar,
Now my code is running. Actually I di...Hello Sagar,<br />Now my code is running. Actually I did nothing ,just downloaded the previous code and I found it was working:).<br />Anyways thanks for prompt reply.<br /><br />I am also staying in Mysore.<br />Is it possible for share your contacts?:)Anonymousnoreply@blogger.comtag:blogger.com,1999:blog-319977725441392717.post-88723372523890811642011-12-25T19:23:17.413-08:002011-12-25T19:23:17.413-08:001. Are you certain you got the code running ?
2. ...1. Are you certain you got the code running ?<br /><br />2. Try modifying the code to keep the LED OFF at start and check out if the LED remains OFF<br /><br />3. Its possible that the CPU isnt running at the right frequency and the delay is too much ( maybe over a minute ) and so you're not seeing it blink. Try smaller delays / check the frequency. If I remember correctly, the code assumes you're running at 100MHz.Sagarhttps://www.blogger.com/profile/15831013932411819192noreply@blogger.comtag:blogger.com,1999:blog-319977725441392717.post-90104134995778206062011-12-25T10:08:01.894-08:002011-12-25T10:08:01.894-08:00Hi,
I tried the same code with BlueBaord Combo , b...Hi,<br />I tried the same code with BlueBaord Combo , but test LED on stamp module didn't blink, instead it was just in ON status.<br />Please help me.yogeshhttps://www.blogger.com/profile/12263149257919179050noreply@blogger.comtag:blogger.com,1999:blog-319977725441392717.post-26206360086703057252011-07-19T13:40:24.901-07:002011-07-19T13:40:24.901-07:00Okay thanks again for the answer. I certainly don&...Okay thanks again for the answer. I certainly don't see any blinking. I'm trying to program it such that the flicker can be eliminated and I can have the display appear as if the digits are on simultaneously. Yes, the software delay is indeed significant and incalculable as I found out while debugging.Anonymousnoreply@blogger.comtag:blogger.com,1999:blog-319977725441392717.post-77440035093574818842011-07-13T19:49:44.945-07:002011-07-13T19:49:44.945-07:00With a software delay routine, its very hard to ca...With a software delay routine, its very hard to calculate. The delay will strongly depend on compiler version, optimization level etc. Maybe a rough estimate can be made if you assembly for cortex m3. But I dont.<br /><br />At 100Mhz, I had gotten about 2Hz. 47Hz seems very high. If you were looking at the LED, most certainly, you cant see it blinking. It'll just appear dull if its blinking at 47Hz.<br /><br />As you might have guessed, a timer will have to be used even if coarse control over timing is needed.Sagarhttps://www.blogger.com/profile/15831013932411819192noreply@blogger.comtag:blogger.com,1999:blog-319977725441392717.post-36468182592294577202011-07-13T11:18:36.233-07:002011-07-13T11:18:36.233-07:00Thanks for the response! I agree with you.
Anoth...Thanks for the response! I agree with you. <br /><br />Another question? In the same page, what frequency does the LED end up blinking at if we assume CCLK = 100 MHz? I get ~47 Hz but want to check if I have erred somewhere.Anonymousnoreply@blogger.comtag:blogger.com,1999:blog-319977725441392717.post-69831962540718137752011-07-13T11:11:24.756-07:002011-07-13T11:11:24.756-07:00I got confused a fair few times over the same issu...I got confused a fair few times over the same issue !<br /><br />This was one of my attempts at programming LPC1768 and I've learnt that code, particularly code that assigns register values, is a LOT more readable if bits are assigned to groups rather than individually.<br /><br />For instance, like you said, assigning ( 0x2 << 2 ) leaves less room for confusion than ( 1 << 3 ).<br /><br />Thanks for pointing this out !Sagarhttps://www.blogger.com/profile/15831013932411819192noreply@blogger.comtag:blogger.com,1999:blog-319977725441392717.post-16157019928411429132011-07-13T10:36:48.333-07:002011-07-13T10:36:48.333-07:00Never mind the above comment, we are actually sett...Never mind the above comment, we are actually setting 3:2 to 10, which makes the explanation CCLK/2 correct.Anonymousnoreply@blogger.comtag:blogger.com,1999:blog-319977725441392717.post-7878573897295117472011-07-13T10:27:30.325-07:002011-07-13T10:27:30.325-07:00It's great finding tutorial like this!
I have ...It's great finding tutorial like this!<br />I have a question if you fancy taking a look at it. Check out the line <br /><br />LPC_SC->PCLKSEL0 |= 1 << 3; <br />// Clock for timer = CCLK/2<br /><br />Here is the page it comes from (likely also appears on LPC source code)<br />http://msys-mv.blogspot.com/2010/11/configuring-and-playing-with-timer-of.html<br /><br />If the clock for timer0 is controlled by bits 3:2 in peripheral clock register, and we are putting a 1 in bit position 2 (1 shifted 3 places), it means we are setting bits 3:2 to 01 which, according to table 42 means clock for timer0 is now set at CCLK, right? I am wondering if I am reasoning properly because the explanation says the clock is now CCLK/2. What do you think?Anonymousnoreply@blogger.com