fr293 / motor_board

6 stars 3 forks source link

Serial communication with 841? #7

Open mathewlippincott opened 8 years ago

mathewlippincott commented 8 years ago

I'm unable to get serial communication going on the 841.

I have the 841 OptiBoot bootloader on it at 8mhz with B.O.D. disabled, LTO enabled.

Based on Spence Konde's pinout, I have this arrangement of pins:

Motor_board 841 PIN 3.3v FTDI Breakout GND 14 Ground VCC 1 VCC RESET 4 DTR chlkhi 9 TX miso3 8 RX Dathi 7 CTS

I've tried reversing TX & RX, but am having no luck. I thought it might be a power problem, so I've tried it with the Pi powering the board, but that hasn't helped either. Any thoughts?

fr293 commented 8 years ago

Mathew,

I fear you’ve uncovered one of the fatal flaws in my design; the use of the internal oscillator. In an effort to simplify the design and reduce part count, I opted against using external crystals to clock the chips. The 841 has a particularly bad oscillator, which is just about accurate at 3.3V, but which jumps to anywhere up to 105% of its nominal frequency at 5V. This could well be the cause of your issues!
Are you able to upload any code beyond the boot loader?

Yours truly,

Fergus Riche Magdalene College Cambridge Mobile: +447974304049

On 23 Nov 2016, at 01:59, mathew lippincott notifications@github.com wrote:

I'm unable to get serial communication going on the 841.

I have the 841 OptiBoot bootloader on it at 8mhz with B.O.D. disabled, LTO enabled.

Based on Spence Konde's pinout, I have this arrangement of pins:

Motor_board 841 PIN 3.3v FTDI Breakout GND 14 Ground VCC 1 VCC RESET 4 DTR chlkhi 9 TX miso3 8 RX Dathi 7 CTS

I've tried reversing TX & RX, but am having no luck. I thought it might be a power problem, so I've tried it with the Pi powering the board, but that hasn't helped either. Any thoughts?

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/fr293/motor_board/issues/7, or mute the thread https://github.com/notifications/unsubscribe-auth/AM3LFR5LVNcGvRm5nxr5gRY0y6_vKP55ks5rA54YgaJpZM4K6Ji7.

mathewlippincott commented 8 years ago

I've tried with a 3.3v FTDI connection, but still no luck beyond the bootloader. I saw that you were using the internal oscillator, and saw Spencer's note about 5v ruining serial communications so I went straight to 3.3v serial. I haven't had any luck with either 3.3v or 5v

Do I have the pinout correct? Is there any special serial strategy you've used?

fr293 commented 7 years ago

Mathew,

How exactly are you programming the 841s? There’s an ISP header with the standard pinout that I designed to be used with an arduino acting as and ISP (something like http://highlowtech.org/?p=1706 http://highlowtech.org/?p=1706 , further details in MRP.pdf §C.1, but note that the method has changed slightly, you have to select Arduino/Leo as ISP (ATtiny)).

I don’t use the optiboot boot loader, instead I select

Board: ATtiny x41, Chip: ATtiny841

before clicking ‘Burn Bootloader’ and then uploading the sketch.

I’ve not had problems using this method, but it can take some tweaking; if a single option is mis-selected, then nothing works!

Do tell me how you get on,

Fergus Riche Magdalene College Cambridge Mobile: +447974304049

On 28 Nov 2016, at 21:25, mathew lippincott notifications@github.com wrote:

I've tried with a 3.3v FTDI connection, but still no luck beyond the bootloader. I saw that you were using the internal oscillator, and saw Spencer's note about 5v ruining serial communications so I went straight to 3.3v serial. I haven't had any luck with either 3.3v or 5v

Do I have the pinout correct? Is there any special serial strategy you've used?

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/fr293/motor_board/issues/7#issuecomment-263399099, or mute the thread https://github.com/notifications/unsubscribe-auth/AM3LFXm5IvJOLNaGIuV1AEfR9EgAmJIrks5rC0bYgaJpZM4K6Ji7.

mathewlippincott commented 7 years ago

I'm trying to program the 841 with an FTDI usb/serial board. I have 3.3. and 5V boards: https://www.sparkfun.com/products/9873

I tried to use Spencer Konde's pinout to make a converter cable between the 841's ISP header and these serial pins:

ATtiny Pin 14 GND ATtiny Pin 1 VCC ATtiny Pin 4 DTR ATtiny Pin 9 TX ATtiny Pin 8 RX ATtiny Pin 7 CTS

It looks like, according to your diagram in the monograph, that I had the TX and CTS (SCK clock) pins reversed. I'll fix that and re-try.

screen shot 2016-12-08 at 3 01 43 pm

I can try to use an arduino, but it should be functionally the same as the FTDI board. I can also try to use the FTDI with a capacitor as described in the tutorial you linked to.

thanks!

fr293 commented 7 years ago

Mathew,

The pinout that you’ve got there is the same as the one I used, and thus it would appear from this list:

ATtiny Pin 14 GND ATtiny Pin 1 VCC ATtiny Pin 4 DTR ATtiny Pin 9 TX ATtiny Pin 8 RX ATtiny Pin 7 CTS

that you do indeed have pins 7 and 9 swapped, which could well be your killer fault!

Yours truly,

Fergus Riche Magdalene College Cambridge Mobile: +447974304049

On 8 Dec 2016, at 23:05, mathew lippincott notifications@github.com wrote:

I'm trying to program the 841 with an FTDI usb/serial board. I have 3.3. and 5V boards: https://www.sparkfun.com/products/9873 https://www.sparkfun.com/products/9873 I tried to use Spencer Konde's pinout https://github.com/SpenceKonde/ATTinyCore/blob/master/avr/extras/ATtiny_x41.md to make a converter cable between the 841's ISP header and these serial pins:

ATtiny Pin 14 GND ATtiny Pin 1 VCC ATtiny Pin 4 DTR ATtiny Pin 9 TX ATtiny Pin 8 RX ATtiny Pin 7 CTS

It looks like, according to your diagram in the monograph, that I had the TX and CTS (SCK clock) pins reversed. I'll fix that and re-try.

https://cloud.githubusercontent.com/assets/1203280/21031329/aaa5e8ba-bd57-11e6-8507-9f948b6da765.png I can try to use an arduino, but it should be functionally the same as the FTDI board. I can also try to use the FTDI with a capacitor as described in the tutorial you linked to.

thanks!

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/fr293/motor_board/issues/7#issuecomment-265882701, or mute the thread https://github.com/notifications/unsubscribe-auth/AM3LFdShE2ogAG5DLrm1raiI9GzetcSVks5rGI0_gaJpZM4K6Ji7.