DIY编程器网

 找回密码
 注册

QQ登录

只需一步,快速开始

扫一扫,访问微社区

查看: 5190|回复: 0
打印 上一主题 下一主题

AT89LP2052 / AT89LP4052 Parallel Port Programmer

[复制链接]
跳转到指定楼层
楼主
发表于 2011-11-26 08:09:09 | 只看该作者 回帖奖励 |倒序浏览 |阅读模式
AT89LP2052 / AT89LP4052 Parallel Port Programmer
Programming the AT89 LP2052/LP4052 Flash Memory, Lock Bits and User Fuses

The AT 89LP2052 / 89LP4052  microcontroller provide two interfaces with same command format for device programming. The serial ISP Programming interface of the new 2052/4052 microcontroller needs one additional SS Signal for device programming. This SPI signal will be added in the near future to the existing AT89ISP cable and Software (driver) for IDE. You can find more details in the Atmel specifications.

This 2052 / 4052 programmer design uses the parallel programming mode via Parallel Port. Only parallel programming can re-enable the ISP Fuse. This programmer is also usefull if you need to write the user fuses to disable the XTAL Osc Bypass fuse -  e.g. to test the LP2052 in existing 2051 hardware designs.

Programmer Hardware
The Dataport is connected via a 574 latch with 3 State outputs. The strobe signal of the Parallel Port is used to latch the datas. The CS/ Signal and Powersupply signals Vcc/Vpp of the micro are controlled through the HC273 device. The Init signal of the parallel Port is used to control these lines with the host software. The status of Vcc and Vpp are displayed with two LEDs on the programmer board. An external Oscillator is not required. The Atmel microcontroller is pulsed with the Select_In signal from the parallel port.
An external power supply (16V= ) is needed to generate the 12V programming voltage.

Visit www.atmel.com to find an application note how to use the Parallel Port for existing Atmel AT89 C/LV 51/52 devices.


Data polling is currently not supported to reduce the number of components on the board.  To verify the datas we still have to test the SPI interface via parallel Port.
To minimize the influence of undefined states it is necessary to start the host software (to disable Vcc and Vpp !) before a 2052 / 4052 LP device is put into the socket.




Programmer Software
The programmer is controlled by software running on the host. The software supports writing the flash memory (bin and hex files), Lock bits and user fuses in parallel programming mode. The software can handle the Vcc and Vpp signals of the microcontroller. The status of the signals are displayed by LED 1 and LED 2 on the board.

The programming algorithm is easy. You can can find detailed descriptions in the Atmel specs.

Some VB software parts (not complete):

Private Sub device_program_enable()
'Program enable sequence
DataWrite_Enable (True)  ' enable 574 on Board
P32_CS_Signal (False)    ' P3.2 CS to low
datasend (&HAA)             ' send preamble
datasend (&HAC)             ' send opcode
datasend (&H53)              ' send AdressHigh to enable
P32_CS_Signal (True)      ' P3.2 CS to high
DataWrite_Enable (False) ' tristate 574 on Board

End Sub

Private Sub datasend(data As Byte)
  ' send datas to micro, clocks 574 and clocks P_SelectIn
  Out PortAddress, data      ' send preamble
  cr_strobe (cr_DataStrobe) ' P strobe for latch to 572
  cr_strobe (cr_clkstrobe)    ' SelectIn: strobe for 2052/4052 XTAL1
End Sub

Public Sub P32_CS_Signal(stat As Boolean)
' true means that signal on Board is high (= VCC =deactivated)

  HC_Reg = HC_Reg Xor 2 ^ P32_CS ' toggle CS signal
  Out PortAddress, HC_Reg              ' Daten anlegen
  cr_strobe (cr_InitStrobe)                  ' init strobe for 74HC273 Bit 0
End Sub


分享到:  QQ好友和群QQ好友和群 QQ空间QQ空间 腾讯微博腾讯微博 腾讯朋友腾讯朋友 微信微信
收藏收藏 分享分享 支持支持 反对反对
您需要登录后才可以回帖 登录 | 注册

本版积分规则

小黑屋|文字版|手机版|DIY编程器网 ( 桂ICP备14005565号-1 )

GMT+8, 2024-12-27 05:41 , 耗时 0.083751 秒, 18 个查询请求 , Gzip 开启.

各位嘉宾言论仅代表个人观点,非属DIY编程器网立场。

桂公网安备 45031202000115号

DIY编程器群(超员):41210778 DIY编程器

DIY编程器群1(满员):3044634 DIY编程器1

diy编程器群2:551025008 diy编程器群2

QQ:28000622;Email:libyoufer@sina.com

本站由桂林市临桂区技兴电子商务经营部独家赞助。旨在技术交流,请自觉遵守国家法律法规,一旦发现将做封号删号处理。

快速回复 返回顶部 返回列表