Shop OBEX P1 Docs P2 Docs Learn Events
6 pin micro — Parallax Forums

6 pin micro

kelvin jameskelvin james Posts: 531
edited 2005-03-06 08:01 in General Discussion
worth a look
www.newark.com/eflyer/microchip/EFlyer-Pic10details.html
Newark is a good place to buy from also.

kelvin

Comments

  • Paul BakerPaul Baker Posts: 6,351
    edited 2005-03-02 16:03
    Thats pretty cool, but personally, I prefer the ATtiny13 which is an 8 pin microcontroller, here's the stats that outshine the PIC10F206 (the best of the PIC10F series):

    20MHz (vs 4MHz)
    20MIPS· (vs 1MIPS)
    32 byte register space (vs 24 bytes)
    64 bytes general SRAM data space (vs none)
    64 bytes EEPROM (vs none)
    upto 64 levels of nested subroutines (vs 2 (or 1 if you have an ISR))
    2 hardware PWM Channels (vs none)
    4 10bit analog·to digital·inputs (vs none)
    Able to self program its flash program memory (vs no capability)
    6 data addressing modes (vs 3)
    3 data pointers (vs 1)
    120 Instruction set (vs 33 instructions) with both uC having 512 instruction program memory, more·instructions means less program space occupation.

    And the ATtiny is $1.40, only $0.10 more than the reprogrammable version of the PIC10F206. I have already bought an ATtiny13·and am in the processes of writing code for the SX to program it, I will be writing the code in SX/B and will try to find someone to translate the code to·PBASIC and test it on a Stamp. Additionally I will create a program for the ATtiny13 to turn it into a perpheral expansion device communicating with the host via I2C so you can use all the goodies on the AT13. All this should be posted in the projects forum in what I hope to be about a month's time or less.

    As for Newark in One, I will attest to thier service, they provided me with·a SOIC version of a specialty chip that digikey only had the BGA version of, and thier service was very prompt.
  • MacGeek117MacGeek117 Posts: 747
    edited 2005-03-02 18:02
    What would you use those chips for?
    bugg

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Geordi: "It's like the laws of physics went right out the window!"
    Q: "And why shouldn't they, they're so inconvenient!"

    Geordi LaForge, Chief Engineer, USS Enterprise, NCC 1701-D
    Q, Omnipotent Prankster
  • Paul BakerPaul Baker Posts: 6,351
    edited 2005-03-02 18:13
    In general they are used when you need complex control of a few signal lines. The AT13 when programed and connected to a stamp will provide analog to digital conversion, PWM, analog compare, and could perform complex algorithms (think co-processor) in a fraction of the time a stamp could in a cheap, all-in-one package.
  • kelvin jameskelvin james Posts: 531
    edited 2005-03-03 08:39
    Geez, that is a huge difference between the 2 chips, the micro is not in the same league as the atmel.
    Paul, you da man ! If you can get this up and running, it would be awsome. An an all in one coproceesor chip that could be interfaced to the stamp would be a valuble addition. It would be that extra step above working through the limitations of the stamp, and would be great for robitics and many other applications. I think the stamp can work well as a master device, and this will just give it the extra processing power that it is missing. I'm sure a lot of people would probably go this route, rather than switch to a SX, just for the simplicity of programming and being easy on the electronics side. I downloaded the AVR software to have a look, way beyond me.
    Anyway, i wish you luck with this.

    kelvin
  • MacGeek117MacGeek117 Posts: 747
    edited 2005-03-03 16:14
    COOL!!!
    bugg

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Geordi: "It's like the laws of physics went right out the window!"
    Q: "And why shouldn't they, they're so inconvenient!"

    Geordi LaForge, Chief Engineer, USS Enterprise, NCC 1701-D
    Q, Omnipotent Prankster
  • Paul BakerPaul Baker Posts: 6,351
    edited 2005-03-03 17:27
    Kelvin,

    What kind of features do you think would be most valuable to a stamper?
    Like I said, it will be communicating with the host via I2C so that will take two I/O pins.

    To an SXer, the PWM isn't that useful since the SX is quite capable of doing it itself, so for the SX the features of the AT13 I will be targeting is the ADC and the EEPROM storage. So the AT13 firmware for the SX interface will likely be on pins 5 and 6.

    But I imagine that PWM via stamp is difficult especially if your trying to run other tasks, so I was thinking in the stamp version of using pins 2 and 3 for the I2C interface, which would give two channels of ADC and two channels of PWM (or 1 ADC and 2 PWM with an external timer counter). Of course the stamper could also use the SX version of the AT13 firmware if they need 4 ADC channels.

    I haven't investigated the possibility of writing a general co-processor engine, but if I did, what functions would you like to see? Integer multiplication/division? Floating point arithmatic? These would be the easiest to create but there are other possibilities.

    I know not all stamps have the I2C command, Jim McCorrison says that it could be implemented via the SEROUT and SERIN commands, but there are some nuanced features of I2C I'm not sure SEROUT and SERIN can handle, such as synchronization and arbitration. Do you think a SPI interface would be benificial to stampers who have the reduced function stamps? (SPI is more straightforward and is likely a better match for SEROUT and SERIN)

    And one last question, do all stamps have the ability of a program·writing to eeprom thats on the stamp, or is that a feature only availible to some stamps?

    Paul
  • Jon WilliamsJon Williams Posts: 6,491
    edited 2005-03-03 17:48
    While it's true that not all of the BS2 family have built-in I2C commands, any member of the BS2 family is capable of communicating with an I2C device with a little code.· I've created an I2C library that I use with my non-BS2p Stamps.



    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Jon Williams
    Applications Engineer, Parallax
    Dallas, TX· USA
  • Paul BakerPaul Baker Posts: 6,351
    edited 2005-03-03 18:01
    Thanks Jon,
    That will simplify development, I was starting to worry this "minor project" would spiral out of control by trying to anticipate all needs.
  • Jim McCorisonJim McCorison Posts: 359
    edited 2005-03-03 18:06
    I should clarify that what I told Paul was that while any of the BS2 Stamps can communicate via I2C or SPI, SPI was easier as it can be done via SERIN/SEROUT. As Jon's code shows, I2C requires "bit banging" to get the job done. But even so, the sample code only requires 240 bytes, so there is still plenty or room for lots of code.

    Jim
  • Jon WilliamsJon Williams Posts: 6,491
    edited 2005-03-03 18:11
    To clarify, SPI would use SHIFTOUT and SHIFTIN as they are synchronous.· The bit-banged I2C routines use SHIFTOUT and SHIFTIN as well, the difference being that many devices can be attached to the two bus lines.


    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Jon Williams
    Applications Engineer, Parallax
    Dallas, TX· USA
  • Jim McCorisonJim McCorison Posts: 359
    edited 2005-03-03 18:20
    blush.gif

    I don't know where my mind is. I am completely out to lunch. Yes, SPI takes SHIFTIN/SHIFTOUT. I haven't worked on my code for 4 days and I can't even remember which IO routines it uses. It seems that every month more of my mind turns to mush. I'm sorry for the confusion. (Paul are you sure you want ole mush-brain here working on the migration?)

    Time for more coffee.

    Jim
  • Paul BakerPaul Baker Posts: 6,351
    edited 2005-03-03 18:31
    Jim: yeah I still do.

    Jon: The best I can tell your code is for I2C master, can the stamp also simultaneously be a slave? (ie multimaster configuration)·Do you code for that as well? I was planning on having the AT13 have two modes for ADC, polling method (host is master), and automatic method (AT13 is master). If its not possible it's no biggie, it'll just be an mode·availible only to the SX.
  • Jon WilliamsJon Williams Posts: 6,491
    edited 2005-03-03 19:18
    My code is for master only.· I think it would be quite tricky to program a BASIC Stamp as an I2C slave, as it would require true bit-banging.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Jon Williams
    Applications Engineer, Parallax
    Dallas, TX· USA
  • Paul BakerPaul Baker Posts: 6,351
    edited 2005-03-05 18:05
    Can anyone tell me what the max time for execution of a single command (16 bits) for the I2C code that Jon posted for the slowest Basic stamp? I need to implement a receive timeout value for the the AT13 I2C routine. I have to use the watchdog timeout, since I need to give user programmability to the only timer for PWM functions, so my options for timeout values are 16, 32, 64 and 128 mS (there are 6 more power of 2 longer values availible but I don't think they·would be nessesary). I want to make the timeout value as short as possible without prohibiting·the slowest·stamp from using the part.
  • kelvin jameskelvin james Posts: 531
    edited 2005-03-06 01:59
    Transmission Rate Approximately 81 kBits/sec (BS2p), 45 kBits/sec (BS2pe) -- not including overhead
    Paul, I can't help out much with the software/ timing issues, wish i could. After some looking into the specs of doing this, it raises some questions to overall functions it will be capable of. Will there be any direct control of the paramaters of the tiny13? This will answer the usefullness of the functions available on it. I can see the counter /timer, pwm, comparator, interrupts all be useful features, but can they be adjusted from the stamp? Kinda lost on the com aspect, so without that, there is a big grey area i can't relate to for the operation. I assume it will be just a firmware written to the tiny13, allowing the stamp to read the processed info through the dedicated pins. By the way, the 2313 looks like it might be able to handle the interface easier with the USI or USART, but only speculation here, and again a more complex chip. To myself, probably co-processor is the wrong term, i would look at it as being a PRE-processor, signal conditioner and data buffer /storage for the stamp to read from. Getting data input from sensors and reading it a fast/ precise way is a good tool to have available for fast program execution. I would think basic math /logic would be good enough, floating point would be nice, but could be bypassed. I guess the thing here is not to get too complicated. If it easy to hook up and use, and it gives the stamp that extra 'power' for peripheral interfacing, i can't see anyone not wanting to use it. It would be really cool if this could turn out to be a 'multiple' I/O.
    Anyway, going to do some more research, and will get back.

    kelvin

    And by the way, incase you haven't seen it, pretty active forum.
    www.avrfreaks.net

    Post Edited (kelvin james) : 3/6/2005 2:23:45 AM GMT
  • Paul BakerPaul Baker Posts: 6,351
    edited 2005-03-06 03:16
    Ok heres what I have planned:

    I will write a loader program for the SX and the BS, wrapped in this will be the firmware for the AT13, SPI protocol to communicate with the AT13 programming interface, The loader will initialize the AT13 for programming, program it, then verify the AT13 was programmed correctly.

    I will write I2C interface functions for the SX and BS that will communicate with the AT13 to be incorporated in a user's program. The Stamp cannot handle slave mode of I2C so the AT13 cant initiate communications with the stamp.

    The firmware that will be downloaded to the AT13 will have I2C to communicate with the host. And the following modules:

    PWM:
    2·modes of operation: phase controlled and·frequency controlled, and I'm contemplating throwing in some more complex modes of operation. You'll be able to set the prescaler of the PWM timer, this will set the frequency of the phase controlled mode and provide a full range frequencies availible in the frequency controlled mode.
    The PWM will be a "set it and forget it" feature, you load the parameters, turn it on, and it will run till the cows come home or you switch off the function or power.

    ADC:
    2 modes of operation: Auto-aquire where the data will be placed in a buffer and when you request a channel's value it provides it, the buffer will be overwritten each successive sample, the aquisition rate will be settable. Aquire on demand, the AT13 will hold the communication channel on hold until it aquires the value. The SX version will have a means of the AT13 pushing the value to the SX when the value becomes availible. The first version may only have the aquire on demand feature.

    Analog Compare:
    When one analog voltage on a pin is greater than another, a buffer availible for polling·will be 1, 0 when the opposite is true.

    EEPROM:
    reading and writing values to the EEPROM.

    Not going to be included in the first version but contemplating future·features:

    FLASH Write:
    storing a page (8 bytes) of·data already stored in EEPROM into program flash memory (expands availible non-volatile memory).

    Floating point engine:
    32 bit +,-,*,/,^ operations.

    Not all modules are availible simultaneously due to pin definition limitations, for instance PWM and analog compare are mutually exclusive.

    Likely to accomodate the timeout issue, there will be a substantially long timeout value, a command will be able to set the value, if you have problems communicating, power cycle the AT13 to restore the long value, then when you find the optimum value you can send another command to make the timeout "permanent" (reprogramming it would be nessesary if you commit a timeout value that is too short for your host).

    Post Edited (Paul Baker) : 3/6/2005 3:26:13 AM GMT
  • kelvin jameskelvin james Posts: 531
    edited 2005-03-06 07:22
    Now that is impressive. Good to see the prescaler is utilized. I'm still going through the doc to see if there is anything else, but at this point, i would highly doubt it. I would have second thoughts about offering it as a freebie.

    kelvin
  • Paul BakerPaul Baker Posts: 6,351
    edited 2005-03-06 07:47
    naw its just code, the idea sprang from a conversation a while back with Chris Savage. At some point I may transition to offering products akin to what Newzed is doing, but it would likely be bits o' hardware. I think I would feel guilty charging for such a small program. I just coded the I2C receiver and it is in the vicinity of 25 bytes, and there isn't a vast amount more to do (wrt the AT13 firmware). Plus the I2C receiver is almost a straight port of Gunther's code for the SX (this is mentioned in the comments of the code) with the exception that the receiver is mainline and not interrupt driven because I need the timer to be used by the PWM (and prescaled to the user's whim), and the watchdog timer is too slow for communications. So the fact that a substantial portion of the code was derived by code that both Gunther and Parallax as the publisher have some claim over could complicate trying to profit from it. Plus its a personal vindication for failing to meet the SX contest deadline, and Im too burnt on that project to continue working on it just yet.

    Post Edited (Paul Baker) : 3/6/2005 7:53:19 AM GMT
  • Paul BakerPaul Baker Posts: 6,351
    edited 2005-03-06 08:01
    Perhaps I'll charge for an
Sign In or Register to comment.