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  [ 16 posts ]  Go to page 1, 2  Next
Author Message
 Post subject: Serin problems with the Nano 18
PostPosted: Tue Apr 13, 2010 10:59 am 
Offline
Guru

Joined: Fri Nov 13, 2009 10:28 am
Posts: 82
Location: Reno, Nevada
I recently started a project using the nano18 as it had enough capability for my project. Problems with the serial port started occurring as I added more code. The program would run fine and communications were all good after programming the nano18. If I turned off the nano18 board and started it up later there would be no communication until I re-programmed the chip. I finally changed to the Nano28 chip and all of the problems are gone! I tried 2 nano18's and both did the same thing which leads me to believe that the problem is with the Nano18. Below is the simple code I was using.

goto startup

Main:
serout s_out,baud,["Start OK"]:pause 500
serin s_in,baud,[dec action]:pause 50
if action=1 then goto ServoSetup
if action=2 then goto SaveData
if action=3 then goto LoadData
goto main

It appears that the Nano18 just isn't running on a powerup as I never get to the Main loop.
The serial out "Start OK" is simply a monitor to show that I got to the Main loop. With the Nano 28's I get the Start OK message every time on a power up. Haven't seen any messages where someone else ran into this problem, so I will just use the 28's as they don't seem to have the same problem!

_________________
Harley


Top
 Profile  
 
 Post subject: Re: Serin problems with the Nano 18
PostPosted: Tue Apr 13, 2010 11:45 am 
Offline
Master

Joined: Sun Aug 17, 2008 5:26 pm
Posts: 798
Location: CA bay Area
Hello, Harley. I have found it helps to start every program with a 500 to 1000 ms PAUSE. This allows timing-critical register setups in the PIC to initialize. This has fixed a couple of serial problems experienced when the SERxxx was placed first thing in the code. Then again, I have had N18's go totally away, won't even program, only to "fix themselves" later. Go figure. :?
Take care.

_________________
kenjj
http://blog.basicmicro.com/
http://kjennejohn.wordpress.com/


Top
 Profile  
 
 Post subject: Re: Serin problems with the Nano 18
PostPosted: Tue Apr 13, 2010 2:22 pm 
Offline
Guru

Joined: Fri Nov 13, 2009 10:28 am
Posts: 82
Location: Reno, Nevada
Thanks kenjj: I have tried some pauses to no avail. Are there more problems with 18's than the 28's? I haven't had any problems to speak of with the 28's I have been using. It just seems that there are some differences between the two, other than the obvious memory sizes etc. In this instance it appears that after a power down, the program just don't run on power up.

_________________
Harley


Top
 Profile  
 
 Post subject: Re: Serin problems with the Nano 18
PostPosted: Tue Apr 13, 2010 2:39 pm 
Offline
Master

Joined: Sun Aug 17, 2008 5:26 pm
Posts: 798
Location: CA bay Area
Harley, what Studio version are you using? And what is your work environment, that is, are you using a commercial development board, a bread board, or a PCB you made yourself?
Take care.

_________________
kenjj
http://blog.basicmicro.com/
http://kjennejohn.wordpress.com/


Top
 Profile  
 
 Post subject: Re: Serin problems with the Nano 18
PostPosted: Tue Apr 13, 2010 4:40 pm 
Offline
Guru

Joined: Fri Nov 13, 2009 10:28 am
Posts: 82
Location: Reno, Nevada
I'm using BasicMicroStudio 1.0.0.14 IDE. the board I am using is a Basic Atom Nano Proto Board RevB. I also made sure I had an active ground on the :D system as I have been bitten by that on the Atoms. I haven't had a glitch since I went to the 28 so that is a good sign. Thanks kenjj!

_________________
Harley


Top
 Profile  
 
 Post subject: Re: Serin problems with the Nano 18
PostPosted: Tue Apr 13, 2010 9:25 pm 
Offline
Site Admin
User avatar

Joined: Thu Mar 01, 2001 11:00 am
Posts: 903
Location: Temecula, CA
I suggest you upgrade to 1.0.0.23 and try it out. It's possible the internal OSC has more error on the 18s than the 28/40s. It's based on the 16F88 which is a bit older chip than the 16F88X chips the 28and 40s use. The datasheet doesn't indicate it though.

_________________
Tech Support
Basic Micro - Robotic Technology Evolved


Top
 Profile  
 
 Post subject: Re: Serin problems with the Nano 18
PostPosted: Tue Apr 13, 2010 11:31 pm 
Offline
Master

Joined: Sun Aug 17, 2008 5:26 pm
Posts: 798
Location: CA bay Area
Harley, get the latest Studio_23. Can't hurt, and there may have been little-known timing problems with Studio_14 that were fixed in later revs.

Another thing, how old is the Nano18 you have? I have two sets of Nano18s. One won't run a servo long without occasionally reseting and it runs a servo slow. A check with an oscilloscope shows the servo is causing "divots" in the Vcc (5V) that have the 5V dropping anywhere from 4.5V to just below 4V. There is a note somewhere saying early-release Nanos had a brownout level of 4.1V, later ones were good to as low as 2.1V. I substituted what *appeared* to be a later Nano (going by the label) in the circuit and it worked with no resets and the servo ran much faster and smoother. Who knows? :? Has MicroChip ever had a PIC recall?!
Take care.

_________________
kenjj
http://blog.basicmicro.com/
http://kjennejohn.wordpress.com/


Top
 Profile  
 
 Post subject: Re: Serin problems with the Nano 18
PostPosted: Wed Apr 14, 2010 9:57 am 
Offline
Site Admin
User avatar

Joined: Thu Mar 01, 2001 11:00 am
Posts: 903
Location: Temecula, CA
IN the case of you running the servo the original 18s could very easily had that problem. I doubt microchip was at fault on these. The 16F88 has been out for several years now. The brown out is the simplest explanation in that case. Occams razor and all that. :)

_________________
Tech Support
Basic Micro - Robotic Technology Evolved


Top
 Profile  
 
 Post subject: Re: Serin problems with the Nano 18
PostPosted: Wed Apr 14, 2010 2:01 pm 
Offline
Guru

Joined: Fri Nov 13, 2009 10:28 am
Posts: 82
Location: Reno, Nevada
Thanks. I didn't realize there had been that many revisions on the IDE and the Nano18's I am using were bought in october 2009. I will try the newer IDE and see what happens. I just checked Basic Micro's home page and could only find studio 15. Where might I find the 23 version?

_________________
Harley


Top
 Profile  
 
 Post subject: Re: Serin problems with the Nano 18
PostPosted: Wed Apr 14, 2010 3:19 pm 
Offline
Master

Joined: Sun Aug 17, 2008 5:26 pm
Posts: 798
Location: CA bay Area
Look for it in this post:
http://forums.basicmicro.net/viewtopic.php?f=481&t=9299&sid=b2f05bc594b86717aaae29a9b946ff87
The latest Studio versions and their download site are usually found under the "News" section in these forums.
'Luck!

_________________
kenjj
http://blog.basicmicro.com/
http://kjennejohn.wordpress.com/


Top
 Profile  
 
 Post subject: Re: Serin problems with the Nano 18
PostPosted: Wed Apr 14, 2010 4:59 pm 
Offline
Guru

Joined: Fri Nov 13, 2009 10:28 am
Posts: 82
Location: Reno, Nevada
Thanks for the link. I downloaded and installed, but seems to have a couple of issues. The backspace key doesn't work, so editing is a little tougher. I can delete things by highlighting and cutting. Will give it try.

_________________
Harley


Top
 Profile  
 
 Post subject: Re: Serin problems with the Nano 18
PostPosted: Wed Apr 14, 2010 5:24 pm 
Offline
Master

Joined: Sun Aug 17, 2008 5:26 pm
Posts: 798
Location: CA bay Area
I'm still running Studio_22, and the backspace key still works. Try installing Studio_22 after you delete Studio_23.
Later.

_________________
kenjj
http://blog.basicmicro.com/
http://kjennejohn.wordpress.com/


Top
 Profile  
 
 Post subject: Re: Serin problems with the Nano 18
PostPosted: Wed Apr 14, 2010 5:38 pm 
Offline
Master

Joined: Tue Nov 21, 2006 9:34 am
Posts: 527
kenjj wrote:
I'm still running Studio_22, and the backspace key still works. Try installing Studio_22 after you delete Studio_23.
Later.

I am running 23 and have no problem with the backspace.

Kurt


Top
 Profile  
 
 Post subject: Re: Serin problems with the Nano 18
PostPosted: Wed Apr 14, 2010 8:01 pm 
Offline
Guru

Joined: Fri Nov 13, 2009 10:28 am
Posts: 82
Location: Reno, Nevada
I tried installing 15 from the home site and had the same problem. Ended up re-installing 14 and all works ok now. Will try reinstalling at a later date. Thanks for all the help. I'm running the 28's and they work fine, so I will stick with them.

_________________
Harley


Top
 Profile  
 
 Post subject: Re: Serin problems with the Nano 18
PostPosted: Wed Jun 02, 2010 6:32 pm 
Offline
Site Admin
User avatar

Joined: Thu Mar 01, 2001 11:00 am
Posts: 903
Location: Temecula, CA
Got an email from Hemicro saying 30 seems to have fixed everything for him.

_________________
Tech Support
Basic Micro - Robotic Technology Evolved


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 16 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