Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
PIC16F1827 HPWM Push-pull
#21
Upravu si nisam rekao da sam pisao u PicBasic Pro i sve rutine su pisane u PicBasic.
Evo i kompletan Kod:

Code:
define OSC 4

OSCCON=%01101000
TRISB=%00000000   ' Port B je izlazni
ANSELB=%0000000   ' Port B je digitalni
ms var word
PortB.0=0
PortB.1=0  

    
    INTCON.5 = 0            'Onemoguci TMR0 prekide
    
    ms=0
    
   OPTION_REG = %1000010    '010 preskaler postavi u odnos    1:8
   TMR0=6               'Postavi vrednost TMR0
            
    INTCON.5=1        'Omoguci TMR0 prekide
    INTCON.7=1        'Omoguci sve prekide

   ON INTERRUPT goto Int_Sub
'------------Glavni program--------------------------
Pocetak:
     
   
   
   
    
    Goto Pocetak
    
'------Podprogram obrade prekida-----------------------
      disable
Int_Sub:

   INTCON.7=0
   
  if INTCON.2 AND INTCON.5 THEN
   INTCON.2=0
       ms = ms + 2
       ENDIF
   
     if ms = 6 then    
    PortB.0=0
    ENDIF
   
  if ms = 10 Then
    PortB.1=1
    endif
   
  IF MS = 16 THEN
    PortB.1=0
    endif
   
  if ms = 20 then
    PortB.0=1
    ms = 0
    endif
   
   
   INTCON.7=1  'Omoguci prekide
   INTCON.5=1  'Omoguci prekide

   resume         'Vrati se iz rutine prekida

    End
Reply


Messages In This Thread
PIC16F1827 HPWM Push-pull - by Milan94 - 10-22-2015, 04:25 PM
RE: PIC16F1827 HPWM Push-pull - by emiSAr - 10-22-2015, 05:01 PM
RE: PIC16F1827 HPWM Push-pull - by Milan94 - 10-22-2015, 05:24 PM
RE: PIC16F1827 HPWM Push-pull - by gorankg - 10-22-2015, 05:40 PM
RE: PIC16F1827 HPWM Push-pull - by Milan94 - 10-22-2015, 06:01 PM
RE: PIC16F1827 HPWM Push-pull - by npejcic - 10-23-2015, 11:30 AM
RE: PIC16F1827 HPWM Push-pull - by Milan94 - 10-23-2015, 03:08 PM
RE: PIC16F1827 HPWM Push-pull - by Želja - 10-23-2015, 03:09 PM
RE: PIC16F1827 HPWM Push-pull - by Milan94 - 10-23-2015, 03:15 PM
RE: PIC16F1827 HPWM Push-pull - by mikikg - 10-23-2015, 04:09 PM
RE: PIC16F1827 HPWM Push-pull - by Milan94 - 10-23-2015, 05:30 PM
RE: PIC16F1827 HPWM Push-pull - by mikikg - 10-23-2015, 05:50 PM
RE: PIC16F1827 HPWM Push-pull - by Želja - 10-23-2015, 07:22 PM
RE: PIC16F1827 HPWM Push-pull - by mikikg - 10-23-2015, 07:41 PM
RE: PIC16F1827 HPWM Push-pull - by Milan94 - 10-23-2015, 06:19 PM
RE: PIC16F1827 HPWM Push-pull - by Želja - 10-23-2015, 07:19 PM
RE: PIC16F1827 HPWM Push-pull - by mikikg - 10-23-2015, 07:22 PM
RE: PIC16F1827 HPWM Push-pull - by gorankg - 10-23-2015, 09:09 PM
RE: PIC16F1827 HPWM Push-pull - by Milan94 - 11-28-2015, 08:12 PM
RE: PIC16F1827 HPWM Push-pull - by Želja - 11-28-2015, 09:17 PM
RE: PIC16F1827 HPWM Push-pull - by Milan94 - 11-28-2015, 09:27 PM
RE: PIC16F1827 HPWM Push-pull - by Želja - 11-28-2015, 09:47 PM
RE: PIC16F1827 HPWM Push-pull - by Milan94 - 11-28-2015, 10:01 PM
RE: PIC16F1827 HPWM Push-pull - by Želja - 11-28-2015, 10:04 PM
RE: PIC16F1827 HPWM Push-pull - by Želja - 11-28-2015, 10:09 PM
RE: PIC16F1827 HPWM Push-pull - by Milan94 - 11-28-2015, 10:16 PM
RE: PIC16F1827 HPWM Push-pull - by Želja - 11-28-2015, 10:23 PM
RE: PIC16F1827 HPWM Push-pull - by Želja - 11-28-2015, 10:37 PM
RE: PIC16F1827 HPWM Push-pull - by Milan94 - 11-28-2015, 10:49 PM
RE: PIC16F1827 HPWM Push-pull - by Želja - 11-28-2015, 10:58 PM
RE: PIC16F1827 HPWM Push-pull - by Želja - 11-28-2015, 10:50 PM
RE: PIC16F1827 HPWM Push-pull - by Milan94 - 11-28-2015, 11:06 PM
RE: PIC16F1827 HPWM Push-pull - by Želja - 11-28-2015, 11:08 PM
RE: PIC16F1827 HPWM Push-pull - by Milan94 - 11-28-2015, 11:15 PM
RE: PIC16F1827 HPWM Push-pull - by Želja - 11-28-2015, 11:26 PM
RE: PIC16F1827 HPWM Push-pull - by Želja - 11-28-2015, 11:21 PM
RE: PIC16F1827 HPWM Push-pull - by Milan94 - 11-28-2015, 11:44 PM
RE: PIC16F1827 HPWM Push-pull - by Želja - 11-28-2015, 11:54 PM
RE: PIC16F1827 HPWM Push-pull - by Želja - 11-28-2015, 11:58 PM
RE: PIC16F1827 HPWM Push-pull - by Milan94 - 11-29-2015, 12:12 AM
RE: PIC16F1827 HPWM Push-pull - by Želja - 11-29-2015, 12:22 AM
RE: PIC16F1827 HPWM Push-pull - by Milan94 - 11-29-2015, 12:28 AM
RE: PIC16F1827 HPWM Push-pull - by Želja - 11-29-2015, 12:33 AM
RE: PIC16F1827 HPWM Push-pull - by mikikg - 11-29-2015, 12:38 AM
RE: PIC16F1827 HPWM Push-pull - by Želja - 11-29-2015, 01:01 AM
RE: PIC16F1827 HPWM Push-pull - by sax778 - 11-29-2015, 05:38 PM
RE: PIC16F1827 HPWM Push-pull - by Milan94 - 11-29-2015, 11:05 PM
RE: PIC16F1827 HPWM Push-pull - by sax778 - 11-29-2015, 11:43 PM
RE: PIC16F1827 HPWM Push-pull - by Milan94 - 04-27-2017, 02:10 PM
RE: PIC16F1827 HPWM Push-pull - by gorankg - 04-27-2017, 02:55 PM
RE: PIC16F1827 HPWM Push-pull - by Milan94 - 04-27-2017, 03:24 PM
RE: PIC16F1827 HPWM Push-pull - by gorankg - 04-27-2017, 07:04 PM
RE: PIC16F1827 HPWM Push-pull - by Milan94 - 04-27-2017, 07:22 PM
RE: PIC16F1827 HPWM Push-pull - by gorankg - 04-27-2017, 07:32 PM
RE: PIC16F1827 HPWM Push-pull - by Milan94 - 04-27-2017, 07:49 PM
RE: PIC16F1827 HPWM Push-pull - by gorankg - 04-27-2017, 08:43 PM
RE: PIC16F1827 HPWM Push-pull - by Macola - 04-28-2017, 08:52 AM
RE: PIC16F1827 HPWM Push-pull - by Milan94 - 04-28-2017, 09:43 AM
RE: PIC16F1827 HPWM Push-pull - by gorankg - 04-28-2017, 02:05 PM
RE: PIC16F1827 HPWM Push-pull - by Macola - 04-28-2017, 11:39 AM
RE: PIC16F1827 HPWM Push-pull - by Milan94 - 04-29-2017, 12:01 AM
RE: PIC16F1827 HPWM Push-pull - by gorankg - 04-29-2017, 12:12 AM
RE: PIC16F1827 HPWM Push-pull - by Milan94 - 04-29-2017, 12:17 AM
RE: PIC16F1827 HPWM Push-pull - by mikikg - 04-29-2017, 12:35 AM
RE: PIC16F1827 HPWM Push-pull - by Milan94 - 04-29-2017, 12:44 AM
RE: PIC16F1827 HPWM Push-pull - by Milan94 - 04-29-2017, 12:37 AM
RE: PIC16F1827 HPWM Push-pull - by mikikg - 04-29-2017, 12:44 AM
RE: PIC16F1827 HPWM Push-pull - by gorankg - 04-29-2017, 12:49 AM
RE: PIC16F1827 HPWM Push-pull - by Milan94 - 04-29-2017, 01:04 AM
RE: PIC16F1827 HPWM Push-pull - by Milan94 - 04-29-2017, 12:56 AM
RE: PIC16F1827 HPWM Push-pull - by Milan94 - 05-02-2017, 12:29 PM
RE: PIC16F1827 HPWM Push-pull - by mikikg - 05-02-2017, 02:14 PM
RE: PIC16F1827 HPWM Push-pull - by Macola - 05-02-2017, 06:56 PM
RE: PIC16F1827 HPWM Push-pull - by Macola - 05-02-2017, 07:01 PM
RE: PIC16F1827 HPWM Push-pull - by MILANNN - 05-02-2017, 07:45 PM
RE: PIC16F1827 HPWM Push-pull - by Milan94 - 05-02-2017, 11:58 PM
RE: PIC16F1827 HPWM Push-pull - by Macola - 05-03-2017, 12:01 AM
RE: PIC16F1827 HPWM Push-pull - by Milan94 - 05-03-2017, 12:27 AM
RE: PIC16F1827 HPWM Push-pull - by mikikg - 05-03-2017, 07:01 AM
RE: PIC16F1827 HPWM Push-pull - by Milan94 - 05-03-2017, 07:57 AM
RE: PIC16F1827 HPWM Push-pull - by Želja - 05-03-2017, 08:04 AM
RE: PIC16F1827 HPWM Push-pull - by Macola - 05-03-2017, 08:13 AM
RE: PIC16F1827 HPWM Push-pull - by mikikg - 05-03-2017, 08:53 AM
RE: PIC16F1827 HPWM Push-pull - by Milan94 - 05-03-2017, 09:20 AM
RE: PIC16F1827 HPWM Push-pull - by Milan94 - 05-03-2017, 04:07 PM
RE: PIC16F1827 HPWM Push-pull - by mikikg - 05-03-2017, 05:23 PM
RE: PIC16F1827 HPWM Push-pull - by Milan94 - 05-03-2017, 05:42 PM
RE: PIC16F1827 HPWM Push-pull - by mikikg - 05-03-2017, 05:57 PM
RE: PIC16F1827 HPWM Push-pull - by Milan94 - 05-03-2017, 06:15 PM
RE: PIC16F1827 HPWM Push-pull - by gorankg - 05-03-2017, 06:26 PM
RE: PIC16F1827 HPWM Push-pull - by Milan94 - 05-03-2017, 06:42 PM
RE: PIC16F1827 HPWM Push-pull - by gorankg - 05-03-2017, 07:25 PM
RE: PIC16F1827 HPWM Push-pull - by Macola - 05-03-2017, 07:33 PM
RE: PIC16F1827 HPWM Push-pull - by Milan94 - 05-03-2017, 08:04 PM
RE: PIC16F1827 HPWM Push-pull - by Macola - 05-03-2017, 10:30 PM
RE: PIC16F1827 HPWM Push-pull - by Macola - 05-03-2017, 10:48 PM
RE: PIC16F1827 HPWM Push-pull - by Milan94 - 05-03-2017, 11:14 PM
RE: PIC16F1827 HPWM Push-pull - by mikikg - 05-04-2017, 05:13 AM
RE: PIC16F1827 HPWM Push-pull - by Macola - 05-04-2017, 07:28 AM
RE: PIC16F1827 HPWM Push-pull - by Želja - 05-04-2017, 07:40 AM
RE: PIC16F1827 HPWM Push-pull - by Macola - 05-05-2017, 06:12 PM
RE: PIC16F1827 HPWM Push-pull - by Macola - 05-05-2017, 11:06 PM
RE: PIC16F1827 HPWM Push-pull - by Milan94 - 05-06-2017, 01:57 AM
RE: PIC16F1827 HPWM Push-pull - by Macola - 05-06-2017, 11:48 AM
RE: PIC16F1827 HPWM Push-pull - by Macola - 05-06-2017, 11:52 AM
RE: PIC16F1827 HPWM Push-pull - by mikikg - 05-06-2017, 08:58 PM
RE: PIC16F1827 HPWM Push-pull - by Milan94 - 05-06-2017, 09:22 PM
RE: PIC16F1827 HPWM Push-pull - by Macola - 05-06-2017, 11:01 PM
RE: PIC16F1827 HPWM Push-pull - by Milan94 - 05-08-2017, 08:40 AM
RE: PIC16F1827 HPWM Push-pull - by Milan94 - 01-19-2021, 01:04 PM
RE: PIC16F1827 HPWM Push-pull - by mikikg - 01-20-2021, 05:58 AM
RE: PIC16F1827 HPWM Push-pull - by Milan94 - 01-20-2021, 07:56 PM
RE: PIC16F1827 HPWM Push-pull - by vojinilic - 01-20-2021, 09:13 PM
RE: PIC16F1827 HPWM Push-pull - by Milan94 - 01-20-2021, 11:05 PM
RE: PIC16F1827 HPWM Push-pull - by mikikg - 01-21-2021, 04:28 AM

Forum Jump:


Users browsing this thread: 3 Guest(s)