Electronic Projects, forums and more.

Go Back   Electronic Circuits Projects Diagrams Free > Electronics Categories > Micro Controllers


Micro Controllers Discuss all aspects of micro controllers - building them, coding them, etc. All controllers are welcome - PIC, BASIC, Z8 Encore!, etc.

Reply
 
LinkBack (1) Thread Tools Display Modes
Old 13th December 2007, 07:23 AM   (permalink)
Default

Quote:
Originally Posted by wschroeder
I see that you don't miss too many details... A few extra RAM slots sure does make a difference in code dimensions... as you've well demonstrated.

I also thought about the PIC16 with the slower clock. Your code has possibilities, at least in theory at this point. 256 bytes is available, but the broken up addressing would be a interesting hurdle. Maybe some FSR magic could be done.
Well, a 4 usec update interval is some 20 instruction cycles if you're using a 20 MHz clock so that gives us some room to work. The available RAM limits us to one 8-bit port group per update cycle so we'd need at least three output 'groups' using my method just to get to 16 outputs.

Perhaps we need another new 'method' for 16F' devices (another design challenge, grin)?
Mike, K8LH is offline  
Old 13th December 2007, 08:49 AM   (permalink)
Default

Quote:
Originally Posted by Mike, K8LH
Perhaps we need another new 'method' for 16F' devices (another design challenge, grin)?
I like a challenge. I think I can manage a 2uS update for a 16 series chip. It requires some tiresome cycle counting, but I think it is possible. When I get more time I'll have a go at coding it.

Mike.
Pommie is online now  
Old 13th December 2007, 01:43 PM   (permalink)
Default

I like a challenge too (grin).

A 2 usec update interval (10 instruction cycles?) seems aggressive but I'm sure if anyone could do it, you guys could. Remember, we need to include UART receive buffering which is implied but not shown in my previous algorithm example.

Happy Holidays, Mike

Last edited by Mike, K8LH; 13th December 2007 at 02:18 PM.
Mike, K8LH is offline  
Old 13th December 2007, 02:18 PM   (permalink)
Default

Managed to spend some time on this and I have a working 2uS servo loop and it's just 22 instructions long. Hopefully, I'll be able to post some working code in the next day or two.

Mike.

Added, unrolling the loop doesn't work as there isn't 512 ram locations.
Happy Holidays.

Last edited by Pommie; 13th December 2007 at 02:21 PM.
Pommie is online now  
Old 13th December 2007, 03:01 PM   (permalink)
Default

So how do we get 512 steps from a 256 byte array?

How about if we do 4 bit output groups? Build the buffer with the first 256 steps in the right nybbles and the second 256 steps in the left nybbles. It means using more 2000+ msec output group sequences but we can probably squeeze quite a few of those sequences into the overall 20 msec servo period.

What do you think?
Mike, K8LH is offline  
Old 13th December 2007, 03:41 PM   (permalink)
Default

I'm treading a completely different path. My buffer is only 20 bytes long, arranged as length, mask. Outputting the buffer is pretty trivial. Building the buffer is the headache.

Mike.
Pommie is online now  
Old 13th December 2007, 03:49 PM   (permalink)
Default

Fascinating. I knew there had to be a better "method". Keep at it.

Happy Holidays, Mike
Mike, K8LH is offline  
Old 13th December 2007, 08:08 PM   (permalink)
Default

I wonder if you could use 128 bytes of RAM as a 1024 bit interval buffer with up to eight '1' bits somewhere in that buffer indicating when to exclusive-or the output port with a value from another 8 byte array? Not quite sure if it's doable but I'll check it out this coming week.

Last edited by Mike, K8LH; 14th December 2007 at 03:02 AM.
Mike, K8LH is offline  
Old 14th December 2007, 02:32 AM   (permalink)
Default

All intriguing ideas. I will get to this later also. Business doubled this week. Got a couple hundred new RGB dotmatrix's in... still waiting for the TS GLCD's and the new prototype TS RGB GLCD. Maybe they'll be here Monday.
wschroeder is offline  
Old 14th December 2007, 02:35 AM   (permalink)
Default

Sounds like interesting stuff Warren
__________________
Steve
mister_e is offline  
Old 14th December 2007, 03:01 AM   (permalink)
Default

Quote:
Originally Posted by wschroeder
All intriguing ideas. I will get to this later also. Business doubled this week. Got a couple hundred new RGB dotmatrix's in... still waiting for the TS GLCD's and the new prototype TS RGB GLCD. Maybe they'll be here Monday.
Great news. Forgive me for asking on the Forum but I seem to have lost my Thunderbird email profile so my email isn't working... Can I expect that order sometime soon after you get caught up Sir?

Mike
Mike, K8LH is offline  
Old 14th December 2007, 03:26 AM   (permalink)
Default

I will ship to you as soon as the new GLCD's come in from China. They put me off by 2 weeks. Even the US Navy and Canadian Dept of Defense are waiting... really.. I have the tracking number, so it should be soon, probably Monday or Tuesday.
wschroeder is offline  
Old 14th December 2007, 08:26 PM   (permalink)
Default

Back to the topic of workable multi-channel hi-rez Servo code for 16F' devices...

I think I may have a method that provides a variable number of steps at 1 usec resolution using very few ram locations. I'll try coding an example for 1024 steps which would require 24 ram locations for the ISR driver and then 2 locations for each Servo array element. Like the method Mike (Pommie) is brain-storming, this method also requires a lot of work setting up those 24 variables.
Mike, K8LH is offline  
Old 16th December 2007, 10:35 AM   (permalink)
Default

A 1uS version on the 16F would be impressive. Would that also handle the serial as well. I have 2uS code for a 20MHz and 4uS code that uses the 8MHz internal oscillator and both manage to do serial with a fifo at 115.2K & 19200.

I'll post them when I get a working example of the buffer build code (got most of it working just no time to tidy it.). It probably won't be until after Christmas as I'm away most of next week.

Mike.
Pommie is online now  
Old 16th December 2007, 11:02 AM   (permalink)
Default

I haven't been able to squeeze serial input into the 1 usec update code which was 16 MHz (4 cycles per microsecond) so it looks like I will also be going with a longer update interval. I'm also having a hard time building serial input code without the 18F' movff instruction (grin).

Looking forward to seeing your method and I'll keep working on mine too.

Happy Holidays. Mike
Mike, K8LH is offline  
Reply

Bookmarks

Thread Tools
Display Modes


LinkBacks (?)
LinkBack to this Thread: http://www.electro-tech-online.com/micro-controllers/34390-drive-33-servos-one-pic-usart.html
Posted By For Type Date
PIC Servo Driver Tutorials? - RC Groups This thread Refback 16th May 2008 11:43 PM

Similar Threads
Title Starter Forum Replies Latest
Problems switchin relay with PIC Andy1845c General Electronics Chat 5 17th November 2007 07:14 PM
RF receive using PIC USART col_implant Electronic Projects Design/Ideas/Reviews 11 15th November 2007 05:06 PM
High ADC sampling rate PIC, 18F needed? bananasiong Micro Controllers 24 28th October 2007 01:13 PM
Controlling servos with PIC16F84A Ostekjeks Robotics Chat 3 25th February 2005 11:06 AM
electric car drive franklin2 Electronic Projects Design/Ideas/Reviews 8 18th October 2004 03:30 PM



All times are GMT. The time now is 04:00 AM.


Electronic Circuits  |  Learning Electronics
Powered by vBulletin® Version 3.7.0
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.

eXTReMe Tracker