SHIFTOUT with PIC12F675?


Closed Thread
Results 1 to 12 of 12

Hybrid View

  1. #1
    Join Date
    Feb 2022
    Posts
    54

    Default SHIFTOUT with PIC12F675?

    Hello to the Community.
    Is the Shiftout command possible for a PIC12F675?
    I ride a program using this command but my logic analyzer does not show me any pulse of Data and Clock!
    Thanks.

  2. #2
    Join Date
    Feb 2022
    Posts
    54


    Did you find this post helpful? Yes | No

    Default Re: SHIFTOUT with PIC12F675?

    Here is the test program...

    Code:
    '************************************************************************
    '   Programme: Shiftout Test PBP   (c)Roger LEGAT 07-2023
    '   RX Tester---> PIC 12F675
    ' PicBasicPro Compiler V:2.40   ---> 393 Words used
    '************************************************************************
    '*** PIC Pinouts/Specifications
    '------------------------------------
    '            PIC 12F675
    '                   __ __
    '           Vcc +|  U  |- Gnd
    '        GPIO.5 x|     |< GPIO.0
    '        GPIO.4 >|     |> GPIO.1 _DIO
    '        GPIO.3 >|     |> GPIO.2 _CLK
    '                    -----
    
    @ Device Pic12F675, intrc_osc, wdt_off, pwrt_on, mclr_off, protect_off
    
    DEFINE OSC 4    ' Pulsin/Pulsout Resolution    =10µsec    => 1ms=100
    '   (Pulse Value of 1msec x10 =1000)    [x10]
    '  Pause =1msec => 1msec=1    1sec=1000
    
    Include "modedefs.bas"   ;for shiftout command
    
    CMCON  = 7   'Comparator Off
    ANSEL  = 0   'Set Port to Digital i/o         
    ADCON0 = 0   'All ADC Off
     
    Asm
     bsf STATUS      ;Bank 1
     call 3FFh       ;Get the CAL value from 3FF addresse YOU WRITE BEFORE !
     movwf OSCCAL    ;Calibrate
     bcf STATUS, RP0 ;Bank 0
    Endasm
    
    '*** In/Out pins ..................................................
     Output 1 : _DIO var GPIO.1
     Output 2 : _CLK var GPIO.2
    
    '*** Variables/Constants
      Pack       VAR BYTE        ;Byte to send
      
     '=== MAIN PROGRAM =====================================================
    
     Pack = 255
    
    MainLoop:
     
       Shiftout _DIO,_CLK,LSBFIRST,[Pack\8] 'Send Byte
       pause 100
    
    Goto MainLoop
    
    
    ;=========== END OF PBP =================================================

  3. #3
    Join Date
    Nov 2003
    Location
    Greece
    Posts
    4,115


    Did you find this post helpful? Yes | No

    Default Re: SHIFTOUT with PIC12F675?

    Maybe it is better to define the output register more convenitional.

    Try

    TRISIO = 0

    DIO VAR GPIO.1
    CLK VAR GPIO.2

    and report back how is doing.

    Ioannis

  4. #4
    Join Date
    Feb 2022
    Posts
    54


    Did you find this post helpful? Yes | No

    Default Re: SHIFTOUT with PIC12F675?

    Hi,

    I'm trying to understand and learn:

    What might be the consequences if I set my ports as follows:

    Dio var GPIO.0
    or
    Symbol Dio = GPIO.0

    Does this make a difference to the way the program is processed?

    Thanks

  5. #5
    Join Date
    Nov 2003
    Location
    Greece
    Posts
    4,115


    Did you find this post helpful? Yes | No

    Default Re: SHIFTOUT with PIC12F675?

    Originally the problem I think was this syntax:

    '*** In/Out pins ..................................................
    Output 1 : _DIO var GPIO.1
    Output 2 : _CLK var GPIO.2

    I do not see how this can compile.

    Ioannis

  6. #6
    Join Date
    Feb 2022
    Posts
    54


    Did you find this post helpful? Yes | No

    Default Re: SHIFTOUT with PIC12F675?

    Hello,
    And yet the compiler didn't give any errors!?

    I'm going to keep your suggested syntax anyway.

    Concerning my problem with the Shiftout command, I note that a problem existed with this command for the Picaxe 08M2 (which is in fact a PIC12F1840).
    The Shiftout command was not possible for this Picaxe and it was necessary to create a small routine explained in the Picaxe manual.

    Before continuing my tests, I wondered if such a problem could also be encountered with my Pic12F675... ?

Similar Threads

  1. Pic12f675
    By Andre_Pretorius in forum Serial
    Replies: 1
    Last Post: - 6th April 2009, 00:27
  2. PIC12F675 not working
    By Russ Kincaid in forum mel PIC BASIC Pro
    Replies: 5
    Last Post: - 26th March 2009, 17:40
  3. SERIN with a PIC12F675
    By ewandeur in forum Serial
    Replies: 4
    Last Post: - 30th July 2007, 15:04
  4. Pic12f675
    By perides in forum mel PIC BASIC Pro
    Replies: 2
    Last Post: - 11th July 2007, 20:37
  5. PIC12F675 and ADCIn
    By Peter1960 in forum mel PIC BASIC Pro
    Replies: 3
    Last Post: - 19th February 2005, 07:42

Members who have read this thread : 0

You do not have permission to view the list of names.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts