In reality, I should have never expressed my concerns in Post #22, because I just realized that no matter what I do, the solution will never be compatible with the Teacup port that I am working on, because the configuration files expects actual IO pins, unless of course, I was to write support code for an external board. So in other words, the code will never be fully compatible with the Propeller, until P2 arrives, providing the final P2 product will support more pins. However I must say that perhaps that code should be altered, for seperate limit switch monitoring, instead of utilizing precious Propeller pins.
Anyhow, thanks jmg and Peter, you both have given a lot to think about.
Having looked at many different micros I come to the conclusion that if you want a simple micro with simple programming tools and that it is readily available in all kinds of TH and SMD packages then you should consider the AVRs such as the ATTINY84A and ATMEGA8A and so on. You can take your pick of 8,14,20,28,40 pin DIP or any of the SMD packages. As for programming tools there is nothing simpler than using BASCOM and a few dozen lines of code. Since it is so simple I will get some of these micros and write a little bit of code to use them as single-wire or I2C I/O. Maybe I can even flash them from the Prop which would mean that anyone could buy these chips off the shelf and not worry about support tools, just wire them in and load your Prop with a binary to RAM that includes the AVR binary which will then flash the AVR and then reboot the Prop back into your eeprom code.
Having looked at many different micros I come to the conclusion that if you want a simple micro with simple programming tools and that it is readily available in all kinds of TH and SMD packages then you should consider the AVRs such as the ATTINY84A and ATMEGA8A and so on. You can take your pick of 8,14,20,28,40 pin DIP or any of the SMD packages....
I think the SiLabs parts you already mentioned are better for slave IO, their only minus is no DIP, but they do have 'coarse pitch' SMD like SO16N and TQFP32 which can fit onto generic breakout boards.
SiLabs have lower cost Debug, and better ADCs (eg 12b) and run faster at the 3v3 the Prop uses.
Some run at 48/50MHz, well above AVR speeds.
Some have 3.4Mbit i2c Slaves, writing an i2c master on a Prop to hit that speed could be interesting ?
The other solution is like the first except I just use a cheap little micro though I do prefer the easy to use Silabs 8051 parts as they are very fast and simple, combine A/D and D/A, easy to flash via the Prop, plus 8051 assembly is a breeze.
Can you expand on "easy to flash via the Prop" - do you have a Prop Code block that does RS232 to C2D for ISP ?
I think the SiLabs parts you already mentioned are better for slave IO, their only minus is no DIP, but they do have 'coarse pitch' SMD like SO16N and TQFP32 which can fit onto generic breakout boards.
SiLabs have lower cost Debug, and better ADCs (eg 12b) and run faster at the 3v3 the Prop uses.
Some run at 48/50MHz, well above AVR speeds.
Some have 3.4Mbit i2c Slaves, writing an i2c master on a Prop to hit that speed could be interesting ?
True, and I do have a soft spot for these Silabs parts, it's just the fact that prices aren't always that good, stocks are miserable, and they don't have TH parts. I'm not worried about TH parts myself although a lot still do and admittedly they are great for protos and testing. The AVRs and even PICs have the advantage of 5V operation where that might be desired and BASCOM as well as the other reasons I mentioned.
There are other micros that I would consider myself besides these including the use of a cheap ARM loaded with Forth so that these could be loaded serially with high-level code and yet run just as fast or faster than the 8-bit micros.
Having looked at many different micros I come to the conclusion that if you want a simple micro with simple programming tools and that it is readily available in all kinds of TH and SMD packages then you should consider the AVRs such as the ATTINY84A and ATMEGA8A and so on. You can take your pick of 8,14,20,28,40 pin DIP or any of the SMD packages. As for programming tools there is nothing simpler than using BASCOM and a few dozen lines of code. Since it is so simple I will get some of these micros and write a little bit of code to use them as single-wire or I2C I/O. Maybe I can even flash them from the Prop which would mean that anyone could buy these chips off the shelf and not worry about support tools, just wire them in and load your Prop with a binary to RAM that includes the AVR binary which will then flash the AVR and then reboot the Prop back into your eeprom code.
'-----------------------------------------------------------------------------------------
'name : i2c_pcf8574.bas
'copyright : (c) 1995-2005, MCS Electronics
'purpose : shows how you could use the I2C slave library to create a PCF8574
'micro : AT90S2313
'suited for demo : NO, ADDON NEEDED
'commercial addon needed : yes
'-----------------------------------------------------------------------------------------
$regfile = "2313def.dat" ' specify the used micro
$crystal = 3684000 ' used crystal frequency
$baud = 19200 ' use baud rate
$hwstack = 32 ' default use 32 for the hardware stack
$swstack = 32 ' default use 32for the SW stack
$framesize = 40 ' default use 40 for the frame space
'This program shows how you could use the I2C slave library to create a PCF8574
'The PCF8574 is an IO extender chip that has 8 pins.
'The pins can be set to a logic level by writing the address followed by a value
'In order to read from the pins you need to make them '1' first
'This program uses a AT90S2313, PORTB is used as the PCF8574 PORT
'The slave library needs INT0 and TIMER0 in order to work.
'SCL is PORTD.4 (T0)
'SDA is PORTD.2 (INT0)
'Use 10K pull up resistors for both SCL and SDA
'The Slave library will only work for chips that have T0 and INT0 connected to the same PORT.
'These chips are : 2313,2323, 2333,2343,4433,tiny22, tiny12,tiny15, M8
'The other chips have build in hardware I2C(slave) support.
'specify the slave address. This is &H40 for the PCF8574
'You always need to specify the address used for write. In this case &H40 ,
'The config i2cslave command will enable the global interrupt enable flag !
Config I2cslave = &B01000001 ' same as &H41 (non default - def = &H40)
'Config I2cslave = &H40 , Int = Int0 , Timer = Timer0
'A byte named _i2c_slave_address_received is generated by the compiler.
'This byte will hold the received address.
'A byte named _i2c_slave_address is generated by the compiler.
'This byte must be assigned with the slave address of your choice
'the following constants will be created that are used by the slave library:
' _i2c_pinmask = &H14
' _i2c_slave_port = Portd
' _i2c_slave_pin = Pind
' _i2c_slave_ddr = Ddrd
' _i2c_slave_scl = 4
' _i2c_slave_sda = 2
'These values are adjusted automatic depending on the selected chip.
'You do not need to worry about it, only provided as additional info
'by default the PCF8574 port is set to input
Config Portb = Input
Portb = 255 'all pins high by default
'DIM a byte that is not needed but shows how you can store/write the I2C DATA
Dim Bfake As Byte
'empty loop
Do
' you could put your other program code here
'In any case, do not use END since it will disable interrupts
Loop
'here you can write your other program code
'But do not forget, do not use END. Use STOP when needed
'!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
' The following labels are called from the slave library
'!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
'When the master wants to read a byte, the following label is allways called
'You must put the data you want to send to the master in variable _a1 which is register R16
I2c_master_needs_data:
'when your code is short, you need to put in a waitms statement
'Take in mind that during this routine, a wait state is active and the master will wait
'After the return, the waitstate is ended
Config Portb = Input ' make it an input
_a1 = Pinb ' Get input from portB and assign it
Return
'When the master writes a byte, the following label is always called
'It is your task to retrieve variable _A1 and do something with it
'_A1 is register R16 that could be destroyed/altered by BASIC statements
'For that reason it is important that you first save this variable
I2c_master_has_data:
'when your code is short, you need to put in a waitms statement
'Take in mind that during this routine, a wait state is active and the master will wait
'After the return, the waitstate is ended
Bfake = _a1 ' this is not needed but it shows how you can store _A1 in a byte
'after you have stored the received data into bFake, you can alter R16
Config Portb = Output ' make it an output since it could be an input
Portb = _a1 'assign _A1 (R16)
Return
'!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
'You could simply extend this sample so it will use 3 pins of PORT D for the address selection
'For example portD.1 , portd.2 and portD.3 could be used for the address selection
'Then after the CONFIG I2CSLAVE = &H40 statement, you can put code like:
'Dim switches as Byte ' dim byte
'switches = PIND ' get dip switch value
'switches = switches and &H1110 ' we only need the lower nibble without the LS bit
'_i2c_slave_address = &H40 + switches ' set the proper address
Further to my suggestions that it would be good to have a cheap ARM chip loaded with Forth so that user software can be loaded as high level source via the serial port, a feat easily accomplished from the Prop. I have lots and lots of different ARM development boards and chip in all embedded kinds from the humble M0 to the F4s but it's this really little guy that I have on a USB keytag that interests me. Why? Because the chip is really small and yet it still has 16KB of RAM and 64KB of Flash as well as boot ROM of course plus A/D and the usual peripherals as listed below. But here's the thing, I can get this in 16-pin or 38-pin TSSOP, one of the easier SMD packages to handle and nice and small, as well as QFN24 and QFN40. The price? around $3 in one off's.
• Two Universal Serial Interface Channels (USIC), usable as UART, double-SPI, quad-SPI, IIC, IIS and LIN interfaces
• A/D Converters, up to 12 channels, includes a 12-bit analog to digital converter
• Capture/Compare Units 4 (CCU4) for use as general purpose timers
• Window Watchdog Timer (WDT) for safety sensitive applications
• Real Time Clock module with alarm support (RTC)
• System Control Unit (SCU) for system configuration and control
• Pseudo random number generator (PRNG), provides random data with fast generation times
• Temperature Sensor (TSE)
There are a couple of Forths available but I could also port an equivalent version of Tachyon across to this chip and preprogram them so that once I place it on a board all I have to worry about is communicating with it from the Prop at that high level where the Prop can issue "commands", "scripts", or just upload source code to it which is compiled and optionally flashed as it does have 16kB of RAM to play in. Not bad for a tiny "I/O processor"! Internal oscillator runs at 64MHz and effectively +/-1% over typical temperature range to deliver a 32MHz clock.
Oh, I didn't mention, the part operates from 1.8 to 5V. Get out of here!
Further to my suggestions that it would be good to have a cheap ARM chip loaded with Forth so that user software can be loaded as high level source via the serial port, a feat easily accomplished from the Prop. I have lots and lots of different ARM development boards and chip in all embedded kinds from the humble M0 to the F4s but it's this really little guy that I have on a USB keytag that interests me. Why? Because the chip is really small and yet it still has 16KB of RAM and 64KB of Flash as well as boot ROM of course plus A/D and the usual peripherals as listed below. But here's the thing, I can get this in 16-pin or 38-pin TSSOP, one of the easier SMD packages to handle and nice and small, as well as QFN24 and QFN40. The price? around $3 in one off's.
Two Universal Serial Interface Channels (USIC), usable as UART, double-SPI, quad-SPI, IIC, IIS and LIN interfaces
A/D Converters, up to 12 channels, includes a 12-bit analog to digital converter
Capture/Compare Units 4 (CCU4) for use as general purpose timers
Window Watchdog Timer (WDT) for safety sensitive applications
Real Time Clock module with alarm support (RTC)
System Control Unit (SCU) for system configuration and control
Pseudo random number generator (PRNG), provides random data with fast generation times
Temperature Sensor (TSE)
There are a couple of Forths available but I could also port an equivalent version of Tachyon across to this chip and preprogram them so that once I place it on a board all I have to worry about is communicating with it from the Prop at that high level where the Prop can issue "commands", "scripts", or just upload source code to it which is compiled and optionally flashed as it does have 16kB of RAM to play in. Not bad for a tiny "I/O processor"! Internal oscillator runs at 64MHz and effectively +/-1% over typical temperature range to deliver a 32MHz clock.
Oh, I didn't mention, the part operates from 1.8 to 5V. Get out of here!
...16KB of RAM and 64KB .... The price? around $3 in one off's.
There are a couple of Forths available but I could also port an equivalent version of Tachyon across to this chip and preprogram them...
Oh, I didn't mention, the part operates from 1.8 to 5V. Get out of here!
The price is a tad high high for Slave IO expansion, but as a Forth Platform it does sounds appealing, as, the RAM is the killer on most tiny MCUs - & 16K or RAM is good for that price.
Wide Vcc is certainly appealing, quite a few new MCUs now offer that.- seems '3v3 only' was an experiment that failed.
Does it have TTL or CMOS thresholds ?
The price is a tad high high for Slave IO expansion, but as a Forth Platform it does sounds appealing, as, the RAM is the killer on most tiny MCUs - & 16K or RAM is good for that price.
Wide Vcc is certainly appealing, quite a few new MCUs now offer that.- seems '3v3 only' was an experiment that failed.
Does it have TTL or CMOS thresholds ?
That was for a quantity of ONE not a thousand like some quote
If I am happy with a 32kB Flash which will be more than likely then it's only $2.10 in a hundred off (nothing). A reel of 3,000 ends up costing $1.14 a piece.
It still specs standard CMOS thresholds though, although the I/O does have pull-up or pull-down.
If I am happy with a 32kB Flash which will be more than likely then it's only $2.10 in a hundred off (nothing). A reel of 3,000 ends up costing $1.14 a piece.
.
Sounds like the Infineon XMC11xx series, they do have more RAM than most small M0's, so would be a good platform for your Forth Peripherals. Wide Vcc and good ADCs complete the offering, and they have a growth path to 200KF in the 38 pin models.
Just refreshed with a glance at the data, & those XMC11xx parts have a very nice Serial Block Cell - be well suited to talking to a Prop, with good FIFOs and choice of length, 1..63b
Heck, a P2 could do a lot worse than have a few serial Blocks like that - has everything that has been discussed, all done. FIFOs and variable length, and fast (plus QuadSPI) & they included hooks for Debug too..
Still comes in above the price of the General Slave IO expander.
Addit : Here are candidates for the lower-end General Slave IO www.silabs.com/EFM8
Starting prices for EFM8 MCUs in 10,000-unit quantities range from $0.21 for EFM8BB MCUs to $0.32 for EFM8SB MCUs to $0.43 for EFM8UB MCUs (all prices in USD). EFM8BB Busy Bee, EFM8SB Sleepy Bee and EFM8UB Universal Bee starter kits are priced at $29 each (USD MSRP).
Smallest part has 12b ADC and 2K FLASH, in QFN20.
There are SO16 and QSOP24 packages (but not in 2KF)
Comments
Yep, it is a pretty cramped working space
Anyhow, I really appreciate the advice. Thank you.
Bruce
Bruce,
Forgive me if you voiced these concerns before. but isn't the Propeller Project Board, (32810), a better fit?
Jim
For relatively low speed digital I/O I prefer the MCP23017
http://www.mikronauts.com/raspberry-pi/pi-rtc-dio/
For medium speed, there is the MCP23S17
For high speed, add another microcontroller (like a Prop <grin>)
Here is a shot of my MCP23017 I/O expander board, works with any microcontroller capable of I2C, and mounts on Pi (& Pi-like) boards:
(click for larger version)
It has I2C address selection jumpers under the chips, you can use four boards on one I2C bus - however only one should have the RTC installed.
It can also be used as a PropPlug when mounted on the Pi - the first four pins of the COM header are equivalent to a PropPlug.
Nah, I don't believe so. Here is my perspective: http://forums.parallax.com/showthread.php/157400-Are-The-Propeller-Proto-Boards-Being-Discontinued?p=1293048&viewfull=1#post1293048
Anyhow, thanks jmg and Peter, you both have given a lot to think about.
OK
I remember that thread now.
Although it is worth mentioning that one of those $8.99 Project Boards would have been a nice place to take the 8 switches I have been talking about
or is that what you meant with your post?
SiLabs have lower cost Debug, and better ADCs (eg 12b) and run faster at the 3v3 the Prop uses.
Some run at 48/50MHz, well above AVR speeds.
Some have 3.4Mbit i2c Slaves, writing an i2c master on a Prop to hit that speed could be interesting ?
Can you expand on "easy to flash via the Prop" - do you have a Prop Code block that does RS232 to C2D for ISP ?
True, and I do have a soft spot for these Silabs parts, it's just the fact that prices aren't always that good, stocks are miserable, and they don't have TH parts. I'm not worried about TH parts myself although a lot still do and admittedly they are great for protos and testing. The AVRs and even PICs have the advantage of 5V operation where that might be desired and BASCOM as well as the other reasons I mentioned.
There are other micros that I would consider myself besides these including the use of a cheap ARM loaded with Forth so that these could be loaded serially with high-level code and yet run just as fast or faster than the 8-bit micros.
They are improving in price - follow the link I gave in #17 which sorts Digikey for lowest price 1000+
There is an add-on I2C-slave library for BASCOM
http://www.mcselec.com/index.php?page=shop.product_details&flypage=shop.flypage&product_id=34&category_id=6&option=com_phpshop&Itemid=1
to do exactly this.
It would also allow to just take the very cheapest ARDUINO modules and use them as remote I2C slaves.
Flashing them from the Prop would be really nice.
But the ISP-programming adapter with USB is only a few $ and runs from within BASCOM.
• Two Universal Serial Interface Channels (USIC), usable as UART, double-SPI, quad-SPI, IIC, IIS and LIN interfaces
• A/D Converters, up to 12 channels, includes a 12-bit analog to digital converter
• Capture/Compare Units 4 (CCU4) for use as general purpose timers
• Window Watchdog Timer (WDT) for safety sensitive applications
• Real Time Clock module with alarm support (RTC)
• System Control Unit (SCU) for system configuration and control
• Pseudo random number generator (PRNG), provides random data with fast generation times
• Temperature Sensor (TSE)
There are a couple of Forths available but I could also port an equivalent version of Tachyon across to this chip and preprogram them so that once I place it on a board all I have to worry about is communicating with it from the Prop at that high level where the Prop can issue "commands", "scripts", or just upload source code to it which is compiled and optionally flashed as it does have 16kB of RAM to play in. Not bad for a tiny "I/O processor"! Internal oscillator runs at 64MHz and effectively +/-1% over typical temperature range to deliver a 32MHz clock.
Oh, I didn't mention, the part operates from 1.8 to 5V. Get out of here!
Well now, that sounds pretty darn convincing!
IMPOSSIBLE!!! )
Wide Vcc is certainly appealing, quite a few new MCUs now offer that.- seems '3v3 only' was an experiment that failed.
Does it have TTL or CMOS thresholds ?
just saw, there is also a 1-wire implementation for the AVR ATtiny and ATmega, saves a pin over I2C
http://www.mcselec.com/index.php?option=com_content&task=view&id=256&Itemid=57
That was for a quantity of ONE not a thousand like some quote
If I am happy with a 32kB Flash which will be more than likely then it's only $2.10 in a hundred off (nothing). A reel of 3,000 ends up costing $1.14 a piece.
It still specs standard CMOS thresholds though, although the I/O does have pull-up or pull-down.
Just refreshed with a glance at the data, & those XMC11xx parts have a very nice Serial Block Cell - be well suited to talking to a Prop, with good FIFOs and choice of length, 1..63b
Heck, a P2 could do a lot worse than have a few serial Blocks like that - has everything that has been discussed, all done. FIFOs and variable length, and fast (plus QuadSPI) & they included hooks for Debug too..
Still comes in above the price of the General Slave IO expander.
Addit : Here are candidates for the lower-end General Slave IO
www.silabs.com/EFM8
Starting prices for EFM8 MCUs in 10,000-unit quantities range from $0.21 for EFM8BB MCUs to $0.32 for EFM8SB MCUs to $0.43 for EFM8UB MCUs (all prices in USD). EFM8BB Busy Bee, EFM8SB Sleepy Bee and EFM8UB Universal Bee starter kits are priced at $29 each (USD MSRP).
Smallest part has 12b ADC and 2K FLASH, in QFN20.
There are SO16 and QSOP24 packages (but not in 2KF)