HSERVO with Atom pro 28

hello!

I and having problems with hservo, it just dosent seam to work.
I’ve tried several different ways, it compiles but nothing happens, using a debug line before and after the hservo command proves that it runs…even the prewriten code for the brat wont do anything.

The IDE ver. is 8.0.1.8.
The Atom is on a bb2.

the weird thing is everything else seams to work???

I would really apreciate any help I can get

This is just a wag but I seem to recall a need for an ENABLEHSERVO command in the code so the module to support HSERVO commands got included or something. Do you have a line like this in your code?

Hi,

There is not enough information here to help much. It would really help to have information, like you have what servos on pins xxx and you have the jumpers set for those pins to use VS and not the +5v and what you are using to supply power, etc.

Also it would help to see the code that is not working for you.

Kurt

Even better show which tutorial you are using, and at what step it isn’t doing what you think it should. Have you skipped any steps? Were you able to get the offset program loaded and working?

  1. I do have the EnableHServo line in my code

  2. I am using hitec hs-422 and hs-475hb, for the pins
    for the pins, i am just trying to get it working with pins 0-3
    The jumpers were set to +5, should i change it to vs? does it really make a difference?
    When fully charged it reads at 5.46V, it is in vs and i do have the jummper on the vs, vl

3)I am not follow a tutorial, im just tring to use the hservo command, I havnt tried the offset because im not making a brat, i was just tring the code to see if it was an error in my code.

ENABLEHSERVO
hservo [p0\0\0,p1\0\0]

Servos can not be powered by the 5vdc regulator on the Bot Board II. That’s why we went to the trouble of adding a second place to apply servo power. You should at least look over the tutorials for the BRAT. You may just come out of the experience a little more knowledgeable. :wink:

I switched it to vs and still no luck

here the code

ENABLEHSERVO
hi var word
hi = 0

main:
hservo [p0\0\0]
pause 1000
serout s_out,i38400,"number of times = ", dec hi,13]
hi = hi + 1
goto main
end

That complies but noting happens.

but on the other hand, this code works just fine

hi var word
hi = 0

main:
	servo p0,0
	serout s_out,i38400,"number = ", dec hi,13] 
	hi = hi + 1
	goto main
end

Maybe it does not like speed of zero.

Try simply hservo [p0\0]

Kurt

Still no go :frowning:

This sounds like a job for AcidTech (Nathan). I think Hservo may be part or fully busted in 8.0.1.8. Or maybe my battery drained just after I rebuilt and downloaded my Brat code to my Brat using the new build and it no longer works.

To verify I just plugged in the battery charger to it and will try it again later. You might try downloading the 8.0.1.7 release and see if it works for you. You can get it from the Basic Micro web site:

basicmicro.com/ViewPage.aspx?ContentCode=d_basicatompro

Kurt

I hope this is the issue and its not my PIC!!!
thanks

Matt

I’ve been trying with 8.0.1.7 and it’s not working. It’s likely to be tomorrow before Nathan can help.

so the error is in 8.0.1.7 as well? What is the last stable release? Which should I try.

Kurt, with this code even the sound command does not work.

ENABLEHSERVO main: sound 9, [100\880, 100\988, 100\1046, 100\1175] hservo [p0\0\0,p1\0\0,p2\0\0] goto main

But if you comment out the two hservo commends the sound command works. We wrote tutorials for the Atom Pro / 8.0.1.7 / and the BRAT. I am not sure they are still working. Nathan tells me he can help tomorrow.

Yes I have used the 8.0.1.7 for awhile and that was the only one that everything was working properly since 8.0.0.0.

When I recompiled the brat that was running using the 8.0.1.7 and working well with the 8.0.1.8 the brat stopped working completely, including the LCD display not showing anything. That is why I decided to try to recharge the battery. But I thought that was a longshot as

I was stupid :blush: when I first tried out the brat with 8.0.1.7 I was not careful on how I picked it up and hit the VOL up key, where the brat promptly pinched my finger in one of the leg joints and cut a little skin. :angry: and I will Razz myself :stuck_out_tongue:

It sounds like it may be hanging in the EnableHSERVO code…

Kurt

8.0.1.7 is the last stable release. This is something weird. We will have to wait for Nathan to help out.

On my 8.0.1.8 code I am getting the sound, but I am not getting the hservo to do anything. This is on a my PS2 test setup with wall wart and I simply changed your code to hservo [p0\0] as I only had one servo and I did not specify a speed. I will try now speed of 255…

I am assuming my spare parallax servo will work, else I could through a 645 on it…

Kurt

Oh np, I got your back…

http://www.clarkambulance.com/sitebuildercontent/sitebuilderpictures/bandaid.jpg

Thanks Jim,

I did a little more playing around on my test setup. BB2 BAP28, PS2 setup, 645mg on P0 and jumpers from P4-6 to the LEDS on the board (p4->p13…) I am running this simple program:

[code]ENABLEHSERVO

i var sword

main:
high p4
high p5
high p6
for i = -10000 to 10000 step 1000
low p4
hservo [p0\i\255]
toggle p6
pause 150
;hservowait [p0]
high p4
next

for i = 10000 to -10000 step -1000
	low p5
	hservo [p0\i\255]
	toggle p6
	pause 50
	high p5
next
hservo [p0\-16000\255]
low p4
low p5
low p6
pause 2000

goto main [/code]
I have tried several variations, but what happened was the servo would get power and go to one location and just sit there. , it was getting some type of signal as I could not move it. I put the extra code in to go to -1600 after each looping that should release the servo. Again it did not. While typing this I moved the servo to P3 and did not change the code so the code is to manipulating P0, but the servo started moving around some on P3. Not good. Maybe I will move the logic analyzer back to this setup and see what I am getting!

Kurt

Ok, I did a quick setup with the Logic Analyzer. I hooked up probes on pins 0-6 and tried the program I showed above. I did play around with some of the timeouts… The only thing that the logic analyzer showed is that my LED outputs High/Low/Toggle are working on P4-P6 and P0 is pulled low and P1-p3 are floating high. So we are not seeing any servo pulses on P0…

That is all I can do…

Kurt