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.
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.
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 =================================================
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
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
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
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... ?
Bookmarks