What program is on delivered Main Board?

Information and discussion regarding the main Firewing development board

What program is on delivered Main Board?

Postby Gordon_H » Sun Dec 08, 2013 5:49 pm

Just curious as to what program is on the Main Board as delivered. Mine has D4 being PWM'ed to change the brightness- I didn't see it in the samples folder. Did I miss it?
Gordon_H
 
Posts: 2
Joined: Sat Jun 29, 2013 7:49 pm

Re: What program is on delivered Main Board?

Postby David John Barker » Sun Dec 08, 2013 6:04 pm

It's something Matt put together ages ago called "Throb" - I use it to test the board before it gets shipped. The Arduino layout doesn't have PWM on D13 but the PIC24HJ128GP502 has a mechanism called Peripheral Pin Select (PPS) which allows you to move the PWM hardware onto another pin. In this case of Firewing, D13 is actually PORTB.14 - here is the code:
Code: Select all
' pic startup...
sub OnStartup() handles PIC.OnStartup
   RPOR7 = &H0012               
   T2CON = &H8000               
   PR2 = &H100                 
   OC1RS = &H00               
   OC1CON = &H0006             
end sub       

' entry point...
sub Main()
   Dim bright as Byte
   
   while true
      for bright = 0 to 100
         OC1RS = bright
         delayms(10)
      next bright

      for bright = 100 to 0 step -1
         OC1RS = bright
         delayms(10)
      next bright
   end while
end sub
User avatar
David John Barker
 
Posts: 490
Joined: Thu Nov 08, 2012 12:21 pm


Return to Main Board

Who is online

Users browsing this forum: No registered users and 2 guests

cron

x