BasicMicro - Forums

www.basicmicro.com
It is currently Mon May 21, 2012 8:21 pm

All times are UTC - 8 hours [ DST ]




Post new topic Reply to topic  [ 27 posts ]  Go to page 1, 2  Next
Author Message
 Post subject: Port Variable Names not recognized
PostPosted: Tue Sep 28, 2010 12:26 pm 
Offline
Citizen

Joined: Sun Apr 11, 2010 12:24 pm
Posts: 6
The Port Variable Names listed on page 31 of the manual (e.g., INL0, INB5, INNA) are not recognized by Studio 2.0.0.0

Thanks,

Dan


Top
 Profile  
 
 Post subject: Re: Port Variable Names not recognized
PostPosted: Wed Sep 29, 2010 8:17 am 
Offline
Site Admin
User avatar

Joined: Thu Mar 01, 2001 11:00 am
Posts: 903
Location: Temecula, CA
Which processor are you using?

_________________
Tech Support
Basic Micro - Robotic Technology Evolved


Top
 Profile  
 
 Post subject: Re: Port Variable Names not recognized
PostPosted: Wed Sep 29, 2010 10:46 am 
Offline
Citizen

Joined: Sun Apr 11, 2010 12:24 pm
Posts: 6
Hi Nathan,

I am using the Arc32 and the BasicAtom Pros (24, 28, & 40). The compiler doesn't accept INB0, for instance, which should work on all the chips.

My question about DIR variable names also concerns the same chips.

Thanks,

Dan


Top
 Profile  
 
 Post subject: Re: Port Variable Names not recognized
PostPosted: Wed Sep 29, 2010 11:35 am 
Offline
Site Admin
User avatar

Joined: Thu Mar 01, 2001 11:00 am
Posts: 903
Location: Temecula, CA
Hmm, I did find that none of the new PORT/DIR variables were defined for the Atom/Nano chips. I've updated their include files and the manual will be updated with which variables are supported on each chip. This however shouldn't have been a problem on the AtomPro processors so I'll check that again.

Please post your code snippet that shows the problem.

_________________
Tech Support
Basic Micro - Robotic Technology Evolved


Top
 Profile  
 
 Post subject: Re: Port Variable Names not recognized
PostPosted: Wed Sep 29, 2010 1:00 pm 
Offline
Citizen

Joined: Sun Apr 11, 2010 12:24 pm
Posts: 6
Here is the code snippet. I assume, also, that naming output ports should follow the same logic as input ports.

Thanks,

Dan

' *****************
dummy var byte

dummy = IN0 'this one compiles OK
dummy = INL 'this one compiles OK, but INL is not listed on page 31
dummy = INB0 'this one *doesn't* compile, nor any of the other port names on page 31

OUT0 = dummy ' outputs compile the same way as the inputs above
OUTL = dummy
OUTB0 = dummy

' *****************


Top
 Profile  
 
 Post subject: Re: Port Variable Names not recognized
PostPosted: Thu Oct 21, 2010 7:54 am 
Offline
Citizen

Joined: Sun Apr 11, 2010 12:24 pm
Posts: 6
Hi Nathan,

What is the resolution of this problem? You mentioned something about updating the Include files. Are these available to me now, or do I have to wait to the next release of the IDE?

Thanks,

Dan


Top
 Profile  
 
 Post subject: Re: Port Variable Names not recognized
PostPosted: Sat Oct 23, 2010 1:42 pm 
Offline
Site Admin
User avatar

Joined: Thu Mar 01, 2001 11:00 am
Posts: 903
Location: Temecula, CA
Studio 2.0.0.3 is now available(next few minutes) with this fixed for all processors.

_________________
Tech Support
Basic Micro - Robotic Technology Evolved


Top
 Profile  
 
 Post subject: Re: Port Variable Names not recognized
PostPosted: Tue Oct 26, 2010 2:54 pm 
Offline
Master

Joined: Tue Jun 22, 2010 1:15 pm
Posts: 203
I'm a bit confused.

Is the studio manual for ALL BasicAtoms, and the ARC-32?

I was trying to use ADIN last night on an ARC-32 build. It compiles. Couldn't get it to read a voltage. Nor error message in using it.

I had seen an ARC-32 demo reading VS/VL pins and running servos. Saw "hservostate 33" as well.

Can't find "hservostate 33" in the Studio manual, did find ADIN.

I'm guessing hservostate invokes interrupt handlers for servos and A/D, and this precludes the old ADIN.

Isn't the chip on the ARC-32 a BAP 40 pin? A/D Pin usage in ARC-32 does seem a little different then the denoted pins of the BAP 40 (a clue, maybe?).

I'm gonna try the "hservostate" as in:

Code:
FLValue = hservostate FL_Pin


tonight.

Thanks!

Alan KM6VV

_________________
Visit:
http://groups.yahoo.com/group/SherlineCNC/
http://tech.groups.yahoo.com/group/HexapodRobotIK/


Top
 Profile  
 
 Post subject: Re: Port Variable Names not recognized
PostPosted: Tue Oct 26, 2010 3:53 pm 
Offline
Master

Joined: Tue Nov 21, 2006 9:34 am
Posts: 528
Hi Alan,

Hservostate is only currently described on the forums or in the Arc32 document.

While I was figuring out how to write my own HSERVO code in C for the Arc32, I found out a lot about how this is wired up. The underlying processor has 8 AtoD pins that are in two groups of 4. Four of these pins are directly connected to 4 IO pins and the standard ADIN should work on them. There is more in my thread about which one. The other 4 Analog IO pins are connected up to the 2 inputs from two of the MUXS that are used by HSERVO. So each of these pins can actually connect to 4 IO pins each, which is why there are 16 hservostate pins.

So yes they do have a different implementation. Personally I wish this was abstracted out and ADIN would simply work for either implementation, as only advanced users will understand the differences. I belive the logical IO pin mappings for the voltage levels is:
Code:
// P56      VS1         (PB0/AN0)
// P57      VL         (PB1/AN1)
// P58      VS2         (PB2/AN2)

So you might be able to try adin on those pins... Not sure if they are fully mapped in the ADIN command or not.

Kurt


Top
 Profile  
 
 Post subject: Re: Port Variable Names not recognized
PostPosted: Tue Oct 26, 2010 5:32 pm 
Offline
Master

Joined: Tue Jun 22, 2010 1:15 pm
Posts: 203
Hi Kurt,

Thanks for the comments!

I went back and read your thread (and others) for a second time today. I did see where Nathan said:

Acidtech wrote:
Pins 8 to 15 and 24 to 31(16pins) are analog capable. You can get their analog value using the HservoState function. Also the Aux1 header has one analog pin that can also be read using HservoState. The 3 input voltages Vl,Vs1 and Vs2 can also be read using HservoState(these three are voltage divided by 10).


Not sure about your P56-P58. My ARC-32 chart ends at P45. (But I'll try 'em!)

I missed which A/D pins were "directly connected" (with ADIN compatibility).

I've got some code to try tonight. If I get lucky, it'll read my new floor/tabletop sensors (and if they work. and if my subsumption code works...). If not, then it's too late for the "Tabletop Challenge" tomorrow.

I'll at least be able to see the VL voltage. And I discovered today at lunch that I had the pinout of the QRB1134 sensors wrong on the board I just laid out. Probably why I couldn't read a voltage change with my Fluke DMM either last night. Hopefully tonight will be better.

Alan KM6VV

KurtEck wrote:
Hi Alan,

Hservostate is only currently described on the forums or in the Arc32 document.

While I was figuring out how to write my own HSERVO code in C for the Arc32, I found out a lot about how this is wired up. The underlying processor has 8 AtoD pins that are in two groups of 4. Four of these pins are directly connected to 4 IO pins and the standard ADIN should work on them. There is more in my thread about which one. The other 4 Analog IO pins are connected up to the 2 inputs from two of the MUXS that are used by HSERVO. So each of these pins can actually connect to 4 IO pins each, which is why there are 16 hservostate pins.

So yes they do have a different implementation. Personally I wish this was abstracted out and ADIN would simply work for either implementation, as only advanced users will understand the differences. I belive the logical IO pin mappings for the voltage levels is:
Code:
// P56      VS1         (PB0/AN0)
// P57      VL         (PB1/AN1)
// P58      VS2         (PB2/AN2)

So you might be able to try adin on those pins... Not sure if they are fully mapped in the ADIN command or not.

Kurt

_________________
Visit:
http://groups.yahoo.com/group/SherlineCNC/
http://tech.groups.yahoo.com/group/HexapodRobotIK/


Top
 Profile  
 
 Post subject: Re: Port Variable Names not recognized
PostPosted: Wed Oct 27, 2010 10:08 am 
Offline
Site Admin
User avatar

Joined: Thu Mar 01, 2001 11:00 am
Posts: 903
Location: Temecula, CA
There are 8 A/D capable pins on a 3687 processor. 4, as Kurt stated, are attached to the servo mux. These 4 connect through to mux to produce 16 A/D capable pins on the servo headers. These get updated/read every 20ms and you can get the last read value by using the hservostate function. The other 4 pins are directly connected to the three power supplies (via voltage dividers) and the 1 A/D capable pin on the AUX1 header.

This is the list of BasicMicro pin numbers to H8-3687 pin numbers/functions. The pins that are NC (no connect) are only accessible through the mux (eg hservostate,hservo commands).
P0(P54/WKP4)
P1(P55/WKP5/ADTRG)
P2(P10/TMOW)
P3(P11/PWM)
P4(P12)
P5(P75/TMCIV)
P6(P76/TMOV)
P7(P23)
P8 NC
P9 NC
P10 NC
P11 NC
P12 NC
P13 NC
P14 NC
P15 NC
P16(P53/WKP3)
P17(P52/WKP2)
P18(P51/WKP1)
P19(P50/WKP0)
P20(P30)
P21(P31)
P22(P32)
P23(P33)
P24 NC
P25 NC
P26 NC
P27 NC
P28(P17/IRQ3/TRGV)
P29(P16/IRQ2)
P30(P15/IRQ1/TMIB1)
P31(P14/IRQ0)
P32/S_IN(P21)
P33/S_OUT(P22)
P34(P57/SCL)
P35(P56/SDA)
P36(P72/TXD_2)
P37(P70/SCK3_2)
P38(P71/RXD_2)
P39(P37)<->(PB3/AN3)
P40(P24)
P41(P85)
P42(P86)
P43(P87)
P44(P36)
P45(P74/TMRIV)
P46(P34)
P47(P35)
P48(P60/FTIOA0)
P49(P61/FTIOB0)
P50(P62/FTIOC0)<->(PB7\AN7)
P51(P63/FTIOD0)<->(PB6\AN6)
P52(P64/FTIOA1)
P53(P65/FTIOB1)
P54(P66/FTIOC1)<->(PB4\AN4)
P55(P67/FTIOD1)<->(PB5\AN5)
P56(PB0/AN0)
P57(PB1/AN1)
P58(PB2/AN2)

Pins P46 to P58 should normally never be used directly because they are handled by the hservo backend. Kurt uses them because he's working in C making a new hservo backend for C.

_________________
Tech Support
Basic Micro - Robotic Technology Evolved


Top
 Profile  
 
 Post subject: Re: Port Variable Names not recognized
PostPosted: Wed Oct 27, 2010 11:52 am 
Offline
Master

Joined: Tue Jun 22, 2010 1:15 pm
Posts: 203
Thanks Nathan for the pinouts. That explains Kurt's P56, P57, P58 reference.

I put in code for HservoState to read the VL voltage, but I couldn't read that either.

I have:

Code:
ENABLEHSERVO2

serout s_out, SOUT_BAUD, ["  VL = ", real (TOFLOAT hservostate 33)/1024.0 * 20.0\2]     ;  2.0



Compiler is 2.0.0.0

I didn't have enough time last night to try the ARC-32 demo program from the ARC-32 manual. I'll try that possibly tonight after the "Table Top Challenge" (or tomorrow).

Thanks!

Edit: page 15 in the B0010 ARC-32 manual has errors in the example. Result never gets set from the parameter Volts which reads the HSERVOSTATE of P8.

On page 16 the scaling (and formatting) of reading VL P33 is

Code:
Volts Var Byte

Volts = HSERVOSTATE P33
[REAL (TOFLOAT Volts/51.2)\2]


instead of

Code:
[REAL TOFLOAT hservostate 33)/1024.0*20.0\2]


Also, Volts is a byte, and hservostate returns 10 bits?


Alan KM6VV

_________________
Visit:
http://groups.yahoo.com/group/SherlineCNC/
http://tech.groups.yahoo.com/group/HexapodRobotIK/


Top
 Profile  
 
 Post subject: Re: Port Variable Names not recognized
PostPosted: Thu Oct 28, 2010 8:40 am 
Offline
Site Admin
User avatar

Joined: Thu Mar 01, 2001 11:00 am
Posts: 903
Location: Temecula, CA
In the 2.0.0.0 compiler you have to use at least one hservo command or hservstate will do nothing(eg the hservo backend isn't running). 2.0.0.5 should have fixed that problem. As of 2.X the ENABLEHSERVO2 directive is no longer used by the compiler. Instead we look for hservo(and as of 2.0.0.3 hservostate) to determine if you are using the hservo backend.

I beleive I've already given Dale the fixes for the datasheet. It just hasn't been updated yet.

_________________
Tech Support
Basic Micro - Robotic Technology Evolved


Top
 Profile  
 
 Post subject: Re: Port Variable Names not recognized
PostPosted: Thu Oct 28, 2010 11:00 am 
Offline
Master

Joined: Tue Nov 21, 2006 9:34 am
Posts: 528
Hi Nathan and Alan,

If the end user only wants the AtoD on the voltages and/or the one on the Aux1 header will the AtoD work properly on these 4 IO pins? If so if their program otherwise does not use HSERVO would they not be better off using it instead of hservostate? Both for performance and as well for timing sensitive bit/bang functions such as serin and serout?

If so I would recommend that you document the physical voltage pins in the document ion.

Kurt


Top
 Profile  
 
 Post subject: Re: Port Variable Names not recognized
PostPosted: Thu Oct 28, 2010 11:11 am 
Offline
Master

Joined: Tue Jun 22, 2010 1:15 pm
Posts: 203
Hi Kurt,

Do you mean use ADIN instead? That would be simpler, but it could lead to confusion if ADIN didn't then work for ALL analog inputs.

But I take you point on the affect on other bit-bang'd routines.

Alan KM6VV

_________________
Visit:
http://groups.yahoo.com/group/SherlineCNC/
http://tech.groups.yahoo.com/group/HexapodRobotIK/


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 27 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:  
cron
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group

phpBB SEO