Re: [Amforth] Serial interface at 115200 BAUD on Arduino Mega 2560

2019-03-15 Thread Fred Zelders
Tristan,

I found an article about step-down en step-up levelers @ 
https://hackaday.com/2016/12/05/taking-it-to-another-level-making-3-3v-and-5v-logic-communicate-with-level-shifters/
 



Fred

> Op 15 mrt. 2019, om 01:30 heeft Tristan Williams  het 
> volgende geschreven:
> 
> Fred,
> 
> Many thanks. I have a DSO112A so I was interested in what you are
> looking to do.
> 
>> One of the connectors is a alternative UART. It is a LVTTL connection.
>> I want to connect the Arduino uart1 (TXD1/RXD1) to this connector (J11).
> 
> I think LVTTL is ~3.3V levels rather than the 5V levels of the
> Mega2560. Some level shifting will be needed/prudent.
> 
>> The bit stream format for the serial interface is: 115200 baudrate,
>> 8 data bits, 1 stop bit, and no parity. This is fixed and can not be
>> changed 
> 
> Are you programming the Mega2560 with AmForth?
> 
> 115200 is uncharted territory for me and usart1. I have written some
> AmForth words which work for me at 9600
> 
> https://www.mostlymostly.uk/post/2019.02.01/
> 
> I have just quickly reconfigured them locally for 115200. Simple
> typing at a terminal seemed OK. Beyond that, how much data is sent by
> the DSO112A, how often, and what you want to do with it will matter,
> so it is difficult to know whether it would work well enough or not.
> 
> Tristan
> 
> 
> 
> ___
> Amforth-devel mailing list for http://amforth.sf.net/
> Amforth-devel@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/amforth-devel


___
Amforth-devel mailing list for http://amforth.sf.net/
Amforth-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/amforth-devel


Re: [Amforth] Serial interface at 115200 BAUD on Arduino Mega 2560

2019-03-15 Thread Fred Zelders
Thanks Tristan!

I'll let you know if I managed to read/write to the DSO112A with AmForth


Fred

> Op 15 mrt. 2019, om 13:37 heeft Tristan Williams  het 
> volgende geschreven:
> 
> Fred
> 
>> I don't have (and can't find) the data sheet that is referred to.
>> Do you have that datasheet? Can I have a copy? (PDF?) 
> 
> https://www.microchip.com/wwwproducts/en/ATmega2560
> 
> I made two changes 
> 
>#16 UBRR1 ! \ change to this - change 1
> 
>  %10 UCSR1A bm-set \ add line above - change 2 
>%10011011 UCSR1B c! \ these two
>%1110 UCSR1C c! \ lines
> 
> Tristan
> 
> 
> ___
> Amforth-devel mailing list for http://amforth.sf.net/
> Amforth-devel@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/amforth-devel



___
Amforth-devel mailing list for http://amforth.sf.net/
Amforth-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/amforth-devel


Re: [Amforth] Serial interface at 115200 BAUD on Arduino Mega 2560

2019-03-15 Thread Tristan Williams
Fred

> I don't have (and can't find) the data sheet that is referred to.
> Do you have that datasheet? Can I have a copy? (PDF?) 

https://www.microchip.com/wwwproducts/en/ATmega2560

I made two changes 

#16 UBRR1 ! \ change to this - change 1

  %10 UCSR1A bm-set \ add line above - change 2 
%10011011 UCSR1B c! \ these two
%1110 UCSR1C c! \ lines

Tristan


___
Amforth-devel mailing list for http://amforth.sf.net/
Amforth-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/amforth-devel


Re: [Amforth] Serial interface at 115200 BAUD on Arduino Mega 2560

2019-03-15 Thread f.zelders--- via Amforth-devel
Tristan,

I like the DSO112A very much. The fact that this device can be controlled by a 
processor/computer makes it even more useful.

I managed to 'communicate' in Python on my MacBookAIr with the DSO112A via USB 
(using the CP2102 driver that can be downloaded from www.silabs.com 
).

> Are you programming the Mega2560 with AmForth?


Yes I do. And I love it!

My challenge is to establish that withAm Forth. 
If successful I want to try to setup the DSO, trigger measurements and download 
the results.

> Some level shifting will be needed/prudent.


I can use a CP2102 USB 2.0 to TTL UART module for level shifting 
N.B. Ali Express is my friend :-)

> I have written some

> AmForth words which work for me at 9600

> https://www.mostlymostly.uk/post/2019.02.01/


Yes, I have that source too. :-)
In that source is stated: 
   \ see section 22 of atmega2560 datasheet for overview
   \ and table 22.9 in section 22.11 for specific UBBR
   \ values.  

#103 UBRR1 ! \ 16MHz 9600 UBBR1 103 
I don't have (and can't find) the data sheet that is referred to.
Do you have that datasheet? Can I have a copy? (PDF?) 

> I have just quickly reconfigured them locally for 115200. Simple

> typing at a terminal seemed OK. 


So you managed to initialize uart1 at 115200 BAUD. That is great!

Would you be so kind to provide me with the settings for the serial 
communication @ 115200



Fred


> Op 15 mrt. 2019, om 01:30 heeft Tristan Williams  het 
> volgende geschreven:
> 
> Fred,
> 
> Many thanks. I have a DSO112A so I was interested in what you are
> looking to do.
> 
>> One of the connectors is a alternative UART. It is a LVTTL connection.
>> I want to connect the Arduino uart1 (TXD1/RXD1) to this connector (J11).
> 
> I think LVTTL is ~3.3V levels rather than the 5V levels of the
> Mega2560. Some level shifting will be needed/prudent.
> 
>> The bit stream format for the serial interface is: 115200 baudrate,
>> 8 data bits, 1 stop bit, and no parity. This is fixed and can not be
>> changed 
> 
> Are you programming the Mega2560 with AmForth?
> 
> 115200 is uncharted territory for me and usart1. I have written some
> AmForth words which work for me at 9600
> 
> https://www.mostlymostly.uk/post/2019.02.01/
> 
> I have just quickly reconfigured them locally for 115200. Simple
> typing at a terminal seemed OK. Beyond that, how much data is sent by
> the DSO112A, how often, and what you want to do with it will matter,
> so it is difficult to know whether it would work well enough or not.
> 
> Tristan
> 
> 
> 
> ___
> Amforth-devel mailing list for http://amforth.sf.net/
> Amforth-devel@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/amforth-devel


___
Amforth-devel mailing list for http://amforth.sf.net/
Amforth-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/amforth-devel