Home
JAQForum Ver 24.01
Log In or Join  
Active Topics
Local Time 22:36 04 Jul 2025 Privacy Policy
Jump to

Notice. New forum software under development. It's going to miss a few functions and look a bit ugly for a while, but I'm working on it full time now as the old forum was too unstable. Couple days, all good. If you notice any issues, please contact me.

Forum Index : Microcontroller and PC projects : Simplest and cheap USB PIC18

     Page 2 of 4    
Author Message
G8JCF

Guru

Joined: 15/05/2014
Location: United Kingdom
Posts: 676
Posted: 01:58pm 27 Oct 2014
Copy link to clipboard 
Print this post

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: Thailand
Posts: 2209
Posted: 07:00pm 27 Oct 2014
Copy link to clipboard 
Print this post

  G8JCF said  
Thanks for the link - GBP 1.42 and FREE P&P, just how do ,they do it ?
Peter


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 Kingdom
Posts: 4033
Posted: 09:26pm 27 Oct 2014
Copy link to clipboard 
Print this post

  G8JCF said   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

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 Kingdom
Posts: 676
Posted: 10:48pm 27 Oct 2014
Copy link to clipboard 
Print this post

@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 Kingdom
Posts: 4033
Posted: 03:54am 28 Oct 2014
Copy link to clipboard 
Print this post

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 :)

JohnEdited by JohnS 2014-10-29
 
JohnS
Guru

Joined: 18/11/2011
Location: United Kingdom
Posts: 4033
Posted: 10:13am 02 Nov 2014
Copy link to clipboard 
Print this post

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.

JohnEdited by JohnS 2014-11-03
 
G8JCF

Guru

Joined: 15/05/2014
Location: United Kingdom
Posts: 676
Posted: 11:16am 02 Nov 2014
Copy link to clipboard 
Print this post

Congratulations John !

Looking forward to the production code

Peter
The only Konstant is Change
 
JohnS
Guru

Joined: 18/11/2011
Location: United Kingdom
Posts: 4033
Posted: 06:05am 07 Nov 2014
Copy link to clipboard 
Print this post

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!

JohnEdited by JohnS 2014-11-08
 
G8JCF

Guru

Joined: 15/05/2014
Location: United Kingdom
Posts: 676
Posted: 06:11am 07 Nov 2014
Copy link to clipboard 
Print this post

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 Kingdom
Posts: 4033
Posted: 07:32am 07 Nov 2014
Copy link to clipboard 
Print this post

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: Romania
Posts: 1697
Posted: 11:09am 07 Nov 2014
Copy link to clipboard 
Print this post

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 Kingdom
Posts: 676
Posted: 06:21am 19 Nov 2014
Copy link to clipboard 
Print this post

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 Kingdom
Posts: 4033
Posted: 07:06am 19 Nov 2014
Copy link to clipboard 
Print this post

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.

JohnEdited by JohnS 2014-11-20
 
G8JCF

Guru

Joined: 15/05/2014
Location: United Kingdom
Posts: 676
Posted: 12:48pm 19 Nov 2014
Copy link to clipboard 
Print this post

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 Kingdom
Posts: 4033
Posted: 01:33pm 19 Nov 2014
Copy link to clipboard 
Print this post

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

JohnEdited by JohnS 2014-11-20
 
G8JCF

Guru

Joined: 15/05/2014
Location: United Kingdom
Posts: 676
Posted: 03:35pm 19 Nov 2014
Copy link to clipboard 
Print this post

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 Kingdom
Posts: 4033
Posted: 09:57pm 19 Nov 2014
Copy link to clipboard 
Print this post

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.

JohnEdited by JohnS 2014-11-21
 
JohnS
Guru

Joined: 18/11/2011
Location: United Kingdom
Posts: 4033
Posted: 02:20pm 25 Nov 2014
Copy link to clipboard 
Print this post

  G8JCF said   Hi John

Thanks, I'll give it a try in the morning

Peter

Anything happen?

John
 
G8JCF

Guru

Joined: 15/05/2014
Location: United Kingdom
Posts: 676
Posted: 02:23pm 25 Nov 2014
Copy link to clipboard 
Print this post

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 Kingdom
Posts: 4033
Posted: 10:42pm 25 Nov 2014
Copy link to clipboard 
Print this post

No problem - it's what happens!

John
 
     Page 2 of 4    
Print this page
The Back Shed's forum code is written, and hosted, in Australia.
© JAQ Software 2025