Home
JAQForum Ver 24.01
Log In or Join  
Active Topics
Local Time 16:46 09 May 2025 Privacy Policy
Jump to

Notice. New forum software under development. It's going to miss a few functions and look a bit ugly for a while, but I'm working on it full time now as the old forum was too unstable. Couple days, all good. If you notice any issues, please contact me.

Forum Index : Microcontroller and PC projects : PICAXE code problem...

Author Message
Grogster

Admin Group

Joined: 31/12/2012
Location: New Zealand
Posts: 9482
Posted: 05:49am 07 Mar 2025
Copy link to clipboard 
Print this post

I don't use a lot of PICAXE chips these days, but they still have their uses.

I have an issue with an 08M2LE chip, where the code works just fine - BUT - at power-on, the chip sends the message on PIN C.2 - despite NOT being asked to do this, it just does it at power up no matter what.  I cannot find out the reason....  

Here is my PICAXE code:





As I say - works PERFECTLY once powered, but AT POWER-UP, it sends the message when it should not.  I tried putting a PAUSE 1000 command at the top of the code, to allow the PSU to stabilize etc, thinking that this was where the issue might have been, but....no change.  

As I have not used PICAXE for quite a while, it has to be something I am doing wrong, so if any of the members can enlighten me.....
Smoke makes things work. When the smoke gets out, it stops!
 
Grogster

Admin Group

Joined: 31/12/2012
Location: New Zealand
Posts: 9482
Posted: 05:54am 07 Mar 2025
Copy link to clipboard 
Print this post

The next thing I will try, is hooking up another HC12 module to a terminal setup, so I can see what is actually being send during the rouge start-up.  Perhaps it is just garbage.  I am just listening to the HC12 with a scanner, so that is how I know it IS transmitting at startup - but I have no idea if this is valid data, or just garbage.

I might need to add a pull-up on the HC12 RXD line or something.....
Smoke makes things work. When the smoke gets out, it stops!
 
phil99

Guru

Joined: 11/02/2018
Location: Australia
Posts: 2414
Posted: 07:30am 07 Mar 2025
Copy link to clipboard 
Print this post

When C.2 is set as an output I think it will be low and TTL serial is active low.
Try setting C.2 High following setting it as an output.
A pullup would hold it high in the brief moment between powerup and setting the pin, but that may not matter.

No guarantee, it's been a couple of decades since I played with a PicAxe.
Edited 2025-03-07 17:38 by phil99
 
lizby
Guru

Joined: 17/05/2016
Location: United States
Posts: 3309
Posted: 02:18pm 07 Mar 2025
Copy link to clipboard 
Print this post

I don't see that the SEROUT C.2 is in any way conditional. Why wouldn't the message be sent every 10 or 20 seconds depending on the state of the solder blob on PINC.3?

If you want to post the code as text, I'll try it in the simulator, and maybe even on a chip. I would agree that "OUTPUT C.2" is superfluous (unless you intend for it to do something I don't understand).
PicoMite, Armmite F4, SensorKits, MMBasic Hardware, Games, etc. on fruitoftheshed
 
Volhout
Guru

Joined: 05/03/2018
Location: Netherlands
Posts: 4852
Posted: 07:14pm 07 Mar 2025
Copy link to clipboard 
Print this post

Check if power down actually powers the 08M2 down. The chip may actually work on very low voltages, maybe back-powered from a programmer, or the serial communication line on C.2. You can (for a test) simply short Vdd to Vss on the chip to make sure it powers down in power down.

Regards,

Volhout
PicomiteVGA PETSCII ROBOTS
 
lizby
Guru

Joined: 17/05/2016
Location: United States
Posts: 3309
Posted: 07:35pm 07 Mar 2025
Copy link to clipboard 
Print this post

  Volhout said  Check if power down actually powers the 08M2 down. The chip may actually work on very low voltages, maybe back-powered from a programmer, or the serial communication line on C.2. You can (for a test) simply short Vdd to Vss on the chip to make sure it powers down in power down.


This is a very good thought. Picaxe will run parasitically from a quite nominal current on a serial-in line if it idles high. I have fixed this by putting a 1K (if I remember correctly) resistor in-line.
PicoMite, Armmite F4, SensorKits, MMBasic Hardware, Games, etc. on fruitoftheshed
 
Grogster

Admin Group

Joined: 31/12/2012
Location: New Zealand
Posts: 9482
Posted: 02:50am 08 Mar 2025
Copy link to clipboard 
Print this post

  phil99 said  When C.2 is set as an output I think it will be low and TTL serial is active low.
Try setting C.2 High following setting it as an output.


You nailed it!    

That was the problem.  

When I saw your post, I had a little lightbulb moment, and that bit of information came back into my head.  I do specifically remember having to set the output pin HIGH, BEFORE you use the SEROUT command on the PICAXE(for TTL).

I had forgotten about that, but once I added a HIGH C.2 to the code right after setting the pin as an output, NOW it does not transmit anything at power-up, and just does what it should - lovely.

I knew it had to be something simple I was doing wrong, cos I used HC12's with the PICAXE before I even used them with MMBASIC, so I knew it SHOULD be working and not doing the odd thing, but cos it has been a few years since I played with the PICAXE chips, you forget some of the deep-down-details.  
Edited 2025-03-08 12:52 by Grogster
Smoke makes things work. When the smoke gets out, it stops!
 
Print this page


To reply to this topic, you need to log in.

The Back Shed's forum code is written, and hosted, in Australia.
© JAQ Software 2025