Forum - MCS Electronics

 

FAQFAQ SearchSearch RegisterRegister Log inLog in

UPDI
Goto page Previous  1, 2, 3  Next
 
Post new topic   Reply to topic    www.mcselec.com Forum Index -> BASCOM-AVR
View previous topic :: View next topic  
Author Message
Netzman

Bascom Expert



Joined: 25 Nov 2005
Posts: 131
Location: Graz

austria.gif
PostPosted: Sat Apr 30, 2022 10:26 pm    Post subject: Reply with quote

something like this (discrete boost converter)?

_________________
LCD Menu | Proportional Fonts
Back to top
View user's profile Visit poster's website
enniom

Bascom Member



Joined: 20 Oct 2009
Posts: 537

PostPosted: Mon May 02, 2022 12:10 am    Post subject: Reply with quote

I've used the Linear Technology LT1073 Boost converter from 3.3V to 12V. Only 4 external components are needed, and the chip is available in 8-DIP.

A second chip - LT1301 - also has a Shutdown pin which can be controlled by the AVR.

E

https://www.analog.com/media/en/technical-documentation/data-sheets/1073fa.pdf

Back to top
View user's profile
albertsm

Administrator



Joined: 09 Apr 2004
Posts: 5922
Location: Holland

blank.gif
PostPosted: Mon May 02, 2022 4:53 pm    Post subject: Reply with quote

the discrete one is simple to make. not depending on specific chips. but that is personal. for some product i was looking for 12v generation for OLED. And that was a problem since all the usual chips are hard to get.
Or have way too much power or are too expensive.

for the circuit i can use a transistor or opto coupler to enable 12V. But i wonder how to protect the tx/rx pins. they probably do not like the 12V. normaly i would use a tranzil but that will absorb the 12V too.
relay will work but i do not like them.
So we have USB-serial converter with TX/RX on ttl level. the resistor goes from TX to RX. And this means that RX is connected direct to the UPDI. So a 12V pulse will go right into the RX pin and also via the resistor into TX.

_________________
Mark
Back to top
View user's profile Visit poster's website
plouf

Bascom Member



Joined: 19 Jan 2012
Posts: 78
Location: Athens,Greece

greece.gif
PostPosted: Mon May 02, 2022 7:34 pm    Post subject: Reply with quote

But why a mosfet ,which act a switch to have problem ?
Anyway a practical and cheap is cd4050 buffer (for digital signaling) or cd4066 as analog switches
Cheap and easily available...

Offcourse pc817 opto transisotr are cheap too . But cd. Solution is four in one package.

_________________
Christos
Back to top
View user's profile
Netzman

Bascom Expert



Joined: 25 Nov 2005
Posts: 131
Location: Graz

austria.gif
PostPosted: Mon May 02, 2022 8:43 pm    Post subject: Reply with quote

imho a simple current protection should do the job:
Code:
 +12V pulse
------------------------------------+
                                    |
                                    |
 TX      +-----+         +-----+    |   UPDI
---------+ 10K +----+----+  1K +----+--------
         +-----+    |    +-----+
                    |
 RX                 |
--------------------+


depending on the sink/source capabilities of the I/Os and if they are equipped with an internal ESD protection diode, most are (ex. AVRs have 20mA sink/source and protection diodes, FTDI232R@5V has 2 mA and protection diodes)

btw, I've found this: https://www.avrfreaks.net/comment/2616176#comment-2616176

br

_________________
LCD Menu | Proportional Fonts
Back to top
View user's profile Visit poster's website
albertsm

Administrator



Joined: 09 Apr 2004
Posts: 5922
Location: Holland

blank.gif
PostPosted: Tue May 03, 2022 8:27 am    Post subject: Reply with quote

i like 4066 which i used before.
the simple current limit is simpler. nowadays i can imagine all chips have some protection. but since it is connected to the usb and thus my PC, i do not want to take risks.

i implemented the following :
in options you can select for DTR and RTS pin the following behavior :
NONE
program/data
HV program

none will do nothing
program/data will work as it works now for DTR : it will set DTR during programming so you can use DTR to switch between data and programming
HV program will create the pulse
of course you need to connect a circuit.

i do not know yet how i can check if this is working.

_________________
Mark
Back to top
View user's profile Visit poster's website
albertsm

Administrator



Joined: 09 Apr 2004
Posts: 5922
Location: Holland

blank.gif
PostPosted: Wed May 04, 2022 8:33 am    Post subject: Reply with quote

ok, i also had a new look at the programming speed. previous attempts and communication with microchip support did not lead to a fix.
but after yet a lot of tries, it now works at higher baud rates.
not all updi processors have a high clock but DA/DB series have a 32 Mhz clock with max 1.6 MBps.
That makes a difference !
The only odd thing : when i read 128 KB it goes very fast.
The programming is however still relatively slow. ok there is more overhead for the programming, but still it seems odd.
to send data, the software sends a byte, then checks the returning data (since tx/rx are connected all data you sent you receive as well) and ack is checked.
for receiving chucks you can use a pointer and you get data back, that works well. but when sending chunks it does not work. the updi get confused somehow.
i tried smaller package size and while it appeared to work, but it did not for a larger file.
for now i settle at packet size of 2, and will check later.

_________________
Mark
Back to top
View user's profile Visit poster's website
albertsm

Administrator



Joined: 09 Apr 2004
Posts: 5922
Location: Holland

blank.gif
PostPosted: Wed May 04, 2022 12:37 pm    Post subject: Reply with quote

i uploaded a test version to the SLA section. if you have access, you can test it.
write speed turns out to be a problem of the usb-serial driver. some chip might suffer more than others.
ft232 has a setting for latency which should be set to 1mS when it is higher. otherwise ft232 will not work.

ok, that is about it. a better way is to use hardware like a processor. normally i would create one with bascom but as there are cheap programmers available it is better so allocate resources to implementation of those.

_________________
Mark
Back to top
View user's profile Visit poster's website
albertsm

Administrator



Joined: 09 Apr 2004
Posts: 5922
Location: Holland

blank.gif
PostPosted: Tue May 10, 2022 9:30 am    Post subject: Reply with quote

i uploaded a new version since there was a problem with DA processors.
turned out that DB and DA series have the family ID right and left aligned. 'AVR ' vs ' AVR'
tested with real DA processor. works perfect and programming is very fast. at least compared to the older version of the programmer.

_________________
Mark
Back to top
View user's profile Visit poster's website
albertsm

Administrator



Joined: 09 Apr 2004
Posts: 5922
Location: Holland

blank.gif
PostPosted: Sun May 22, 2022 1:35 pm    Post subject: Reply with quote

another update for the updi programmer. get it from the SLA area. it fix a problem where the updi interface was not properly reset.
this update performs very good at 1600000 baud.

there was no feedback about the 12 v pulse.
but the mliab-snap will be supported in either 2086 or 2087.
came a long way with this.
notice that this snap programmer is great but requires r48 to be removed and it need a firmware update.


mod 25 may : by mistake i wrote R28 but must indeed be R48, just for readers that do not read all, i edited this post so the right resistor is shown.

_________________
Mark


Last edited by albertsm on Tue May 24, 2022 8:20 am; edited 1 time in total
Back to top
View user's profile Visit poster's website
JC

Bascom Member



Joined: 15 Dec 2007
Posts: 586
Location: Cleveland, OH

usa.gif
PostPosted: Mon May 23, 2022 3:12 pm    Post subject: Reply with quote

Hi Mark,

Thank you for all of your continued work on this!

Also, I'm looking forward to the SNAP programmer support.
I will no longer have to load Studio just to use this programmer!

Jay
Back to top
View user's profile Visit poster's website
enniom

Bascom Member



Joined: 20 Oct 2009
Posts: 537

PostPosted: Mon May 23, 2022 10:27 pm    Post subject: Reply with quote

Mark,

the Microchip information seems to show that R48 (not 28) is removed in the SNAP programmer?

E
Back to top
View user's profile
enniom

Bascom Member



Joined: 20 Oct 2009
Posts: 537

PostPosted: Mon May 23, 2022 10:29 pm    Post subject: Reply with quote

Thanks Netzman for updating the circuit diagram.

The first one had an error for transistors Q1 and Q3?

E
Back to top
View user's profile
EDC

Bascom Expert



Joined: 26 Mar 2014
Posts: 971

poland.gif
PostPosted: Mon May 23, 2022 11:17 pm    Post subject: Reply with quote

Yes. For SNAP it is R48 -> https://ww1.microchip.com/downloads/en/DeviceDoc/ETN36_MPLAB%20Snap%20AVR%20Interface%20Modification.pdf

Whole Studio is not nesessary. IPE program can be installed only by "uncheck" IDE when installing MPLAB X IDE -> https://www.microchipdeveloper.com/ipe:installation

When SNAP is connected to IPE then upgrade is self explained.

Probably, for now, it can be set as External Programmer in Bascom because it can take parameters and run from command line Wink -> https://microchipsupport.force.com/s/article/Automate-MPLAB-programming-process-using-command-lineIPECMD
Back to top
View user's profile Visit poster's website
albertsm

Administrator



Joined: 09 Apr 2004
Posts: 5922
Location: Holland

blank.gif
PostPosted: Tue May 24, 2022 8:32 am    Post subject: Reply with quote

EDC, i tried to install with absolute minimum files. So first i only installed the required drivers. That made the programmer work for windows (device working correct)
But i did not want to install all the files so i tried your method too. it recognized the programmer but i could not get it to work with UPDI.
Then it turned out i had to create an AVR project which required to install the total package , and only then it would do an update of the firmware.
I performed this on a VM.

Your post suggest a simpler way but i could not get that to work. So it was kind of complicated to get it to work (when you do not want to install mlab-X)
I will test this later again with a different unit on a new PC. Could be the unit.
Maybe you already had mlab-X installed?
I hope that new snap users can share their experience here.

_________________
Mark
Back to top
View user's profile Visit poster's website
Display posts from previous:   
Post new topic   Reply to topic    www.mcselec.com Forum Index -> BASCOM-AVR All times are GMT + 1 Hour
Goto page Previous  1, 2, 3  Next
Page 2 of 3

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You cannot download files in this forum