BasicMicro - Forums

www.basicmicro.com
It is currently Sun Sep 05, 2010 10:58 am

All times are UTC - 8 hours [ DST ]




Post new topic Reply to topic  [ 6 posts ] 
Author Message
 Post subject: Bap28 HSerin vs Hserin2 Timeouts... New builds...
PostPosted: Wed Jul 21, 2010 7:11 am 
Offline
Master

Joined: Tue Nov 21, 2006 9:34 am
Posts: 291
Hi Nathan,

I ran into some of problems of my updated XBee code running on a BAP28, which I converted the calls from HSERIN to HSERIN2. i.e. I am working on merging my code bases and would like to reduce the #ifdefs...

I started running into a bunch of unexpected timeouts on hserin2 calls. I converted my code back to hserin calls and it worked. So I created a simple test program:
Code:
ENABLEHSERIAL

sethserial H62500, H8DATABITS,HNOPARITY,H1STOPBITS
b1      var   byte

Loop:
   pause 10
   low p4
   hserin   100000, TO1, [b1]   
   high p4
   goto HS2
TO1:
   high p4
   toggle P5   

HS2:
   pause 10
   low p4   
   hserin2   100000, TO2, [b1]   
   high p4
   goto Loop
TO2:
   high P4
   toggle P6
   goto loop   
   

Could be simpler, but I wanted to have a bunch of outputs that I could test with the logic Analyzer. I found looking at the analyzer that:
Hserin with a time out of 100000 timed out after approx: 51.87ms which is close enough, but the hserin2 timed out at about: 24.75us (yes us...)

I am using build 32 of studio.

Kurt


Top
 Profile  
 
 Post subject: Re: Bap28 HSerin vs Hserin2 Timeouts... New builds...
PostPosted: Wed Jul 21, 2010 8:45 am 
Offline
Site Admin

Joined: Thu Mar 01, 2001 11:00 am
Posts: 317
Location: Temecula, CA
I'll take alook at it. I must have trashed the timeout variabel when I made hserin and hserin2 swappable. Kurt can you send me an email reminder about this so I don't forget?

_________________
Nathan Scherdin
Visit BasicMicro

Datasheets:
Servo Controller - ARC32
Microcontroller - AtomPro
Motor Controller - Robo Claw
RC Lighting - Cylon LED


Top
 Profile E-mail  
 
 Post subject: Re: Bap28 HSerin vs Hserin2 Timeouts... New builds...
PostPosted: Wed Jul 21, 2010 8:54 am 
Offline
Master

Joined: Tue Nov 21, 2006 9:34 am
Posts: 291
Will Do. Also updated the program to not need hardware to see...
Code:
ENABLEHSERIAL

sethserial H62500, H8DATABITS,HNOPARITY,H1STOPBITS
b1      var   byte
DT      var word
ROK      var byte

TMRW = 0x80      ; start timer
TCRW = 0x30      ; increment on 8 clocks

Main:
   ROK = 0
   TCNT = 0   ; clear counter
   hserin   50000, MTO1, [b1]   
   ROK = 1
MTO1:
   DT = TCNT
   serout s_out, i9600, ["HS ", dec ROK, " ", dec DT, 13]

   ROK = 0
   TCNT = 0   ; clear counter
   hserin2   50000, MTO2, [b1]   
   ROK = 1
MTO2:
   DT = TCNT
   serout s_out, i9600, ["HS2 ", dec ROK, " ", dec DT, 13]
   pause 500
   goto Main


I changed the timeout so it would fit in TimerW counter...

Output was:
Code:
HS 0 52129
HS2 0 2660
HS 0 52129
HS2 0 2661


Will send you simple program in email as well.

Kurt


Top
 Profile  
 
 Post subject: Re: Bap28 HSerin vs Hserin2 Timeouts... New builds...
PostPosted: Thu Jul 22, 2010 9:37 am 
Offline
Site Admin

Joined: Thu Mar 01, 2001 11:00 am
Posts: 317
Location: Temecula, CA
Kurt, What version of Studio are you using? 1.0.0.32?

_________________
Nathan Scherdin
Visit BasicMicro

Datasheets:
Servo Controller - ARC32
Microcontroller - AtomPro
Motor Controller - Robo Claw
RC Lighting - Cylon LED


Top
 Profile E-mail  
 
 Post subject: Re: Bap28 HSerin vs Hserin2 Timeouts... New builds...
PostPosted: Thu Jul 22, 2010 11:43 am 
Offline
Master

Joined: Tue Nov 21, 2006 9:34 am
Posts: 291
Acidtech wrote:
1.0.0.32?

Yes

Kurt


Top
 Profile  
 
 Post subject: Re: Bap28 HSerin vs Hserin2 Timeouts... New builds...
PostPosted: Fri Jul 23, 2010 8:31 am 
Offline
Site Admin

Joined: Thu Mar 01, 2001 11:00 am
Posts: 317
Location: Temecula, CA
I should be able to fix this this weekend I think.

_________________
Nathan Scherdin
Visit BasicMicro

Datasheets:
Servo Controller - ARC32
Microcontroller - AtomPro
Motor Controller - Robo Claw
RC Lighting - Cylon LED


Top
 Profile E-mail  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 6 posts ] 

All times are UTC - 8 hours [ DST ]


Who is online

Users browsing this forum: No registered users and 3 guests


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