Shop OBEX P1 Docs P2 Docs Learn Events
MCP3204 5ft away from Prop - Page 2 — Parallax Forums

MCP3204 5ft away from Prop

2

Comments

  • eagletalontimeagletalontim Posts: 1,399
    edited 2014-12-20 21:25
    Well, this thread has continued on more than I expected. I have no idea how to work with any other IC nor how to program them. The SX is where I started and moved to the Prop since the SX was at an EOL. It took me over a year to figure how to write my own code with the Prop without having to copy and paste.....and that is still in Spin. Adding another IC that I have to program sounds even more "scary" but if all it takes is the 1 chip, 4 resistors and no power regulation other than a cap or 2, that sounds like I should at least try it.

    So.... Not sure if I should start another thread, but how do I program one of these ATtiny chips? Digikey shows to have the PIC12F675 in stock. It is for sure less expensive than the MCP3204 and appears be a great alternative. If I am going to try something new, I should give it a shot at least.... may come in handy for other projects too :)
  • Peter JakackiPeter Jakacki Posts: 10,193
    edited 2014-12-20 22:08
    Well, this thread has continued on more than I expected. I have no idea how to work with any other IC nor how to program them. The SX is where I started and moved to the Prop since the SX was at an EOL. It took me over a year to figure how to write my own code with the Prop without having to copy and paste.....and that is still in Spin. Adding another IC that I have to program sounds even more "scary" but if all it takes is the 1 chip, 4 resistors and no power regulation other than a cap or 2, that sounds like I should at least try it.

    So.... Not sure if I should start another thread, but how do I program one of these ATtiny chips? Digikey shows to have the PIC12F675 in stock. It is for sure less expensive than the MCP3204 and appears be a great alternative. If I am going to try something new, I should give it a shot at least.... may come in handy for other projects too :)

    I'd go either way although I mentioned the PICs because I have them and I could program and post them. Same with the AVRs. Seems the AVRs are very popular in Arduinos though. The AVRs are easy enough to burn from the Prop as you only need 4 I/O at the time to load you object code into the chip. So I would recommend the ATTINY13 and use BASCOM so you don't have any learning humps to get over plus MJB has already done the code.

    I think you will be very pleased that you went this route though even though it seems as if you are using another "micro" but in the end it is a custom chip that you can set and forget. I know that kwinn said that we should be able to work with the parts you mentioned, and yes, of course you can, but is it really worth it for this job when a cheap and easy alternative is at hand? Embedded electronics requires a sort of stick-with-it-ness, that tough unrelenting perseverance, and at the same time not being so stubborn or blind as to forego the better solution just because it's easier ;)

    Cluso99 programmed ATTINY13s a while ago and there is something in the OBEX for it too. Normally what I do with this type of thing is F10 the programming code including the object file (AVR) into RAM where the Prop burns the chip after which you can reboot back into whatever the Prop was doing before, so it's only a temporary setup. You don't even have to compile the BASCOM code either as I'm sure MJB can send you the binary file that you can include.

    Have I done something similar before?
    Yes, At least once I've used PICs as A/Ds that conditioned the signal and transmitted this serially through optos. Worked very well and never ever had to touch the code again, it just works.
  • eagletalontimeagletalontim Posts: 1,399
    edited 2014-12-20 22:16
    So there is not some sort of programming device kind of like how the Prop is programmed? I don't mind buying a board to program these PIC's since if I learn them, I can use them in several other projects even without the Prop.
  • Peter JakackiPeter Jakacki Posts: 10,193
    edited 2014-12-20 23:03
    So there is not some sort of programming device kind of like how the Prop is programmed? I don't mind buying a board to program these PIC's since if I learn them, I can use them in several other projects even without the Prop.

    There are heaps of them out there and some program from Arduino Unos which is based on the same AVR architecture.
    http://www.instructables.com/id/Programming-an-ATTiny13A-using-Arduino-servo-int/


    There's a whole heap of USB programmers using the 10pin IDC header (ribbon cable)
    http://www.ebay.com.au/itm/like/181592029817?limghlpsr=true&hlpv=2&ops=true&viphx=1&hlpht=true&lpid=107&chn=ps

    But the Prop option is handy too.
  • LoopyBytelooseLoopyByteloose Posts: 12,537
    edited 2014-12-20 23:51
    The core issue remains.

    Is SPI without the addition of driver chips and their related receiver chips a wise choice to dangle at the end of 5 feet of wire, or should an alternative provide a better solution? Twisted pairs, pull-ups, and impedance matching can only do so much.

    Historically, I think some of the game input devices, such as the Ninetendo Entertainment system used SPI at the end of a long wire. But that wasn't around electric motors and the EMI that they create.

    So motor environments may just be too hostile for long-wire SPI.

    http://en.wikipedia.org/wiki/Nintendo_Entertainment_System
  • DomanikDomanik Posts: 233
    edited 2014-12-21 00:01
    One last thought. If you use twisted pairs, active signals should not be paired or they'll crosstalk. Ideally an active signal should be paired with ground or its complement.
  • LoopyBytelooseLoopyByteloose Posts: 12,537
    edited 2014-12-21 01:29
    I must admit ignorance about adapting SPI to long wire with RS422 chips, but here is a white paper that explains exactly how to.

    www.ti.com/lit/an/slyt441/slyt441.pdf

    Seems simpler for the OP that starting in with programing another genre of uP.
  • MJBMJB Posts: 1,235
    edited 2014-12-21 04:02
    I'd go either way although I mentioned the PICs because I have them and I could program and post them. Same with the AVRs. Seems the AVRs are very popular in Arduinos though. The AVRs are easy enough to burn from the Prop as you only need 4 I/O at the time to load you object code into the chip. So I would recommend the ATTINY13 and use BASCOM so you don't have any learning humps to get over plus MJB has already done the code.

    Cluso99 programmed ATTINY13s a while ago and there is something in the OBEX for it too. Normally what I do with this type of thing is F10 the programming code including the object file (AVR) into RAM where the Prop burns the chip after which you can reboot back into whatever the Prop was doing before, so it's only a temporary setup. You don't even have to compile the BASCOM code either as I'm sure MJB can send you the binary file that you can include.
    btw BASCOM is free for up to 4k FLASH
    http://mcselec.com/index.php?option=com_docman&task=cat_view&gid=99&Itemid=54
    And it includes even a simulator.
    too bad I can't include the screen shot right here. - see link
    http://smmu.info/assets/images/BASCOM_screen.jpg
  • Peter JakackiPeter Jakacki Posts: 10,193
    edited 2014-12-21 04:14
    MJB wrote: »
    btw BASCOM is free for up to 4k FLASH
    http://mcselec.com/index.php?option=com_docman&task=cat_view&gid=99&Itemid=54
    And it includes even a simulator.
    too bad I can't include the screen shot right here. - see link
    http://smmu.info/assets/images/BASCOM_screen.jpg

    Sure, just manually change the url tag to img tags.
    BASCOM_screen.jpg
  • eagletalontimeagletalontim Posts: 1,399
    edited 2014-12-21 07:19
    Ok, I just downloaded the BASCOM utility and will tinker with it a bit. The code looks kind of similar to VB so I may be able to catch on kind of quickly. So who has instructions on how to program one of these chips using the Prop? I have a bread board with a prop set up on it already that I can plug in the PIC and program then remove, kind of like the SX28 board.

    EDIT * : The PIC12F675 appears to have a 2.0 to 5.5V range so it looks as though I still need some sort of power regulation from 12V down. I thought all I would need is 1 PIC, a couple caps and resistors and the IR sensors?

    EDIT #2 : I just tried to simulate the code posted for the ADC on the PIC but had to modify it a little due to errors and when the errors were clear, it says "Out of SRAM". I guess I have to buy the program to accomplish this?
    $regfile = "attiny13.dat"
    $crystal = 9600000
    
    Config Portb.0 = Output
    Open "COMB.0:9600,8,N,2" For Output As #1
    
    Config Adc = Single , Prescaler = Auto , Reference = Avcc
    'Now give power to the chip
    Start Adc
    Dim Cnt As Integer
    Dim W As Word , channel As Byte
    'now read A/D value from channel 0 .. 3
    Do
       Print #1 , "!"
       For channel = 0 To 3
           W = 0
           For Cnt = 0 To 63
               W = W + Getadc(channel)
           Next Cnt
           Print #1 , W ; " " ;
       Next channel
       Print #1 , ":"
    Loop
    End
    
  • MJBMJB Posts: 1,235
    edited 2014-12-21 08:27
    Ok, I just downloaded the BASCOM utility and will tinker with it a bit. The code looks kind of similar to VB so I may be able to catch on kind of quickly. So who has instructions on how to program one of these chips using the Prop? I have a bread board with a prop set up on it already that I can plug in the PIC and program then remove, kind of like the SX28 board.

    EDIT * : The PIC12F675 appears to have a 2.0 to 5.5V range so it looks as though I still need some sort of power regulation from 12V down. I thought all I would need is 1 PIC, a couple caps and resistors and the IR sensors?

    EDIT #2 : I just tried to simulate the code posted for the ADC on the PIC but had to modify it a little due to errors and when the errors were clear, it says "Out of SRAM". I guess I have to buy the program to accomplish this?

    ATTENTION: a PIC is from Mircochip and an AVR ATtiny13 or other ATmegas/Xmegas are from ATMEL -
    so BASCOM is for AVR tinies, megas and xmegas - and NOT for PICs
    (the ATtiny13 is a few cents more than the PIC12F675 Peter had mentioned.

    There is an Object in OBEX by Cluso99 fpr programming a ATtiny from Propeller.
    http://forums.parallax.com/showthread.php/134719-Programming-the-ATtiny84-with-the-Propeller-%28working%29?highlight=attiny+programmer
  • Peter JakackiPeter Jakacki Posts: 10,193
    edited 2014-12-21 08:38
    Ok, I just downloaded the BASCOM utility and will tinker with it a bit. The code looks kind of similar to VB so I may be able to catch on kind of quickly. So who has instructions on how to program one of these chips using the Prop? I have a bread board with a prop set up on it already that I can plug in the PIC and program then remove, kind of like the SX28 board.

    EDIT * : The PIC12F675 appears to have a 2.0 to 5.5V range so it looks as though I still need some sort of power regulation from 12V down. I thought all I would need is 1 PIC, a couple caps and resistors and the IR sensors?

    EDIT #2 : I just tried to simulate the code posted for the ADC on the PIC but had to modify it a little due to errors and when the errors were clear, it says "Out of SRAM". I guess I have to buy the program to accomplish this?

    There are no micros that run straight off 12V and that's not what I said. I said you could use a shunt "regulator" using a resistor and two series red LEDs acting as a 3.3V zener, so it's still a regulator.

    I'm guessing Out of SRAM is referring to your target chip, it's not a PIC but an AVR and you may have to set it to the device you are intending to use to it can simulate it properly. I will have to fire up a copy to see what's what first though.

    Have a look at this thread: (ATTINY84, same principle)
    http://forums.parallax.com/showthread.php/134719-Programming-the-ATtiny84-with-the-Propeller-%28working%29
  • MJBMJB Posts: 1,235
    edited 2014-12-21 08:52
    EDIT #2 : I just tried to simulate the code posted for the ADC on the PIC but had to modify it a little due to errors and when the errors were clear, it says "Out of SRAM". I guess I have to buy the program to accomplish this?

    This code runs in the simulator - I don't havE a chip at hand atm.
    $regfile = "attiny13.dat"
    $crystal = 9600000
    
    Config Portb.0 = Output
    Open "COMB.0:9600,8,N,2" For Output As #1
    
    Config Adc = Single , Prescaler = Auto , Reference = Avcc
    'Now give power to the chip
    Start Adc
    Dim W As Word , Channel As Byte , Cnt As Byte
    'now read A/D value from channel 0 .. 3
    Do
       Print #1 , "!"
       For Channel = 0 To 3
           W = 0
           For Cnt = 0 To 63
               W = W + Getadc(channel)
           Next Cnt
           Print #1 , W ; " " ;
       Next Channel
       Print #1 ,
    Loop
    End
    

    and this is the compiler report
    Report       : attiny13 4-ADC Serial
    Date         : 12-21-2014
    Time         : 12:46:20
    
    Compiler     : BASCOM-AVR LIBRARY V 2.0.7.7
    Processor    : ATTINY13
    SRAM         : 40 hex
    EEPROM       : 40 hex
    ROMSIZE      : 400 hex
    
    ROMIMAGE     : 246 hex  -> Will fit into ROM
    ROMIMAGE     :  582 dec
    FLASH USED   :  56  %
    
    so should easily fir in ATtiny13
  • eagletalontimeagletalontim Posts: 1,399
    edited 2014-12-21 09:07
    From what I can tell with my limited knowledge of these AVR chips is the ATtiny13 will not be able to hold the program for the 4 channel ADC and serial output.

    I looked at the thread to program one of these AVR's with the Prop and felt like I was in advanced calculus.....definitely not for me.... To some, it may seem simple, but I believe I need simpler :P I was really hoping there was 1 board that would connect to my computer via USB and I could program the IC using the BASCOM-AVR program kind of like how the SX28 is programmed. Is there a such beast that is affordable?

    Here is the report I get from the exact same code above :
    Report       : Sun-Position-Sensor
    Date         : 12-21-2014
    Time         : 11:09:25
    
    Compiler     : BASCOM-AVR LIBRARY V 2.0.7.5,  DEMO Edition
    Processor    : ATTINY13
    SRAM         : 40 hex
    EEPROM       : 40 hex
    ROMSIZE      : 400 hex
    
    ROMIMAGE     : 23C hex  -> Will fit into ROM
    ROMIMAGE     :  572 dec
    FLASH USED   :  55  %
    BAUD         : 9600 Baud
    XTAL         : 9600000 Hz
    BAUD error   : 100.%
    
    Stack start  : 9F hex
    Stack size   : 28 hex
    S-Stacksize  : 10 hex
    S-Stackstart : 78 hex
    Framesize    : 20 hex
    Framestart   : 48 hex
    Space left   : -29  dec
    
    LCD DB7      : PORTB.7
    LCD DB6      : PORTB.6
    LCD DB5      : PORTB.5
    LCD DB4      : PORTB.4
    LCD E        : PORTB.3
    LCD RS       : PORTB.2
    LCD mode     :  4  bit
    
    --------------------------------------------------------------------------------
    Variable                         Type            Address(hex)   Address(dec)
    --------------------------------------------------------------------------------
    ADC                              Word              0024          36
    HWSTACK                          Word              005D          93
    SWSTACK                          Word              001C          28
    FRAME                            Word              0004          4
    ADCD                             Word              0024          36
    PWM0                             Byte              0056          86
    PWM0A                            Byte              0056          86
    PWM0B                            Byte              0049          73
    ERR                              Bit               0006          6
    W                                Word              0060          96
    CHANNEL                          Byte              0062          98
    CNT                              Byte              0063          99
    
    --------------------------------------------------------------------------------
    Constant                         Value
    --------------------------------------------------------------------------------
    SREG                             &H3F
    SPL                              &H3D
    GIMSK                            &H3B
    GIFR                             &H3A
    TIMSK                            &H39
    TIMSK0                           &H39
    TIFR                             &H38
    SPMCSR                           &H37
    OCR0A                            &H36
    PWM0A                            &H36
    COMPARE0A                        &H36
    OCR0                             &H36
    PWM0                             &H36
    COMPARE0                         &H36
    MCUCR                            &H35
    MCUSR                            &H34
    MCUCSR                           &H34
    TCCR0B                           &H33
    TCCR0                            &H33
    TCNT0                            &H32
    COUNTER0                         &H32
    TIMER0                           &H32
    OSCCAL                           &H31
    TCCR0A                           &H2F
    DWDR                             &H2E
    OCR0B                            &H29
    PWM0B                            &H29
    COMPARE0B                        &H29
    GTCCR                            &H28
    CLKPR                            &H26
    WDTCR                            &H21
    EEAR                             &H1E
    EEARL                            &H1E
    EEDR                             &H1D
    EECR                             &H1C
    PORTB                            &H18
    DDRB                             &H17
    PINB                             &H16
    PCMSK                            &H15
    DIDR0                            &H14
    ACSR                             &H08
    ADMUX                            &H07
    ADCSRA                           &H06
    ADCSR                            &H06
    ADCH                             &H05
    ADCL                             &H04
    ADCSRB                           &H03
    SP7                              7
    SP6                              6
    SP5                              5
    SP4                              4
    SP3                              3
    SP2                              2
    SP1                              1
    SP0                              0
    INT0                             6
    PCIE                             5
    INTF0                            6
    PCIF                             5
    OCIE0B                           3
    OCIE0A                           2
    TOIE0                            1
    OCF0B                            3
    OCF0A                            2
    TOV0                             1
    TSM                              7
    PSR10                            0
    PUD                              6
    SE                               5
    SM1                              4
    SM0                              3
    ISC01                            1
    ISC00                            0
    WDRF                             3
    BORF                             2
    EXTRF                            1
    PORF                             0
    CTPB                             4
    RFLB                             3
    PGWRT                            2
    PGERS                            1
    SPMEN                            0
    COM0A1                           7
    COM0A0                           6
    COM0B1                           5
    COM0B0                           4
    WGM01                            1
    WGM00                            0
    COM00                            6
    COM01                            7
    FOC0A                            7
    FOC0B                            6
    WGM02                            3
    CS02                             2
    CS01                             1
    CS00                             0
    CLKPCE                           7
    CLKPS3                           3
    CLKPS2                           2
    CLKPS1                           1
    CLKPS0                           0
    WDTIF                            7
    WDTIE                            6
    WDP3                             5
    WDTOE                            4
    WDE                              3
    WDP2                             2
    WDP1                             1
    WDP0                             0
    EEPM1                            5
    EEPM0                            4
    EERIE                            3
    EEMPE                            2
    EEMWE                            2
    EEPE                             1
    EEWE                             1
    EERE                             0
    PB4                              4
    PB3                              3
    PB2                              2
    PB1                              1
    PB0                              0
    DDB4                             4
    DDB3                             3
    DDB2                             2
    DDB1                             1
    DDB0                             0
    PINB4                            4
    PINB3                            3
    PINB2                            2
    PINB1                            1
    PINB0                            0
    PCINT5                           5
    PCINT4                           4
    PCINT3                           3
    PCINT2                           2
    PCINT1                           1
    PCINT0                           0
    ADC0D                            5
    ADC2D                            4
    ADC3D                            3
    ADC1D                            2
    AIN1D                            1
    AIN0D                            0
    ACD                              7
    ACBG                             6
    AINBG                            6
    ACO                              5
    ACI                              4
    ACIE                             3
    ACIS1                            1
    ACIS0                            0
    REFS0                            6
    ADLAR                            5
    MUX1                             1
    MUX0                             0
    ADEN                             7
    ADSC                             6
    ADATE                            5
    ADIF                             4
    ADIE                             3
    ADPS2                            2
    ADPS1                            1
    ADPS0                            0
    ACME                             6
    ADTS2                            2
    ADTS1                            1
    ADTS0                            0
    _DATE_FORMAT                     0
    _DATE_SEPARATOR                  92
    _GSTRBUF                         72
    _DECIMALPOINT                    46
    _RTSCTS                          0
    _RTSCTS1                         0
    _RTSCTS3                         0
    _RTSCTS4                         0
    _CHIP                            30
    _RAMSIZE                         64
    _ERAMSIZE                        64
    _SIM                             0
    _HUGE                            0
    _BASE                            1
    _XTAL                            9600000
    _BUILD                           20750
    _COMPILER                        90
    _HWMUL                           0
    _ROMSIZE                         1024
    _DOSFILEWRITE                    0
    _DOSDIRWRITE                     0
    _1WEXT                           0
    _ADC_REFMODEL                    3
    _UARTS                           0
    _HWSTACKSTART                    159
    _TIMEOUT                         0
    _PRDWORD                         0
    _PBIN_EXTENDED                   0
    _HWSTACK_LOW                      119
    _SWSTACK_LOW                      104
    _FRAME_HIGH                       104
    _XMEGA                           0
    
    
    --------------------------------------------------------------------------------
    Warnings:
    --------------------------------------------------------------------------------
    ADC                              not used
    ADCD                             not used
    PWM0                             not used
    PWM0A                            not used
    PWM0B                            not used
    
    High Baud rate error  in line  23
    
  • MJBMJB Posts: 1,235
    edited 2014-12-21 09:26
    From what I can tell with my limited knowledge of these AVR chips is the ATtiny13 will not be able to hold the program for the 4 channel ADC and serial output.

    I looked at the thread to program one of these AVR's with the Prop and felt like I was in advanced calculus.....definitely not for me.... To some, it may seem simple, but I believe I need simpler :P I was really hoping there was 1 board that would connect to my computer via USB and I could program the IC using the BASCOM-AVR program kind of like how the SX28 is programmed. Is there a such beast that is affordable?
    maybe you did not realise the ATtiny13 is a FLASH device, which runs the code directly from FLASH and not from SRAM. SRAM is only for some variables.
    so it fits comfortably.

    Programmers: yes of course there are many simple programming circuits you can build or buy.
    Also USB programmers for the AVR series chips.

    just google "AVR ISP programmer"
  • eagletalontimeagletalontim Posts: 1,399
    edited 2014-12-21 09:46
    Ok, so I guess if I buy 10 of these ATTINY13A chips, I could program them with the serial port on my PC. Seems simple enough. I am guessing the simulator does not work with ATTINY13A? As soon as I click the "Simulate Program (F2)" I get the error "Out of SRAM space". How many times can these AVR's be flashed?
  • MJBMJB Posts: 1,235
    edited 2014-12-21 13:17
    Ok, so I guess if I buy 10 of these ATTINY13A chips, I could program them with the serial port on my PC. Seems simple enough. I am guessing the simulator does not work with ATTINY13A? As soon as I click the "Simulate Program (F2)" I get the error "Out of SRAM space". How many times can these AVR's be flashed?

    after a compile here it runs ok
    just that the output is not visible.
    The SW-UART is not shown in the Terminal window in simulation.
    Flash works 10000 times reprogramming.
    even for heavy debugging this is a LOT
    the image in the post above shows the simulation running
    Programming requires a SPI protocol.
    So just serial port is probably not enough - unless you found a programmer supporting this.
  • eagletalontimeagletalontim Posts: 1,399
    edited 2014-12-21 14:56
    I found this simple circuit but am not sure if this would work. I have all the parts to build this already.

    http://www.avrfreaks.net/comment/603328#comment-603328

    Is this what I would be needing?
  • MJBMJB Posts: 1,235
    edited 2014-12-21 15:41
    I found this simple circuit but am not sure if this would work. I have all the parts to build this already.

    http://www.avrfreaks.net/comment/603328#comment-603328

    Is this what I would be needing?
    I did not see this very simple programmer before. But it might work together with the recommended programming SW.
    In any case do not try it without the 5.1V zener diodes - the RS232 can be quite high voltage and damage the MCU.

    And let us know if you are successful.
  • Dr_AculaDr_Acula Posts: 5,484
    edited 2014-12-21 16:06
    Just going back to the very first post, it looks like you have 4 leds/sensors and 5 foot of cat5 cable. Now the discussion is about AVR chips, but what if you put the MCP3204 next to the propeller chip, and run a pair of wires to each led?
    It is very unlikely you will pick up interference with a twisted pair over 5 foot, but even if you did, a simple low pass RC filter at the MCP3204 chip would fix that. Simple solution.
  • DomanikDomanik Posts: 233
    edited 2014-12-21 19:58
    As the title says, I have an ADC (MCP3204) at least 5 feet from the Prop and want to ensure it will reliably send data to the Prop through CAT5 cable. My question is...Will I need pull up or pull down resistors on any of the pins to ensure data is not interfered with noise through the long run of CAT5. I have attached the board layout I have right now where the ADC will be. Any input is appreciated!
    Attached is a design that addresses your original concerns using a remote ADC. I believe this will provide:
    1) accurate ADC readings,
    2) keep noise to a minimum during signal transmission and at the ADC CH0 - CH3 inputs
    3) rapidly update readings to the prop if running at 2MHz
    4) added ESD protection at both ends of the cable.

    Schm1.pdf
    Lately the direction has changed to use remote processing. It might also be possible to move the prop to the remote board and drive the motor control remotely. That seems simpler than adding another processor & SW language & tools to the mix.
  • Peter JakackiPeter Jakacki Posts: 10,193
    edited 2014-12-22 00:22
    Someone mentioned using a ATTINY13 but looking at the specs and the price I would never bother because for 10 cents more I have double the SRAM and FLASH and for another 20 cents I have four times that again. So go with either the ATTINY25 or 85 as I see BASCOM is saying that the ATTINY13 is a bit too tiny and does not have enough SRAM.

    This is NOT about learning and using another processor, this is about knowing how to make your own custom chip tailored to suit the application. Remember that this "chip" is in the same package as a 555 which you wouldn't think twice about using, correct? Except once you write a few lines of BASCOM code and use a $10 USB stick programmer the chip turns into your special "555" and it's even simpler to use. In fact talking about 555s I think one of the very early uses we had for little 8-pin micros such as these were as replacements for 555s, but ones that didn't require all those caps and trim resistors but it could generate a reliable timing pulse. Even with the Prop I have used little chips like these to handle the reset pulse timing based on listening to the serial receive line.

    Having the simple setup for cheap customisable chips is an effective weapon in a maker's arsenal. You will never regret it.

    Sorry guys, I know you are offering lots of good advice about noise suppression but unless you are hands on right there I don't think it will ever be implemented properly at this stage and grief will add to grief. This is a very good solution that the OP is willing to undertake although I hope he doesn't complicate that too :) (forget about burning it from the Prop then)
  • MJBMJB Posts: 1,235
    edited 2014-12-22 00:23
    Domanik wrote: »
    Attached is a design that addresses your original concerns using a remote ADC.
    Schm1.pdf
    looking at this schematic and reconsidering the application,
    I am thinking a very course resolution of the position is probably suficcient.
    So the ADC needs only a few bits of resolution anyhow.
    With the RC filter on the lines, a local Delta-Sigma ADC directly on the prop might be enough.
    The motor can turn very slowly anyhow, which makes timing uncritical.

    low cost, little parts, very simple, code readily availyble in OBEX ... what more do you really need?
  • MJBMJB Posts: 1,235
    edited 2014-12-22 01:12
    Someone mentioned using a ATTINY13 but looking at the specs and the price I would never bother because for 10 cents more I have double the SRAM and FLASH and for another 20 cents I have four times that again. So go with either the ATTINY25 or 85 as I see BASCOM is saying that the ATTINY13 is a bit too tiny and does not have enough SRAM.

    This is NOT about learning and using another processor, this is about knowing how to make your own custom chip tailored to suit the application. Remember that this "chip" is in the same package as a 555 which you wouldn't think twice about using, correct? Except once you write a few lines of BASCOM code and use a $10 USB stick programmer the chip turns into your special "555" and it's even simpler to use. In fact talking about 555s I think one of the very early uses we had for little 8-pin micros such as these were as replacements for 555s, but ones that didn't require all those caps and trim resistors but it could generate a reliable timing pulse. Even with the Prop I have used little chips like these to handle the reset pulse timing based on listening to the serial receive line.

    Having the simple setup for cheap customisable chips is an effective weapon in a maker's arsenal. You will never regret it.

    Sorry guys, I know you are offering lots of good advice about noise suppression but unless you are hands on right there I don't think it will ever be implemented properly at this stage and grief will add to grief. This is a very good solution that the OP is willing to undertake although I hope he doesn't complicate that too :) (forget about burning it from the Prop then)
    Hi Peter,
    the ATtiny13 was my AVR equivalent to your suggested PIC12F675 - AND it is sufficient. (maybe the Stack has been set too large for the little SRAM)
    Of course again - I completely agree with you on this.
    The tiny13 is the result of 'I want the cheapest ...' but in this cents business just thinking about it a minute has cost more than having a bunch of the 'biggest' 8-Pin-DIPs at hand
    for what ever need come. Which in this case is the Tiny85 with 8k Flash and 1/2k SRAM and 1/2k EEPROM.
    Plus a USI HW peripheral for serial comms. and this at $1.69 at DIGIKEY.
    http://www.digikey.com/product-detail/en/ATTINY85-20PU/ATTINY85-20PU-ND/735469

    and the idea of using the Prop as a programmer is again just a result of 'I want so save a cent' not considering the cost (time ..) for this approach.

    but referring to my post above, maybe all of this is not needed at all.
  • kwinnkwinn Posts: 8,697
    edited 2014-12-22 06:39
    And the battle rages on. Very politely mind you, which speaks well of the folks on this forum.
  • MJBMJB Posts: 1,235
    edited 2014-12-22 07:08
    battle??
    kwinn wrote: »
    And the battle rages on. Very politely mind you, which speaks well of the folks on this forum.
  • eagletalontimeagletalontim Posts: 1,399
    edited 2014-12-22 10:47
    In all honesty, I like the idea of using an programmable PIC / AVR with only 8 pins could come in useful for other projects in the future and now is a good time for me to learn about them with this project. The use of 1 wire serial also opens up more options as I am all about saving pins :) There will be a few humps to get over getting started but in the long run, it will probably be more beneficial. Putting the ADC on the same board as the PROP may also work, but I am pretty much strapped for room unless I go with SMD parts which I could do but prefer to stick with through hole on this project unless it becomes necessary.

    The BASCOM seems easy enough to understand and if I can get the programmer (custom serial circuit) to work with the BASCOM program, that would be perfect. Maybe the ATTINY13 is not quite right for other possible projects, but I am sure there are others like it (Possibly the ATTINY85?).

    Everyone has recommendations on what to go with other than the MCP3204 and they may all be more than sufficient. The idea of using an AVR has sparked my interest and now I am curious.
  • MJBMJB Posts: 1,235
    edited 2014-12-22 13:12
    here is the link to the BASCOM forum
    http://www.mcselec.com/index2.php?option=com_forum&Itemid=59
    there are even 6-pin MCUs ATTiny 4,5,9,10 ...
  • kwinnkwinn Posts: 8,697
    edited 2014-12-22 20:00
    MJB wrote: »
    battle??

    Perhaps debate would have been a better word choice. I'm just surprised to see how much response such a simple question got.
  • Peter JakackiPeter Jakacki Posts: 10,193
    edited 2014-12-22 22:55
    kwinn wrote: »
    Perhaps debate would have been a better word choice. I'm just surprised to see how much response such a simple question got.

    As I said to Phil in another thread, it's "head butting" but in a friendly way :)
Sign In or Register to comment.