Welcome, Guest. Please login or register.

Author Topic: Update PIC on Minimig  (Read 24760 times)

Description:

0 Members and 1 Guest are viewing this topic.

Offline Oliver

  • Hero Member
  • *****
  • Join Date: Sep 2005
  • Posts: 803
    • Show all replies
Re: Update PIC on Minimig
« on: May 12, 2008, 10:17:34 AM »
Quote
boing4000 wrote:
Is there any way to find out the write protection is set?


Hi,

I've not used tiny bootloader, but if you can read the PIC's program memory, then you should be able to check the configuration bits. If you read the data sheet for your PIC, then you should be able to find exactly where the relevant configuration bit is located. This is likely to not be in the user program memory space, but in configuration program memory (probably above address 30000h).

Hope that helps (sorry, I'm not really sure what your background is)

Oliver
Good good study, day day up!
 

Offline Oliver

  • Hero Member
  • *****
  • Join Date: Sep 2005
  • Posts: 803
    • Show all replies
Re: Update PIC on Minimig
« Reply #1 on: May 13, 2008, 01:58:39 AM »
Hi Sascha,

I have no experience with the Minimig. I use PICs a lot in my work though. I generally use in circuit serial programming (ICSP) pins, rather than a bootloader. Acube really should have included the bootloader firmware in the PIC.

Just a few notes to explain the difference:

Dedicated PIC programming hardware uses dedicated pins on the PIC to write to the PICs program memory. In some designs (I guess the Minimig is included here), those programming pins on the PIC may not be available to plug in a header for the programming hardware. If using a bootloader, and not ICSP, then three I/O pins are made available for other uses. I'm guessing these pins are used in the Minimig.

A bootloader has two parts:
-PC software: interfaces to the PIC using a UART (RS-232), sends a command for the PIC to initiate a series of table write operations to program memory, and then dumps all the instructions to the PIC.

-PIC firmware: generally a set of instructions that sits in the start of program memory, which waits for the command to commence operation. When started, it buffers the instructions received from the PC, and writes the buffered data to program memory space usig table write commands. The PIC bootloader firmware must first be programmed in the PIC using programming hardware, such as the PIC Kit 2.

There are many programmers available now. At work I use the MPLAB ICD 2 (which is not very robust). At home I use a Willem from Sivava. There are many others available. I like the Willem as a hobby programmer, as it is quite versatile for use with other chips.

Hope that helps.

Oliver
Good good study, day day up!
 

Offline Oliver

  • Hero Member
  • *****
  • Join Date: Sep 2005
  • Posts: 803
    • Show all replies
Re: Update PIC on Minimig
« Reply #2 on: May 14, 2008, 06:04:54 AM »
I would consider asking Acube to send you a new PIC chip, preprogrammed with the appropriate bootloader. I am not sure what the conditions of sale were/are, but if the contract of sale was to provide the PIC with bootloader, then users should not be out of pocket correcting their mistake.

If Acube deals with large numbers of chips, then their cost per unit will be pretty low, anyway.

It will be interesting to learn the result of Vesalia's tests.

I wouldn't mind programming a PIC for a few people, for the cost of postage. I live in Perth, Western Australia. People could PM me if interested. I would require the PIC, and the hex file with the bootloader assembled/compiled into it. I should note that I don't have a minimig with which to test any PICs, though I would of course verify the code against the provided hex file.

Regards,

Oliver
Good good study, day day up!
 

Offline Oliver

  • Hero Member
  • *****
  • Join Date: Sep 2005
  • Posts: 803
    • Show all replies
Re: Update PIC on Minimig
« Reply #3 on: May 14, 2008, 11:48:25 AM »
Hi folk, it's a pleasure to help.

I think Alex's idea of including stamps and self adressed envelope is good. I would be happy to work on that basis.

Quote

Darrin wrote:
The good old Amiga community spirit in action...


I don't really have anything to do with Amiga anymore; I've moved on. I still really appreciate good will in any community, which is probably the main reason I still frequent this forum. Also, programming a PIC only takes a few seconds, and I usually have a programmer on my desk.

I still think a well made Willem is a worthwhile investment, for anyone who likes to muck around with hardware. I have had mixed results with things like the JDM, though.
Good good study, day day up!
 

Offline Oliver

  • Hero Member
  • *****
  • Join Date: Sep 2005
  • Posts: 803
    • Show all replies
Re: Update PIC on Minimig
« Reply #4 on: May 14, 2008, 02:32:02 PM »
Quote

whiteb wrote:
...If its Protection bits..., then you gotta buy a new PIC buddy :(  As said before, protection bits will PREVENT any further updating.


Hi,

I'm pretty sure the code protection does not prevent an external erase function. It will prevent an external read function. When re-programming a PIC, an external erase function is performed prior to programming in the new code.

There are a few types of read/write possible:
1. Internal table read - reading program memory from within the PIC firmware
2. Internal table write - writing to program memory from within the PIC firmware
3. External erase - Using and exetrnal programmer to erase the PIC
4. External write - Using an external programmer to write to program memory

These read write processes effectively apply in the same fashion to both the flash program memory, and the EEPROM data memory.

It is my understanding that code protection can be applied separately to internal and external operations, though an external erase will always be available for anything other than a one time programmable version of a chip (PROM).

PROMs tend not to be used much in hobby projects, but can be appealing for large manufacturing runs.

Though I have only used code protection once, some time ago, I'm pretty sure it functions as I have described.
Good good study, day day up!
 

Offline Oliver

  • Hero Member
  • *****
  • Join Date: Sep 2005
  • Posts: 803
    • Show all replies
Re: Update PIC on Minimig
« Reply #5 on: May 14, 2008, 02:51:33 PM »
Quote

boing4000 wrote:
Do you think out of your experience that could work?


Yes, I think it could work, though it may not. To my understanding, the issue is that this type of programmer relies on the port to provide Vpp, the programming voltage. Ports on many modern computers tend not to be strictly standards compliant in this regard. You may get lucky. There are also Amiga based programmers of this type available (look at Aminet; I'm pretty sure I've seen some schematics there before).

Another issue is the port signal timing. Modern OS's tend to have the OS arbitrate port access, which can effect signal timing. I'm not sure if this is significant for PIC programming or not. There are some hacks available which allow direct low level port control. I've generally had no problem using these hacks, but some people have had less success.

If the Minimig operates on ~+3V supply, then you could probably use low voltage programming of the PIC with a simple port controlled programmer. This allows programming with a lower Vpp. However, this is not advised when the PIC is to be operated at a voltage above that at which Vpp is used for programming.

If you try to make your own programmer, I suggest you pay attention to voltages being generated, and which pins they are applied to. Check the pin numbers against the pin names in the data sheet for your particular PIC; be careful just blindly copying something you see online. Also, be wary of using substitute zener diodes of different volatges.

There are lots of programmers around, DIY, second hand, Microchip, and third party commercial. Here is one which has had some success with users who had issues with the JDM style: MBHP PIC Burner from the MIDIBox site (I haven't used one of these).

Let us know how you go, as I'm pretty sure quite a few people on this forum have experience with PICs (with Amiga keyboard and mouse adapters, etc).

Cheers,

Oliver
Good good study, day day up!
 

Offline Oliver

  • Hero Member
  • *****
  • Join Date: Sep 2005
  • Posts: 803
    • Show all replies
Re: Update PIC on Minimig
« Reply #6 on: May 14, 2008, 07:02:32 PM »
Quote
boing4000 wrote:
I feel a bit frustrated because nothing is working :madashell:


Hmm, know that feeling. Maybe just leave it for a few days, and wait for Vesalia's response. Probably the worst case would be for you to pay for postage to and from the UK, and take Alex up on his offer to help you out. It shouldn't be too bad, either way.
Good good study, day day up!
 

Offline Oliver

  • Hero Member
  • *****
  • Join Date: Sep 2005
  • Posts: 803
    • Show all replies
Re: Update PIC on Minimig
« Reply #7 on: May 16, 2008, 01:23:22 AM »
Quote
koaftder wrote:
That is good news.


Yes, a good result. Nice to see they take care of their customers.
Good good study, day day up!