Skip to main content

Messages

This section allows you to view all Messages made by this member. Note that you can only see Messages made in areas you currently have access to.

Messages - ian

8611
Bus Pirate Support / Re: Linux - Bootloader-Programmer
I tried the programmer successfully with the Windows version of Python 2.x.

You ignore the bootloader area, what a nice touch, the Microchip programmer doesn't have this option.

The first two bytes gave an error, but I assume this is because the bootloader modifies the start address.

I also got verify failures at c04, c05, c06, a8f8, a8f9, a8fa, a8fc, a8fd, and a8fe.

Firmware seemed to work OK. I didn't remove the jumper, is this a problem? It went into the firmware just fine with the jumper attached. I can tweak the bootloader or firmware if this is causing an issue.

The update seems a bit slow. I used 115200bps, which works fine on my PIC, and it seemed to take longer than normal. There was much less frequent traffic, the TX LED was only on intermittently, instead of constantly as with the Microchip programmer utility.

I'm writing a guide for the Python programmer now. Is your serial port on Linux specified as /dev/ttySx? Do you know what it should look like for a Mac?

Can we change the name to P24qp.py to be consistent with the existing programmer?
8612
Bus Pirate Support / Re: Linux - Bootloader-Programmer
If you add an open source license to the source, I'll copy it to the SVN.

Can you please copy and past your terminal output as a usage example? I'll put a link on the project page.
8614
Bus Pirate Support / Re: Linux - Bootloader-Programmer
Config words appear to be correct, save some endianness (from MPLAB):
@ABFC = F9DF
@ABFE = 3F7F

I also started a new topic to discuss the hardware I2C mode you PMed me about. There's already code for it, but I was never able to test it because I only had REV3 silicone.
8616
Bus Pirate Support / Re: Linux - Bootloader-Programmer
I used the free MS Windows Portmon utility to get a full debug dump of the serial traffic. The virtual serial port monitor I used didn't echo back the local traffic, only the serial port traffic. I held this up by posting bad dumps, and I'm really sorry. Now we can really see what's going on. I also attached this as an archive too.

Connect:
Quote
17   0.00042659   P24QP.exe   IRP_MJ_WRITE   VCP0   SUCCESS   Length 9: 55 55 01 01 00 00 FF FF 04    
18   0.00398207   P24QP.exe   IRP_MJ_READ   VCP0   SUCCESS   Length 1: 55    
19   0.00000503   P24QP.exe   IRP_MJ_READ   VCP0   SUCCESS   Length 1: 55    
20   0.00000223   P24QP.exe   IRP_MJ_READ   VCP0   SUCCESS   Length 1: 01    
21   0.00000223   P24QP.exe   IRP_MJ_READ   VCP0   SUCCESS   Length 1: 01    
22   0.00000251   P24QP.exe   IRP_MJ_READ   VCP0   SUCCESS   Length 1: 00    
23   0.00000223   P24QP.exe   IRP_MJ_READ   VCP0   SUCCESS   Length 1: 00    
24   0.00000223   P24QP.exe   IRP_MJ_READ   VCP0   SUCCESS   Length 1: FF    
25   0.00000223   P24QP.exe   IRP_MJ_READ   VCP0   SUCCESS   Length 1: 47    
26   0.00000251   P24QP.exe   IRP_MJ_READ   VCP0   SUCCESS   Length 1: 05    
27   0.00000223   P24QP.exe   IRP_MJ_READ   VCP0   SUCCESS   Length 1: 04    
28   0.00000223   P24QP.exe   IRP_MJ_READ   VCP0   SUCCESS   Length 1: 00    
29   0.00000223   P24QP.exe   IRP_MJ_READ   VCP0   SUCCESS   Length 1: 00    
30   0.00000223   P24QP.exe   IRP_MJ_READ   VCP0   SUCCESS   Length 1: B4    
31   0.00000223   P24QP.exe   IRP_MJ_READ   VCP0   SUCCESS   Length 1: 04    
32   0.00028607   P24QP.exe   IRP_MJ_WRITE   VCP0   SUCCESS   Length 6: 55 55 00 02 FE 04    
33   0.01497844   P24QP.exe   IRP_MJ_READ   VCP0   SUCCESS   Length 1: 55    
34   0.00000503   P24QP.exe   IRP_MJ_READ   VCP0   SUCCESS   Length 1: 55    
35   0.00000223   P24QP.exe   IRP_MJ_READ   VCP0   SUCCESS   Length 1: 00    
36   0.00000223   P24QP.exe   IRP_MJ_READ   VCP0   SUCCESS   Length 1: 02    
37   0.00000251   P24QP.exe   IRP_MJ_READ   VCP0   SUCCESS   Length 1: 02    
38   0.00000223   P24QP.exe   IRP_MJ_READ   VCP0   SUCCESS   Length 1: 01    
39   0.00000223   P24QP.exe   IRP_MJ_READ   VCP0   SUCCESS   Length 1: FB    
40   0.00000251   P24QP.exe   IRP_MJ_READ   VCP0   SUCCESS   Length 1: 04    
41   0.00024780   P24QP.exe   IRP_MJ_WRITE   VCP0   SUCCESS   Length 9: 55 55 01 02 00 00 00 FD 04    
42   0.01398278   P24QP.exe   IRP_MJ_READ   VCP0   SUCCESS   Length 1: 55    
43   0.00000475   P24QP.exe   IRP_MJ_READ   VCP0   SUCCESS   Length 1: 55    
44   0.00000251   P24QP.exe   IRP_MJ_READ   VCP0   SUCCESS   Length 1: 01    
45   0.00000251   P24QP.exe   IRP_MJ_READ   VCP0   SUCCESS   Length 1: 02    
46   0.00000223   P24QP.exe   IRP_MJ_READ   VCP0   SUCCESS   Length 1: 00    
47   0.00000223   P24QP.exe   IRP_MJ_READ   VCP0   SUCCESS   Length 1: 00    
48   0.00000223   P24QP.exe   IRP_MJ_READ   VCP0   SUCCESS   Length 1: 00    
49   0.00000223   P24QP.exe   IRP_MJ_READ   VCP0   SUCCESS   Length 1: 00    
50   0.00000223   P24QP.exe   IRP_MJ_READ   VCP0   SUCCESS   Length 1: 05    
51   0.00000223   P24QP.exe   IRP_MJ_READ   VCP0   SUCCESS   Length 1: 04    
52   0.00000223   P24QP.exe   IRP_MJ_READ   VCP0   SUCCESS   Length 1: 05    
53   0.00000223   P24QP.exe   IRP_MJ_READ   VCP0   SUCCESS   Length 1: 04    
54   0.00000223   P24QP.exe   IRP_MJ_READ   VCP0   SUCCESS   Length 1: 00    
55   0.00000223   P24QP.exe   IRP_MJ_READ   VCP0   SUCCESS   Length 1: 00    
56   0.00000223   P24QP.exe   IRP_MJ_READ   VCP0   SUCCESS   Length 1: 00    
57   0.00000223   P24QP.exe   IRP_MJ_READ   VCP0   SUCCESS   Length 1: 00    
58   0.00000223   P24QP.exe   IRP_MJ_READ   VCP0   SUCCESS   Length 1: 00    
59   0.00000251   P24QP.exe   IRP_MJ_READ   VCP0   SUCCESS   Length 1: F5    
60   0.00000223   P24QP.exe   IRP_MJ_READ   VCP0   SUCCESS   Length 1: 04
   

Erase:
Quote
0   0.00054476   P24QP.exe   IRP_MJ_WRITE   VCP0   SUCCESS   Length 9: 55 55 03 2A 00 00 00 D3 04    
1   0.85696953   P24QP.exe   IRP_MJ_READ   VCP0   SUCCESS   Length 1: 55    
2   0.00000643   P24QP.exe   IRP_MJ_READ   VCP0   SUCCESS   Length 1: 55    
3   0.00000251   P24QP.exe   IRP_MJ_READ   VCP0   SUCCESS   Length 1: 03    
4   0.00000223   P24QP.exe   IRP_MJ_READ   VCP0   SUCCESS   Length 1: FD    
5   0.00000223   P24QP.exe   IRP_MJ_READ   VCP0   SUCCESS   Length 1: 04    

Exit bootloader:
Quote
0   0.00102639   P24QP.exe   IRP_MJ_WRITE   VCP0   SUCCESS   Length 6: 55 55 00 00 00 04    
1   0.00000419   P24QP.exe   IRP_MJ_CLEANUP   VCP0   SUCCESS      
2   0.13068421   P24QP.exe   IRP_MJ_CLOSE   VCP0   SUCCESS   

The programming dump is only the first 26000 lines, but it includes about 2meg of text. It's in the archive attached to this message.
8617
Bus Pirate Support / Re: Linux - Bootloader-Programmer
I'm doing some new dumps, they look exactly like the old ones. It looks like the serial splitter isn't echoing the data from the local application into the other local apps. I need to find a new way to dump the traffic, I think the previous dumps only show what the PIC echoes back to the application.

While I work on dumping the traffic, does the source to the quick programmer .dll help? The PICBOOT.h defines all the commands:

Quote
//Bootloader commands
#define COMMAND_READVER      0
#define COMMAND_READPM      1
#define COMMAND_WRITEPM      2
#define COMMAND_ERASEPM      3
#define COMMAND_READEE      4
#define COMMAND_WRITEEE      5
#define COMMAND_READCFG      6
#define COMMAND_WRITECFG   7
#define COMMAND_VERIFYOK   8

PICBOOT.c has simple C functions. Here's the erase PIC function:
Quote
/****************************************************************************

    FUNCTION:   ErasePIC

    PURPOSE:   Simple erase function.

****************************************************************************/
INT APIENTRY ErasePIC(HANDLE hComPort, DWORD PICAddr, BYTE nBlock, BYTE nRetry)
{
   BYTE InData[MAX_PACKET];      //Allocate for one packet
   INT RetStatus;
   
      
   //Build header
   InData[0] = COMMAND_ERASEPM;
   InData[1] = nBlock;
   InData[2] = (BYTE)(PICAddr & 0xFF);
   InData[3] = (BYTE)((PICAddr & 0xFF00) / 0x100);
   InData[4] = (BYTE)((PICAddr & 0xFF0000) / 0x10000);

   RetStatus = SendGetPacket(hComPort, InData, 5, MAX_PACKET, nRetry);

   if(RetStatus < 0) return RetStatus;

   return InData[1];
}

The command to make the PIC go is sent from PicComms.bas in the P24qp program. It looks like it's just a packet of two 0's:
Quote
Function GotoRunMode() As Integer
    ReDim DevID(10) As Byte
    Dim RetStat As Integer
    Dim picb As PIC

    DevID(0) = 0
    DevID(1) = 0
    RetStat = SendPacket(PicBootS.PortHandle, DevID(0), 2)
   
End Function

It's picked up by the sendpacket function in PICBOOT.c:

Quote
INT APIENTRY SendPacket(HANDLE hComPort,
                  BYTE PacketData[], 
                  WORD NumOfBytes)

I'll try to get a dump that shows both sides of the COM traffic.
8618
DIY Life projects / Free PCBs
I was sent 50+ PCBs for this project. I plan to hand them out at conventions, but I thought I'd open requests to the internet too.
8619
Bus Pirate Support / Re: Linux - Bootloader-Programmer
Thank you, a patch would be great, or you can have SVN access (send me an e-mail addy that's registered with google). Peter's actually maintaining the python QP code, I only have a passing familiarity with Python.

Looking at your break-down of my dumps, the "sequence to start the bootloader" is actually the output of the firmware after it boots. Great catch, I didn't pay any attention. I bet that's causing a problem because it's certainly not correct.

Do you want dumps that show who said what? A text file with a full, 100% log of a programming session? Do you have a favorite snooper utility? I'll be happy to provide anything I can.
8621
Bus Pirate Support / Re: Bus Pirate v3: Beating the shortage
For the bootloader - one pin is twiddled, the other watches for a match. If there are accidental matches, the jumper can be moved over one position to ground the watching (input) pin. If I swap them, then the firmware has to swap which pin get's twiddled and which is an input, or moving the jumper shorts the output pin to ground. For the new POST mode, the inner pin will need to be taken high, which will generate a mismatch in the bootloader and trigger the power-on self-test mode for quality control (QC will be automated in the future).
8622
Bus Pirate Support / Re: Problems with 1-wire
I did these demos again, and I had problems getting the scratch pad data to save until I used an external 1.8K pull-up resistor on the 1-Wire bus:
http://dangerousprototypes.com/2009/07/ ... rer-board/

You said you tried a 1K resistor, so that obviously isn't it. My new post has the 1-Wire demo re-done for the Bus Pirate 2go. I included the complete terminal output so you can see everything I did. I can verify that the v2 firmware 1-wire library can work with the DS2431, but that doesn't mean you didn't find another problem.
8623
Bus Pirate Support / Re: Bus Pirate v3: Beating the shortage
Are there standard dimensions for a case, or mounting holes? I'll be sure to leave clearance for a 90degree header.

I really want to swap PGC/PGD. It'll mean a new bootloader for this revision and the routing is a bit messy.
8624
Bus Pirate Support / Re: Bus Pirate - Problems and Solution
Thanks for the report. I'm sorry it didn't work.

It's strange that the PIC wouldn't even connect to the programmer. Did you see how it had failed? Seeed did two tests on each unit before it left the factory, it's worrying if the minor stress of shipping is breaking a lot of connections.
8625
Bus Pirate Support / Re: Why PIC24J64GA002?
At Hack a Day I had to kick out projects cheap and fast, so it was advantageous to the same chip over and over.

The 16bit PICs (24F-ds33) are great, so much easier to work with than the 8bit 18F series. 8K SRAM, 64K program space, twice as fast, and only a few dollars. Also full speed operation at 3volts.

The 28pin SOIC package is a good first surface mount chip for a timid solder, and it's easy to prototype on homemade PCBs (I make 99% of my own PCBs).

I didn't use a USB PIC for several reasons. First, Microchip's USB stack would have to be licensed separately from the rest of the Bus Pirate code because it's not public domain. Second, the USB stack uses a cooperative multi-tasking system that would take some major changes to the Bus Pirate code to implement and make development harder for beginners. Third, when you're using a USB PIC during development, the USB disconnects any time you hit a breakpoint in the code, so you have to do a full reset and reconnect every time. Fourth, it would have meant changing PICs and code right before I manufactured a product for the first time, which is a bit scary, the existing Bus Pirate design was well proven. Fifth, I believe the price difference was negligible once the extra PCB space and larger chip costs were taken into account. Finally, the FTDI driver is so well known and support, it was difficult not to choose it.

Great question. I was expecting someone to ask this on the original article.

( ! ) Fatal error: Uncaught exception 'Elk_Exception' with message 'Please try again. If you come back to this error screen, report the error to an administrator.' in /var/www/dangerousprototypes/forum/sources/database/Db-mysql.class.php on line 696
( ! ) Elk_Exception: Please try again. If you come back to this error screen, report the error to an administrator. in /var/www/dangerousprototypes/forum/sources/database/Db-mysql.class.php on line 696
Call Stack
#TimeMemoryFunctionLocation
10.01942459072session_write_close ( )...(null):0
20.01982590696ElkArte\sources\subs\SessionHandler\DatabaseHandler->write( )...(null):0
30.01982591472Database_MySQL->query( ).../DatabaseHandler.php:119
40.06562730232Database_MySQL->error( ).../Db-mysql.class.php:273