![]() |
Forum Index : Microcontroller and PC projects : PICAXE code problem...
Author | Message | ||||
Grogster![]() Admin Group ![]() Joined: 31/12/2012 Location: New ZealandPosts: 9482 |
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 ZealandPosts: 9482 |
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: AustraliaPosts: 2414 |
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 StatesPosts: 3309 |
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: NetherlandsPosts: 4852 |
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 StatesPosts: 3309 |
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 ZealandPosts: 9482 |
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! |
||||
![]() |
![]() |
The Back Shed's forum code is written, and hosted, in Australia. | © JAQ Software 2025 |