View previous topic :: View next topic |
Author |
Message |
Duval JP
Joined: 22 Jun 2004 Posts: 1161 Location: France
|
Posted: Sun Feb 23, 2020 6:45 pm Post subject: helb about serial to usb converter |
|
|
Hello
for my last project, I have to transmit the serial data to a USB port.
I did the proto with an Aduino M2560 and it works well, I transmit my data without any problem.
the setting is
Config Com1 = 115200 , Synchrone = 0 , Parity = None , Stopbits = 1 , Databits = 8 , Clockpol = 0
Echo Off
Config Serialin0 = Buffered , Size = 30
Open "COM1:" For Binary As #1
Const Usb = 1
Code: |
If Identifiant <> "" Then
While Len(identifiant) < 9
Identifiant = Identifiant + " "
Wend
Print #usb , Identifiant;
End If
'----nom ------------------
While Len(nom) < 20
Nom = Nom + " "
Wend
Print #usb , Nom;
'---prenom----------------
While Len(prenom) < 20
Prenom = Prenom + " "
Wend
Print #usb , Prenom; |
I would like to use a Atmega1284 to replace the M2560 and to do my own PCB board
but for the converter usb I see one with a CP210x, because I dont need DTR and CTS line
befor order it
I imagine some Bascom'User did it before
do you have code sample and tips for me ?
Thanks
JP
:wink:
(BASCOM-AVR version : 2.0.8.2 ) _________________ pleasure to learn, to teach, to create |
|
Back to top |
|
|
krolikbest
Joined: 02 Jan 2017 Posts: 112
|
Posted: Sun Feb 23, 2020 7:30 pm Post subject: |
|
|
Why not to use ready to go "uart to usb converters"? |
|
Back to top |
|
|
Duval JP
Joined: 22 Jun 2004 Posts: 1161 Location: France
|
Posted: Mon Feb 24, 2020 12:29 pm Post subject: solved |
|
|
I found an
USB Serial Light Adapter - Atmega8U2 from DFrobot It use the same chip as Arduino and don't need driver with WIN10 _________________ pleasure to learn, to teach, to create |
|
Back to top |
|
|
albertsm
Joined: 09 Apr 2004 Posts: 5921 Location: Holland
|
Posted: Mon Feb 24, 2020 4:11 pm Post subject: |
|
|
I dont get what this has to do with bascom?
Maybe i dont understand.
When you want to send data to usb using virtual com, you can use about any CDC chip, like FTDI FT232RL, or the CP which are pin compatible and much cheaper.
You can even use a usb162 and program it with bascom. (using usb add on and the CDC example)
windows always requires a (signed) driver but it will download/install it for you. it depends on MS. _________________ Mark |
|
Back to top |
|
|
Duval JP
Joined: 22 Jun 2004 Posts: 1161 Location: France
|
Posted: Mon Feb 24, 2020 5:26 pm Post subject: |
|
|
You're right, this doesn't have much to do with bascom.
I don't dare tell you why I asked for help on the forum:
by changing the development tool (Arduino to my development board similar to STK200) I left the power supply on 5V. my board requires 9V.
I couldn't understand why the FTDI Basic module wasn't working...
3 hours to understand ... too old ?
you once said that Arduino was perfect for prototypes and indeed I think so too, but when you make a machine, it's better to make your own circuit.
In the machine I make, the "engine": AVR_ATMEGA1284 must be interchangeable. At the request of my customer, we do not use a bootloader to make updates.
The machine is covered by a maintenance contract and comes back regularly to change used parts.
For my part : electronics and programs, there is a USB port, a RTC clock, a special keyboard, a nextion display, (We have some difficulties to get it with the virus....) a powerful memory ( SD card) etc.
So I do the Arduino conversion to the pre-series model and I needed this serial-usb output.
I ordered an FT232RL since it now works perfectly.
JP _________________ pleasure to learn, to teach, to create |
|
Back to top |
|
|
albertsm
Joined: 09 Apr 2004 Posts: 5921 Location: Holland
|
Posted: Mon Feb 24, 2020 9:03 pm Post subject: |
|
|
yes i only use arduino or stk600 for proto type. after that it is best to create a pcb.
the connectors of the arduino are not real good in my experience and it is better to have a pcb. you can design the pcb with just the parts you need without stacking boards _________________ Mark |
|
Back to top |
|
|
|