Jump to content


Real Hardware Example For Dummies

1 reply to this topic

#1 Micmar



  • EstablishedMember
  • 13 posts

Posted 19 March 2012 - 10:44 AM


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

#2 hjlink



  • EstablishedMember
  • 6 posts
  • Gender:Male

Posted 31 October 2012 - 04:25 PM


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

Reply to this topic


0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users