disconnect command

the old fart

Senior Member
Hi Guys,
08m2
when I use the disconnect command, it's stopping serial output on pinC.4.

c.0 is an led

Code:
;catalex mp3 player
;

#Picaxe 08M2
SetFreq m8  'Must be set to 8mhz or 16mhz for Serout command to work at 9600 baud

disconnect

Init:  
pause 2500	'Required for proper operation after power-up

serout C.4,T9600_8,($7E,$FF,$06,$09,$00,$00,$02,$EF) 'Select TF socket on Catalex

'Required for proper operation after power-up
pause 500
HIGH c.0
pause 4000
LOW c.0

Main:



serout C.4,T9600_8,($7E,$FF,$06,$03,$00,$00,$01,$EF)
trun:


readadc C.1,w11; volume 0 to255
w11=w11/8 min 10 max 30

serout C.4,T9600_8,($7E,$FF,$06,$06,$00,$00,w11,$EF); volume 
pause 50
goto trun
tof
 
Last edited:

AllyCat

Senior Member
Hi,

Why are you using the disconnect command? Your code doesn't seem to be doing anything with the relevant pin (C.5).

Have you tried a High (or Low) C.4 just after the disconnect? There appear to be some slightly similar "bugs" with other M2s, but nothing is logged for the 08M2.

Maybe we need hippy/technical.

Cheers, Alan.
 

hippy

Technical Support
Staff member
It all works as expected when I try it.

On an 08M2 ( Version 4.A ) I can see the expected TF command then repeated volume commands being transmitted on C.4.

As you are using a T9600_8 baud rate, it would be advisable to put a HIGH C.4 early in the program.
 

the old fart

Senior Member
Hi Allycat, pin is going to be used later. program still in development stage.


Hi Hippy, Thanks for reply, would using disconnect effect the cycle time? maybe I need to increase the 'pause' times?

tof
 

hippy

Technical Support
Staff member
Using DISCONNECT will have minimal effect on program execution. All it will do is shave a few microseconds off each command as it skips the check to see in the Serial In Download pin is high.

Perhaps provide detail of how the problem manifests itself and a link to the module datasheet.

Added: Does your code work as expected with the DISCONNECT commented out ?
 

the old fart

Senior Member
Using DISCONNECT will have minimal effect on program execution. All it will do is shave a few microseconds off each command as it skips the check to see in the Serial In Download pin is high.

Perhaps provide detail of how the problem manifests itself and a link to the module datasheet.

Added: Does your code work as expected with the DISCONNECT commented out ?
Yes, it all works correctly. Catalex powers up and plays.
It's the initial power up where the problem is.
Increasing PAUSE commands does overcome the problem.
perhaps original PAUSE were too short.
tried other 08M2 and all have the same result.

manual is in another thread http://www.picaxeforum.co.uk/attachment.php?attachmentid=17480&d=1417151766

Only technical data sheet is in Chinese.

I'm packing up for model exhibition in Lowestoft, will be playing with player their, back in workshop on Monday.

TOF
 

hippy

Technical Support
Staff member
My guess would be that it's not setting C.4 high at the start which is corrupting the first message sent. Not getting the first command would also be likely if the PICAXE were halfway through sending a volume command when power was lost, or cycled as necessary once you have added the DISCONNECT.

Adding a 1K, 4K7 or 10K pull-up on the C.4 line might also help, ensuring the module sees a high (idle) as soon as power is applied.
 
Top