Jump to content

Real Hardware Example For Dummies

Recommended Posts



I have download, test, and buy the basic compiler.

The example work well and the simulation is very usefull.

But when I tried to start whith my first project I have some trouble on the port initializazion, register setting(clock, wd, etc.)

Can anyone publish in the forum a simple real example finished to fit in a micro?

The increment of the port example is well but not referred to an hardware.


Thanks in advance and sorry for my english, Marco

Share this post

Link to post
Share on other sites



Below is a program I wrote for a 16F877A. All it does is flash an LED on PORT C. But I think it will have all of the basic info you need.




#include <basic/system.bas>



#pragma CLOCK_FREQ 4000000

#pragma OPTIMIZE "1"


dim PC as byte


sub ToggleLED()

PC = PC ^ 00000001b

portc = PC 'Flip the 1st LED

call delay_ms(500)

end sub



sub main()

'setup PIC

trisc = 0 'Set port c to all output


'main loop

do while 1

call ToggleLED()


end sub

Share this post

Link to post
Share on other sites

Join the conversation

You are posting as a guest. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.


  • Create New...