BasicMicro - Forums

www.basicmicro.com
It is currently Mon May 21, 2012 12:41 am

All times are UTC - 8 hours [ DST ]




Post new topic Reply to topic  [ 20 posts ]  Go to page 1, 2  Next
Author Message
 Post subject: Serin won't run after shut down:
PostPosted: Fri Oct 28, 2011 4:32 pm 
Offline
Citizen

Joined: Fri Oct 28, 2011 4:18 pm
Posts: 7
I saw the same problem posted here atomnano-f485/serin-problems-with-the-nano-18-t9304.html with a Nano 18. I'm having the same problem with a Nano 28. The code runs fine and everything works until it's powered down, on power up the serin isn't working.

Code:
X var word

pause 1000
high p17 'LED lights to show code has started running.
pause 500
low p17

start

serin p12, i9600, [Dec X] 'Radio data modem sends number (1,2 or 3) to activate corrisponing FET
If X = 1 then
high 10 : pause 1200 : low 10
elseif X = 2 
high 11 : pause 1200 : low 11
elseif X = 3
high 19 : pause 1200 : low 19

endif

goto start


This is really strange, as long I don't power down the uC it works fine. When powered down and turned back on the code is running because the LED lights as it should, then nothing. Any ideas would be appreciated. I'm using the latest version of Studio, and I've tried this on several nano 28's and a couple of different boards. Every other program runs fine on the same boards.

Scott


Top
 Profile  
 
 Post subject: Re: Serin won't run after shut down:
PostPosted: Sat Oct 29, 2011 9:44 pm 
Offline
Site Admin
User avatar

Joined: Thu Mar 01, 2001 11:00 am
Posts: 903
Location: Temecula, CA
Does the LED remain lit or does it turn off after 1 second? If it doesn't the problem isn't the serin command since you program never gets to it.

How does your device that is sending the command know the board is ready to receive? Do you have anything attached to the s_in/s_out pins when doing this? If the PC is attached via the USB2Serial adapter try disconnecting that and retesting. The chip can be held in reset by the PC if the adapter is still connected and you are not in Studio.

_________________
Tech Support
Basic Micro - Robotic Technology Evolved


Top
 Profile  
 
 Post subject: Re: Serin won't run after shut down:
PostPosted: Sun Oct 30, 2011 8:57 am 
Offline
Master

Joined: Sun Oct 05, 2008 9:40 am
Posts: 111
I change the code to use S_In, S_out and I can get it to work fine on the nano dev board.

One time I used an FTDI chip set on bus power with the ftdi ATN pin connected to the res pin of the processor. Everthing worked until I disconnected the usb cable and the ftdi chip was no longer powered wich keep the micro in reset.

What are the chances that you are Scott F and this is a rocket related project?


Top
 Profile  
 
 Post subject: Re: Serin won't run after shut down:
PostPosted: Sun Oct 30, 2011 11:31 am 
Offline
Citizen

Joined: Fri Oct 28, 2011 4:18 pm
Posts: 7
Nathan: The LED flashes on and off once, like it should. So it must be hanging at serin.

Nathan asked: "How does your device that is sending the command know the board is ready to receive? " It's a MaxStream Xtend radio modem, the radios act as a physical serial cable extension, data is stored in the radio buffer if needed then sent out with regular serial data properties. In short, the device doesn't know anything is ready to receive, it sends the data regardless.

Nathan asked: "Do you have anything attached to the s_in/s_out pins when doing this?" No, but I did try switching from P12 to S_in, still didn't work after re-powering the uC.

I've got an old Atom 28 interpreter chip on an OEM board and I tried running the code on that, it worked fine even after powering down and back on again. My only option at this point is to power the Nano 28 from an unswitched power source and program it ahead of time, and just let it run. Not elegant but it would work.

Would a pull down resistor on P12 help?

Mike,

Yes and Yes! Of course it's a rocket project. I'm using 2 separate altimeter boards that run Nano 28's, one sends telemetry data down to the ground station and the other just listens for uplink commands. The telemetry downlink works fine, and the uplink works great until I power down the board, then it hangs at the serin. I don't absolutely need the unlink capability, but I wanted to have uplink commands for redundant second stage ignition, deploy at apogee and terminate flight.

Scott


Top
 Profile  
 
 Post subject: Re: Serin won't run after shut down:
PostPosted: Sun Oct 30, 2011 4:14 pm 
Offline
Master

Joined: Sun Oct 05, 2008 9:40 am
Posts: 111
Quote:
"Do you have anything attached to the s_in/s_out pins when doing this?" No, but I did try switching from P12 to S_in, still didn't work after re-powering the uC.


Was this using radios to communicate? Will it still hang if connected right to the computer without radios inline?
Is carrage return being sent after byte of data?

Like stated above I can get this to work on a nano28 connected right to the computer.

Quote:
Yes and Yes! Of course it's a rocket project.


Very cool. Im a big fan of your website.

What kind of telemetry data are you sending?


Top
 Profile  
 
 Post subject: Re: Serin won't run after shut down:
PostPosted: Sun Oct 30, 2011 5:37 pm 
Offline
Citizen

Joined: Fri Oct 28, 2011 4:18 pm
Posts: 7
Mike,

I haven't tried just going to a terminal window, it's always been through the radios.

We know the code works, it works using the MaxStream radios and the Nano 28 so long as I don't power down the uC before I use it. The code also works using an Atom 28 on an OEM board, and still works after a power down and power back up on the Atom 28. The problem is, I've always had problems with serial communications and the Atom 28 on homemade PCBs. I suppose I'm not filtering and grounding as well as the OEM board. I can't use the OEM board because it's a little too big for the payload bay.

So, it's got to be either something with the Nano 28 when it powers back up, or something I'm missing elsewhere... My next launch day is under 2 weeks and I've got a lot of work to do, didn't really expect this to be taking days and don't have time to mess with it much more. For the time being I'm going to field program the Rx Nano 28 and power it straight off the main battery pack. There won't be any power available to the pyro channels until the main power switch is turned on just prior to launch, so it'll still be "safed" until then. I've got a 2.5 amp hour at 12 volt battery pack, so the < 10 mA draw isn't going to cost me much for an hour or so.

I'd like to figure this out, but after this next launch I'll have all winter to get it right. Thanks for your help Mike!

Scott


Top
 Profile  
 
 Post subject: Re: Serin won't run after shut down:
PostPosted: Sun Oct 30, 2011 7:49 pm 
Offline
Master

Joined: Sun Oct 05, 2008 9:40 am
Posts: 111
I have had my own serin issues as well atomnano-f485/nano-to-gps-t9318.html \ The suggested resistors here did not cure the problem. In fact this is where I moved on from the nano. I know that in my case it was not the pcb. However I do not remember if I was able to communicate between radios.

I currently use the pro 64 chip and love it. I also find that assembly using stencil and solder paste takes about half the time. Investment is pretty easy to swallow as well 25.00 stencil and 15.00 hot plate.


Top
 Profile  
 
 Post subject: Re: Serin won't run after shut down:
PostPosted: Mon Oct 31, 2011 6:33 am 
Offline
Master

Joined: Tue Nov 21, 2006 9:34 am
Posts: 527
Hi Mike,

I know this is off subject, but how what process are you doing with the hot plate and solder paste to attach the Pro-64. I have thought of trying something like this or with a toaster oven, but have not tried it yet.

Kurt


Top
 Profile  
 
 Post subject: Re: Serin won't run after shut down:
PostPosted: Mon Oct 31, 2011 7:55 am 
Offline
Guru

Joined: Sun Jan 03, 2010 8:01 am
Posts: 55
Location: Eau Claire, WI
Greetings Kurt and Mike,

Another off topic post

I am also intrested in the process for getting a PRO-64 up and running.

Like Kurt I considered a toster oven and a board with solder paste but frankly I would be willing to pay an extra $30-$50 (depending on options) for a PRO-64 already mounted to a breakout board....along the lines of the the ARC32 (or maybe just a board with pins/headers only). Just a thought.

Let me know if anyone has a link on how to get a PRO-64 mounted TQFP board (I've seen some run for under a few dollars and other boards that are sold in a kit for around $30).

Thanks-Brian

PS: sorry...no spell checker with IE!


Top
 Profile  
 
 Post subject: Re: Serin won't run after shut down:
PostPosted: Mon Oct 31, 2011 10:51 am 
Offline
Master

Joined: Sun Oct 05, 2008 9:40 am
Posts: 111
http://youtu.be/0L43AnseE_s

This was my first attempt using this kit
http://www.proto-advantage.com/store/pr ... 8780ei6ep5

http://youtu.be/YeEjJWnF2wk
Second attempt on my own pcb

This is where I get my stencils http://ohararp.com/Stencils.html
solderpaste from sparkfun.
The hotplate is from Target and is the Oster brand capable of 450 deg F

The first few attempts were not very smooth. The first time I ended up cleaning and re stenciling the board wich is not really a big deal. I did have a few jumpers that needed to be removed but this also is an easy task using solder wick. Having done a few more boards I have alot better control of the solder paste and usually have no jumpers. Its one of them things you got to do to get better.

Brian and Kurt you should check you PM messages


Top
 Profile  
 
 Post subject: Re: Serin won't run after shut down:
PostPosted: Mon Oct 31, 2011 4:51 pm 
Offline
Site Admin
User avatar

Joined: Thu Mar 01, 2001 11:00 am
Posts: 903
Location: Temecula, CA
Well if the LED is doing what it is supposed to do then I would add a timeout to the serin command. Also when you send data to the nano are you continuously sending or are you putting some delay between the bytes sent. If you continuously send and the serin command grabs one byte out of sync(eg misinterprets a different bit as the start bit) then all the data from that point on will be out of sync garbage. If however you add a delay between each byte of atleast one byte width then that can't happen.

_________________
Tech Support
Basic Micro - Robotic Technology Evolved


Top
 Profile  
 
 Post subject: Re: Serin won't run after shut down:
PostPosted: Tue Nov 01, 2011 10:41 pm 
Offline
Citizen

Joined: Fri Oct 28, 2011 4:18 pm
Posts: 7
I've already tried adding a timeout to the serin command, didn't help. I'm only sending one byte of data at a time, and it's seconds between bytes. The uC doesn't have a lot to do...

I've had better luck with serial communications using PCB's that are professionally made, I wonder if a module, maybe a Pro One would do the trick. I don't really need a lot pins for this application.

Scott


Top
 Profile  
 
 Post subject: Re: Serin won't run after shut down:
PostPosted: Wed Nov 02, 2011 6:03 am 
Offline
Master

Joined: Tue Nov 21, 2006 9:34 am
Posts: 527
ScottF wrote:
I'm only sending one byte of data at a time, and it's seconds between bytes. The uC doesn't have a lot to do...


I am confused here.

The code:
Code:
serin p12, i9600, [Dec X] 'Radio data modem sends number (1,2 or 3) to activate corrisponing FET
If X = 1 then
high 10 : pause 1200 : low 10
elseif X = 2 
...


Is assuming you are sending a string that has one or more characters in the ascii range "0" to "9" followed by a character out of this range that terminates the number. But your comment says you are only sending one byte every second.
If it were me, I would change the code of the serin and remove the Dec from it, so it just reads in one byte of data. If the characters sent are in the range of ASCII numbers, I would simply change my if test to
if X = "1"

Also I would put in a final else clause that showed you if you were getting some bogus data. Like maybe turn on all three pause and then turn them all off...

Kurt


Top
 Profile  
 
 Post subject: Re: Serin won't run after shut down:
PostPosted: Wed Nov 02, 2011 9:56 am 
Offline
Site Admin
User avatar

Joined: Thu Mar 01, 2001 11:00 am
Posts: 903
Location: Temecula, CA
Kurt is right. If you are using the DEC modifier it ecxpects to receive numbers("0" to "9" until it receives upto 9 numbers or receives a non-number character. Otherwise it will just sit there forever.

_________________
Tech Support
Basic Micro - Robotic Technology Evolved


Top
 Profile  
 
 Post subject: Re: Serin won't run after shut down:
PostPosted: Wed Nov 02, 2011 9:31 pm 
Offline
Citizen

Joined: Fri Oct 28, 2011 4:18 pm
Posts: 7
Ok, sorry. And I think Mike asked about this early on. The software I'm using to monitor/send the serial data does send an end of line command, I think it's CR, maybe an enter command, not sure how the Nano handles that, but it does. The code works fine on the Atom, it works fine on the Nano (so long as I don't turn it off after programming). I was hoping someone would have an explanation as to why it doesn't work when I re-boot the Nano.

Scott


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 20 posts ]  Go to page 1, 2  Next

All times are UTC - 8 hours [ DST ]


Who is online

Users browsing this forum: No registered users and 1 guest


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Jump to:  
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group

phpBB SEO