News:

;) This forum is the property of Proton software developers

Main Menu

Had to replace SHOut command

Started by shantanu@india, Jun 29, 2025, 04:20 PM

Previous topic - Next topic

shantanu@india

Hi,
I didn't have time to delve deep into it so I simply replaced the SHOut with a for loop. The PIC was hanging for some reason with the SHOut.

I have attached my program for others to analyze. The commnted out SHOut lies in the "control_relay" subroutine
Regards
Shantanu

Frizie

#1
I can not open the .rar file.
Please send .zip file.
Ohm sweet Ohm | www.picbasic.nl

Pepe

#2
look #9

shantanu@india

Hi Pepe,
Thanks.
Unfortunately I don't have Proteus to simulate but I presume it is working OK in simulation.
In the actual hardware the led stops blinking & the pushbuttons stop responding with SHOut.
Regards
Shantanu

Pepe

#4
look #9

Pepe

#5
look #9

shantanu@india

Thanks a million Pepe for detecting the fallacy.
I shall definitely try it out.
Maybe Les can have a look at the backend code generated by SHOut when he is free.
Regards
Shantanu

shantanu@india

Your code is working perfectly. :)
Thanks Pepe.
Regards
Shantanu

tumbleweed

#8
The code that you commented out in post #5 has to do with controlling the direction of a PORTx pin (TRISx register) and should not normally have to be removed.

Quoteit's the same as doing PIE1.0 = 0
I don't know why Les does it in shout.
The reason that it is effecting the PIE1 register is because you defined the SHOUT pin symbols using LAT register definitions instead of the PORT registers...

Symbol DataPin   LATC.0
Symbol ClockPin  LATA.6

Try this instead:
Symbol DataPin   PORTC.0
Symbol ClockPin  PORTA.6

TRISC is 18 locations after the PORTC register, hence the 'Addlw 18'. PIE1 is 18 locations after LATC.

Pepe

#9
Then a warning could be added so that Lat is not used to define shout pins.