![]() |
Forum Index : Microcontroller and PC projects : Simplest and cheap USB PIC18
![]() ![]() ![]() ![]() |
|||||
Author | Message | ||||
G8JCF![]() Guru ![]() Joined: 15/05/2014 Location: United KingdomPosts: 676 |
Hi JohnS So great progress ! Would a 10K to 3V3 on PIC32 PGD 'help' get the PIC32 PGD up a little over the VIH bump ? Peter The only Konstant is Change |
||||
MicroBlocks![]() Guru ![]() Joined: 12/05/2012 Location: ThailandPosts: 2209 |
It is one of those things that were not foreseen when trade agreements were made. Basically the Chinese post is subsidized putting all other countries at a disadvantage for online trade. A masterful play by the Chinese. Chinese post also has agreements with postal services around the world. Something send from China cost about 0.30 USD. Once it arrives in another country it is that countries 'problem' as they have to deliver the package at a loss. Thailand has something similar but the shipping rates are about 8 times higher, about 2 USD. If i were in my own country shipping that same package would cost 12 USD. Only shipping within a country is then competitive. 'Free' trade works great for developing countries, not so much for the others. Even Thailand suffers from all the trade moving to China. Not sure where it all ends. Microblocks. Build with logic. |
||||
JohnS Guru ![]() Joined: 18/11/2011 Location: United KingdomPosts: 4033 |
What a good idea! Thanks, I'll try it. Haven't got quite enough code yet as I need libusb stuff... Debugging's going to be "fun". John |
||||
G8JCF![]() Guru ![]() Joined: 15/05/2014 Location: United KingdomPosts: 676 |
@TZ That explains a lot, thanks for the clarification. I never expected China to be counted as a developing country and in need of subsidy by the rest of the world. Peter The only Konstant is Change |
||||
JohnS Guru ![]() Joined: 18/11/2011 Location: United KingdomPosts: 4033 |
This is looking promising. I hard-wired some of my code into the usbasp and connected it to a PIC32 MX220's ICSP. The code put the MX220 into programming mode and got back the MX220's IDCODE via 2-wire ICSP. I have uart debug working, too :) John |
||||
JohnS Guru ![]() Joined: 18/11/2011 Location: United KingdomPosts: 4033 |
Yayy! I'm liking the (roughly $2, but you need two) USBASP modules. Programming the umite (MX150) takes about 74 seconds. Need some clean up and to tweak the Linux version to make an EXE (oh, and to write a HowTo) but all looks good! Appears to be no point at all buying FT232R / FTDI boards. John |
||||
G8JCF![]() Guru ![]() Joined: 15/05/2014 Location: United KingdomPosts: 676 |
Congratulations John ! Looking forward to the production code Peter The only Konstant is Change |
||||
JohnS Guru ![]() Joined: 18/11/2011 Location: United KingdomPosts: 4033 |
I've tweaked the code and now have the same code working on Linux and Windows. Looks slightly faster on Linux (69 secs) than Windows (87) to erase then program a umite. It should allow any PIC32 (blank or not) to be flashed, with any hex (doesn't have to be MMBasic). So... anyone with two USBASP boards (they're a bit over $2 each) let me know as it's a bit lonely doing testing on my own! John |
||||
G8JCF![]() Guru ![]() Joined: 15/05/2014 Location: United KingdomPosts: 676 |
I've ordered 2 USBASP's on eBay, hopefully they will arrive soon Peter The only Konstant is Change |
||||
JohnS Guru ![]() Joined: 18/11/2011 Location: United KingdomPosts: 4033 |
Thanks, Peter. I'll see if I can write more howto etc and I've an idea about a statically-linked avrdude to make things easier. I'm quite impressed by the usbasps - only 8KB flash, a tiny 512 bytes RAM (plus 2K EEPROM) - but the price is good and they do GPIO fine. 5V logic... handy, depending on what's wanted. Easy to reprogram. Fairly quick CPU (12MHz). John |
||||
vasi![]() Guru ![]() Joined: 23/03/2007 Location: RomaniaPosts: 1697 |
Yeah, those AVRs are quite amazing compared with the Microchips 8bit parts... I like them alot but a little expensive (in my country) compared to PICs. Well, I know you are talking about USBASPs but still... Hobbit name: Togo Toadfoot of Frogmorton Elvish name: Mablung Miriel Beyound Arduino Lang |
||||
G8JCF![]() Guru ![]() Joined: 15/05/2014 Location: United KingdomPosts: 676 |
Hi JohnS The 2 x USBASP's arrived today. So what do I do now please ![]() Peter The only Konstant is Change |
||||
JohnS Guru ![]() Joined: 18/11/2011 Location: United KingdomPosts: 4033 |
Good news! Are they with the atmega8 (maybe even atmega8a) cpu chip? I'm not certain if it matters, but if they're not atmega8 please let me know and I'll at least do a quick check of the data sheet. Is ICSP about all you really want to do or do you fancy more general use? If the latter, it's worth installing AVRDUDE but you probably don't need it just for PIC32 ICSP stuff. (You can always install it later.) The basic idea is to fit the "self-programming" jumper (JP2) on one, daisy chain the boards, using the unjumpered one to reprogram the other. Then separate them, remove jumper and connect the changed one to ICSP via some voltage dividers. I'll post more and the programs once I know what cpus you have and about avrdude. John |
||||
G8JCF![]() Guru ![]() Joined: 15/05/2014 Location: United KingdomPosts: 676 |
Hi John The chip ,is marked ATMEL ATMEGA8A and AU 1414. The board is marked USBASP V2.0 LC Technology. The board has a fitted jumper JP1 which seems to select 5v or 3.3V, a JP2 and a JP3 both unfitted. And it comes with a 10 way IDC cable. I still can't get over how cheap it is given the amount of electronics/components and P&P. If I can do more than just program a PIC32, then yes please I'm really keen to learn more. Many thanks for offering to help me Peter The only Konstant is Change |
||||
JohnS Guru ![]() Joined: 18/11/2011 Location: United KingdomPosts: 4033 |
They sound the same as mine :) Yes, they're very cheap (I already had a couple before messing with the FTDI boards but the 5V logic put me off). Try this 2014-11-19_232607_asp1.zip It takes about 40 secs to program a umite on Linux but rather more for me on Win7. If you use avrdude you'll get a copy of the existing hex that's on the board being reprogrammed and also it's the tool that can program just about any avr / atmel chip. The extra exe I've included knows only how to reprogram a usbasp like our ones. Oh - just realised I'm not sure what your Windows will think of the usbasp when plugged in. Device Manager etc I find to be less than intuitive. As with previous USB work on Windows I used zadig.exe to shut it up. I chose WinUSB in zadig, which I got from here (as before) zadig site John |
||||
G8JCF![]() Guru ![]() Joined: 15/05/2014 Location: United KingdomPosts: 676 |
Hi John Thanks, I'll give it a try in the morning Peter The only Konstant is Change |
||||
JohnS Guru ![]() Joined: 18/11/2011 Location: United KingdomPosts: 4033 |
They're neat boards. The original and software look to be by Thomas Fischl here but the schematic of the boards we have is a little different (and another chip). Looks to be almost this schematic but the boards appaear to have the correct 1.5K USB pull-up. The USB is done by software! Known as V-USB Objective Development There was some free space in the chip (it only has 8KB flash and 1K RAM; there's also 512 EEPROM I'm not using) so added ICSP. The atmega instruction set is quite reeadable. The boards run at 12MHz and many instructions just take 1 cycle. You can see them counted in the V-USB source code that does the bit-banged USB. I'm using gcc (again) to cross-compile. It looks to have quite a good grasp of the many registers in the cpu and when to inline. John |
||||
JohnS Guru ![]() Joined: 18/11/2011 Location: United KingdomPosts: 4033 |
Anything happen? John |
||||
G8JCF![]() Guru ![]() Joined: 15/05/2014 Location: United KingdomPosts: 676 |
Sorry John I've been engrossed in sorting out DATA CFunctions (I think it's all sorted now, so I can get back to the USBISP modules) Peter The only Konstant is Change |
||||
JohnS Guru ![]() Joined: 18/11/2011 Location: United KingdomPosts: 4033 |
No problem - it's what happens! John |
||||
![]() ![]() ![]() ![]() |
![]() |
![]() |
The Back Shed's forum code is written, and hosted, in Australia. | © JAQ Software 2025 |